Skip to content

Commit

Permalink
Adopt for cime5.8.32-Nor
Browse files Browse the repository at this point in the history
  • Loading branch information
blcc committed Sep 23, 2021
1 parent d11e195 commit 8486a7a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
7 changes: 4 additions & 3 deletions Prediction/create_ensemble.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh -ex

echo "USAGE: ./`basename $0` <path to settings file>"

Expand Down Expand Up @@ -72,7 +72,8 @@ do

echo ++ REMOVE OLD CASE
CASEROOT=$CASESROOT/$ENSEMBLE_PREFIX/$CASE
EXEROOT=$EXESROOT/$ENSEMBLE_PREFIX/$CASE
EXEROOT=$(echo $EXESROOT/$ENSEMBLE_PREFIX/$CASE | sed -e's://*:/:g')
## replace '//' with '/', which cause mct complie failed at cime5.8.32-Nor, do now know why
DOUT_S_ROOT=$ARCHIVESROOT/$ENSEMBLE_PREFIX/$CASE
for ITEM in $CASEROOT $EXEROOT $DOUT_S_ROOT
do
Expand Down Expand Up @@ -164,7 +165,7 @@ do
fi
fi
if [ "$CESMVERSION" == '2' ];then
./case.setup
./case.setup --reset
else
./configure -case
fi
Expand Down
8 changes: 5 additions & 3 deletions Prediction/create_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ ENSEMBLE_PREFIX=${ENSEMBLE_PREFIX:-${PREFIX}_${START_YEAR1}${START_MONTH1}${STAR
logfile=`basename $0`_${ENSEMBLE_PREFIX}.log
CASE=${ENSEMBLE_PREFIX}_${MEMBERTAG}${MEMBER1:-001}
CASEROOT=$CASESROOT/$ENSEMBLE_PREFIX/$CASE
EXEROOT=$EXESROOT/$ENSEMBLE_PREFIX/$CASE
EXEROOT=$(echo $EXESROOT/$ENSEMBLE_PREFIX/$CASE | sed -e's://*:/:g')
## replace '//' with '/', which cause mct complie failed at cime5.8.32-Nor, do now know why
RUNDIR=$EXEROOT/run ## for consistant with create_ensemble.sh
DOUT_S_ROOT=$ARCHIVESROOT/$ENSEMBLE_PREFIX/$CASE
for ITEM in $CASEROOT $EXEROOT $DOUT_S_ROOT
Expand All @@ -45,8 +46,8 @@ mkdir -p $CASESROOT/$ENSEMBLE_PREFIX $EXESROOT/$ENSEMBLE_PREFIX $ARCHIVESROOT/$E

echo + CREATE CASE1 CASE, logfile: ${logfile}
if [ $CESMVERSION == '2' ]; then
echo $SCRIPTSROOT/create_newcase --case $CASEROOT --compset $COMPSET --res $RES --mach $MACH --project $ACCOUNT --run-unsupported
$SCRIPTSROOT/create_newcase --case $CASEROOT --compset $COMPSET --res $RES --mach $MACH --project $ACCOUNT --run-unsupported >& ${logfile}
echo $SCRIPTSROOT/create_newcase --case $CASEROOT --compset $COMPSET --res $RES --mach $MACH --project $ACCOUNT
$SCRIPTSROOT/create_newcase --case $CASEROOT --compset $COMPSET --res $RES --mach $MACH --project $ACCOUNT >& ${logfile}
#$SCRIPTSROOT/create_newcase --case $CASEROOT --compset $COMPSET --res $RES --mach $MACH --pecount $PECOUNT --project $ACCOUNT --run-unsupported -q short ## for testing
else
$SCRIPTSROOT/create_newcase -case $CASEROOT -compset $COMPSET -res $RES -mach $MACH -pecount $PECOUNT
Expand All @@ -62,6 +63,7 @@ else
./xmlchange -file env_build.xml -id EXEROOT -val $EXEROOT
./xmlchange -file env_run.xml -id DOUT_S_ROOT -val $DOUT_S_ROOT
fi

if [[ $RUN_TYPE && $RUN_TYPE == "hybrid" ]]
then
## not changed for NorESM2 yet
Expand Down
14 changes: 7 additions & 7 deletions Prediction/use_cases/case_setting.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ CCSMROOT=$(readlink -f $(dirname $(readlink -f $0))/../..)
### Case settings
PREFIX='Casename'
ENSEMBLE_PREFIX=${PREFIX} ## leave it empty will be ${PREFIX}_${START_YEAR}${START_MONTH}${START_DAY}
START_YEARS='1980'
START_YEARS='1970'
START_MONTHS='01'
START_DAYS='01'
STOP_OPTION=nday # units for run length specification STOP_N
STOP_N=14 # run continuesly for this length
RESTART=0 # restart this many times, but it does not work on Betzy
RESUBMIT=0
WALLTIME='3-00:00:00'
WALLTIME='72:00:00'
NMEMBER=8 # number of prediction members
COMPSET=NHIST
RES=f19_tn14 ## resolution
ACCOUNT=ACCOUNT ## project account
ACCOUNT=nn9039k ## project account

##### The NTASKS, ROOTPE setting here will override default setting.
##### Change here and PRECASESETUP if any optimize.
Expand All @@ -67,10 +67,10 @@ MEMBER_PES=128 ## This value is the number of PE for each member.
##### ${REST_PATH_LOCAL}/${REST_PREFIX}002/rest/${START_YEARS}-00000/
##### ${REST_PATH_LOCAL}/${REST_PREFIX}003/rest/${START_YEARS}-00000/
##### ...
REST_PATH_LOCAL=/cluster/home/$USER/work/restarts/cases
REST_CASE=NHIST_f19_tn14_20190710_19700101 ## resolution must same as RES variable
REST_PATH_LOCAL=/cluster/home/$USER/nn9039k/restarts/cases
REST_CASE=NHIST_f19_tn14_20190710 ## resolution must same as RES variable
REST_PREFIX=${REST_CASE}_mem # reference prefix, including everything but member id
RUN_REFCASE=
RUN_REFCASE=$REST_CASE
## Keep it empty if casename of restart files are $REST_CASE_mem001 (restart files are generated from NorCPM case)
## Or fill it with casename if restart files are pertubed from single case.

Expand Down Expand Up @@ -100,7 +100,7 @@ PRECASESETUP=$PRECASESETUP"; sed -i -e'/<\/environment_variables>/i\ \ \ \ <env\

### NorCPM, run multiple members in one job
patchfile="${CCSMROOT}/cime/src/drivers/mct/main/cime_comp_mod.F90"
if [ -f "$patchfile" ] && [ ! -z "$(grep -i 'NorCPM' ${patchfile})" ] ; then
if [ -f "$patchfile" ] && [ -z "$(grep -i 'NorCPM' ${patchfile})" ] ; then
PRECASESETUP=$PRECASESETUP"; cp ${SCRIPTDIR}/../SourceMods.noresm2/src.drv/cime_comp_mod.F90 ./SourceMods/src.drv/"
fi

Expand Down

0 comments on commit 8486a7a

Please sign in to comment.