Skip to content

Commit

Permalink
Retire tropchem option and make UCX the default for full-chemistry si…
Browse files Browse the repository at this point in the history
…mulations

Following the Github feature request #839,
the tropchem option for full-chemistry simulations is now retired. This option
allowed users to run online chemistry in the troposphere only and use linearized
prod/loss rates in the stratosphere. Now the UCX (strat-trop chemistry) mechanism
is the default and linearized P/L rates are applied to the mesosphere by default.
This update primarily include the following changes:

(1) Removed Input_Opt%LUCX, this is now the default.

(2) Removed all tropchem-specific code (mainly within ELSE statements
    previously following IF (Input_Opt%LUCX) THEN..).

(2) Rename Input_Opt%LSCHEM to Input_Opt%LINEAR_CHEM and strat_chem_mod.F90
    to linear_chem_mod.F90 to reflect that linearized chemistry now applies
    above the chemistry grid (which is now the mesopsphere in all full-
    chemistry simulations).

These updates pass a benchmark difference test with respect to the previous
commit.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
  • Loading branch information
msulprizio committed Sep 10, 2021
1 parent 62cfba5 commit ea34834
Show file tree
Hide file tree
Showing 42 changed files with 660 additions and 2,156 deletions.
2 changes: 1 addition & 1 deletion GeosCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ add_library(GeosCore
input_mod.F90
isorropiaII_mod.F90
land_mercury_mod.F90
linear_chem_mod.F90
linoz_mod.F90
mapping_mod.F90
mercury_mod.F90
Expand All @@ -90,7 +91,6 @@ add_library(GeosCore
set_global_ch4_mod.F90
set_prof_o3.F90
sfcvmr_mod.F90
strat_chem_mod.F90
sulfate_mod.F90
tagged_co_mod.F90
tagged_o3_mod.F90
Expand Down
318 changes: 135 additions & 183 deletions GeosCore/aerosol_mod.F90

Large diffs are not rendered by default.

13 changes: 2 additions & 11 deletions GeosCore/calc_met_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,8 @@ SUBROUTINE AIRQNT( Input_Opt, State_Chm, State_Grid, State_Met, &

ELSE

IF ( Input_Opt%LUCX ) THEN

! UCX mechanisms: Chemistry grid goes up to stratopause
State_Met%InChemGrid(I,J,L) = ( L <= State_Grid%MaxChemLev )

ELSE

! "tropchem" mechanisms: Chemistry grid goes up to tropopause
State_Met%InChemGrid(I,J,L) = State_Met%InTroposphere(I,J,L)

ENDIF
! Chemistry grid goes up to stratopause
State_Met%InChemGrid(I,J,L) = ( L <= State_Grid%MaxChemLev )

ENDIF

Expand Down
65 changes: 27 additions & 38 deletions GeosCore/chemistry_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
USE GLOBAL_CH4_MOD, ONLY : CHEMCH4
USE Input_Opt_Mod, ONLY : OptInput
USE ISORROPIAII_MOD, ONLY : DO_ISORROPIAII
! The CPP statement simply reflect the dependence in
! these two modules on other code incompatible with
! the coupling of FullChem to CESM - MSL 1-18-18
USE LINEAR_CHEM_MOD, ONLY : DO_LINEAR_CHEM
USE MERCURY_MOD, ONLY : CHEMMERCURY
USE POPS_MOD, ONLY : CHEMPOPS
USE RnPbBe_MOD, ONLY : CHEMRnPbBe
Expand All @@ -89,7 +87,6 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
USE State_Diag_Mod, ONLY : DgnState
USE State_Grid_Mod, ONLY : GrdState
USE State_Met_Mod, ONLY : MetState
USE STRAT_CHEM_MOD, ONLY : DO_STRAT_CHEM
USE TAGGED_CO_MOD, ONLY : CHEM_TAGGED_CO
USE TAGGED_O3_MOD, ONLY : CHEM_TAGGED_O3
USE TIME_MOD, ONLY : GET_ELAPSED_SEC
Expand Down Expand Up @@ -148,12 +145,11 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
LOGICAL :: LCARB
LOGICAL :: LCHEM
LOGICAL :: LDUST
LOGICAL :: LSCHEM
LOGICAL :: LINEAR_CHEM
LOGICAL :: LSSALT
LOGICAL :: LSULF
LOGICAL :: LSOA
LOGICAL :: LNLPBL
LOGICAL :: LUCX
LOGICAL :: prtDebug
INTEGER :: TS_Chem
REAL(f8) :: DT_Chem
Expand Down Expand Up @@ -184,12 +180,11 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
LCARB = Input_Opt%LCARB
LCHEM = Input_Opt%LCHEM
LDUST = Input_Opt%LDUST
LSCHEM = Input_Opt%LSCHEM
LINEAR_CHEM = Input_Opt%LINEAR_CHEM
LSSALT = Input_Opt%LSSALT
LSULF = Input_Opt%LSULF
LSOA = Input_Opt%LSOA
LNLPBL = Input_Opt%LNLPBL
LUCX = Input_Opt%LUCX
IT_IS_A_CH4_SIM = Input_Opt%ITS_A_CH4_SIM
IT_IS_A_FULLCHEM_SIM = Input_Opt%ITS_A_FULLCHEM_SIM
IT_IS_A_MERCURY_SIM = Input_Opt%ITS_A_MERCURY_SIM
Expand Down Expand Up @@ -332,23 +327,22 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
CALL Timer_End( "=> FlexChem", RC )
ENDIF

!----------------------------------------
! Call linearized stratospheric scheme
!----------------------------------------
IF ( LSCHEM ) THEN
!-------------------------------------------
! Linearized chemistry above chemistry grid
!-------------------------------------------
IF ( LINEAR_CHEM ) THEN

IF ( Input_Opt%useTimers ) THEN
CALL Timer_Start( "=> Linearized strat chem", RC )
CALL Timer_Start( "=> Linearized chem", RC )
ENDIF

! Do linearized chemistry for the stratosphere (tropchem)
! or the mesosphere (UCX)
CALL Do_Strat_Chem( Input_Opt, State_Chm, State_Grid, &
State_Met, RC )
! Do linearized chemistry for the mesosphere
CALL Do_Linear_Chem( Input_Opt, State_Chm, State_Grid, &
State_Met, RC )

! Check units (ewl, 10/5/15)
IF ( TRIM( State_Chm%Spc_Units ) /= 'kg' ) THEN
ErrMsg = 'Incorrect species units after DO_STRAT_CHEM!'
ErrMsg = 'Incorrect species units after DO_LINEARCHEM!'
CALL GC_Error( ErrMsg, RC, ThisLoc )
ENDIF

Expand All @@ -360,7 +354,7 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
ENDIF

IF ( Input_Opt%useTimers ) THEN
CALL Timer_End( "=> Linearized strat chem", RC )
CALL Timer_End( "=> Linearized chem", RC )
ENDIF

ENDIF
Expand Down Expand Up @@ -409,19 +403,14 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
!-------------------------------
! Recalculate PSC properties
!-------------------------------
IF ( LUCX ) THEN

! Recalculate PSC
CALL Calc_Strat_Aer( Input_Opt, State_Chm, State_Grid, &
State_Met, RC )

! Trap potential errors
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in "Calc_Strat_Aer"!'
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF
CALL Calc_Strat_Aer( Input_Opt, State_Chm, State_Grid, &
State_Met, RC )

! Trap potential errors
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in "Calc_Strat_Aer"!'
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF

!--------------------------------
Expand Down Expand Up @@ -756,27 +745,27 @@ SUBROUTINE DO_CHEMISTRY( Input_Opt, State_Chm, State_Diag, &
ENDIF

!-----------------------------------------------
! Call linearized stratospheric scheme (LINOZ)
! Linearized chemistry
!-----------------------------------------------
IF ( LSCHEM ) THEN
IF ( LINEAR_CHEM ) THEN

IF ( Input_Opt%useTimers ) THEN
CALL Timer_Start( "=> Linearized strat chem", RC )
CALL Timer_Start( "=> Linearized chem", RC )
ENDIF

! Do LINOZ for Ozone
CALL Do_Strat_Chem( Input_Opt, State_Chm, State_Grid, &
State_Met, RC )
CALL Do_Linear_Chem( Input_Opt, State_Chm, State_Grid, &
State_Met, RC )

! Trap potential errors
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in "Do_Strat_Chem"!'
ErrMsg = 'Error encountered in "Do_Linear_Chem"!'
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF

IF ( Input_Opt%useTimers ) THEN
CALL Timer_End( "=> Linearized strat chem", RC )
CALL Timer_End( "=> Linearized chem", RC )
ENDIF

ENDIF
Expand Down
12 changes: 2 additions & 10 deletions GeosCore/cleanup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ SUBROUTINE CLEANUP( Input_Opt, State_Grid, ERROR, RC )
USE CARBON_MOD, ONLY : CLEANUP_CARBON
USE CO2_MOD, ONLY : CLEANUP_CO2
USE CMN_FJX_Mod, ONLY : Cleanup_CMN_FJX
USE CMN_SIZE_Mod, ONLY : Cleanup_CMN_SIZE
USE DEPO_MERCURY_MOD, ONLY : CLEANUP_DEPO_MERCURY
USE DRYDEP_MOD, ONLY : CLEANUP_DRYDEP
USE DUST_MOD, ONLY : CLEANUP_DUST
Expand All @@ -33,6 +32,7 @@ SUBROUTINE CLEANUP( Input_Opt, State_Grid, ERROR, RC )
USE Input_Opt_Mod, ONLY : OptInput
USE ISORROPIAII_MOD, ONLY : CLEANUP_ISORROPIAII
USE LAND_MERCURY_MOD, ONLY : CLEANUP_LAND_MERCURY
USE LINEAR_CHEM_MOD, ONLY : CLEANUP_LINEAR_CHEM
USE MERCURY_MOD, ONLY : CLEANUP_MERCURY
USE ObsPack_Mod, ONLY : ObsPack_SpeciesMap_Cleanup
USE OCEAN_MERCURY_MOD, ONLY : CLEANUP_OCEAN_MERCURY
Expand All @@ -43,7 +43,6 @@ SUBROUTINE CLEANUP( Input_Opt, State_Grid, ERROR, RC )
USE SEASALT_MOD, ONLY : CLEANUP_SEASALT
USE SULFATE_MOD, ONLY : CLEANUP_SULFATE
USE State_Grid_Mod, ONLY : GrdState
USE STRAT_CHEM_MOD, ONLY : CLEANUP_STRAT_CHEM
USE TAGGED_CO_MOD, ONLY : CLEANUP_TAGGED_CO
USE UCX_MOD, ONLY : CLEANUP_UCX
USE EMISSIONS_MOD, ONLY : EMISSIONS_FINAL
Expand Down Expand Up @@ -148,7 +147,7 @@ SUBROUTINE CLEANUP( Input_Opt, State_Grid, ERROR, RC )
CALL CLEANUP_PRESSURE()
CALL CLEANUP_SEASALT()
CALL CLEANUP_SULFATE()
CALL CLEANUP_STRAT_CHEM()
CALL CLEANUP_LINEAR_CHEM()

CALL Cleanup_FlexChem( RC )
IF ( RC /= GC_SUCCESS ) THEN
Expand Down Expand Up @@ -187,13 +186,6 @@ SUBROUTINE CLEANUP( Input_Opt, State_Grid, ERROR, RC )
RETURN
ENDIF

CALL Cleanup_CMN_SIZE( RC )
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in "Cleanup_CMN_SIZE"!'
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF

CALL Cleanup_CMN_FJX( RC )
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in "Cleanup_CMN_FJX"!'
Expand Down
8 changes: 1 addition & 7 deletions GeosCore/dust_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1245,13 +1245,7 @@ SUBROUTINE RDUST_ONLINE( Input_Opt, State_Chm, State_Diag, State_Grid, &
WTAREA => State_Chm%WetAeroArea ! Wet Aerosol Area [cm2/cm3]

! Index for dust in ODAER and LUT arrays
! Dust properties are saved to different indices in RD_AOD for
! UCX vs tropchem simulations
IF ( Input_Opt%LUCX ) THEN
IDST = 8
ELSE
IDST = 6
ENDIF
IDST = 8

! Dust density
MSDENS(1) = 2500.0_fp
Expand Down
82 changes: 32 additions & 50 deletions GeosCore/fast_jx_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2508,8 +2508,7 @@ SUBROUTINE RD_AOD( NJ1, Input_Opt, RC )
CHARACTER(LEN=255) :: ThisLoc

! String arrays
CHARACTER(LEN=30) :: SPECFIL(6)
CHARACTER(LEN=30) :: SPECFIL_UCX(8)
CHARACTER(LEN=30) :: SPECFIL(8)

!================================================================
! RD_AOD begins here!
Expand All @@ -2523,12 +2522,6 @@ SUBROUTINE RD_AOD( NJ1, Input_Opt, RC )
DATA_DIR = TRIM( Input_Opt%FAST_JX_DIR )

! IMPORTANT: aerosol_mod.F and dust_mod.F expect aerosols in this order
DATA SPECFIL /"so4.dat","soot.dat","org.dat", &
"ssa.dat","ssc.dat", "dust.dat"/

! For simulations with UCX (online trop+strat chem) enabled:
!
! Extra two LUT dat files for strat H2SO4 and NAT particles
!
! Treating strat sulfate with GADS data but modified to match
! the old Fast-J values size (r=0.09um, sg=0.6) - I think there's
Expand All @@ -2537,21 +2530,17 @@ SUBROUTINE RD_AOD( NJ1, Input_Opt, RC )
! but for now we are just treating the NAT like the sulfate... limited
! info but ref index is similar e.g. Scarchilli et al. (2005)
!(DAR 05/2015)
DATA SPECFIL_UCX /"so4.dat","soot.dat","org.dat", &
"ssa.dat","ssc.dat", &
"h2so4.dat","h2so4.dat", &
"dust.dat"/
DATA SPECFIL /"so4.dat","soot.dat","org.dat", &
"ssa.dat","ssc.dat", &
"h2so4.dat","h2so4.dat", &
"dust.dat"/

! Loop over the array of filenames
DO k = 1, NSPAA

! Choose different set of input files for standard (trop+strat chenm)
! and tropchem (trop-only chem) simulations
IF ( Input_Opt%LUCX) THEN
THISFILE = TRIM( DATA_DIR ) // TRIM( SPECFIL_UCX(k) )
ELSE
THISFILE = TRIM( DATA_DIR ) // TRIM( SPECFIL(k) )
ENDIF
THISFILE = TRIM( DATA_DIR ) // TRIM( SPECFIL(k) )

!--------------------------------------------------------------
! In dry-run mode, print file path to dryrun log and cycle.
Expand Down Expand Up @@ -3620,40 +3609,36 @@ SUBROUTINE PHOTO_JX( U0, REFLB, P_COL, &
!to the new speciated LUT
KMIE2=LUTIDX(KMIE)

IF ( Input_Opt%LUCX ) THEN

! Strat aerosols for UCX simulations
IM=10+(NRHAER*NRH)+1
DO M=IM,IM+1
IDXAER=M-IM+6 !6-STS, 7-NAT
! Stratospheric aerosols
IM=10+(NRHAER*NRH)+1
DO M=IM,IM+1
IDXAER=M-IM+6 !6-STS, 7-NAT

IF (AERX_COL(M,L).gt.0d0) THEN
IF (AOD999) THEN
! Aerosol/dust (999 nm scaling)
! Fixed to dry radius
QSCALING = QQAA(KMIE2,1,IDXAER)/QQAA(10,1,IDXAER)
ELSE
! Aerosol/dust (550 nm scaling)
QSCALING = QQAA(KMIE2,1,IDXAER)/QQAA(5,1,IDXAER)
ENDIF
LOCALOD = QSCALING*AERX_COL(M,L)
LOCALSSA = SSAA(KMIE2,1,IDXAER)*LOCALOD
OD(KMIE,L) = OD(KMIE,L) + LOCALOD
SSA(KMIE,L)= SSA(KMIE,L) + LOCALSSA
DO I=1,8
SLEG(I,KMIE,L) = SLEG(I,KMIE,L) + &
(PAA(I,KMIE,IDXAER)*LOCALSSA)
ENDDO ! I (Phase function)
IF (AERX_COL(M,L).gt.0d0) THEN
IF (AOD999) THEN
! Aerosol/dust (999 nm scaling)
! Fixed to dry radius
QSCALING = QQAA(KMIE2,1,IDXAER)/QQAA(10,1,IDXAER)
ELSE
! Aerosol/dust (550 nm scaling)
QSCALING = QQAA(KMIE2,1,IDXAER)/QQAA(5,1,IDXAER)
ENDIF
LOCALOD = QSCALING*AERX_COL(M,L)
LOCALSSA = SSAA(KMIE2,1,IDXAER)*LOCALOD
OD(KMIE,L) = OD(KMIE,L) + LOCALOD
SSA(KMIE,L)= SSA(KMIE,L) + LOCALSSA
DO I=1,8
SLEG(I,KMIE,L) = SLEG(I,KMIE,L) + &
(PAA(I,KMIE,IDXAER)*LOCALSSA)
ENDDO ! I (Phase function)
ENDIF

ENDDO ! M (Aerosol)

ENDIF ! LUCX
ENDDO ! M (Aerosol)

! Mineral dust (from new optics LUT)
DO M=4,10
IF (AERX_COL(M,L).gt.0d0) THEN
IDXAER=NSPAA !dust is last in LUT (6, or 8 if UCX=y)
IDXAER=NSPAA !dust is last in LUT
IR=M-3
IF (AOD999) THEN
QSCALING = QQAA(KMIE2,IR,IDXAER)/ &
Expand Down Expand Up @@ -4865,7 +4850,6 @@ SUBROUTINE SET_PROF( YLAT, MONTH, DAY, T_CTM, P_CTM, &
! TOMS_200701 directory.
!=================================================================

! Updated with UCX
! Since we now have stratospheric ozone calculated online, use
! this instead of archived profiles for all chemistry-grid cells
! The variable O3_CTM is obtained from State_Met%Species, and will be 0
Expand Down Expand Up @@ -4965,11 +4949,9 @@ SUBROUTINE SET_AER( Input_Opt )
ENDDO
ENDDO

IF ( Input_Opt%LUCX ) THEN
! Stratospheric aerosols - SSA/STS and solid PSCs
MIEDX(10+(NRHAER*NRH)+1) = 4 ! SSA/LBS/STS
MIEDX(10+(NRHAER*NRH)+2) = 14 ! NAT/ice PSCs
endif
! Stratospheric aerosols - SSA/STS and solid PSCs
MIEDX(10+(NRHAER*NRH)+1) = 4 ! SSA/LBS/STS
MIEDX(10+(NRHAER*NRH)+2) = 14 ! NAT/ice PSCs

! Ensure all 'AN_' types are valid selections
do i=1,AN_
Expand Down

0 comments on commit ea34834

Please sign in to comment.