Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG/ISSUE] Bug when running with TOMAS and chemistry time step under 1 hr #218

Closed
danamcguff opened this issue Feb 7, 2020 · 1 comment
Assignees
Labels
category: Bug Something isn't working
Milestone

Comments

@danamcguff
Copy link

Describe the bug

In AEROPHYS subroutine of tomas_mod, the overall time step is 1 hour.
Here is a permalink to the hard-coded bug:

! Get info on this grid box
ADT = 3600.
PRES = State_Met%PMID(i,j,l)*100.0 ! in Pa
TEMPTMS = State_Met%T(I,J,L)
BOXMASS = State_Met%AD(I,J,L)
RHTOMAS = State_Met%RH(I,J,L)/ 1.e2
IF ( RHTOMAS > 0.99 ) RHTOMAS = 0.99
BOXVOL = State_Met%AIRVOL(I,J,L) * 1.e6 !convert from m3 -> cm3

I suggest changing the definition of the time step so line 704 reads:
ADT = GET_TS_CHEM()
You will also need to add a line of code to the beginning of AEROPHYS subroutine such as:
USE Time_Mod, ONLY : GET_TS_CHEM

Expected behavior

When running GC with TOMAS on and using a time step smaller than 1 hour for chemistry, the simulated aerosol microphysics are faster than they should be.

Required information

  • GEOS-Chem version : discovered in 12.3.2 but also in current release (12.7.0)
@danamcguff danamcguff added the category: Bug Something isn't working label Feb 7, 2020
@yantosca yantosca self-assigned this Feb 7, 2020
@yantosca yantosca added this to the 12.7.1 milestone Feb 7, 2020
@yantosca
Copy link
Contributor

yantosca commented Feb 7, 2020

Thanks @danamcguff for bringing this to our attention. This is now fixed by commit 7a7f3d7, which will go into GEOS-Chem 12.7.1.

I also made a couple more updates as seen here:

! Get chemistry timestep for use below [s]
! NOTE: This doesn't have to be !$OMP+PRIVATE (bmy, 2/7/20)
ADT = GET_TS_CHEM()
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!%%% NOTE: THIS PARALLEL LOOP MAY BE ABLE TO BE REVERSED TO L-J-I
!%%% WHICH IS MUCH MORE EFFICIENT (bmy, 1/28/14)
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!$OMP PARALLEL DO
!$OMP+DEFAULT( SHARED )
!$OMP+PRIVATE( I, J, L )
!$OMP+PRIVATE( PRES, TEMPTMS, BOXMASS, RHTOMAS, BOXVOL )
!$OMP+PRIVATE( printneg, ionrate, lev, weight, GC, N, NK, JC )
!$OMP+PRIVATE( MK, H2SO4rate_o, tot_n_1, k, tot_s_1, MPNUM )
!$OMP+PRIVATE( Nkd, Mkd, TOT_NK, TOT_MK, TRANSFER )
!$OMP+PRIVATE( Nkout,Mkout,Gcout,fn,fn1 )
!$OMP+PRIVATE( num_iter,Nknuc,Mknuc,Nkcond )
!$OMP+PRIVATE( Mkcond, ERRORSWITCH, tot_s_1a, tot_n_1a )
!$OMP+PRIVATE( ERR_VAR, ERR_MSG, ERR_IND )
!$OMP+PRIVATE( TRACNUM, NH3_TO_NH4, SURF_AREA )
!$OMP+SCHEDULE( DYNAMIC )
DO I = 1, State_Grid%NX
DO J = 1, State_Grid%NY
DO L = 1, State_Grid%NZ
#ifdef BPCH_DIAG
! Reset the AD61_INST array used for tracking instantaneous
! certain rates. As of now, tracking nucleation (win, 10/7/08)
IF ( Input_Opt%ND61 > 0 ) THEN
AD61_INST(I,J,L,:) = 0e0
ENDIF
#endif

  1. I moved ADT out of the parallel loop, since it does not need to be held PRIVATE (i.e. its value is the same for all threads). This will prevent calling the GET_TS_CHEM function on each (I,J,L) iteration.

  2. I had to add an IF statement around the AD61_INST array. This will prevent a segfault if ND61 is not turned on.

@yantosca yantosca closed this as completed Feb 7, 2020
yantosca added a commit that referenced this issue Jun 21, 2023
run/GCHP/HISTORY.rc.templates/HISTORY.rc.TransportTracers
- Replace old species names with the updated species names
  from the 14.2.0-alpha.15 update.  This was causing integration
  tests to fail (see geoschem/HEMCO PR #218).

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants