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

Set GAAS offset to CHEMISTRY_DT #647

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
20 changes: 20 additions & 0 deletions gcm_forecast.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions gcm_run.j
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,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 # ---------------------------------------------------
Expand Down
21 changes: 21 additions & 0 deletions gcm_run_benchmark.j
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading