Skip to content

Commit

Permalink
Update logic to reset of frequency & declaration in HISTORY.rc files
Browse files Browse the repository at this point in the history
test/shared/commonFunctionsForTests.sh
- Update SED_HISTORY_RC_1 and SED_HISTORY_RC_N to use regex wildcard
  characters for certain digits
- Update logic so that we first test on the resolution name before
  changing frequency & duration values to 20 mins (for nested-grid
  tests) or 1-hr (for other tests)

run/GCClassic/HISTORY.rc.templates/HISTORY.rc.fullchem
- Update frequency and duration of the TOMAS collection from "010000"
  to "00000100 000000", to be consistent with other collections

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Jul 26, 2024
1 parent 1fe1dec commit d67ff08
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 10 deletions.
4 changes: 2 additions & 2 deletions run/GCClassic/HISTORY.rc.templates/HISTORY.rc.fullchem
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,8 @@ COLLECTIONS: 'Restart',
Tomas.format: 'CFIO',
Tomas.timestampStart: .true.
Tomas.monthly: 0
Tomas.frequency: 010000
Tomas.duration: 010000
Tomas.frequency: 00000100 000000
Tomas.duration: 00000100 000000
Tomas.mode: 'time-averaged'
Tomas.fields: 'TomasH2SO4 ',
'TomasH2SO4mass_bin01 ',
Expand Down
52 changes: 44 additions & 8 deletions test/shared/commonFunctionsForTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ SED_HEMCO_CONF_2='s/GEOS_0.5x0.625/GEOS_0.5x0.625_NA/'
SED_HEMCO_CONF_3='s/DiagnFreq: Monthly/DiagnFreq: 00000000 010000/'
SED_HEMCO_CONF_4='s/DiagnFreq: Monthly/DiagnFreq: 00000000 002000/'
SED_HEMCO_CONF_N='s/\$RES.\$NC/\$RES.NA.\$NC/'
SED_HISTORY_RC_1='s/00000100 000000/00000000 010000/'
SED_HISTORY_RC_N='s/00000100 000000/00000000 002000/'
SED_HISTORY_RC_1='s/00000... 0..000/00000000 010000/'
SED_HISTORY_RC_N='s/00000... 0..000/00000000 002000/'
CMP_PASS_STR='Configure & Build.....PASS'
CMP_FAIL_STR='Configure & Build.....FAIL'
EXE_PASS_STR='Execute Simulation....PASS'
Expand Down Expand Up @@ -267,14 +267,17 @@ function update_config_files() {
# Replace text in HISTORY.rc
#------------------------------------------------------------------------

# For nested-grid fullchem runs, change frequency and duration to 20 mins
# in order to reduce the run time of the whole set of integration tests.
if grep -q "05x0625" <<< "${runPath}"; then
sed_ie "${SED_HISTORY_RC_N}" "${runPath}/HISTORY.rc"
fi

# Other text replacements
sed_ie "${SED_HISTORY_RC_1}" "${runPath}/HISTORY.rc"
# For nested-grid fullchem runs, change frequency and duration
# to 20 mins to reduce the run time of the whole set of tests.
sed_ie "${SED_HISTORY_RC_N}" "${runPath}/HISTORY.rc"

else

# Otherwise change frequency & duration to 1 hour
sed_ie "${SED_HISTORY_RC_1}" "${runPath}/HISTORY.rc"
fi
}


Expand Down Expand Up @@ -781,3 +784,36 @@ function get_default_gchp_env_file() {
echo "$envFile"
return 0
}


function print_submodule_head_commits() {
#========================================================================
# Print the head commits for each Git submodule #####
#
# 1st argument: Number of pad characters before commit line starts
# 2nd argument: Path to top-level code directory
# 3rd argument: Log file where output will be written
#========================================================================
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
n_pad=${1}
pad=" "
submods=$(grep path "${2}/.gitmodules")
submods=${submods//path = /}
for submod in ${submods[@]}; do
if [[ "X${submod}" != "X" ]]; then
# Skip the geos-chem-shared-docs output
if [[ ! "${submod}" =~ "geos-chem-shared-docs" ]]; then
if [[ -d "${2}/$submod" ]]; then
head=$(git -C "${2}/$submod" log --oneline -1)
y=$(basename $submod)
if [[ "X${3}" == "X" ]]; then
echo "${y:0:n_pad}${pad:0:$((n_pad - ${#y}))}: $head"
else
echo "${y:0:n_pad}${pad:0:$((n_pad - ${#y}))}: $head" >> "${3}"
fi

fi
fi
fi
done
}

0 comments on commit d67ff08

Please sign in to comment.