Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enhance the setup scripts, particularly GMI and StratChem wrt GOCART2G #445

Merged
merged 3 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions gcm_setup
Original file line number Diff line number Diff line change
Expand Up @@ -2490,7 +2490,7 @@ if( $AGCM_LM != 72 ) then
cat $EXPDIR/RC/dummy | sed -e "s|/L72/|/L${AGCM_LM}/|g" \
| sed -e "s|z72|z${AGCM_LM}|g" \
| sed -e "s|_72_|_${AGCM_LM}_|g" > $file
end
end
endif


Expand Down Expand Up @@ -2541,10 +2541,6 @@ if( $AERO_PROVIDER == GOCART2G ) then
-e '/ACTIVE_INSTANCES_CA:/ s/CA.br /CA.br.data /' > $EXPDIR/RC/GOCART2G_GridComp.rc
endif

/bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GOCART:") { sub(/FALSE/,"TRUE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc

/bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GOCART_DATA:") { sub(/TRUE/,"FALSE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc
Expand All @@ -2558,17 +2554,11 @@ endif

# Turn on RATS_PROVIDER
# ---------------------
if( $RATS_PROVIDER == PCHEM ) then
/bin/mv $EXPDIR/RC/Chem_Registry.rc $EXPDIR/RC/Chem_Registry.tmp
cat $EXPDIR/RC/Chem_Registry.tmp | \
awk '{if ( $1 ~ "doing") { if ( $1 ~ "PC") sub(/no/, "yes" ); print;} else print }' > $EXPDIR/RC/Chem_Registry.rc
endif
# (By default, doing_PC is yes in RC/Chem_Registry.rc and RC/AMIP/Chem_Registry.rc)

# Turn on TR GridComp
# ---------------------
/bin/mv $EXPDIR/RC/Chem_Registry.rc $EXPDIR/RC/Chem_Registry.tmp
cat $EXPDIR/RC/Chem_Registry.tmp | \
awk '{if ( $1 ~ "doing") { if ( $1 ~ "TR") sub(/no/, "yes" ); print;} else print }' > $EXPDIR/RC/Chem_Registry.rc
# (By default, ENABLE_TR is TRUE in RC/GEOS_ChemGridComp.rc)


#######################################################################
Expand Down
232 changes: 106 additions & 126 deletions gmichem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,8 @@ set GFDL_HYDRO = ".TRUE."
set GFDL_PROG_CCN = "prog_ccn = .true."
set GFDL_USE_CCN = "use_ccn = .true."

# 1MOM and GFDL do not use WSUB_CLIM, so this eliminates a regrid
if ( "$AGCM_MP" == "1MOM" | "$AGCM_MP" == "GFDL" ) then
# BACM_1M and GFDL do not use WSUB_CLIM, so this eliminates a regrid
if ( "$CLDMICRO" == "BACM_1M" | "$CLDMICRO" == "GFDL_1M" ) then
set MP_NO_USE_WSUB = ""
else
set MP_NO_USE_WSUB = "#DELETE#"
Expand Down Expand Up @@ -1499,9 +1499,8 @@ echo "Specify the AERO_PROVIDER by number:"
echo "------------------------------------"
echo " ${C2}0${CN} none"
echo " ${C2}1${CN} GOCART2G (Default)"
echo " ${C2}2${CN} GOCART.data"
echo " ${C2}3${CN} GMICHEM"
echo " ${C2}4${CN} CARMA"
echo " ${C2}2${CN} GMICHEM"
echo " ${C2}3${CN} CARMA"
echo "------------------------------------"

set APNum = ''
Expand All @@ -1527,89 +1526,63 @@ set PCHEM_CLIM_YEARS = ""
if($APNum == 0) then
set AERO_PROVIDER = none

set GOKART2G = FALSE
set GOKART = FALSE
set GOKARTDATA = FALSE
set LGOCART2G = FALSE
set GOCART = "#"
set HIST_GOCART = "#DELETE"
set USE_AEROSOL_NN = "USE_AEROSOL_NN"
set USE_AEROSOL_NN = "USE_AEROSOL_NN: .FALSE."
endif

if($APNum == 1) then
set AERO_PROVIDER = GOCART2G

set GOKART2G = TRUE
set GOKART = FALSE
set GOKARTDATA = FALSE
set GOCART = ""
set HIST_GOCART = ""
set USE_AEROSOL_NN = "#USE_AEROSOL_NN"
endif

if($APNum == 2) then
set AERO_PROVIDER = GOCART.data

set GOKART2G = FALSE
set GOKART = FALSE
set GOKARTDATA = TRUE
set GOCART = "#"
set HIST_GOCART = "#DELETE"
set USE_AEROSOL_NN = "USE_AEROSOL_NN"
set LGOCART2G = TRUE
set USE_AEROSOL_NN = "USE_AEROSOL_NN: .TRUE."

# GOCART.data uses MERRA2OX currently
set MERRA2OX_SPECIES = ""
set PCHEM_CLIM_YEARS = 39
endif
GOCART:
echo "Do you wish to run ${C1}GOCART${CN} with ${C2}Actual${CN} or ${C2}Climatological${CN} Aerosols? (Enter: ${C2}A${CN} (Default) or ${C2}C${CN})"
set DATA_DRIVEN = $<
if( .$DATA_DRIVEN == . ) set DATA_DRIVEN = A
set DATA_DRIVEN = `echo $DATA_DRIVEN | tr "[:lower:]" "[:upper:]"`
if( $DATA_DRIVEN != 'A' & $DATA_DRIVEN != 'C' ) then
echo
echo "${C1}GOCART${CN} must be set equal to ${C2}A${CN} or ${C2}C${CN}!"
goto GOCART
else
echo
endif

if($APNum == 3) then
set AERO_PROVIDER = GMICHEM
if( $DATA_DRIVEN == "A" ) set DATA_DRIVEN = FALSE # Use Actual Aerosols
if( $DATA_DRIVEN == "C" ) set DATA_DRIVEN = TRUE # Use Climatological Aerosols

set GOKART2G = FALSE
set GOKART = FALSE
set GOKARTDATA = FALSE
set GOCART = "#"
set HIST_GOCART = "#DELETE"
set USE_AEROSOL_NN = "USE_AEROSOL_NN"
endif
if( $DATA_DRIVEN == FALSE ) then

if($APNum == 4) then
set AERO_PROVIDER = CARMA
set GOCART = ""
set HIST_GOCART = ""

set GOKART2G = FALSE
set GOKART = FALSE
set GOKARTDATA = FALSE
set GOCART = "#"
set HIST_GOCART = "#DELETE"
set USE_AEROSOL_NN = "#USE_AEROSOL_NN"
endif
else

set GOCART = "#"
set HIST_GOCART = "#DELETE"

if( $GOKART2G == TRUE ) then
endif

# Emission Files
# --------------
EMISSIONS:
set EMISSIONS = ''
echo
echo "-------------------------------------------------"
echo "Enter the GOCART ${C1}Emission Files${CN} to use: "
echo "-------------------------------------------------"
echo " ${C2}AMIP${CN} (Default)"
echo " ${C2}OPS${CN}"
echo "-------------------------------------------------"
echo "Enter the GOCART ${C1}Emission Files${CN} to use: ${C2}AMIP${CN} (Default) or ${C2}OPS${CN}:"
set EMISSIONS = $<
if( .$EMISSIONS == . ) then
set EMISSIONS = AMIP
set EMISSIONS = AMIP
else
set EMISSIONS = `echo $EMISSIONS | tr "[:lower:]" "[:upper:]"`
if( $EMISSIONS != AMIP & \
$EMISSIONS != OPS ) then
echo
echo " Sorry. Invalid choice. Try again."
goto EMISSIONS
else
echo
endif
set EMISSIONS = `echo $EMISSIONS | tr "[:lower:]" "[:upper:]"`
if( $EMISSIONS != OPS & $EMISSIONS != AMIP) then
echo
echo "${C1}Emission Files${CN} must be equal to: ${C2}AMIP${CN} or ${C2}OPS${CN}!"
goto EMISSIONS
else
echo
endif
endif

set EMISSIONS = ${EMISSIONS}_EMISSIONS
Expand All @@ -1623,8 +1596,28 @@ EMISSIONS:
set MERRA2OX_SPECIES = ''
set PCHEM_CLIM_YEARS = 39
endif

endif

if($APNum == 2) then
set AERO_PROVIDER = GMICHEM

set LGOCART2G = FALSE
set GOCART = "#"
set HIST_GOCART = "#DELETE"
set USE_AEROSOL_NN = "USE_AEROSOL_NN: .FALSE."
endif

if($APNum == 3) then
set AERO_PROVIDER = CARMA

set LGOCART2G = FALSE
set GOCART = "#"
set HIST_GOCART = "#DELETE"
set USE_AEROSOL_NN = "USE_AEROSOL_NN: .TRUE."
endif


# Should we run HEMCO for MEGAN emissions?
# ----------------------------------------
MEGANviaHEMCO:
Expand Down Expand Up @@ -1826,10 +1819,10 @@ if( $SITE == 'NAS' ) then
setenv CONVERT_P "PBS -l select=${CNV_NX}:ncpus=${NCPUS_PER_NODE}:mpiprocs=${NCPUS_PER_NODE}:model=${MODEL}" # PE Configuration for gcm_convert.j
setenv MOVE_P "PBS -l select=1:ncpus=1" # PE Configuration for gcm_moveplot.j

setenv BCSDIR /nobackup/gmao_SIteam/ModelData/bcs/${LSM_BCS}/${LSM_BCS}_${OCEAN_TAG} # location of Boundary Conditions
setenv REPLAY_ANA_EXPID ONLY_MERRA2_SUPPORTED # Default Analysis Experiment for REPLAY
setenv REPLAY_ANA_LOCATION ONLY_MERRA2_SUPPORTED # Default Analysis Location for REPLAY
setenv M2_REPLAY_ANA_LOCATION /nobackup/gmao_SIteam/ModelData/merra2/data # Default Analysis Location for M2 REPLAY
setenv BCSDIR /nobackup/gmao_SIteam/ModelData/bcs/${LSM_BCS}/${LSM_BCS}_${OCEAN_TAG} # location of Boundary Conditions
setenv REPLAY_ANA_EXPID ONLY_MERRA2_SUPPORTED # Default Analysis Experiment for REPLAY
setenv REPLAY_ANA_LOCATION ONLY_MERRA2_SUPPORTED # Default Analysis Location for REPLAY
setenv M2_REPLAY_ANA_LOCATION /nobackup/gmao_SIteam/ModelData/merra2/data # Default Analysis Location for M2 REPLAY

if( ${OGCM_IM}x${OGCM_JM} == "1440x720" ) then
setenv SSTDIR /nobackup/gmao_SIteam/ModelData/fvInput/g5gcm/bcs/SST/${OGCM_IM}x${OGCM_JM} # location of SST Boundary Conditions
Expand Down Expand Up @@ -2474,9 +2467,6 @@ s?@PCHEM_CLIM_YEARS?$PCHEM_CLIM_YEARS?g
s?@RATS_PROVIDER?$RATS_PROVIDER?g
s?@AERO_PROVIDER?$AERO_PROVIDER?g

#.sds.. need to uncomment out if AERO_PROVIDER=[none, GMIDATA]
s?^#USE_AEROSOL_NN?$USE_AEROSOL_NN?g

s?@OANA_PROVIDER?GMICHEM?g
s?@EMISSIONS?$EMISSIONS?g

Expand Down Expand Up @@ -2674,24 +2664,25 @@ set LCARMA = FALSE
set LMATRIX = FALSE
set LMAM = FALSE
set LDNA = FALSE
set LGOCART = FALSE
set LGOCART_DATA = FALSE

set LGOCART_DATA = $GOKARTDATA
set LGOCART = $GOKART
set LGOCART2G = $GOKART2G
set LDU = $GOKART2G
set LSS = $GOKART2G
set LCA_OC = $GOKART2G
set LCA_BC = $GOKART2G
set LCA_BR = $GOKART2G
set LNI = $GOKART2G
set LSU = $GOKART2G
set LACHEM = $GOKART2G
# already set LGOCART2G

set LDU = $LGOCART2G
set LSS = $LGOCART2G
set LCA_OC = $LGOCART2G
set LCA_BC = $LGOCART2G
set LCA_BR = $LGOCART2G
set LNI = $LGOCART2G
set LSU = $LGOCART2G
set LACHEM = $LGOCART2G

# Use HEMCO for GOCART2G, GMI, or both
set LHEMCO = FALSE
@ HEMCOinst = 0

if ( $GOKART2G == TRUE ) then
if ( $LGOCART2G == TRUE ) then
set LHEMCO = TRUE
@ HEMCOinst = $HEMCOinst + 1
endif
Expand Down Expand Up @@ -2833,26 +2824,23 @@ set file = $HOMDIR/AGCM.rc
/bin/mv $file $HOMDIR/dummy

#.sds... special case for AERO_PROVIDER=GMICHEM or CARMA(temporary?) set these-
set DOIT = FALSE
if ( $AERO_PROVIDER == 'CARMA' ) then
set DOIT = TRUE
endif
if ( $AERO_PROVIDER == 'GMICHEM' ) then
set DOIT = TRUE
endif
if ( $DOIT == 'TRUE' ) then
echo 'DU_OPTICS: ExtData/g5chem/x/opticsBands_DU.v15_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'SS_OPTICS: ExtData/g5chem/x/opticsBands_SS.v3_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'SU_OPTICS: ExtData/g5chem/x/opticsBands_SU.v2_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'OC_OPTICS: ExtData/g5chem/x/opticsBands_OC.v1_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'BC_OPTICS: ExtData/g5chem/x/opticsBands_BC.v1_5.RRTMG.nc' >> $HOMDIR/dummy
if ( $AERO_PROVIDER == 'GMICHEM' || $AERO_PROVIDER == 'CARMA' ) then
echo 'DU_OPTICS: ExtData/g5chem/x/opticsBands_DU.v15_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'SS_OPTICS: ExtData/g5chem/x/opticsBands_SS.v3_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'SU_OPTICS: ExtData/g5chem/x/opticsBands_SU.v2_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'OC_OPTICS: ExtData/g5chem/x/opticsBands_OC.v1_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'BC_OPTICS: ExtData/g5chem/x/opticsBands_BC.v1_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'BRC_OPTICS: ExtData/g5chem/x/opticsBands_BRC.v2_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'NI_OPTICS: ExtData/g5chem/x/opticsBands_NI.v2_5.RRTMG.nc' >> $HOMDIR/dummy
echo 'NI_OPTICS: ExtData/g5chem/x/opticsBands_NI.v2_5.RRTMG.nc' >> $HOMDIR/dummy
endif
#.sds... end

cat $HOMDIR/dummy | sed -e "/SATSIM_DT/a GMICHEM_DT: $GMICHEM_DT" > $file

# Add AERO-related flag
/bin/mv $file $HOMDIR/dummy
cat $HOMDIR/dummy | sed -e "/GMICHEM_DT/a $USE_AEROSOL_NN" > $file

## Change from GF to RAS for now:
#/bin/mv $file $HOMDIR/dummy
#cat $HOMDIR/dummy | sed -e "s/CONVPAR_OPTION: GF/CONVPAR_OPTION: RAS/" > $file
Expand Down Expand Up @@ -2913,18 +2901,6 @@ else
awk '{ if ($1~"Z0_FORMULATION:") { sub(/4/,"2") }; print }' > $EXPDIR/RC/GEOS_SurfaceGridComp.rc
endif

# Turn on GOCART.data
# -------------------
if( $LGOCART_DATA == TRUE ) then
/bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GOCART_DATA:") { sub(/FALSE/,"TRUE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc
else
/bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GOCART_DATA:") { sub(/TRUE/,"FALSE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc
endif

# Turn on GOCART
# --------------
if( $LGOCART == TRUE ) then
Expand Down Expand Up @@ -2956,9 +2932,27 @@ cat $CHEMREG_OPS.tmp | awk '{ if ( $1 ~ "doing_" ) { sub(/yes/, "no" ) }; print
cat $CHEMREG_AMIP.tmp | awk '{ if ( $1 ~ "doing_" ) { sub(/yes/, "no" ) }; print }' > $CHEMREG_AMIP
/bin/rm $CHEMREG_AMIP.tmp

# Turn off GOCART_DATA
# --------------------
/bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GOCART_DATA:") { sub(/TRUE/,"FALSE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc

# Turn on GOCART2G
# ----------------
if( $LGOCART2G == TRUE ) then
if ($DATA_DRIVEN == TRUE ) then
/bin/mv $EXPDIR/RC/GOCART2G_GridComp.rc $EXPDIR/RC/GOCART2G_GridComp.tmp
cat $EXPDIR/RC/GOCART2G_GridComp.tmp | \
sed -e '/ACTIVE_INSTANCES_DU:/ s/DU /DU.data /' \
-e '/ACTIVE_INSTANCES_SS:/ s/SS /SS.data /' \
-e '/ACTIVE_INSTANCES_SU:/ s/SU /SU.data /' \
-e '/ACTIVE_INSTANCES_NI:/ s/NI /NI.data /' \
-e '/ACTIVE_INSTANCES_CA:/ s/CA.oc /CA.oc.data /' \
-e '/ACTIVE_INSTANCES_CA:/ s/CA.bc /CA.bc.data /' \
-e '/ACTIVE_INSTANCES_CA:/ s/CA.br /CA.br.data /' > $EXPDIR/RC/GOCART2G_GridComp.rc
endif

/bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GOCART2G:") { sub(/FALSE/,"TRUE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc
Expand Down Expand Up @@ -2992,7 +2986,7 @@ if( $LHEMCO == TRUE ) then
awk '{ if ($1~"HEMCO_Instances:") { print "HEMCO_Instances: " xx; next; }; print }' xx="$HEMCOinst" \
> $EXPDIR/RC/HEMCO_GridComp.rc

if ( $GOKART2G == FALSE ) then
if ( $LGOCART2G == FALSE ) then
# Set GOCART to be instance 999, and GMI to be instance 1
# (by default the G2G instance is 1, and GMI instance is 2)
sed -e 's/001/999/' $EXPDIR/RC/HEMCO_GridComp.rc > $EXPDIR/RC/HEMCO_GridComp.tmp
Expand All @@ -3013,20 +3007,6 @@ endif
cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
awk '{ if ($1~"ENABLE_GMICHEM:") { sub(/FALSE/,"TRUE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc

# # Turn on GOCART.data if it is the AERO_PROVIDER
# # ----------------------------------------------
# if( $AERO_PROVIDER == GOCART.data ) then
# /bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
# cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
# awk '{ if ($1~"ENABLE_GOCART_DATA:") { sub(/FALSE/,"TRUE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc
# endif
#
# if( $AERO_PROVIDER == GMICHEM ) then
# /bin/mv $EXPDIR/RC/GEOS_ChemGridComp.rc $EXPDIR/RC/GEOS_ChemGridComp.tmp
# cat $EXPDIR/RC/GEOS_ChemGridComp.tmp | \
# awk '{ if ($1~"ENABLE_GOCART_DATA:") { sub(/TRUE/,"FALSE") }; print }' > $EXPDIR/RC/GEOS_ChemGridComp.rc
# endif

# Remove FVWORK/EXPID syntax from GAAS_GridComp.rc for use in REPLAY
# ------------------------------------------------------------------
/bin/mv $EXPDIR/RC/GAAS_GridComp.rc $EXPDIR/RC/GAAS_GridComp.tmp
Expand Down
Loading