diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da7afe4e..f4b7862b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,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` @@ -32,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` diff --git a/GeosCore/convection_mod.F90 b/GeosCore/convection_mod.F90 index 21c94414c..429173783 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 ) @@ -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] [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. + 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,9 @@ 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 + IF ( State_Grid%NZ > 72 .or. & Input_Opt%MetField == "MODELE2.1" ) THEN ! Higher vertical resolution runs need shorter convective timestep @@ -597,6 +606,31 @@ SUBROUTINE DO_CLOUD_CONVECTION( Input_Opt, & DNS = DBLE( NS ) ! Num internal timesteps (real) SDT = DBLE( NDT ) / DBLE( NS ) ! seconds in internal timestep + IF ( .NOT. Input_Opt%Reconstruct_Conv_Precip_Flux ) 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 +650,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 ( .NOT. Input_Opt%Reconstruct_Conv_Precip_Flux ) THEN + PDOWN(:) = ( ( PFLCU(:) / 1000e+0_fp ) & + + ( PFICU(:) / 917e+0_fp ) ) * 100e+0_fp + ELSE + 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) & + * 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 - 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 +684,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 +1410,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 diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index cfc041eec..0812c9924 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%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 + 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 !---------------------------------------- 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 # -------------------|-------------|-----|---|----|---|---|-----|------|-------------------------- diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index c3407fd94..9594d89c0 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -353,6 +353,26 @@ 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 \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}" + 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 @@ -858,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} @@ -1036,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} @@ -1046,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" @@ -1142,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} @@ -1223,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} @@ -1239,11 +1260,18 @@ 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 +#----------------------------------------------------------------- +# Create and populate warnings file +#----------------------------------------------------------------- +if [[ $met == "geosfp" ]]; then + echo -e ${fp_msg} > ${rundir}/warnings.txt +fi + #----------------------------------------------------------------- # Done! #----------------------------------------------------------------- diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index fdf2dd414..b187c8b8f 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -317,6 +317,25 @@ 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-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}" + 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" @@ -600,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} @@ -784,8 +799,14 @@ fi # Replace settings in config files with RUNDIR variables #-------------------------------------------------------------------- -# Save RUNDIR variables to file -rundir_config_log=${rundir_config}/rundir_vars.txt +# 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 @@ -818,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} @@ -864,11 +885,8 @@ while [ "$valid_response" -eq 0 ]; do fi done -#----------------------------------------------------------------- -# 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" @@ -915,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 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