From e8910379aafd82aaa2b569faed78399415d046fc Mon Sep 17 00:00:00 2001 From: "yuanjian.z" Date: Wed, 16 Oct 2024 15:18:07 -0500 Subject: [PATCH 01/12] Add surface precipitation flux to GCHP_chem component --- Interfaces/GCHP/Includes_Before_Run.H | 4 ++++ Interfaces/GCHP/Registry/Chem_Registry.rc | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Interfaces/GCHP/Includes_Before_Run.H b/Interfaces/GCHP/Includes_Before_Run.H index c3caee2f6..890fcc224 100644 --- a/Interfaces/GCHP/Includes_Before_Run.H +++ b/Interfaces/GCHP/Includes_Before_Run.H @@ -154,6 +154,10 @@ ! transport is correctly implemented. State_Met%SPHU1 = SPHU1 *1.0d3 ! kg/kg -> g/kg State_Met%SPHU2 = SPHU2 *1.0d3 ! kg/kg -> g/kg + State_Met%PRECCON = PRECCON * 86400d0 ! kg/m2/s to mm/day + State_Met%PRECLSC = PRECLSC * 86400d0 ! kg/m2/s to mm/day + State_Met%PRECANV = PRECANV * 86400d0 ! kg/m2/s to mm/day + State_Met%PRECTOT = PRECTOT * 86400d0 ! kg/m2/s to mm/day ! If meteorology vertical index is top down, flip imports coming from ExtData. if (meteorology_vertical_index_is_top_down) then diff --git a/Interfaces/GCHP/Registry/Chem_Registry.rc b/Interfaces/GCHP/Registry/Chem_Registry.rc index 937d1128c..bd658988d 100755 --- a/Interfaces/GCHP/Registry/Chem_Registry.rc +++ b/Interfaces/GCHP/Registry/Chem_Registry.rc @@ -25,7 +25,7 @@ # Name | Units | Dim |Loc|Type| R | A |Tiles| ault | Name # -------------------|-------------|-----|---|----|---|---|-----|------|-------------------------- # AIRDENS | kg m-3 | xyz | C | | | | | | air_density - AREA | m2 | xy | | | | | | | + AREA | m2 | xy | | | | | | | FRLAKE | 1 | xy | | | | | | | FRLAND | 1 | xy | | | | | | | FRLANDIC | 1 | xy | | | | | | | @@ -96,9 +96,13 @@ TMPU1 | 1 | xyz | C | | | | | | SPHU2 | 1 | xyz | C | | | | | | TMPU2 | 1 | xyz | C | | | | | | - FLASH_DENS | 1 | xy | | | | | | | lightning_flash_density - CONV_DEPTH | 1 | xy | | | | | | | convective_cloud_depth - XLAIMULTI | cm2_cm-2 | xyz | E | | | | | | LAI_by_type + FLASH_DENS | 1 | xy | | | | | | | lightning_flash_density + CONV_DEPTH | 1 | xy | | | | | | | convective_cloud_depth + XLAIMULTI | cm2_cm-2 | xyz | E | | | | | | LAI_by_type + PRECCON | 1 | xy | | | | | | | surface convective precipitation flux + PRECLSC | 1 | xy | | | | | | | surface large-scale precipitation flux + PRECANV | 1 | xy | | | | | | | surface anvil precipitation flux + PRECTOT | 1 | xy | | | | | | | surface total precipitation flux # -------------------|-------------|-----|---|----|---|---|-----|------|-------------------------- From 4df55045bc6fde44caddc354312e84235e9724b1 Mon Sep 17 00:00:00 2001 From: "yuanjian.z" Date: Wed, 16 Oct 2024 15:59:12 -0500 Subject: [PATCH 02/12] Avoid zero convective precipitation and high cloud base due to met field definition change in Grell-Freitas convection --- GeosCore/convection_mod.F90 | 157 ++++++++++++++++++++++-------------- 1 file changed, 98 insertions(+), 59 deletions(-) diff --git a/GeosCore/convection_mod.F90 b/GeosCore/convection_mod.F90 index 21c94414c..2604c087c 100644 --- a/GeosCore/convection_mod.F90 +++ b/GeosCore/convection_mod.F90 @@ -342,7 +342,7 @@ SUBROUTINE DO_CONVECTION( Input_Opt, State_Chm, State_Diag, & !$OMP END PARALLEL DO #endif - ! Return if COMPUTE_F returned an error + ! Return if Do_Cloud_Convection returned an error IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Do_Cloud_Convection"!' CALL GC_Error( ErrMsg, RC, ThisLoc ) @@ -502,7 +502,7 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! !LOCAL VARIABLES: ! ! Scalars - LOGICAL :: AER, IS_Hg + LOGICAL :: AER, IS_Hg, Is_GF_Conv INTEGER :: IC, ISTEP, K INTEGER :: KTOP, NC, NDT INTEGER :: NLAY, NS, CLDBASE @@ -526,21 +526,25 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! Arrays REAL(fp) :: BMASS (State_Grid%NZ) REAL(fp) :: PDOWN (State_Grid%NZ) + REAL(fp) :: REEVAPCN (State_Grid%NZ) + REAL(fp) :: DQRCU (State_Grid%NZ) ! Pointers - REAL(fp), POINTER :: BXHEIGHT (:) - REAL(fp), POINTER :: CMFMC (:) - REAL(fp), POINTER :: DQRCU (:) - REAL(fp), POINTER :: DTRAIN (:) - REAL(fp), POINTER :: PFICU (:) - REAL(fp), POINTER :: PFLCU (:) - REAL(fp), POINTER :: REEVAPCN (:) - REAL(fp), POINTER :: DELP_DRY (:) - REAL(fp), POINTER :: T (:) - REAL(fp), POINTER :: H2O2s (:) - REAL(fp), POINTER :: SO2s (:) - REAL(fp), POINTER :: Q (:) - TYPE(SpcConc), POINTER :: Spc (:) + REAL(fp), POINTER :: BXHEIGHT (:) + REAL(fp), POINTER :: CMFMC (:) + REAL(fp), POINTER :: DQRCU_MET (:) + REAL(fp), POINTER :: DTRAIN (:) + REAL(fp), POINTER :: PFICU (:) + REAL(fp), POINTER :: PFLCU (:) + REAL(fp), POINTER :: REEVAPCN_MET (:) + REAL(fp), POINTER :: DELP_DRY (:) + REAL(fp), POINTER :: DELP (:) + REAL(fp), POINTER :: T (:) + REAL(fp), POINTER :: H2O2s (:) + REAL(fp), POINTER :: SO2s (:) + REAL(fp), POINTER :: Q (:) + REAL(fp), POINTER :: PRECCON + TYPE(SpcConc), POINTER :: Spc (:) TYPE(Species), POINTER :: SpcInfo !======================================================================== @@ -553,18 +557,20 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ThisLoc = ' -> at Do_Cloud_Convection (in convection_mod.F90)' ! Point to columns of derived-type object fields - BXHEIGHT => State_Met%BXHEIGHT(I,J,: ) ! Box height [m] - CMFMC => State_Met%CMFMC (I,J,2:State_Grid%NZ+1) ! Cloud mass flux - ! [kg/m2/s] - DQRCU => State_Met%DQRCU (I,J,: ) ! Precip production rate: - DTRAIN => State_Met%DTRAIN (I,J,: ) ! Detrainment flux [kg/m2/s] - REEVAPCN => State_Met%REEVAPCN(I,J,: ) ! Evap of precip'ing conv. - DELP_DRY => State_Met%DELP_DRY(I,J,: ) ! Edge dry P diff [hPa] - T => State_Met%T (I,J,: ) ! Air temperature [K] - H2O2s => State_Chm%H2O2AfterChem(I,J,: ) ! H2O2s from sulfate_mod - SO2s => State_Chm%SO2AfterChem (I,J,: ) ! SO2s from sulfate_mod - Spc => State_Chm%Species ! Chemical species vector - SpcInfo => NULL() ! Species database entry + BXHEIGHT => State_Met%BXHEIGHT(I,J,: ) ! Box height [m] + CMFMC => State_Met%CMFMC (I,J,2:State_Grid%NZ+1) ! Cloud mass flux + ! [kg/m2/s] + DQRCU_MET => State_Met%DQRCU (I,J,: ) ! Precip production rate: + DTRAIN => State_Met%DTRAIN (I,J,: ) ! Detrainment flux [kg/m2/s] + REEVAPCN_MET => State_Met%REEVAPCN(I,J,: ) ! Evap of precip'ing conv. + DELP_DRY => State_Met%DELP_DRY(I,J,: ) ! Edge dry P diff [hPa] + DELP => State_Met%DELP (I,J,: ) ! Edge P diff [hPa] + T => State_Met%T (I,J,: ) ! Air temperature [K] + PRECCON => State_Met%PRECCON (I,J ) ! Surface precipitation flux [mm/day] + H2O2s => State_Chm%H2O2AfterChem(I,J,: ) ! H2O2s from sulfate_mod + SO2s => State_Chm%SO2AfterChem (I,J,: ) ! SO2s from sulfate_mod + Spc => State_Chm%Species ! Chemical species vector + SpcInfo => NULL() ! Species database entry ! PFICU and PFLCU are on level edges PFICU => State_Met%PFICU (I,J,2:State_Grid%NZ+1) ! Dwnwd flx of conv @@ -584,6 +590,11 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! Convection timestep [s] NDT = TS_DYN + ! Is this a Hg simulation? + IS_Hg = Input_Opt%ITS_A_MERCURY_SIM + ! GF convection scheme? + Is_GF_Conv = Input_Opt%Met_Conv_Is_Grell_Freitas + IF ( State_Grid%NZ > 72 .or. & Input_Opt%MetField == "MODELE2.1" ) THEN ! Higher vertical resolution runs need shorter convective timestep @@ -597,6 +608,31 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & DNS = DBLE( NS ) ! Num internal timesteps (real) SDT = DBLE( NDT ) / DBLE( NS ) ! seconds in internal timestep + IF ( Is_GF_Conv == .FALSE. ) THEN + ! RAS scheme + REEVAPCN(:) = REEVAPCN_MET(:) + DQRCU(:) = DQRCU_MET(:) + ELSE + ! GF scheme + ! REEVAPCN_MET is cumulative re-evaporation + ! DQRCU_MET is net precipitation formation (need to add re-evaporation back) + REEVAPCN(NLAY) = REEVAPCN_MET(NLAY) + DO K = 2, NLAY-1 + ! REEVAPCN (kg/kg/s) to REEVAPCN_FLUX (kg/m2/s) + ! subtraction between fluxes instead + REEVAPCN(K) = (REEVAPCN_MET(K) * DELP(K) & + - REEVAPCN_MET(K+1) * DELP(K+1) ) & + / DELP(K) + ENDDO + ! Zero DQRCU and some negative REEVAPCN at surface in GF scheme + ! Set as zero to avoid cloud base mistakenly at surface level + REEVAPCN(1) = 0.0_fp + DQRCU(1) = 0.0_fp + DO K = 2, NLAY + DQRCU(K) = DQRCU_MET(K) + REEVAPCN(K) + ENDDO + ENDIF + !----------------------------------------------------------------- ! Determine location of the cloud base, which is the level where ! we start to have non-zero convective precipitation formation @@ -616,24 +652,29 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & !----------------------------------------------------------------- ! Compute PDOWN and BMASS !----------------------------------------------------------------- - DO K = 1, NLAY - - ! PDOWN is the convective precipitation leaving each - ! box [cm3 H2O/cm2 air/s]. This accounts for the - ! contribution from both liquid & ice precip. - ! PFLCU and PFICU are converted from kg/m2/s to m3/m2/s - ! using water and ice densities, respectively. - ! m3/m2/s becomes cm3/cm2/s using a factor of 100. - PDOWN(K) = ( ( PFLCU(K) / 1000e+0_fp ) & - + ( PFICU(K) / 917e+0_fp ) ) * 100e+0_fp - - ! BMASS is the dry air mass per unit area for the grid box - ! bounded by level K and K+1 [kg/m2] - ! BMASS is equivalent to deltaP (dry) * 100 / g - ! This is done to keep BMASS in the same units as CMFMC * SDT - BMASS(K) = DELP_DRY(K) * G0_100 + ! PDOWN is the convective precipitation leaving each + ! box [cm3 H2O/cm2 air/s]. This accounts for the + ! contribution from both liquid & ice precip. + ! PFLCU and PFICU are converted from kg/m2/s to m3/m2/s + ! using water and ice densities, respectively. + ! m3/m2/s becomes cm3/cm2/s using a factor of 100. + IF ( Is_GF_Conv == .FALSE. ) THEN + PDOWN(:) = ( ( PFLCU(:) / 1000e+0_fp ) & + + ( PFICU(:) / 917e+0_fp ) ) * 100e+0_fp + ELSE + PDOWN(NLAY) = 0 + DO K = NLAY-1, 1, -1 + PDOWN(K) = PDOWN(K+1) + DQRCU_MET(K+1) & + * DELP(K+1) * G0_100 * 100e+0_fp + ! kg/kg wet air/s to kg/m2/s then to cm3 H20/cm2 air/s + ENDDO + ENDIF - ENDDO + ! BMASS is the dry air mass per unit area for the grid box + ! bounded by level K and K+1 [kg/m2] + ! BMASS is equivalent to deltaP (dry) * 100 / g + ! This is done to keep BMASS in the same units as CMFMC * SDT + BMASS(:) = DELP_DRY(:) * G0_100 !----------------------------------------------------------------- ! Compute MB, the mass per unit area of dry air below the cloud @@ -645,9 +686,6 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & MB = MB + BMASS(K) ENDDO - ! Is this a Hg simulation? - IS_Hg = Input_Opt%ITS_A_MERCURY_SIM - !======================================================================== ! (1) A d v e c t e d S p e c i e s L o o p !======================================================================== @@ -1374,18 +1412,19 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & !================================================================ ! Nullify pointers - NULLIFY( BXHEIGHT ) - NULLIFY( CMFMC ) - NULLIFY( DQRCU ) - NULLIFY( DTRAIN ) - NULLIFY( PFICU ) - NULLIFY( PFLCU ) - NULLIFY( REEVAPCN ) - NULLIFY( DELP_DRY ) - NULLIFY( T ) - NULLIFY( H2O2s ) - NULLIFY( SO2s ) - NULLIFY( Spc ) + NULLIFY( BXHEIGHT ) + NULLIFY( CMFMC ) + NULLIFY( DQRCU_MET ) + NULLIFY( DTRAIN ) + NULLIFY( PFICU ) + NULLIFY( PFLCU ) + NULLIFY( REEVAPCN_MET ) + NULLIFY( DELP_DRY ) + NULLIFY( DELP ) + NULLIFY( T ) + NULLIFY( H2O2s ) + NULLIFY( SO2s ) + NULLIFY( Spc ) ! Set error code to success RC = GC_SUCCESS From 4be2a161e811e2a3cafb213f1922db545817da6e Mon Sep 17 00:00:00 2001 From: "yuanjian.z" Date: Mon, 21 Oct 2024 14:51:26 -0500 Subject: [PATCH 03/12] Fix PDOWN definition to lower edge and remove re-evaporation requirement for washout --- GeosCore/convection_mod.F90 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/GeosCore/convection_mod.F90 b/GeosCore/convection_mod.F90 index 2604c087c..7d0f38cdc 100644 --- a/GeosCore/convection_mod.F90 +++ b/GeosCore/convection_mod.F90 @@ -559,7 +559,7 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! Point to columns of derived-type object fields BXHEIGHT => State_Met%BXHEIGHT(I,J,: ) ! Box height [m] CMFMC => State_Met%CMFMC (I,J,2:State_Grid%NZ+1) ! Cloud mass flux - ! [kg/m2/s] + ! [kg/m2/s] [upper edge] DQRCU_MET => State_Met%DQRCU (I,J,: ) ! Precip production rate: DTRAIN => State_Met%DTRAIN (I,J,: ) ! Detrainment flux [kg/m2/s] REEVAPCN_MET => State_Met%REEVAPCN(I,J,: ) ! Evap of precip'ing conv. @@ -573,12 +573,12 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & SpcInfo => NULL() ! Species database entry ! PFICU and PFLCU are on level edges - PFICU => State_Met%PFICU (I,J,2:State_Grid%NZ+1) ! Dwnwd flx of conv + PFICU => State_Met%PFICU (I,J,1:State_Grid%NZ) ! Dwnwd flx of conv ! ice precip - ! [kg/m2/s] - PFLCU => State_Met%PFLCU (I,J,2:State_Grid%NZ+1) ! Dwnwd flux of conv + ! [kg/m2/s] [lower edge] + PFLCU => State_Met%PFLCU (I,J,1:State_Grid%NZ) ! Dwnwd flux of conv ! liquid precip - ! [kg/m2/s] + ! [kg/m2/s] [lower edge] ! # of levels and # of species NLAY = State_Grid%NZ @@ -662,10 +662,10 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & PDOWN(:) = ( ( PFLCU(:) / 1000e+0_fp ) & + ( PFICU(:) / 917e+0_fp ) ) * 100e+0_fp ELSE - PDOWN(NLAY) = 0 + PDOWN(NLAY) = DQRCU_MET(NLAY) * DELP(NLAY) * G0_100 * 100e+0_fp DO K = NLAY-1, 1, -1 - PDOWN(K) = PDOWN(K+1) + DQRCU_MET(K+1) & - * DELP(K+1) * G0_100 * 100e+0_fp + PDOWN(K) = PDOWN(K+1) + DQRCU_MET(K) & + * DELP(K) * G0_100 * 100e+0_fp ! kg/kg wet air/s to kg/m2/s then to cm3 H20/cm2 air/s ENDDO ENDIF @@ -1138,10 +1138,8 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! Check if... ! (1) there is precip coming into box (I,J,K) from (I,J,K+1) - ! (2) there is re-evaporation happening in grid box (I,J,K) - ! (3) there is species to re-evaporate + ! (2) there is species to re-evaporate IF ( PDOWN(K+1) > 0 .and. & - REEVAPCN(K) > 0 .and. & T0_SUM > 0 ) THEN ! Compute F_WASHOUT, the fraction of grid box (I,J,L) From c70672947ea977a54e2e31af82165be40c2d3a6d Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 5 Nov 2024 14:29:34 -0500 Subject: [PATCH 04/12] Add met source to GCHP geoschem_config.yml Signed-off-by: Lizzie Lundgren --- run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.CO2 | 1 + .../geoschem_config.yml.TransportTracers | 1 + .../geoschem_config.yml.templates/geoschem_config.yml.carbon | 1 + .../geoschem_config.yml.templates/geoschem_config.yml.fullchem | 1 + run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.tagO3 | 1 + 5 files changed, 5 insertions(+) diff --git a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.CO2 b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.CO2 index f76c32020..3a4b71da3 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.CO2 +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.CO2 @@ -10,6 +10,7 @@ #============================================================================ simulation: name: ${RUNDIR_SIM_NAME} + met_field: ${RUNDIR_MET} chem_inputs_dir: ./ChemDir/ species_database_file: ./species_database.yml species_metadata_output_file: OutputDir/geoschem_species_metadata.yml diff --git a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.TransportTracers b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.TransportTracers index 9ec66e0e2..acf1fd404 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.TransportTracers +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.TransportTracers @@ -10,6 +10,7 @@ #============================================================================ simulation: name: ${RUNDIR_SIM_NAME} + met_field: ${RUNDIR_MET} chem_inputs_dir: ./ChemDir/ species_database_file: ./species_database.yml species_metadata_output_file: OutputDir/geoschem_species_metadata.yml diff --git a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon index 323f4f2d8..7c68d6a07 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon @@ -7,6 +7,7 @@ #============================================================================ simulation: name: ${RUNDIR_SIM_NAME} + met_field: ${RUNDIR_MET} chem_inputs_dir: ./ChemDir/ species_database_file: ./species_database.yml species_metadata_output_file: OutputDir/geoschem_species_metadata.yml 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 6b610b466..1e9573d92 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.fullchem +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.fullchem @@ -10,6 +10,7 @@ #============================================================================ simulation: name: ${RUNDIR_SIM_NAME} + met_field: ${RUNDIR_MET} chem_inputs_dir: ./ChemDir/ species_database_file: ./species_database.yml species_metadata_output_file: OutputDir/geoschem_species_metadata.yml diff --git a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.tagO3 b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.tagO3 index 332395a89..92605393f 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.tagO3 +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.tagO3 @@ -10,6 +10,7 @@ #============================================================================ simulation: name: ${RUNDIR_SIM_NAME} + met_field: ${RUNDIR_MET} chem_inputs_dir: ./ChemDir/ species_database_file: ./species_database.yml species_metadata_output_file: OutputDir/geoschem_species_metadata.yml From 3d463d04f10b16adb5d33d5bf1b1f508beef3ebd Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 5 Nov 2024 14:30:57 -0500 Subject: [PATCH 05/12] Add Input_Opt field for reconstruction convective precipitation flux Signed-off-by: Lizzie Lundgren --- GeosCore/convection_mod.F90 | 8 +++----- GeosCore/input_mod.F90 | 41 ++++++++++++++++++++++++++++++++++++- Headers/input_opt_mod.F90 | 2 ++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/GeosCore/convection_mod.F90 b/GeosCore/convection_mod.F90 index 7d0f38cdc..a51b1b993 100644 --- a/GeosCore/convection_mod.F90 +++ b/GeosCore/convection_mod.F90 @@ -502,7 +502,7 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! !LOCAL VARIABLES: ! ! Scalars - LOGICAL :: AER, IS_Hg, Is_GF_Conv + LOGICAL :: AER, IS_Hg INTEGER :: IC, ISTEP, K INTEGER :: KTOP, NC, NDT INTEGER :: NLAY, NS, CLDBASE @@ -592,8 +592,6 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! Is this a Hg simulation? IS_Hg = Input_Opt%ITS_A_MERCURY_SIM - ! GF convection scheme? - Is_GF_Conv = Input_Opt%Met_Conv_Is_Grell_Freitas IF ( State_Grid%NZ > 72 .or. & Input_Opt%MetField == "MODELE2.1" ) THEN @@ -608,7 +606,7 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & DNS = DBLE( NS ) ! Num internal timesteps (real) SDT = DBLE( NDT ) / DBLE( NS ) ! seconds in internal timestep - IF ( Is_GF_Conv == .FALSE. ) THEN + IF ( .NOT. Input_Opt%Reconstruct_Conv_Precip_Flux ) THEN ! RAS scheme REEVAPCN(:) = REEVAPCN_MET(:) DQRCU(:) = DQRCU_MET(:) @@ -658,7 +656,7 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! PFLCU and PFICU are converted from kg/m2/s to m3/m2/s ! using water and ice densities, respectively. ! m3/m2/s becomes cm3/cm2/s using a factor of 100. - IF ( Is_GF_Conv == .FALSE. ) THEN + IF ( .NOT. Input_Opt%Reconstruct_Conv_Precip_Flux ) THEN PDOWN(:) = ( ( PFLCU(:) / 1000e+0_fp ) & + ( PFICU(:) / 917e+0_fp ) ) * 100e+0_fp ELSE diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index cfc041eec..9e985784c 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -3202,7 +3202,9 @@ END SUBROUTINE Config_Photolysis ! !IROUTINE: config_convection_mixing ! ! !DESCRIPTION: Copies convection & PBL mixing information from the Config -! object to Input_Opt, and does necessary checks. +! object to Input_Opt, and does necessary checks. Also sets whether +! to reconstruct convective precipitation flux based on meteorology +! source and simulation start date. !\\ !\\ ! !INTERFACE: @@ -3286,6 +3288,10 @@ SUBROUTINE Config_Convection_Mixing( Config, Input_Opt, RC ) ENDIF Input_Opt%LNLPBL = v_bool + !------------------------------------------------------------------------ + ! Other settings based on inputs + !------------------------------------------------------------------------ + ! Set the PBL drydep flag. This determines if dry deposition is ! applied (and drydep frequencies are calculated) over the entire ! PBL or the first model layer only. For now, set this value @@ -3293,6 +3299,29 @@ SUBROUTINE Config_Convection_Mixing( Config, Input_Opt, RC ) ! for the non-local PBL scheme, full PBL for the full-mixing scheme. Input_Opt%PBL_DRYDEP = ( .not. Input_Opt%LNLPBL ) + ! Set whether to reconstruct convective precipitation flux based on + ! meteorology source and simulation start date. This is important for + ! avoiding a bug where convective precipitation met-fields are all zero + ! in GEOS-IT for all years and in GEOS-FP following June 1, 2020. + ! + ! IMPORTANT NOTE: The logic for GEOS-FP assumes (1) meteorology year + ! is the same as simulation year and (2) the simulation does not + ! run across June 1, 2020. Use the following rules to ensure your + ! simulation is correct: + ! (1) Manually update code below if GEOS-FP data year is + ! different than simulation year: + ! - Set to .FALSE. if data is prior to June 1, 2020 + ! - Set to .TRUE. if data is on or after June 1, 2020 + ! (2) Do not run a GEOS-FP simulation across June 1, 2020. Split + ! up the run in time to avoid this. + IF ( Input_Opt%MetField == 'GEOSIT' ) THEN + Input_Opt%Reconstruct_Conv_Precip_Flux = .TRUE. + ELSEIF ( Input_Opt%MetField == 'GEOSFP' .AND. Input_Opt%NYMDb >= 20200601 ) THEN + Input_Opt%Reconstruct_Conv_Precip_Flux = .TRUE. + ELSE + Input_Opt%Reconstruct_Conv_Precip_Flux = .FALSE. + ENDIF + ! Return success RC = GC_SUCCESS @@ -3303,6 +3332,16 @@ SUBROUTINE Config_Convection_Mixing( Config, Input_Opt, RC ) WRITE( 6, 90 ) 'CONVECTION SETTINGS' WRITE( 6, 95 ) '-------------------' WRITE( 6, 100 ) 'Turn on cloud convection? : ', Input_Opt%LCONV + WRITE( 6, 100 ) 'Reconstruct convective precipitation flux? : ', & + Input_Opt%Reconstruct_Conv_Precip_Flux + + IF ( Input_Opt%MetFields == 'GEOSFP' ) THEN + IF ( Input_Opt%Reconstruct_Conv_Precip_Flux ) THEN + WRITE( 6, 90 ) 'WARNING: Convection will assume met data is on or after 01Jun2020!' + ELSE + WRITE( 6, 90 ) 'WARNING: Convection will assume met data is prior to 01Jun2020!' + ENDIF + ENDIF WRITE( 6, 90 ) 'PBL MIXING SETTINGS' WRITE( 6, 95 ) '-------------------' diff --git a/Headers/input_opt_mod.F90 b/Headers/input_opt_mod.F90 index 9d60405c9..721b4879a 100644 --- a/Headers/input_opt_mod.F90 +++ b/Headers/input_opt_mod.F90 @@ -239,6 +239,7 @@ MODULE Input_Opt_Mod LOGICAL :: LCONV LOGICAL :: LTURB LOGICAL :: LNLPBL + LOGICAL :: Reconstruct_Conv_Precip_Flux INTEGER :: TS_CONV !---------------------------------------- @@ -759,6 +760,7 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%LCONV = .FALSE. Input_Opt%LTURB = .FALSE. Input_Opt%LNLPBL = .FALSE. + Input_Opt%Reconstruct_Conv_Precip_Flux = .FALSE. Input_Opt%TS_CONV = 0 !---------------------------------------- From 77ad9ae480e4d721802bc38c8f5063505d4c53fa Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 5 Nov 2024 14:38:50 -0500 Subject: [PATCH 06/12] Add GEOS-FP warning to GCHP and GC-Classic run directory creation Signed-off-by: Lizzie Lundgren --- run/GCClassic/createRunDir.sh | 30 ++++++++++++++++++++++++++++++ run/GCHP/createRunDir.sh | 29 ++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index c3407fd94..724ac51ea 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -54,6 +54,9 @@ RUNDIR_VARS+="RUNDIR_GC_MODE='GCClassic'\n" thickline="\n===========================================================\n" thinline="\n-----------------------------------------------------------\n" +# Define run directory config log +rundir_config_log=${rundir_config}/rundir_vars.txt + printf "${thickline}GEOS-CHEM RUN DIRECTORY CREATION${thickline}" #----------------------------------------------------------------- @@ -353,6 +356,24 @@ while [ "${valid_met}" -eq 0 ]; do met="geosfp" shared_met_settings=${gcdir}/run/shared/settings/geosfp/geosfp.preprocessed_ll.txt RUNDIR_VARS+="RUNDIR_MET_FIELD_CONFIG='HEMCO_Config.rc.gmao_metfields'\n" + + # Print warning about GEOS-FP and require user to acknowledge it. + fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology files changed from RAS to Grell-Freidas starting June 1, 2020 with impact on vertical transport. Discussion and analysis of the impact is available at github.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in convective precipitation flux following the switch where all values are zero. This bug is automatically fixed by computing fluxes online for runs starting on or after June 1 2020, but not for the case of running across the time boundary. Due to these issues we recommend splitting up GEOS-FP runs in time such that a single simulation does not run across June 1, 2020. Instead set one run to stop on June 1 2020 and then restart a new run from there. If you wish to use a GEOS-FP meteorology year different from your simulation year please create a GEOS-Chem GitHub issue for assistance to avoid accidentally using zero convective precipitation flux.\n\nThis warning will be printed to run directory file ${rundir_config_log} for future reference.\n" + printf ${fp_msg} + valid_fp_accept=0 + while [ "${valid_fp_accept}" -eq 0 ]; do + read -p "${USER_PROMPT}" fp_accept + valid_fp_accept=1 + if [[ ${fp_accept} = "y" ]]; then + x=0 + elif [[ ${fp_accept} = "q" ]]; then + exit + else + valid_fp_accept=0 + printf "Invalid option. Try again.\n" + fi + done + elif [[ ${met_num} = "3" ]]; then met="geosit" shared_met_settings=${gcdir}/run/shared/settings/geosit/geosit.preprocessed_ll.txt @@ -1244,6 +1265,15 @@ if [[ "x${enable_git}" == "xy" ]]; then fi fi + +#----------------------------------------------------------------- +# If using GEOS-FP then add a warning at top of rundir config log +#----------------------------------------------------------------- +if [[ $met == "geosfp" ]]; then + cat ${fp_msg} ${rundir_config_log} > tmp.txt + mv tmp.txt ${rundir_config_log} +fi + #----------------------------------------------------------------- # Done! #----------------------------------------------------------------- diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index fdf2dd414..d02216287 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -52,6 +52,9 @@ RUNDIR_VARS+="RUNDIR_GC_MODE='GCHP'\n" thickline="\n===========================================================\n" thinline="\n-----------------------------------------------------------\n" +# Define run directory config log +rundir_config_log=${rundir_config}/rundir_vars.txt + printf "${thickline}GCHP RUN DIRECTORY CREATION${thickline}" #----------------------------------------------------------------- @@ -317,6 +320,23 @@ while [ "${valid_met}" -eq 0 ]; do met="geosfp" + # Print warning about GEOS-FP and require user to acknowledge it. + fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology files changed from RAS to Grell-Freidas starting June 1, 2020 with impact on vertical transport. Discussion and analysis of the impact is available at github.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in convective precipitation flux following the switch where all values are zero. This bug is automatically fixed by computing fluxes online for runs starting on or after June 1 2020, but not for the case of running across the time boundary. Due to these issues we recommend splitting up GEOS-FP runs in time such that a single simulation does not run across June 1, 2020. Instead set one run to stop on June 1 2020 and then restart a new run from there. If you wish to use a GEOS-FP meteorology year different from your simulation year please create a GEOS-Chem GitHub issue for assistance to avoid accidentally using zero convective precipitation flux.\n\nThis warning will be printed to run directory file ${rundir_config_log} for future reference.\n" + printf ${fp_msg} + valid_fp_accept=0 + while [ "${valid_fp_accept}" -eq 0 ]; do + read -p "${USER_PROMPT}" fp_accept + valid_fp_accept=1 + if [[ ${fp_accept} = "y" ]]; then + x=0 + elif [[ ${fp_accept} = "q" ]]; then + exit + else + valid_fp_accept=0 + printf "Invalid option. Try again.\n" + fi + done + # Ask user to specify processed or raw files printf "${thinline}Choose meteorology file type:${thinline}" printf " 1. 0.25x0.3125 daily files pre-processed for GEOS-Chem\n" @@ -785,7 +805,6 @@ fi #-------------------------------------------------------------------- # Save RUNDIR variables to file -rundir_config_log=${rundir_config}/rundir_vars.txt echo -e "$RUNDIR_VARS" > ${rundir_config_log} # Initialize run directory @@ -864,6 +883,14 @@ while [ "$valid_response" -eq 0 ]; do fi done +#----------------------------------------------------------------- +# If using GEOS-FP then add a warning at top of rundir config log +#----------------------------------------------------------------- +if [[ $met == "geosfp" ]]; then + cat ${fp_msg} ${rundir_config_log} > tmp.txt + mv tmp.txt ${rundir_config_log} +fi + #----------------------------------------------------------------- # Done! #----------------------------------------------------------------- From 32d07a09e0a94ecbb65966ffb8a8f681edc85d26 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 5 Nov 2024 16:48:31 -0500 Subject: [PATCH 07/12] Further update create run directory scripts for GC-Classic and GCHP Signed-off-by: Lizzie Lundgren --- run/GCClassic/createRunDir.sh | 36 ++++++++-------- run/GCHP/createRunDir.sh | 80 ++++++++++++++++++++++++----------- 2 files changed, 73 insertions(+), 43 deletions(-) diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index 724ac51ea..15d452404 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -54,9 +54,6 @@ RUNDIR_VARS+="RUNDIR_GC_MODE='GCClassic'\n" thickline="\n===========================================================\n" thinline="\n-----------------------------------------------------------\n" -# Define run directory config log -rundir_config_log=${rundir_config}/rundir_vars.txt - printf "${thickline}GEOS-CHEM RUN DIRECTORY CREATION${thickline}" #----------------------------------------------------------------- @@ -358,8 +355,10 @@ while [ "${valid_met}" -eq 0 ]; do RUNDIR_VARS+="RUNDIR_MET_FIELD_CONFIG='HEMCO_Config.rc.gmao_metfields'\n" # Print warning about GEOS-FP and require user to acknowledge it. - fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology files changed from RAS to Grell-Freidas starting June 1, 2020 with impact on vertical transport. Discussion and analysis of the impact is available at github.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in convective precipitation flux following the switch where all values are zero. This bug is automatically fixed by computing fluxes online for runs starting on or after June 1 2020, but not for the case of running across the time boundary. Due to these issues we recommend splitting up GEOS-FP runs in time such that a single simulation does not run across June 1, 2020. Instead set one run to stop on June 1 2020 and then restart a new run from there. If you wish to use a GEOS-FP meteorology year different from your simulation year please create a GEOS-Chem GitHub issue for assistance to avoid accidentally using zero convective precipitation flux.\n\nThis warning will be printed to run directory file ${rundir_config_log} for future reference.\n" - printf ${fp_msg} + fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology \nfiles changed from RAS to Grell-Freidas starting June 1 2020 with impact on \nvertical transport. Discussion and analysis of the impact is available at \ngithub.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in \nconvective precipitation flux following the switch where all values are zero \nin the input files. This bug is addressed by computing fluxes online for runs \nstarting on or after June 1 2020. The fix does not extend to the case of running \nacross the time boundary. Due to these issues we recommend splitting up GEOS-FP \nruns in time such that a single simulation does not span the switch. Configure \none run to end on June 1 2020 and then use its output restart to start another \nrun on June 1. Alternatively consider using MERRA2. If you wish to use a \nGEOS-FP meteorology year different from your simulation year please create a \nGEOS-Chem GitHub issue for assistance to avoid accidentally using zero \nconvective precipitation flux.\n" + printf "\n${fp_msg}\n" + printf "This warning will be printed to run directory file warnings.txt.\n" + printf "${thinline}Enter y to acknowledge and proceed, or q to quit:${thinline}" valid_fp_accept=0 while [ "${valid_fp_accept}" -eq 0 ]; do read -p "${USER_PROMPT}" fp_accept @@ -879,10 +878,6 @@ done mkdir -p ${rundir} mkdir -p ${rundir}/Restarts -# Define a subdirectory for rundir configuration files -rundir_config=${rundir}/CreateRunDirLogs -mkdir -p ${rundir_config} - # Copy run directory files and subdirectories cp ${gcdir}/run/shared/cleanRunDir.sh ${rundir} cp ${gcdir}/run/shared/download_data.py ${rundir} @@ -1057,8 +1052,13 @@ fi # Replace settings in config files with RUNDIR variables #-------------------------------------------------------------------- +# Define a subdirectory for rundir configuration files +rundir_config_dirname=CreateRunDirLogs +mkdir -p ${rundir}/${rundir_config_dirname} + # Save RUNDIR variables to a file in the rundirConfig folder -rundir_config_log=${rundir_config}/rundir_vars.txt +rundir_config_logname=rundir_vars.txt +rundir_config_log=${rundir}/${rundir_config_dirname}/${rundir_config_logname} echo -e "$RUNDIR_VARS" > ${rundir_config_log} #sort -o ${rundir_config_log} ${rundir_config_log} @@ -1067,10 +1067,10 @@ echo -e "$RUNDIR_VARS" > ${rundir_config_log} ${srcrundir}/init_rd.sh ${rundir_config_log} #-------------------------------------------------------------------- -# Print run direcory setup info to screen +# Print run directory setup info to screen #-------------------------------------------------------------------- -printf "\n -- See rundir_vars.txt for summary of default run directory settings" +printf "\n -- See ${rundir_config_dirname}/${rundir_config_logname} for summary of default run directory settings" printf "\n -- This run directory has been set up to start on ${startdate}" printf "\n -- A restart file for this date has been copied to the Restarts subdirectory" printf "\n -- You may add more restart files using format GEOSChem.Restart.YYYYMMDD_HHmmz.nc4" @@ -1163,7 +1163,7 @@ commit_hash=$(git log -n 1 --pretty=format:"%h") cd ${srcrundir} # Write commit info to a version log -version_log=${rundir_config}/rundir.version +version_log=${rundir}/${rundir_config_dirname}/rundir.version printf " This run directory was created with:" > ${version_log} printf "\n ${srcrundir}/createRunDir.sh.\n" >> ${version_log} printf "\n GEOS-Chem repository version information:\n" >> ${version_log} @@ -1244,7 +1244,7 @@ unset msg printf "\n\n IMPORTANT: ONLY USE THESE RUNDIR SETTINGS WITH THIS COMMIT!\n" >> ${version_log} # Add a "# " characters to the front of each line so we can use -# it as a comment heading for rundir_vars.txt +# it as a comment heading for ${rundir_config_logname} sed 's/^/# /' ${version_log} > tmp.txt mv tmp.txt ${version_log} @@ -1260,18 +1260,16 @@ if [[ "x${enable_git}" == "xy" ]]; then if [[ -f ${rundir_config_log} ]]; then cd ${rundir} git add ${rundir_config_log} - git commit -m "Update header of rundirConfig/rundir_vars.txt" > /dev/null + git commit -m "Update header of ${rundir_config_dirname}/${rundir_config_logname}" > /dev/null cd ${srcrundir} fi fi - #----------------------------------------------------------------- -# If using GEOS-FP then add a warning at top of rundir config log +# Create and populate warnings file #----------------------------------------------------------------- if [[ $met == "geosfp" ]]; then - cat ${fp_msg} ${rundir_config_log} > tmp.txt - mv tmp.txt ${rundir_config_log} + echo -e ${fp_msg} > ${rundir}/warnings.txt fi #----------------------------------------------------------------- diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index d02216287..265bfa0af 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -52,9 +52,6 @@ RUNDIR_VARS+="RUNDIR_GC_MODE='GCHP'\n" thickline="\n===========================================================\n" thinline="\n-----------------------------------------------------------\n" -# Define run directory config log -rundir_config_log=${rundir_config}/rundir_vars.txt - printf "${thickline}GCHP RUN DIRECTORY CREATION${thickline}" #----------------------------------------------------------------- @@ -321,8 +318,10 @@ while [ "${valid_met}" -eq 0 ]; do met="geosfp" # Print warning about GEOS-FP and require user to acknowledge it. - fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology files changed from RAS to Grell-Freidas starting June 1, 2020 with impact on vertical transport. Discussion and analysis of the impact is available at github.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in convective precipitation flux following the switch where all values are zero. This bug is automatically fixed by computing fluxes online for runs starting on or after June 1 2020, but not for the case of running across the time boundary. Due to these issues we recommend splitting up GEOS-FP runs in time such that a single simulation does not run across June 1, 2020. Instead set one run to stop on June 1 2020 and then restart a new run from there. If you wish to use a GEOS-FP meteorology year different from your simulation year please create a GEOS-Chem GitHub issue for assistance to avoid accidentally using zero convective precipitation flux.\n\nThis warning will be printed to run directory file ${rundir_config_log} for future reference.\n" - printf ${fp_msg} + fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology \nfiles changed from RAS to Grell-Freidas starting June 1 2020 with impact on \nvertical transport. Discussion and analysis of the impact is available at \ngithub.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in \nconvective precipitation flux following the switch where all values are zero \nin the input files. This bug is addressed by computing fluxes online for runs \nstarting on or after June 1 2020. The fix does not extend to the case of running \nacross the time boundary. Due to these issues we recommend splitting up GEOS-FP \nruns in time such that a single simulation does not span the switch. Configure \none run to end on June 1 2020 and then use its output restart to start another \nrun on June 1. Alternatively consider using MERRA2. If you wish to use a \nGEOS-FP meteorology year different from your simulation year please create a \nGEOS-Chem GitHub issue for assistance to avoid accidentally using zero \nconvective precipitation flux.\n" + printf "\n${fp_msg}\n" + printf "This warning will be printed to run directory file warnings.txt.\n" + printf "${thinline}Enter y to acknowledge and proceed, or q to quit:${thinline}" valid_fp_accept=0 while [ "${valid_fp_accept}" -eq 0 ]; do read -p "${USER_PROMPT}" fp_accept @@ -336,7 +335,7 @@ while [ "${valid_met}" -eq 0 ]; do printf "Invalid option. Try again.\n" fi done - + # Ask user to specify processed or raw files printf "${thinline}Choose meteorology file type:${thinline}" printf " 1. 0.25x0.3125 daily files pre-processed for GEOS-Chem\n" @@ -620,10 +619,6 @@ done mkdir -p ${rundir} mkdir -p ${rundir}/Restarts -# Define a subdirectory for rundir configuration files -rundir_config=${rundir}/CreateRunDirLogs -mkdir -p ${rundir_config} - # Copy run directory files and subdirectories cp ${gcdir}/run/shared/cleanRunDir.sh ${rundir} cp ./archiveRun.sh ${rundir} @@ -804,7 +799,14 @@ fi # Replace settings in config files with RUNDIR variables #-------------------------------------------------------------------- -# Save RUNDIR variables to file +# Define a subdirectory for rundir configuration files +rundir_config_dirname=CreateRunDirLogs +rundir_config=${rundir}/${rundir_config_dirname} +mkdir -p ${rundir_config} + +# Save RUNDIR variables to a file in the rundirConfig folder +rundir_config_logname=rundir_vars.txt +rundir_config_log=${rundir}/${rundir_config_dirname}/${rundir_config_logname} echo -e "$RUNDIR_VARS" > ${rundir_config_log} # Initialize run directory @@ -837,7 +839,7 @@ cd ${srcrundir} #---------------------------------------------------------------------- # Archive repository version in run directory file rundir.version #---------------------------------------------------------------------- -version_log=${rundir_config}/rundir.version +version_log=${rundir}/${rundir_config_dirname}/rundir.version echo "This run directory was created with ${srcrundir}/createRunDir.sh." > ${version_log} echo " " >> ${version_log} echo "GEOS-Chem repository version information:" >> ${version_log} @@ -883,19 +885,8 @@ while [ "$valid_response" -eq 0 ]; do fi done -#----------------------------------------------------------------- -# If using GEOS-FP then add a warning at top of rundir config log -#----------------------------------------------------------------- -if [[ $met == "geosfp" ]]; then - cat ${fp_msg} ${rundir_config_log} > tmp.txt - mv tmp.txt ${rundir_config_log} -fi - -#----------------------------------------------------------------- -# Done! -#----------------------------------------------------------------- - printf "\n${thinline}Created ${rundir}\n" +printf "\n -- See ${rundir_config_dirname}/${rundir_config_logname} for summary of default run directory settings" printf "\n -- This run directory is set up for simulation start date $start_date" printf "\n -- Restart files for this date at different grid resolutions are in the" printf "\n Restarts subdirectory" @@ -942,4 +933,45 @@ msg+="$ make install\n" printf "${msg}" > ${rundir}/build/README unset msg +#----------------------------------------------------------------- +# Add the version info to the top of the rundir configuration log +#----------------------------------------------------------------- + +# Add a caveat that these rundir settings only go with this commit +printf "\n\n IMPORTANT: ONLY USE THESE RUNDIR SETTINGS WITH THIS COMMIT!\n" >> ${version_log} + +# Add a "# " characters to the front of each line so we can use +# it as a comment heading for ${rundir_config_logname} +sed 's/^/# /' ${version_log} > tmp.txt +mv tmp.txt ${version_log} + +# Add the version log to the top of the rundir config log +cat ${version_log} ${rundir_config_log} > tmp.txt +mv tmp.txt ${rundir_config_log} + +# Remove the version log +rm -rf ${version_log} + +# Save the updated rundir_vars file to the git repo +if [[ "x${enable_git}" == "xy" ]]; then + if [[ -f ${rundir_config_log} ]]; then + cd ${rundir} + git add ${rundir_config_log} + git commit -m "Update header of ${rundir_config_dirname}/${rundir_config_lognbame}" > /dev/null + cd ${srcrundir} + fi +fi + +#----------------------------------------------------------------- +# Create and populate warnings file +#----------------------------------------------------------------- +if [[ $met == "geosfp" ]]; then + echo -e ${fp_msg} > ${rundir}/warnings.txt +fi + +#----------------------------------------------------------------- +# Done! +#----------------------------------------------------------------- +printf "\nCreated ${rundir}\n" + exit 0 From 6fd9a22363eb6eab91cb3e8fac8868a5f846d99e Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Tue, 5 Nov 2024 16:52:21 -0500 Subject: [PATCH 08/12] Fix bug preventing compile Signed-off-by: Lizzie Lundgren --- GeosCore/input_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index 9e985784c..0812c9924 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -3335,7 +3335,7 @@ SUBROUTINE Config_Convection_Mixing( Config, Input_Opt, RC ) WRITE( 6, 100 ) 'Reconstruct convective precipitation flux? : ', & Input_Opt%Reconstruct_Conv_Precip_Flux - IF ( Input_Opt%MetFields == 'GEOSFP' ) THEN + IF ( Input_Opt%MetField == 'GEOSFP' ) THEN IF ( Input_Opt%Reconstruct_Conv_Precip_Flux ) THEN WRITE( 6, 90 ) 'WARNING: Convection will assume met data is on or after 01Jun2020!' ELSE From 2ad1af9782e8415e4b5e1f3ba4d150f5fe7ee74e Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Thu, 14 Nov 2024 14:56:46 -0500 Subject: [PATCH 09/12] Update changelog Signed-off-by: Lizzie Lundgren --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da7afe4e..8fc4a0fc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ This file documents all notable changes to the GEOS-Chem repository starting in version 14.0.0, including all GEOS-Chem Classic and GCHP run directory updates. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] - TBD +### Added +- Specified meteorology source in GCHP geoschem_config.yml +- Added Input_Opt logical for whether to reconstruct convective precipitation fluxes rather than use met-fields +- Added to run directory creation a warning about convection discontinuity and bug if GEOS-FP meteorology is chosen +- Added surface precipitation flux fields as inputs to GCHP + +### Fixed +- Fixed zero convective precipitation and high cloud base in runs using GEOS-FP (>=01Jun2020) or GEOS-IT +- Fixed PDOWN definition to lower rather than upper edge + +### Changed + +### Removed +-Removed re-evaporation requirement for washout ## [Unreleased] - TBD ### Added From 33531ebe5cb31d9c1650aa28ef0099b20e3d5617 Mon Sep 17 00:00:00 2001 From: "yuanjian.z" Date: Fri, 15 Nov 2024 13:42:20 -0600 Subject: [PATCH 10/12] Revert RAS PDOWN and REEVAP condition fix to another PR for 14.6.0 so this PR goes into 14.5.1 --- CHANGELOG.md | 2 -- GeosCore/convection_mod.F90 | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fc4a0fc7..a08795538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - Fixed zero convective precipitation and high cloud base in runs using GEOS-FP (>=01Jun2020) or GEOS-IT -- Fixed PDOWN definition to lower rather than upper edge ### Changed ### Removed --Removed re-evaporation requirement for washout ## [Unreleased] - TBD ### Added diff --git a/GeosCore/convection_mod.F90 b/GeosCore/convection_mod.F90 index a51b1b993..429173783 100644 --- a/GeosCore/convection_mod.F90 +++ b/GeosCore/convection_mod.F90 @@ -573,12 +573,12 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & SpcInfo => NULL() ! Species database entry ! PFICU and PFLCU are on level edges - PFICU => State_Met%PFICU (I,J,1:State_Grid%NZ) ! Dwnwd flx of conv + PFICU => State_Met%PFICU (I,J,2:State_Grid%NZ+1) ! Dwnwd flx of conv ! ice precip - ! [kg/m2/s] [lower edge] - PFLCU => State_Met%PFLCU (I,J,1:State_Grid%NZ) ! Dwnwd flux of conv + ! [kg/m2/s] + PFLCU => State_Met%PFLCU (I,J,2:State_Grid%NZ+1) ! Dwnwd flux of conv ! liquid precip - ! [kg/m2/s] [lower edge] + ! [kg/m2/s] ! # of levels and # of species NLAY = State_Grid%NZ @@ -1136,8 +1136,10 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & ! Check if... ! (1) there is precip coming into box (I,J,K) from (I,J,K+1) - ! (2) there is species to re-evaporate + ! (2) there is re-evaporation happening in grid box (I,J,K) + ! (3) there is species to re-evaporate IF ( PDOWN(K+1) > 0 .and. & + REEVAPCN(K) > 0 .and. & T0_SUM > 0 ) THEN ! Compute F_WASHOUT, the fraction of grid box (I,J,L) From cee694dc8cda9fd1893a45f45fc4ee4a78ceb391 Mon Sep 17 00:00:00 2001 From: Yuanjian Zhang Date: Tue, 3 Dec 2024 17:53:23 -0600 Subject: [PATCH 11/12] Fix typoes --- run/GCClassic/createRunDir.sh | 2 +- run/GCHP/createRunDir.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index 15d452404..9594d89c0 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -355,7 +355,7 @@ while [ "${valid_met}" -eq 0 ]; do RUNDIR_VARS+="RUNDIR_MET_FIELD_CONFIG='HEMCO_Config.rc.gmao_metfields'\n" # Print warning about GEOS-FP and require user to acknowledge it. - fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology \nfiles changed from RAS to Grell-Freidas starting June 1 2020 with impact on \nvertical transport. Discussion and analysis of the impact is available at \ngithub.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in \nconvective precipitation flux following the switch where all values are zero \nin the input files. This bug is addressed by computing fluxes online for runs \nstarting on or after June 1 2020. The fix does not extend to the case of running \nacross the time boundary. Due to these issues we recommend splitting up GEOS-FP \nruns in time such that a single simulation does not span the switch. Configure \none run to end on June 1 2020 and then use its output restart to start another \nrun on June 1. Alternatively consider using MERRA2. If you wish to use a \nGEOS-FP meteorology year different from your simulation year please create a \nGEOS-Chem GitHub issue for assistance to avoid accidentally using zero \nconvective precipitation flux.\n" + fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology \nfiles changed from RAS to Grell-Freitas starting June 1 2020 with impact on \nvertical transport. Discussion and analysis of the impact is available at \ngithub.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in \nconvective precipitation flux following the switch where all values are zero \nin the input files. This bug is addressed by computing fluxes online for runs \nstarting on or after June 1 2020. The fix does not extend to the case of running \nacross the time boundary. Due to these issues we recommend splitting up GEOS-FP \nruns in time such that a single simulation does not span the switch. Configure \none run to end on June 1 2020 and then use its output restart to start another \nrun on June 1. Alternatively consider using MERRA2. If you wish to use a \nGEOS-FP meteorology year different from your simulation year please create a \nGEOS-Chem GitHub issue for assistance to avoid accidentally using zero \nconvective precipitation flux.\n" printf "\n${fp_msg}\n" printf "This warning will be printed to run directory file warnings.txt.\n" printf "${thinline}Enter y to acknowledge and proceed, or q to quit:${thinline}" diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index 265bfa0af..b187c8b8f 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -318,7 +318,7 @@ while [ "${valid_met}" -eq 0 ]; do met="geosfp" # Print warning about GEOS-FP and require user to acknowledge it. - fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology \nfiles changed from RAS to Grell-Freidas starting June 1 2020 with impact on \nvertical transport. Discussion and analysis of the impact is available at \ngithub.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in \nconvective precipitation flux following the switch where all values are zero \nin the input files. This bug is addressed by computing fluxes online for runs \nstarting on or after June 1 2020. The fix does not extend to the case of running \nacross the time boundary. Due to these issues we recommend splitting up GEOS-FP \nruns in time such that a single simulation does not span the switch. Configure \none run to end on June 1 2020 and then use its output restart to start another \nrun on June 1. Alternatively consider using MERRA2. If you wish to use a \nGEOS-FP meteorology year different from your simulation year please create a \nGEOS-Chem GitHub issue for assistance to avoid accidentally using zero \nconvective precipitation flux.\n" + fp_msg="WARNING: The convection scheme used to generate archived GEOS-FP meteorology \nfiles changed from RAS to Grell-Freitas starting June 1 2020 with impact on \nvertical transport. Discussion and analysis of the impact is available at \ngithub.com/geoschem/geos-chem/issues/1409. In addition, there is a bug in \nconvective precipitation flux following the switch where all values are zero \nin the input files. This bug is addressed by computing fluxes online for runs \nstarting on or after June 1 2020. The fix does not extend to the case of running \nacross the time boundary. Due to these issues we recommend splitting up GEOS-FP \nruns in time such that a single simulation does not span the switch. Configure \none run to end on June 1 2020 and then use its output restart to start another \nrun on June 1. Alternatively consider using MERRA2. If you wish to use a \nGEOS-FP meteorology year different from your simulation year please create a \nGEOS-Chem GitHub issue for assistance to avoid accidentally using zero \nconvective precipitation flux.\n" printf "\n${fp_msg}\n" printf "This warning will be printed to run directory file warnings.txt.\n" printf "${thinline}Enter y to acknowledge and proceed, or q to quit:${thinline}" From 550f9cd85388b7d7e2bb9cd31f86c0b2fc07fff7 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Thu, 5 Dec 2024 10:49:25 -0500 Subject: [PATCH 12/12] Fixed changelog to not have two 'unreleased' sections Signed-off-by: Lizzie Lundgren --- CHANGELOG.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a08795538..f4b7862b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,19 +3,6 @@ This file documents all notable changes to the GEOS-Chem repository starting in version 14.0.0, including all GEOS-Chem Classic and GCHP run directory updates. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] - TBD -### Added -- Specified meteorology source in GCHP geoschem_config.yml -- Added Input_Opt logical for whether to reconstruct convective precipitation fluxes rather than use met-fields -- Added to run directory creation a warning about convection discontinuity and bug if GEOS-FP meteorology is chosen -- Added surface precipitation flux fields as inputs to GCHP - -### Fixed -- Fixed zero convective precipitation and high cloud base in runs using GEOS-FP (>=01Jun2020) or GEOS-IT - -### Changed - -### Removed ## [Unreleased] - TBD ### Added @@ -28,6 +15,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Added KPP standalone interface (archives model state to selected locations) - Added `https://github/geoschem/KPP-Standalone` as a Git submodule - Added comments in `./run/sharedcleanRunDir.sh` describing the `--force` option (i.e. remove files w/o user confirmation) +- Specified meteorology source in GCHP geoschem_config.yml +- Added Input_Opt logical for whether to reconstruct convective precipitation fluxes rather than use met-fields +- Added to run directory creation a warning about convection discontinuity and bug if GEOS-FP meteorology is chosen +- Added surface precipitation flux fields as inputs to GCHP ### Changed - Renamed `Emiss_Carbon_Gases` to `CO2_Production` in `carbon_gases_mod.F90` @@ -45,6 +36,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fixed the satellite diagnostics counters from being inadvertently being reset - Fixed segmentation fault in qfyaml when running with certain compilers without debug flags on - Fixed errors in adjoint-only code preventing successful adjoint build +- Fixed zero convective precipitation and high cloud base in runs using GEOS-FP (>=01Jun2020) or GEOS-IT ### Removed - Removed duplicate `WD_RetFactor` tag for HgClHO2 in `species_database.yml`