Skip to content

Commit

Permalink
update gmao_forecast tempolate for ExtData2G
Browse files Browse the repository at this point in the history
  • Loading branch information
bena-nasa committed May 31, 2022
1 parent 4050a02 commit 193089f
Showing 1 changed file with 41 additions and 19 deletions.
60 changes: 41 additions & 19 deletions gcm_forecast.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -598,28 +598,36 @@ endif
set yearc = `echo $nymdc | cut -c1-4`
set yearf = `echo $nymdf | cut -c1-4`

# Which ExtData are we using
set EXTDATA2G_TRUE = `grep -i '^\s*USE_EXTDATA2G:\s*\.TRUE\.' CAP.rc | wc -l
# Select proper AMIP GOCART Emission RC Files
# -------------------------------------------
if( ${EMISSIONS} == AMIP_EMISSIONS) then
set AMIP_Transition_Date = 20000301

if( $nymdc < ${AMIP_Transition_Date} ) then
set AMIP_EMISSIONS_DIRECTORY = $EXPDIR/RC/AMIP.20C
if( $nymdf > ${AMIP_Transition_Date} ) then
set nymdf = ${AMIP_Transition_Date}
set oldstring = `grep '^\s*END_DATE:' CAP.rc`
set newstring = "END_DATE: $nymdf $nhmsf"
/bin/mv CAP.rc CAP.tmp
cat CAP.tmp | sed -e "s?$oldstring?$newstring?g" > CAP.rc
endif
if( $EXTDATA2G_TRUE == 0 ) then
if( $nymdc < ${AMIP_Transition_Date} ) then
set AMIP_EMISSIONS_DIRECTORY = $EXPDIR/RC/AMIP.20C
if( $nymdf > ${AMIP_Transition_Date} ) then
set nymdf = ${AMIP_Transition_Date}
set oldstring = `grep '^\s*END_DATE:' CAP.rc`
set newstring = "END_DATE: $nymdf $nhmsf"
/bin/mv CAP.rc CAP.tmp
cat CAP.tmp | sed -e "s?$oldstring?$newstring?g" > CAP.rc
endif
else
set AMIP_EMISSIONS_DIRECTORY = $EXPDIR/RC/AMIP
endif
else
set AMIP_EMISSIONS_DIRECTORY = $EXPDIR/RC/AMIP
set AMIP_EMISSIONS_DIRECTORY = $EXPDIR/RC/AMIP
endif
if( $AGCM_LM == 72 ) then
cp ${AMIP_EMISSIONS_DIRECTORY}/*.rc .
cp ${AMIP_EMISSIONS_DIRECTORY}/*.yaml .
else
set files = `/bin/ls -1 ${AMIP_EMISSIONS_DIRECTORY}/*.rc`
set files = `/bin/ls -1 ${AMIP_EMISSIONS_DIRECTORY}/*.rc ${AMIP_EMISSIONS_DIRECTORY}/*.yaml`
foreach file ($files)
/bin/rm -f `basename $file`
/bin/rm -f dummy
Expand Down Expand Up @@ -655,8 +663,13 @@ if ( $GOCART_DATA_TRUE == 0 && -e GOCARTdata_ExtData.rc ) /bin/mv
@MP_NO_USE_WSUB# 1MOM and GFDL microphysics do not use WSUB_NATURE
@MP_NO_USE_WSUB# -------------------------------------------------
@MP_NO_USE_WSUB/bin/mv WSUB_ExtData.rc WSUB_ExtData.tmp
@MP_NO_USE_WSUBcat WSUB_ExtData.tmp | sed -e '/^WSUB_NATURE/ s#ExtData.*#/dev/null#' > WSUB_ExtData.rc
if ($EXTDATA2G_TRUE == 0 ) then
@MP_NO_USE_WSUB/bin/mv WSUB_ExtData.rc WSUB_ExtData.tmp
@MP_NO_USE_WSUBcat WSUB_ExtData.tmp | sed -e '/^WSUB_NATURE/ s#ExtData.*#/dev/null#' > WSUB_ExtData.rc
else
@MP_NO_USE_WSUB/bin/mv WSUB_ExtData.yaml WSUB_ExtData.tmp
@MP_NO_USE_WSUBcat WSUB_ExtData.tmp | sed -e '/collection:/ s#WSUB_Wvar_positive_05hrdeg.*#/dev/null#' > WSUB_ExtData.yaml
endif
@MP_NO_USE_WSUB/bin/rm WSUB_ExtData.tmp
# Generate the complete ExtData.rc
Expand All @@ -665,11 +678,20 @@ if(-e ExtData.rc ) /bin/rm -f ExtData.rc
set extdata_files = `/bin/ls -1 *_ExtData.rc`
# Switch to MODIS v6.1 data after Nov 2021
set MODIS_Transition_Date = 20211101
if ( ${EMISSIONS} == OPS_EMISSIONS && ${MODIS_Transition_Date} <= $nymdc ) then
cat $extdata_files | sed 's|\(qfed2.emis_.*\).006.|\1.061.|g' > ExtData.rc
else
cat $extdata_files > ExtData.rc
if( $EXTDATA2G_TRUE == 0 ) then
set MODIS_Transition_Date = 20211101
if ( ${EMISSIONS} == OPS_EMISSIONS && ${MODIS_Transition_Date} <= $nymdc ) then
cat $extdata_files | sed 's|\(qfed2.emis_.*\).006.|\1.061.|g' > ExtData.rc
else
cat $extdata_files > ExtData.rc
endif
endif
if( $EXTDATA2G_TRUE == 1 ) then
$GEOSBIN/construct_extdata_yaml_list.py GEOS_ChemGridComp.rc
touch ExtData.rc
endif
# Move GOCART to use RRTMGP Bands
Expand Down

0 comments on commit 193089f

Please sign in to comment.