diff --git a/gcm_forecast.tmpl b/gcm_forecast.tmpl index 6acf75ed..6f2bf7da 100755 --- a/gcm_forecast.tmpl +++ b/gcm_forecast.tmpl @@ -749,6 +749,26 @@ if( $REPLAY_MODE == 'Exact' | $REPLAY_MODE == 'Regular' ) then endif +# Update GAAS_GridComp_ExtData.yaml with CHEMISTRY_DT +# --------------------------------------------------- + +# NOTE: Even though GAAS is disabled above, we keep this code here in case this changes + +# We need to make sure GAAS has an offset that matches CHEMISTRY_DT from CAP.rc +# We also need to take that CHEMISTRY_DT and convert it to ISO duration format in seconds +# So, if CHEMISTRY_DT is 1800, we need to convert it to PT1800S +# Then in GAAS_GridComp_ExtData.yaml, we need to find: +# update_offset: PT450S +# and replace it with: +# update_offset: PT1800S +# NOTE: Since it is YAML, we need to make sure the indentation is correct +# 1. First we grab the CHEMISTRY_DT from CAP.rc +set CAPRC_CHEMISTRY_DT = `grep '^\s*CHEMISTRY_DT:' CAP.rc | cut -d: -f2 | awk '{print $1}'` +# 2. Then we convert it to ISO duration format +set CHEMDT_ISO_DURATION = `echo "PT${CAPRC_CHEMISTRY_DT}S"` +# 3. Then we replace the update_offset in GAAS_GridComp_ExtData.yaml +sed -i "s/update_offset: .*/update_offset: ${CHEMDT_ISO_DURATION}/" GAAS_GridComp_ExtData.yaml + # Establish safe default number of OpenMP threads # ----------------------------------------------- setenv OMP_NUM_THREADS 1 diff --git a/gcm_run.j b/gcm_run.j index 3c91ad40..586e518e 100755 --- a/gcm_run.j +++ b/gcm_run.j @@ -970,6 +970,24 @@ if( $REPLAY_MODE == 'Exact' | $REPLAY_MODE == 'Regular' ) then endif +# Update GAAS_GridComp_ExtData.yaml with CHEMISTRY_DT +# --------------------------------------------------- + +# We need to make sure GAAS has an offset that matches CHEMISTRY_DT from CAP.rc +# We also need to take that CHEMISTRY_DT and convert it to ISO duration format in seconds +# So, if CHEMISTRY_DT is 1800, we need to convert it to PT1800S +# Then in GAAS_GridComp_ExtData.yaml, we need to find: +# update_offset: PT450S +# and replace it with: +# update_offset: PT1800S +# NOTE: Since it is YAML, we need to make sure the indentation is correct +# 1. First we grab the CHEMISTRY_DT from CAP.rc +set CAPRC_CHEMISTRY_DT = `grep '^\s*CHEMISTRY_DT:' CAP.rc | cut -d: -f2 | awk '{print $1}'` +# 2. Then we convert it to ISO duration format +set CHEMDT_ISO_DURATION = `echo "PT${CAPRC_CHEMISTRY_DT}S"` +# 3. Then we replace the update_offset in GAAS_GridComp_ExtData.yaml +sed -i "s/update_offset: .*/update_offset: ${CHEMDT_ISO_DURATION}/" GAAS_GridComp_ExtData.yaml + # Establish safe default number of OpenMP threads # ----------------------------------------------- @MIT # --------------------------------------------------- diff --git a/gcm_run_benchmark.j b/gcm_run_benchmark.j index 0b87eb2c..8fcc6eb4 100755 --- a/gcm_run_benchmark.j +++ b/gcm_run_benchmark.j @@ -827,6 +827,9 @@ if( $REPLAY_MODE == 'Exact' | $REPLAY_MODE == 'Regular' ) then # Modify GAAS_GridComp.rc and Link REPLAY files # --------------------------------------------- + /bin/mv -f GAAS_GridComp_ExtData.yaml GAAS_GridComp_ExtData.yaml.tmpl + cat GAAS_GridComp_ExtData.yaml.tmpl | sed -e "s?das.aod_?chem/Y%y4/M%m2/${ANA_EXPID}.aod_?g" > GAAS_GridComp_ExtData.yaml + /bin/mv -f GAAS_GridComp.rc GAAS_GridComp.tmp cat GAAS_GridComp.tmp | sed -e "s?aod/Y%y4/M%m2/${ANA_EXPID}.?aod/Y%y4/M%m2/${ANA_EXPID}.?g" > GAAS_GridComp.rc @@ -836,6 +839,24 @@ if( $REPLAY_MODE == 'Exact' | $REPLAY_MODE == 'Regular' ) then endif +# Update GAAS_GridComp_ExtData.yaml with CHEMISTRY_DT +# --------------------------------------------------- + +# We need to make sure GAAS has an offset that matches CHEMISTRY_DT from CAP.rc +# We also need to take that CHEMISTRY_DT and convert it to ISO duration format in seconds +# So, if CHEMISTRY_DT is 1800, we need to convert it to PT1800S +# Then in GAAS_GridComp_ExtData.yaml, we need to find: +# update_offset: PT450S +# and replace it with: +# update_offset: PT1800S +# NOTE: Since it is YAML, we need to make sure the indentation is correct +# 1. First we grab the CHEMISTRY_DT from CAP.rc +set CAPRC_CHEMISTRY_DT = `grep '^\s*CHEMISTRY_DT:' CAP.rc | cut -d: -f2 | awk '{print $1}'` +# 2. Then we convert it to ISO duration format +set CHEMDT_ISO_DURATION = `echo "PT${CAPRC_CHEMISTRY_DT}S"` +# 3. Then we replace the update_offset in GAAS_GridComp_ExtData.yaml +sed -i "s/update_offset: .*/update_offset: ${CHEMDT_ISO_DURATION}/" GAAS_GridComp_ExtData.yaml + # Establish safe default number of OpenMP threads # ----------------------------------------------- setenv OMP_NUM_THREADS 1