-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add ability to use GEFS replay ICs #2559
Changes from 9 commits
65f9449
36316e1
06dae2f
2cdc9aa
1cfbe24
2f09626
aa9862f
e9952b4
9b5fe8b
b223067
1ba3cc1
caf09f6
a9266f5
8e11642
cee7a65
70abb0c
31b9481
a67d1b6
1ffd164
eb82d40
79046c1
080cc9f
9e141ea
d709db5
71f89d7
8878810
2fbcc06
8e65208
73ab4d4
9588c9c
1f187e0
71022f6
8cc51d2
6d2c2de
8e82ffd
655a320
a2a7fc0
ffd4416
ac79c26
8b0b99e
9a8f481
290870c
9ec6345
ccd0b3f
fe26095
64dc36a
f1fa27e
b02dd1b
3283d21
35b2c08
b1a46a3
b9555b3
29cdb5f
90df2fa
10af079
61a6121
b6e2114
482670a
31b2333
acbef7d
d220479
3b8f813
c3f98c8
5e52498
97e40ff
19147e0
c6f86ea
5cc44b8
8924e87
56a80e2
a541e2b
adbecb5
26e8796
8952916
11833d2
c420dd0
079f1eb
a5cf1f7
580d015
1675627
59d2411
d84fcf3
71dafbb
d2e1d68
4f5b1d7
3b229f3
1cafcf9
20facbd
68dda32
6ea65d4
5e208cd
b020115
d528778
0f61a64
52ad4ae
9b235c7
0024137
f0410de
b0571d1
7a38397
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,25 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do | |
# Stage the FV3 restarts to ROTDIR (warm start) | ||
RUN=${rCDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl COM_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL | ||
[[ ! -d "${COM_ATMOS_RESTART_PREV}" ]] && mkdir -p "${COM_ATMOS_RESTART_PREV}" | ||
for ftype in coupler.res fv_core.res.nc; do | ||
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${PDY}${cyc}/${MEMDIR}/atmos/${PDY}.${cyc}0000.${ftype}" | ||
tgt="${COM_ATMOS_RESTART_PREV}/${PDY}.${cyc}0000.${ftype}" | ||
${NCP} "${src}" "${tgt}" | ||
rc=$? | ||
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}" | ||
err=$((err + rc)) | ||
done | ||
|
||
# fv_core.res.nc file | ||
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${PDY}${cyc}/${MEMDIR}/atmos/${PDY}.${cyc}0000.fv_core.res.nc" | ||
tgt="${COM_ATMOS_RESTART_PREV}/${PDY}.${cyc}0000.fv_core.res.nc" | ||
${NCP} "${src}" "${tgt}" | ||
rc=$? | ||
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}" | ||
err=$((err + rc)) | ||
|
||
# coupler.res file | ||
if [[ "${USE_REPLAY_ICS:-"false"}" == "false" ]]; then | ||
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${PDY}${cyc}/${MEMDIR}/atmos/${PDY}.${cyc}0000.coupler.res" | ||
tgt="${COM_ATMOS_RESTART_PREV}/${PDY}.${cyc}0000.coupler.res" | ||
${NCP} "${src}" "${tgt}" | ||
rc=$? | ||
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}" | ||
err=$((err + rc)) | ||
fi | ||
|
||
NeilBarton-NOAA marked this conversation as resolved.
Show resolved
Hide resolved
|
||
for ftype in ca_data fv_core.res fv_srf_wnd.res fv_tracer.res phy_data sfc_data; do | ||
for ((tt = 1; tt <= 6; tt++)); do | ||
src="${BASE_CPLIC}/${CPL_ATMIC:-}/${PDY}${cyc}/${MEMDIR}/atmos/${PDY}.${cyc}0000.${ftype}.tile${tt}.nc" | ||
|
@@ -72,6 +83,17 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do | |
done | ||
done | ||
fi | ||
|
||
# Atmosphere Perturbation Files (usually used with replay ICS) | ||
# Extra zero on MEMDIR ensure we have a number even if the string is empty | ||
if (( 0${MEMDIR:3} > 0 )) && [[ "${USE_ATM_PERTURB_FILES:-false}" == "true" ]]; then | ||
src="${BASE_CPLIC}/${CPL_OCNIC:-}/${PDY}${cyc}/${MEMDIR}/atmos/${PDY}.${cyc}0000.fv3_perturbation.nc" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are atmosphere perturbations coming from the ocean IC directory? Doesn't matter right now since they are identical, but this should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error in coping and pasting. Updated |
||
tgt="${COM_ATMOS_RESTART_PREV}/${PDY}.${cyc}0000.fv3_perturbation.nc" | ||
${NCP} "${src}" "${tgt}" | ||
rc=${?} | ||
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}" | ||
err=$((err + rc)) | ||
fi | ||
|
||
# Stage ocean initial conditions to ROTDIR (warm start) | ||
if [[ "${DO_OCN:-}" = "YES" ]]; then | ||
|
@@ -107,8 +129,8 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do | |
# Ocean Perturbation Files | ||
# Extra zero on MEMDIR ensure we have a number even if the string is empty | ||
if (( 0${MEMDIR:3} > 0 )) && [[ "${USE_OCN_PERTURB_FILES:-false}" == "true" ]]; then | ||
src="${BASE_CPLIC}/${CPL_OCNIC:-}/${PDY}${cyc}/${MEMDIR}/ocean/${PDY}.${cyc}0000.mom6_increment.nc" | ||
tgt="${COM_OCEAN_RESTART_PREV}/${PDY}.${cyc}0000.mom6_increment.nc" | ||
src="${BASE_CPLIC}/${CPL_OCNIC:-}/${PDY}${cyc}/${MEMDIR}/ocean/${PDY}.${cyc}0000.mom6_perturbation.nc" | ||
tgt="${COM_OCEAN_RESTART_PREV}/${PDY}.${cyc}0000.mom6_perturbation.nc" | ||
${NCP} "${src}" "${tgt}" | ||
rc=${?} | ||
((rc != 0)) && error_message "${src}" "${tgt}" "${rc}" | ||
|
@@ -149,7 +171,7 @@ for MEMDIR in "${MEMDIR_ARRAY[@]}"; do | |
|
||
# Stage the WW3 initial conditions to ROTDIR (warm start; TODO: these should be placed in $RUN.$gPDY/$gcyc) | ||
if [[ "${DO_WAVE:-}" = "YES" ]]; then | ||
YMD=${PDY} HH=${cyc} declare_from_tmpl COM_WAVE_RESTART | ||
YMD=${gPDY} HH=${gcyc} declare_from_tmpl COM_WAVE_RESTART | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is now going to use the previous cycle's date, the variable name should be changed to Also, I believe this will break the existing GEFS test. |
||
[[ ! -d "${COM_WAVE_RESTART}" ]] && mkdir -p "${COM_WAVE_RESTART}" | ||
for grdID in ${waveGRD}; do # TODO: check if this is a bash array; if so adjust | ||
src="${BASE_CPLIC}/${CPL_WAVIC:-}/${PDY}${cyc}/${MEMDIR}/wave/${PDY}.${cyc}0000.restart.${grdID}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,10 @@ FV3_postdet() { | |
|
||
# Create an array of FV3 restart files | ||
local fv3_restart_files tile_files fv3_restart_file restart_file | ||
fv3_restart_files=(coupler.res fv_core.res.nc) | ||
fv3_restart_files=(fv_core.res.nc) | ||
if [[ "${USE_REPLAY_ICS}" == "false" ]]; then | ||
fv_restart_files+=(coupler.res) | ||
fi | ||
tile_files=(fv_core.res fv_srf_wnd.res fv_tracer.res phy_data sfc_data ca_data) | ||
local nn tt | ||
for (( nn = 1; nn <= ntiles; nn++ )); do | ||
|
@@ -97,16 +100,28 @@ FV3_postdet() { | |
local model_start_time="${current_cycle}" | ||
local model_current_time="${current_cycle}" | ||
fi | ||
if [[ "${USE_REPLAY_ICS}" != "true" ]]; then | ||
rm -f "${DATA}/INPUT/coupler.res" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indent this block (except the EOF) |
||
cat >> "${DATA}/INPUT/coupler.res" << EOF | ||
3 (Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4) | ||
${model_start_time:0:4} ${model_start_time:4:2} ${model_start_time:6:2} ${model_start_time:8:2} 0 0 Model start time: year, month, day, hour, minute, second | ||
${model_current_time:0:4} ${model_current_time:4:2} ${model_current_time:6:2} ${model_current_time:8:2} 0 0 Current model time: year, month, day, hour, minute, second | ||
EOF | ||
fi | ||
|
||
# Create a array of increment files | ||
local inc_files inc_file iaufhrs iaufhr | ||
if [[ "${DOIAU}" == "YES" ]]; then | ||
if [[ "${USE_REPLAY_ICS}" == "true" ]]; then | ||
if (( MEMBER > 0 )) && [[ "${USE_ATM_PERTURB_FILES:-false}" == "true" ]]; then | ||
increment_file="${COM_ATMOS_RESTART_PREV}/${current_cycle:0:8}.${current_cycle:8:2}0000.fv3_perturbation.nc" | ||
${NCP} "${increment_file}" "${DATA}/INPUT/fv3_perturbation.nc" \ | ||
|| ( echo "FATAL ERROR: Unable to copy FV3 perturbation file, ABORT!"; exit 1 ) | ||
read_increment=".true." | ||
res_latlon_dynamics="fv3_perturbation.nc" | ||
fi | ||
elif [[ "${RUN}" == "gefs" ]]; then | ||
inc_files=() | ||
elif [[ "${DOIAU}" == "YES" ]]; then | ||
# create an array of inc_files for each IAU hour | ||
IFS=',' read -ra iaufhrs <<< "${IAUFHRS}" | ||
inc_files=() | ||
|
@@ -407,7 +422,7 @@ MOM6_postdet() { | |
# TODO if [[ $RUN} == "gefs" ]] block maybe be needed | ||
# to ensure it does not interfere with the GFS when ensemble is updated in the GFS | ||
if (( MEMBER > 0 )) && [[ "${ODA_INCUPD:-False}" == "True" ]]; then | ||
${NCP} "${COM_OCEAN_RESTART_PREV}/${restart_date:0:8}.${restart_date:0:8}0000.mom6_increment.nc" "${DATA}/INPUT/mom6_increment.nc" \ | ||
${NCP} "${COM_OCEAN_RESTART_PREV}/${restart_date:0:8}.${restart_date:8:2}0000.mom6_perturbation.nc" "${DATA}/INPUT/mom6_increment.nc" \ | ||
|| ( echo "FATAL ERROR: Unable to copy ensemble MOM6 increment, ABORT!"; exit 1 ) | ||
fi | ||
fi # if [[ "${RERUN}" == "NO" ]]; then | ||
|
@@ -490,6 +505,7 @@ MOM6_out() { | |
esac | ||
|
||
# Copy MOM6 restarts at the end of the forecast segment to COM for RUN=gfs|gefs | ||
if [[ "${USE_REPLAY_ICS}" != "true" ]]; then | ||
local restart_file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indent this block. |
||
if [[ "${RUN}" == "gfs" || "${RUN}" == "gefs" ]]; then | ||
echo "Copying MOM6 restarts for 'RUN=${RUN}' at ${forecast_end_cycle}" | ||
|
@@ -499,6 +515,7 @@ MOM6_out() { | |
"${COM_OCEAN_RESTART}/${restart_file}" | ||
done | ||
fi | ||
fi | ||
|
||
# Copy restarts at the beginning/middle of the next assimilation cycle to COM for RUN=gdas|enkfgdas|enkfgfs | ||
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then | ||
|
@@ -590,6 +607,7 @@ CICE_out() { | |
${NCP} "${DATA}/ice_in" "${COM_CONF}/ufs.ice_in" | ||
|
||
# Copy CICE restarts at the end of the forecast segment to COM for RUN=gfs|gefs | ||
if [[ "${USE_REPLAY_ICS}" != "true" ]]; then | ||
local seconds source_file target_file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indent this block. |
||
if [[ "${RUN}" == "gfs" || "${RUN}" == "gefs" ]]; then | ||
echo "Copying CICE restarts for 'RUN=${RUN}' at ${forecast_end_cycle}" | ||
|
@@ -599,6 +617,7 @@ CICE_out() { | |
${NCP} "${DATArestart}/CICE_RESTART/${source_file}" \ | ||
"${COM_ICE_RESTART}/${target_file}" | ||
fi | ||
fi | ||
|
||
# Copy restarts at the beginning/middle of the next assimilation cycle to COM for RUN=gdas|enkfgdas|enkfgfs | ||
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then | ||
|
@@ -729,6 +748,7 @@ CMEPS_out() { | |
echo "SUB ${FUNCNAME[0]}: Copying output data for CMEPS mediator" | ||
|
||
# Copy mediator restarts at the end of the forecast segment to COM for RUN=gfs|gefs | ||
if [[ "${USE_REPLAY_ICS}" != "true" ]]; then | ||
echo "Copying mediator restarts for 'RUN=${RUN}' at ${forecast_end_cycle}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indent this block. |
||
local seconds source_file target_file | ||
seconds=$(to_seconds "${forecast_end_cycle:8:2}"0000) | ||
|
@@ -740,6 +760,7 @@ CMEPS_out() { | |
else | ||
echo "Mediator restart '${DATArestart}/CMEPS_RESTART/${source_file}' not found." | ||
fi | ||
fi | ||
|
||
# Copy restarts at the beginning/middle of the next assimilation cycle to COM for RUN=gdas|enkfgdas|enkfgfs | ||
if [[ "${RUN}" =~ "gdas" || "${RUN}" == "enkfgfs" ]]; then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please retain the use of
${NLN}