Skip to content

Commit

Permalink
add atml warm start sample
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-hoo committed Dec 9, 2024
1 parent c6c118f commit 69bdc8f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 18 deletions.
1 change: 1 addition & 0 deletions modulefiles/tasks/hera/task.prep_obs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ load(pathJoin("py-cartopy", py_cartopy_ver))
load(pathJoin("py-matplotlib", py_matplotlib_ver))
load(pathJoin("py-netcdf4", py_netcdf4_ver))
load(pathJoin("py-numpy", py_numpy_ver))
load(pathJoin("py-pandas", py_pandas_ver))
load(pathJoin("py-pyyaml", py_pyyaml_ver))

38 changes: 38 additions & 0 deletions parm/config_samples/config.ATML.warmstart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
account: epic
app: ATML
atm_io_layout_x: 1
atm_io_layout_y: 1
atm_layout_x: 2
atm_layout_y: 4
coldstart: 'NO'
coupler_calendar: 3
date_cycle_freq_hr: 24
date_first_cycle: 2022122300
date_last_cycle: 2022122400
dt_atmos: 720
dt_runseq: 720
envir: test_atml_warm
exp_case_name: atml_warmstart_00
fcsthr: 24
fhrot: 0
ic_data_model: GFS
imo: 384
jmo: 190
lnd_calc_snet: .false.
lnd_ic_type: sfc
lnd_initial_albedo: 0.2
lnd_layout_x: 1
lnd_layout_y: 2
lnd_output_freq_sec: 21600
med_coupling_mode: ufs.frac
model_ver: v2.1.0
net: landda
nprocs_analysis: 6
nprocs_fcst_ic: 36
output_fh: '6 -1'
res: 96
restart_interval: '6 -1'
run: landda
we2e_test: 'NO'
write_groups: 1
write_tasks_per_group: 6
30 changes: 19 additions & 11 deletions parm/templates/template.land_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ workflow:
LOGFN_SUFFIX: "<cyclestr>_@Y@m@d@H.log</cyclestr>"
PDY: "<cyclestr>@Y@m@d</cyclestr>"
cyc: "<cyclestr>@H</cyclestr>"
DATADEP_FILE1: "<cyclestr>&DATAROOT;/DATA_SHARE/RESTART/ufs_land_restart.@Y-@m-@d_@H-00-00.tile6.nc</cyclestr>"
DATADEP_FILE2: "<cyclestr>&WARMSTART_DIR;/ufs_land_restart.@Y-@m-@d_@H-00-00.tile6.nc</cyclestr>"
DATADEP_LRST1: "<cyclestr>&DATAROOT;/DATA_SHARE/RESTART/ufs_land_restart.@Y-@m-@d_@H-00-00.tile6.nc</cyclestr>"
DATADEP_LRST2: "<cyclestr>&WARMSTART_DIR;/ufs_land_restart.@Y-@m-@d_@H-00-00.tile6.nc</cyclestr>"
DATADEP_COLDSTART: "<cyclestr>&EXP_BASEDIR;/exp_case/&EXP_CASE_NAME;/task_skip_coldstart_@Y@m@d@H.txt</cyclestr>"
DATADEP_SFCDATA: "<cyclestr>&DATAROOT;/DATA_SHARE/RESTART/@Y@m@d.@H0000.sfc_data.tile6.nc</cyclestr>"
DATADEP_SFC1: "<cyclestr>&DATAROOT;/DATA_SHARE/RESTART/@Y@m@d.@H0000.sfc_data.tile6.nc</cyclestr>"
DATADEP_SFC2: "<cyclestr>&WARMSTART_DIR;/@Y@m@d.@H0000.sfc_data.tile6.nc</cyclestr>"
log: "&LOGDIR;/workflow.log"
tasks:
task_prep_obs:
Expand Down Expand Up @@ -177,15 +178,15 @@ workflow:
join: "&LOGDIR;/pre_anal&LOGFN_SUFFIX;"
dependency:
or:
datadep_file1:
datadep_lrst1:
attrs:
age: 5
value: "&DATADEP_FILE1;"
value: "&DATADEP_LRST1;"
{%- if coldstart == "NO" %}
datadep_file2:
datadep_lrst2:
attrs:
age: 5
value: "&DATADEP_FILE2;"
value: "&DATADEP_LRST2;"
{%- endif %}
{%- endif %}
task_analysis:
Expand Down Expand Up @@ -214,6 +215,7 @@ workflow:
PDY: "&PDY;"
RES: "&RES;"
SCHED: "&SCHED;"
WARMSTART_DIR: "&WARMSTART_DIR;"
WE2E_TEST: "&WE2E_TEST;"
WE2E_ATOL: "&WE2E_ATOL;"
WE2E_LOG_FN: "&WE2E_LOG_FN;"
Expand All @@ -234,10 +236,15 @@ workflow:
attrs:
task: pre_anal
{%- else %}
datadep_sfcdata:
attrs:
age: 5
value: "&DATADEP_SFCDATA;"
or:
datadep_sfc1:
attrs:
age: 5
value: "&DATADEP_SFC1;"
datadep_sfc2:
attrs:
age: 5
value: "&DATADEP_SFC2;"
{%- endif %}
task_post_anal:
attrs:
Expand All @@ -263,6 +270,7 @@ workflow:
RES: "&RES;"
RUN: "&RUN;"
SCHED: "&SCHED;"
WARMSTART_DIR: "&WARMSTART_DIR;"
WE2E_TEST: "&WE2E_TEST;"
WE2E_ATOL: "&WE2E_ATOL;"
WE2E_LOG_FN: "&WE2E_LOG_FN;"
Expand Down
12 changes: 10 additions & 2 deletions scripts/exlandda_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ esac
GFSv17="NO"
B=30 # back ground error std for LETKFOI

# Import input files
# copy sfc_data files into work directory
for itile in {1..6}
do
cp ${DATA_RESTART}/${FILEDATE}.sfc_data.tile${itile}.nc .
sfc_fn="${FILEDATE}.sfc_data.tile${itile}.nc"
if [ -f ${DATA_RESTART}/${sfc_fn} ]; then
cp -p ${DATA_RESTART}/${sfc_fn} .
elif [ -f ${WARMSTART_DIR}/${sfc_fn} ]; then
cp -p ${WARMSTART_DIR}/${sfc_fn} .
else
err_exit "Initial sfc_data files do not exist"
fi
done
# Copy obserbation file to work directory
ln -nsf ${COMIN}/obs/GHCN_${YYYY}${MM}${DD}${HH}.nc .

# update coupler.res file
Expand Down
10 changes: 5 additions & 5 deletions scripts/exlandda_forecast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ if [ "${COLDSTART}" = "NO" ] || [ "${PDY}${cyc}" != "${DATE_FIRST_CYCLE:0:10}" ]
if [ "${COLDSTART}" = "NO" ] && [ "${PDY}${cyc}" = "${DATE_FIRST_CYCLE:0:10}" ]; then
data_dir="${WARMSTART_DIR}"
else
data_dir="${COMINm1}"
data_dir="${COMINm1}/RESTART"
fi

# NoahMP restart files
Expand All @@ -208,10 +208,10 @@ if [ "${COLDSTART}" = "NO" ] || [ "${PDY}${cyc}" != "${DATE_FIRST_CYCLE:0:10}" ]

# CMEPS restart and pointer files
r_fn="ufs.cpld.cpl.r.${YYYY}-${MM}-${DD}-${HHsec_5d}.nc"
if [ -f "${data_dir}/RESTART/${r_fn}" ]; then
ln -nsf "${data_dir}/RESTART/${r_fn}" RESTART/.
if [ -f "${data_dir}/${r_fn}" ]; then
ln -nsf "${data_dir}/${r_fn}" RESTART/.
else
err_exit "${data_dir}/RESTART/${r_fn} file does not exist."
err_exit "${data_dir}/${r_fn} file does not exist."
fi
ls -1 "./RESTART/${r_fn}">rpointer.cpl
fi
Expand Down Expand Up @@ -266,7 +266,7 @@ if [ "${APP}" = "ATML" ]; then
if [ "${COLDSTART}" = "NO" ] || [ "${PDY}${cyc}" != "${DATE_FIRST_CYCLE:0:10}" ]; then
# Set path to directory where restart files exist
if [ "${COLDSTART}" = "NO" ] && [ "${PDY}${cyc}" = "${DATE_FIRST_CYCLE:0:10}" ]; then
data_dir="${WARMSTART_DIR}/RESTART"
data_dir="${WARMSTART_DIR}"
else
data_dir="${COMINm1}/RESTART"
fi
Expand Down

0 comments on commit 69bdc8f

Please sign in to comment.