Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Remove hard-coded State_Grid%MaxTropLev and State_Grid%MaxStratLev #284

Open
msulprizio opened this issue Apr 16, 2020 · 2 comments
Assignees
Labels
category: Feature Request New feature or request no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates)

Comments

@msulprizio
Copy link
Contributor

msulprizio commented Apr 16, 2020

The State_Grid%MaxStratLev and State_Grid%MaxTropLev scalars are used in very few places, and
can be replaced by State_Met%InStratosphere and State_Met%InTroposphere
logicals. This will allow for removal of MaxStratLev and MaxTropLev completely.
The State_Grid%MaxChemLev scalar can be moved to State_Met, where
the other chemistry grid fields (ChemGridLev, InChemGrid) are stored.

In subroutine AIRQNT (in GeosCore/calc_met_mod.F90), State_Met%InStratosphere can be computed using the threshold of 1 hPa as the stratopause. Seb Eastham
wrote, "The value of [MaxStratLev=]59 is actually based on the stratopause
being at 1 hPa, so that would be a much better way to define it!" In that
routine, we can also compute State_Met%MaxChemLev based on the actual
tropopause or stratopause level.

@msulprizio msulprizio added the category: Feature Request New feature or request label Apr 16, 2020
@msulprizio msulprizio added this to the 12.9.0 milestone Apr 16, 2020
@msulprizio msulprizio self-assigned this Apr 16, 2020
@msulprizio msulprizio removed this from the 12.9.0 milestone Jun 2, 2020
@yantosca yantosca added the topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates) label Jan 21, 2022
@yantosca
Copy link
Contributor

yantosca commented May 16, 2023

The State_Grid%MaxTropLev is defined but not used anywhere. We can remove it.

GeosUtil/gc_grid_mod.F90:124:       State_Grid%MaxTropLev  = 38
GeosUtil/gc_grid_mod.F90:127:       State_Grid%MaxTropLev  = 40
GeosUtil/gc_grid_mod.F90:131:       State_Grid%MaxTropLev  = 28
GeosUtil/gc_grid_mod.F90:135:       State_Grid%MaxTropLev  = 60
GeosUtil/gc_grid_mod.F90:139:       State_Grid%MaxTropLev  = 60
GeosUtil/gc_grid_mod.F90:143:                ' does not have MaxTropLev and MaxStratLev defined.'// &
Headers/state_grid_mod.F90:69:     INTEGER            :: MaxTropLev  ! Max # levels below trop
Headers/state_grid_mod.F90:177:    State_Grid%MaxTropLev   = 0

On the other hand, the MaxStratLev is used in a couple of places but we can probably take those out without too much trouble.

GeosCore/calc_met_mod.F90:563:            ( L <= State_Grid%MaxStratLev .and. State_Met%InStratMeso(I,J,L) )
GeosCore/mercury_mod.F90:998:       !IF ( L > State_Grid%MaxStratLev ) CYCLE
GeosCore/mercury_mod.F90:2788:       IF ( L > State_Grid%MaxStratLev ) CYCLE
GeosUtil/gc_grid_mod.F90:125:       State_Grid%MaxStratLev = 44
GeosUtil/gc_grid_mod.F90:128:       State_Grid%MaxStratLev = 59
GeosUtil/gc_grid_mod.F90:132:       State_Grid%MaxStratLev = 40
GeosUtil/gc_grid_mod.F90:136:       State_Grid%MaxStratLev = 72
GeosUtil/gc_grid_mod.F90:140:       State_Grid%MaxStratLev = 91
GeosUtil/gc_grid_mod.F90:143:                ' does not have MaxTropLev and MaxStratLev defined.'// &
GeosUtil/gc_grid_mod.F90:150:    State_Grid%MaxChemLev  = State_Grid%MaxStratLev
Headers/state_grid_mod.F90:68:     INTEGER            :: MaxStratLev ! Max # levels below strat
Headers/state_grid_mod.F90:176:    State_Grid%MaxStratLev  = 0

Tagging @msulprizio @lizziel

@yantosca
Copy link
Contributor

Also State_Grid%MaxChemLev is defined in several places. It is initialized from MaxStratLev. We should probably replace this with State_Grid%NZ

GeosCore/aero_drydep.F90:303:             L     = State_Grid%MaxChemLev
GeosCore/aero_drydep.F90:307:             DO L = State_Grid%MaxChemLev-1, 1, -1
GeosCore/aero_drydep.F90:397:    DO L = 1, State_Grid%MaxChemLev
GeosCore/aerosol_mod.F90:1817:                     L <= State_Grid%MaxChemLev      .AND. &
GeosCore/calc_met_mod.F90:566:       IF ( L > State_Grid%MaxChemLev ) THEN
GeosCore/calc_met_mod.F90:574:          State_Met%InChemGrid(I,J,L) = ( L <= State_Grid%MaxChemLev )
GeosCore/carbon_mod.F90:1813:   DO L = 1, State_Grid%MaxChemLev
GeosCore/carbon_mod.F90:2272:         print*, 'POA to trop', SUM(Spc(id_POA1)%Conc(:,:,1:State_Grid%MaxChemLev))+ &
GeosCore/carbon_mod.F90:2273:                                SUM(Spc(id_POA2)%Conc(:,:,1:State_Grid%MaxChemLev))
GeosCore/carbon_mod.F90:5798:      IF ( L <= State_Grid%MaxChemLev ) THEN
GeosCore/carbon_mod.F90:6541:   DO L = 1, State_Grid%MaxChemLev
GeosCore/carbon_mod.F90:6683:   DO L = 1, State_Grid%MaxChemLev
GeosCore/diagnostics_mod.F90:1382:          State_Diag%SatDiagnOH(I,:,1:State_Grid%MaxChemLev) =               &
GeosCore/diagnostics_mod.F90:1383:               ( Spc(id_OH)%Conc(I,:,1:State_Grid%MaxChemLev) * good  *      &
GeosCore/diagnostics_mod.F90:1384:               State_Met%AIRDEN(I,:,1:State_Grid%MaxChemLev)  * AVO ) /      &
GeosCore/dust_mod.F90:872:          L           = State_Grid%MaxChemLev
GeosCore/dust_mod.F90:877:          DO L = State_Grid%MaxChemLev-1, 1, -1
GeosCore/dust_mod.F90:1480:       DO L = 1, State_Grid%MaxChemLev
GeosCore/dust_mod.F90:1541:          DO L = 1, State_Grid%MaxChemLev
GeosCore/dust_mod.F90:1558:       DO L = 1, State_Grid%MaxChemLev
GeosCore/fast_jx_mod.F90:80:                       ZZJ,       DDJ,        maxChemLev, State_Chm,  &
GeosCore/fast_jx_mod.F90:112:    INTEGER,  INTENT(IN)                       :: maxChemLev
GeosCore/fast_jx_mod.F90:424:    call JRATET(PPJ,T_INPUT,FFF, VALJXX,L_,maxChemLev,NJX)
GeosCore/fjx_interface_mod.F90:617:                      Z_CLIM,    AIR_CLIM,   State_Grid%maxChemLev, &
GeosCore/fjx_interface_mod.F90:622:       DO L=1,State_Grid%MaxChemLev
GeosCore/fjx_interface_mod.F90:633:       IF (State_Grid%MaxChemLev.lt.L_) THEN
GeosCore/fjx_interface_mod.F90:634:          DO L=State_Grid%MaxChemLev+1,L_
GeosCore/fjx_interface_mod.F90:1246:            (I <= State_Grid%MaxChemLev) .and. &
GeosCore/global_br_mod.F90:262:    IF ( State_Grid%MaxChemLev < State_Grid%NZ ) THEN
GeosCore/global_br_mod.F90:263:       J_BrO(:,:,State_Grid%MaxChemLev+1:State_Grid%NZ) = 0e+0_fp 
GeosCore/hco_utilities_gc_mod.F90:1755:            IF ( L > State_Grid%MaxChemLev .and. &
GeosCore/linear_chem_mod.F90:251:    IF ( State_Grid%MaxChemLev == State_Grid%NZ ) THEN
GeosCore/ocean_mercury_mod.F90:385:    SO4_GC(:,:,1:State_Grid%MaxChemLev) = ARRAYso4(:,:,1:State_Grid
MaxChemLev)
GeosCore/ocean_mercury_mod.F90:396:    NH4_CONC(:,:,1:State_Grid%MaxChemLev) = ARRAYnh4(:,:,1:State_Grid%MaxChemLev)
GeosCore/ocean_mercury_mod.F90:407:    NIT_CONC(:,:,1:State_Grid%MaxChemLev) = ARRAYnit(:,:,1:State_Grid%MaxChemLev)
GeosCore/ocean_mercury_mod.F90:432:    BC_CONC(:,:,1:State_Grid%MaxChemLev) = ARRAYtemp(:,:,1:State_Grid%MaxChemLev)
GeosCore/ocean_mercury_mod.F90:457:    OC_CONC(:,:,1:State_Grid%MaxChemLev) = ARRAYtemp(:,:,1:State_Grid%MaxChemLev)
GeosCore/ocean_mercury_mod.F90:468:    DST_CONC(:,:,1:State_Grid%MaxChemLev) = ARRAYdst1(:,:,1:State_Grid%MaxChemLev)
GeosCore/pbl_mix_mod.F90:373:       DO L = 1, State_Grid%MaxChemLev
GeosCore/seasalt_mod.F90:778:       L         = State_Grid%MaxChemLev
GeosCore/seasalt_mod.F90:782:       DO L = State_Grid%MaxChemLev-1, 1, -1
GeosCore/sulfate_mod.F90:1733:       L    = State_Grid%MaxChemLev
GeosCore/sulfate_mod.F90:1738:       DO L = State_Grid%MaxChemLev-1, 1, -1
GeosCore/sulfate_mod.F90:2705:          IF ( L <= State_Grid%MaxChemLev ) THEN
GeosCore/sulfate_mod.F90:8261:      DO L = 1, State_Grid%MaxChemLev
GeosCore/sulfate_mod.F90:8926:    ALLOCATE( PMSA_DMS( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8932:    ALLOCATE( PSO2_DMS( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8938:    ALLOCATE( PSO4_SO2( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8944:    ALLOCATE( PHMS_SO2( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8950:    ALLOCATE( PSO2_HMS( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8956:    ALLOCATE( PSO4_HMS( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8962:    ALLOCATE( PSO4_ss( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8968:    ALLOCATE( PNITs( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), &
GeosCore/sulfate_mod.F90:8974:    ALLOCATE( PNIT( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev), STAT=RC )
GeosCore/sulfate_mod.F90:8979:    ALLOCATE( PACL( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), STAT=RC )
GeosCore/sulfate_mod.F90:8984:    ALLOCATE( PCCL( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev ), STAT=RC )
GeosCore/sulfate_mod.F90:8990:    ALLOCATE( PSO4_dust( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev, &
GeosCore/sulfate_mod.F90:8997:    ALLOCATE( PNIT_dust( State_Grid%NX, State_Grid%NY, State_Grid%MaxChemLev, &
GeosUtil/gc_grid_mod.F90:150:    State_Grid%MaxChemLev  = State_Grid%MaxStratLev
Headers/state_grid_mod.F90:67:     INTEGER            :: MaxChemLev  ! Max # levels in chemistry grid
Headers/state_grid_mod.F90:175:    State_Grid%MaxChemLev   = 0

@yantosca yantosca self-assigned this May 16, 2023
@yantosca yantosca added no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations and removed no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations labels May 16, 2023
yantosca added a commit that referenced this issue May 16, 2023
GeosUtil/gc_grid_mod.F90
Headers/state_grid_mod.F90
- Removed State_Grid%MaxTropLev, as it was not being used anymore.
  This was raised in issue geoschem/geos-chem #284.

This was confirmed to result in zero-diffs w/r/t the prior commit.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added the no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates)
Projects
None yet
Development

No branches or pull requests

2 participants