From 5cb776ec7a561d9665d4eabaca8402929c99fa17 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Thu, 20 Jun 2024 16:32:38 -0400 Subject: [PATCH] Read number of levels with clouds from geoschem_config.yml; pass to cloud-j Updates include: - Add new Input_Opt setting Nlevs_Phot_Cloud - Set Input_Opt%Nlevs_Phot_Cloud from new setting in geoschem_config.yml photolysis menu - Move a few existing settings in input_opt_mod.F90 to photolysis menu since that is now where they are stored in geoschem_config.yml - Update all geoschem_config.yml templates. All use 34 as number of levels with clouds except CESM which uses 22. Signed-off-by: Lizzie Lundgren --- CHANGELOG.md | 3 ++ GeosCore/cldj_interface_mod.F90 | 5 +-- GeosCore/input_mod.F90 | 19 +++++++++- Headers/input_opt_mod.F90 | 36 ++++++++++--------- run/CESM/geoschem_config.yml | 1 + .../geoschem_config.yml.Hg | 1 + .../geoschem_config.yml.aerosol | 1 + .../geoschem_config.yml.fullchem | 1 + .../geoschem_config.yml.fullchem | 1 + run/GEOS/geoschem_config.yml | 1 + run/WRF/fullchem/geoschem_config.yml | 1 + 11 files changed, 50 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afcdb997f..9f2c6eea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fixed formatting error in `.github/workflows/stale.yml` that caused the Mark Stale Issues action not to run - Fixed typo `$GCAPVERTRESL` -> `$GCAPVERTRES` in `HEMCO_Config.rc.fullchem` template file +### Added +- Added number of levels with clouds for photolysis to geoschem_config.yml and Input_Opt to pass to Cloud-J + ## [14.4.0] - 2024-05-30 ### Added - Added `SpcConc%Units` for species-specific unit conversion diff --git a/GeosCore/cldj_interface_mod.F90 b/GeosCore/cldj_interface_mod.F90 index faa735272..80d389500 100644 --- a/GeosCore/cldj_interface_mod.F90 +++ b/GeosCore/cldj_interface_mod.F90 @@ -131,8 +131,9 @@ SUBROUTINE INIT_CLOUDJ( Input_Opt, State_Grid, State_Diag, State_Chm, RC ) ! Initialize Cloud-J. Includes reading input data files ! FJX_spec.dat (RD_XXX), FJX_scat-aer.dat (RD_MIE), and ! FJX_j2j.dat (RD_JS_JX) - CALL Init_CldJ(Input_Opt%amIRoot, Input_Opt%CloudJ_Dir, & - State_Grid%NZ, TITLEJXX, JVN_, NJXX) + CALL Init_CldJ(Input_Opt%amIRoot, Input_Opt%CloudJ_Dir, & + State_Grid%NZ, Input_Opt%Nlevs_Phot_Cloud, & + TITLEJXX, JVN_, NJXX) ! Store # of photolysis reactions in State_Chm object State_Chm%Phot%nPhotRxns = NRatJ diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index 15d0a6e48..6294d010f 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -2762,6 +2762,7 @@ SUBROUTINE Config_Photolysis( Config, Input_Opt, RC ) ! ! Scalars LOGICAL :: v_bool + INTEGER :: v_int REAL(yp) :: v_real ! Strings @@ -2793,6 +2794,19 @@ SUBROUTINE Config_Photolysis( Config, Input_Opt, RC ) ENDIF Input_Opt%Do_Photolysis = v_bool + !------------------------------------------------------------------------ + ! Number levels with clouds to use in photolysis + !------------------------------------------------------------------------ + key = "operations%photolysis%num_levs_with_cloud" + v_int = MISSING_INT + CALL QFYAML_Add_Get( Config, TRIM( key ), v_int, "", RC ) + IF ( RC /= GC_SUCCESS ) THEN + errMsg = 'Error parsing ' // TRIM( key ) // '!' + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF + Input_Opt%NLevs_Phot_Cloud = v_int + !------------------------------------------------------------------------ ! Directories with photolysis input files !------------------------------------------------------------------------ @@ -3000,6 +3014,8 @@ SUBROUTINE Config_Photolysis( Config, Input_Opt, RC ) WRITE( 6,90 ) 'PHOTOLYSIS SETTINGS' WRITE( 6,95 ) '-------------------' WRITE( 6,100 ) 'Turn on photolysis? : ', Input_Opt%Do_Photolysis + WRITE( 6,130 ) 'Number levels with cloud : ', & + Input_Opt%Nlevs_Phot_Cloud WRITE( 6,120 ) 'FAST-JX input directory : ', & TRIM( Input_Opt%FAST_JX_DIR ) WRITE( 6,120 ) 'Cloud-J input directory : ', & @@ -3031,7 +3047,8 @@ SUBROUTINE Config_Photolysis( Config, Input_Opt, RC ) 105 FORMAT( A, F8.3 ) 110 FORMAT( A, F4.2 ) 120 FORMAT( A, A ) - +130 FORMAT( A, I5 ) + END SUBROUTINE Config_Photolysis !EOC !------------------------------------------------------------------------------ diff --git a/Headers/input_opt_mod.F90 b/Headers/input_opt_mod.F90 index ba8a14e51..8b4623e70 100644 --- a/Headers/input_opt_mod.F90 +++ b/Headers/input_opt_mod.F90 @@ -120,12 +120,6 @@ MODULE Input_Opt_Mod LOGICAL :: LBCAE REAL(fp) :: BCAE_1 REAL(fp) :: BCAE_2 - ! for nitrate aerosol photolysis (TMS, 23/08/2018) - LOGICAL :: hvAerNIT - REAL(fp) :: hvAerNIT_JNIT - REAL(fp) :: hvAerNIT_JNITs - REAL(fp) :: JNITChanA - REAL(fp) :: JNITChanB !---------------------------------------- ! EMISSIONS fields @@ -171,9 +165,6 @@ MODULE Input_Opt_Mod REAL(fp) :: GAMMA_HO2 LOGICAL :: LACTIVEH2O LOGICAL :: LINITSPEC - LOGICAL :: USE_ONLINE_O3 - LOGICAL :: USE_O3_FROM_MET - LOGICAL :: USE_TOMS_O3 LOGICAL :: USE_AUTOREDUCE LOGICAL :: AUTOREDUCE_IS_KEEPACTIVE LOGICAL :: AUTOREDUCE_IS_KEY_THRESHOLD @@ -192,6 +183,16 @@ MODULE Input_Opt_Mod LOGICAL :: Do_Photolysis CHARACTER(LEN=255) :: FAST_JX_DIR CHARACTER(LEN=255) :: CloudJ_Dir + INTEGER :: Nlevs_Phot_Cloud + LOGICAL :: USE_ONLINE_O3 + LOGICAL :: USE_O3_FROM_MET + LOGICAL :: USE_TOMS_O3 + ! for nitrate aerosol photolysis (TMS, 23/08/2018) + LOGICAL :: hvAerNIT + REAL(fp) :: hvAerNIT_JNIT + REAL(fp) :: hvAerNIT_JNITs + REAL(fp) :: JNITChanA + REAL(fp) :: JNITChanB !---------------------------------------- ! RADIATION MENU fields @@ -612,11 +613,6 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%P_ICE_SUPERSAT = 0.0_fp Input_Opt%LPSCCHEM = .FALSE. Input_Opt%LSTRATOD = .FALSE. - Input_Opt%hvAerNIT = .FALSE. - Input_Opt%hvAerNIT_JNIT = 0.0_fp - Input_Opt%hvAerNIT_JNITs = 0.0_fp - Input_Opt%JNITChanA = 0.0_fp - Input_Opt%JNITChanB = 0.0_fp !---------------------------------------- ! EMISSIONS MENU fields @@ -661,9 +657,6 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%GAMMA_HO2 = 0.0_fp Input_Opt%LACTIVEH2O = .FALSE. Input_Opt%LINITSPEC = .FALSE. - Input_Opt%USE_ONLINE_O3 = .FALSE. - Input_Opt%USE_O3_FROM_MET = .FALSE. - Input_Opt%USE_TOMS_O3 = .FALSE. Input_Opt%USE_AUTOREDUCE = .FALSE. Input_Opt%AUTOREDUCE_IS_KEY_THRESHOLD = .TRUE. @@ -679,6 +672,15 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%Do_Photolysis = .FALSE. Input_Opt%FAST_JX_DIR = '' Input_Opt%CloudJ_Dir = '' + Input_Opt%Nlevs_Phot_Cloud = 0 + Input_Opt%USE_ONLINE_O3 = .FALSE. + Input_Opt%USE_O3_FROM_MET = .FALSE. + Input_Opt%USE_TOMS_O3 = .FALSE. + Input_Opt%hvAerNIT = .FALSE. + Input_Opt%hvAerNIT_JNIT = 0.0_fp + Input_Opt%hvAerNIT_JNITs = 0.0_fp + Input_Opt%JNITChanA = 0.0_fp + Input_Opt%JNITChanB = 0.0_fp !---------------------------------------- ! RADIATION MENU fields (for RRTMG only) diff --git a/run/CESM/geoschem_config.yml b/run/CESM/geoschem_config.yml index d7a8a5270..b8fc3d1c2 100644 --- a/run/CESM/geoschem_config.yml +++ b/run/CESM/geoschem_config.yml @@ -46,6 +46,7 @@ operations: photolysis: activate: true + num_levs_with_cloud: 22 input_directories: fastjx_input_dir: /see/namelist/file cloudj_input_dir: /see/namelist/file diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.Hg b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.Hg index 52bb52141..bfdff2473 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.Hg +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.Hg @@ -65,6 +65,7 @@ operations: photolysis: activate: true + num_levs_with_cloud: 34 input_directories: fastjx_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/FAST_JX/v2024-05-Hg/ cloudj_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/CLOUD_J/v2024-05/ diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.aerosol b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.aerosol index c221e620d..a3331633b 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.aerosol +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.aerosol @@ -65,6 +65,7 @@ operations: photolysis: activate: true + num_levs_with_cloud: 34 input_directories: fastjx_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/FAST_JX/v2024-05/ cloudj_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/CLOUD_J/v2023-05/ diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.fullchem b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.fullchem index e3ed1fb28..1a30babe9 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.fullchem +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.fullchem @@ -88,6 +88,7 @@ operations: photolysis: activate: true + num_levs_with_cloud: 34 input_directories: fastjx_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/FAST_JX/v2024-05/ cloudj_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/CLOUD_J/v2023-05/ diff --git a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.fullchem b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.fullchem index f62f202f6..fddcf3d90 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.fullchem +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.fullchem @@ -71,6 +71,7 @@ operations: photolysis: activate: true + num_levs_with_cloud: 34 input_directories: fastjx_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/FAST_JX/v2024-05/ cloudj_input_dir: ${RUNDIR_DATA_ROOT}/CHEM_INPUTS/CLOUD_J/v2023-05/ diff --git a/run/GEOS/geoschem_config.yml b/run/GEOS/geoschem_config.yml index 98d5d6321..a35738fed 100644 --- a/run/GEOS/geoschem_config.yml +++ b/run/GEOS/geoschem_config.yml @@ -59,6 +59,7 @@ operations: photolysis: activate: true + num_levs_with_cloud: 34 input_directories: fastjx_input_dir: /discover/nobackup/projects/gmao/share/dasilva/fvInput/ExtData/chemistry/GEOSCHEMchem/v0.0.0/CHEM_INPUTS/FAST_JX/v2023-10/ cloudj_input_dir: /discover/nobackup/projects/gmao/share/dasilva/fvInput/ExtData/chemistry/GEOSCHEMchem/v0.0.0/CHEM_INPUTS/CLOUD_J/v2023-05/ diff --git a/run/WRF/fullchem/geoschem_config.yml b/run/WRF/fullchem/geoschem_config.yml index 50d7d7520..ed5b8c096 100644 --- a/run/WRF/fullchem/geoschem_config.yml +++ b/run/WRF/fullchem/geoschem_config.yml @@ -67,6 +67,7 @@ operations: photolysis: input_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/data/ExtData/CHEM_INPUTS/FAST_JX/v2021-10/ + num_levs_with_cloud: 20 overhead_O3: use_online_O3_from_model: true use_column_O3_from_met: true