-
Notifications
You must be signed in to change notification settings - Fork 25
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
Ens fix 1210 #458
Ens fix 1210 #458
Changes from 2 commits
c6942b6
f0ec682
3e94362
9953fe0
1684e4c
5c164d5
1e5c2bb
3c01ab0
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 |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/bin/bash | ||
|
||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# This script runs the save_input to save DA analysis files to nwges | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
|
||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Source the variable definitions file and the bash utility functions. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
. ${GLOBAL_VAR_DEFNS_FP} | ||
. $USHDIR/source_util_funcs.sh | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Save current shell options (in a global array). Then set new options | ||
# for this script/function. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
{ save_shell_opts; set -u -x; } > /dev/null 2>&1 | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Get the full path to the file in which this script/function is located | ||
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in | ||
# which the file is located (scrfunc_dir). | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" ) | ||
scrfunc_fn=$( basename "${scrfunc_fp}" ) | ||
scrfunc_dir=$( dirname "${scrfunc_fp}" ) | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Print message indicating entry into script. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
print_info_msg " | ||
======================================================================== | ||
Entering script: \"${scrfunc_fn}\" | ||
In directory: \"${scrfunc_dir}\" | ||
This is the J-job script for the task that runs the post-processor (UPP) | ||
on the output files corresponding to a specified forecast hour. | ||
========================================================================" | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Set the run directory. | ||
# | ||
#----------------------------------------------------------------------- | ||
# CYCLE_TYPE is to indicate which type of cycle this job for: | ||
# spinup: this job is for spin-up cycles | ||
# others(prod): this job is for product cycle | ||
# | ||
# NWGES_DIR is the directory in which the model IC file (DA analysis) will be saved | ||
# | ||
CYCLE_TYPE=${CYCLE_TYPE:-prod} | ||
CYCLE_SUBTYPE=${CYCLE_SUBTYPE:-empty} | ||
if [ ${CYCLE_TYPE} == "spinup" ]; then | ||
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_spinup" | ||
nwges_dir="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_spinup" | ||
if [ ${CYCLE_SUBTYPE} == "ensinit" ]; then | ||
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_ensinit" | ||
nwges_dir="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam_ensinit" | ||
fi | ||
else | ||
run_dir="${CYCLE_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam" | ||
nwges_dir="${NWGES_DIR}${SLASH_ENSMEM_SUBDIR}/fcst_fv3lam" | ||
fi | ||
|
||
if [ "${RUN_ENVIR}" = "nco" ]; then | ||
mkdir_vrfy -p "${nwges_dir}/DA_OUTPUT" | ||
fi | ||
|
||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Call the ex-script for this J-job and pass to it the necessary varia- | ||
# bles. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
$SCRIPTSDIR/exregional_save_input.sh \ | ||
cdate="${CDATE}" \ | ||
run_dir="${run_dir}" \ | ||
nwges_dir="${nwges_dir}" \ | ||
cycle_type="${CYCLE_TYPE}" \ | ||
cycle_subtype="${CYCLE_SUBTYPE}" || \ | ||
print_err_msg_exit "\ | ||
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed." | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Print exit message. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
print_info_msg " | ||
======================================================================== | ||
Exiting script: \"${scrfunc_fn}\" | ||
In directory: \"${scrfunc_dir}\" | ||
========================================================================" | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Restore the shell options saved at the beginning of this script/func- | ||
# tion. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
{ restore_shell_opts; } > /dev/null 2>&1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,7 +207,7 @@ if [[ ${regional_ensemble_option:-1} -eq 5 ]]; then | |
ens_nstarthr=$( printf "%02d" ${DA_CYCLE_INTERV} ) | ||
imem=1 | ||
ifound=0 | ||
for hrs in ${CYCL_HRS_HYB_FV3LAM_ENS}; do | ||
for hrs in ${CYCL_HRS_HYB_FV3LAM_ENS[@]}; do | ||
if [ $HH == ${hrs} ]; then | ||
|
||
while [[ $imem -le ${NUM_ENS_MEMBERS} ]];do | ||
|
@@ -219,7 +219,7 @@ if [[ ${regional_ensemble_option:-1} -eq 5 ]]; then | |
slash_ensmem_subdir=$memchar | ||
bkpathmem=${rrfse_fg_root}/${YYYYMMDDHHmInterv}/${slash_ensmem_subdir}/fcst_fv3lam/RESTART | ||
if [ ${DO_SPINUP} == "TRUE" ]; then | ||
for cycl_hrs in ${CYCL_HRS_PRODSTART_ENS}; do | ||
for cycl_hrs in ${CYCL_HRS_PRODSTART_ENS[@]}; do | ||
if [ $HH == ${cycl_hrs} ]; then | ||
bkpathmem=${rrfse_fg_root}/${YYYYMMDDHHmInterv}/${slash_ensmem_subdir}/fcst_fv3lam_spinup/RESTART | ||
fi | ||
|
@@ -944,13 +944,14 @@ if [ $binary_diag = ".true." ]; then | |
fi | ||
|
||
if [ $netcdf_diag = ".true." ]; then | ||
nc_diag_cat="${EXECDIR}/nc_diag_cat.x" | ||
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. this is not needed from the latest update after APP load ncidag module. |
||
listall_cnv="conv_ps conv_q conv_t conv_uv conv_pw conv_rw conv_sst conv_dbz" | ||
listall_rad="hirs2_n14 msu_n14 sndr_g08 sndr_g11 sndr_g11 sndr_g12 sndr_g13 sndr_g08_prep sndr_g11_prep sndr_g12_prep sndr_g13_prep sndrd1_g11 sndrd2_g11 sndrd3_g11 sndrd4_g11 sndrd1_g15 sndrd2_g15 sndrd3_g15 sndrd4_g15 sndrd1_g13 sndrd2_g13 sndrd3_g13 sndrd4_g13 hirs3_n15 hirs3_n16 hirs3_n17 amsua_n15 amsua_n16 amsua_n17 amsua_n18 amsua_n19 amsua_metop-a amsua_metop-b amsua_metop-c amsub_n15 amsub_n16 amsub_n17 hsb_aqua airs_aqua amsua_aqua imgr_g08 imgr_g11 imgr_g12 pcp_ssmi_dmsp pcp_tmi_trmm conv sbuv2_n16 sbuv2_n17 sbuv2_n18 omi_aura ssmi_f13 ssmi_f14 ssmi_f15 hirs4_n18 hirs4_metop-a mhs_n18 mhs_n19 mhs_metop-a mhs_metop-b mhs_metop-c amsre_low_aqua amsre_mid_aqua amsre_hig_aqua ssmis_las_f16 ssmis_uas_f16 ssmis_img_f16 ssmis_env_f16 iasi_metop-a iasi_metop-b iasi_metop-c seviri_m08 seviri_m09 seviri_m10 seviri_m11 cris_npp atms_npp ssmis_f17 cris-fsr_npp cris-fsr_n20 atms_n20 abi_g16" | ||
|
||
for type in $listall_cnv; do | ||
count=$(ls pe*.${type}_${loop}.nc4 | wc -l) | ||
if [[ $count -gt 0 ]]; then | ||
${APRUN} nc_diag_cat.x -o diag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4 | ||
${APRUN} ${nc_diag_cat} -o diag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4 | ||
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. Do not change this one |
||
cp diag_${type}_${string}.${YYYYMMDDHH}.nc4 $comout | ||
echo "diag_${type}_${string}.${YYYYMMDDHH}.nc4*" >> listcnv | ||
numfile_cnv=`expr ${numfile_cnv} + 1` | ||
|
@@ -960,7 +961,7 @@ if [ $netcdf_diag = ".true." ]; then | |
for type in $listall_rad; do | ||
count=$(ls pe*.${type}_${loop}.nc4 | wc -l) | ||
if [[ $count -gt 0 ]]; then | ||
${APRUN} nc_diag_cat.x -o diag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4 | ||
${APRUN} ${nc_diag_cat} -o diag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4 | ||
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. do not change this one |
||
cp diag_${type}_${string}.${YYYYMMDDHH}.nc4 $comout | ||
echo "diag_${type}_${string}.${YYYYMMDDHH}.nc4*" >> listrad | ||
numfile_rad=`expr ${numfile_rad} + 1` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#!/bin/bash | ||
|
||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Source the variable definitions file and the bash utility functions. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
. ${GLOBAL_VAR_DEFNS_FP} | ||
. $USHDIR/source_util_funcs.sh | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Save current shell options (in a global array). Then set new options | ||
# for this script/function. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
{ save_shell_opts; set -u +x; } > /dev/null 2>&1 | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Get the full path to the file in which this script/function is located | ||
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in | ||
# which the file is located (scrfunc_dir). | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" ) | ||
scrfunc_fn=$( basename "${scrfunc_fp}" ) | ||
scrfunc_dir=$( dirname "${scrfunc_fp}" ) | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Print message indicating entry into script. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
print_info_msg " | ||
======================================================================== | ||
Entering script: \"${scrfunc_fn}\" | ||
In directory: \"${scrfunc_dir}\" | ||
This is the ex-script for the task that runs the post-processor (UPP) on | ||
the output files corresponding to a specified forecast hour. | ||
========================================================================" | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Specify the set of valid argument names for this script/function. | ||
# Then process the arguments provided to this script/function (which | ||
# should consist of a set of name-value pairs of the form arg1="value1", | ||
# etc). | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
valid_args=( \ | ||
"cdate" \ | ||
"run_dir" \ | ||
"nwges_dir" \ | ||
"cycle_type" \ | ||
"cycle_subtype" \ | ||
) | ||
process_args valid_args "$@" | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# For debugging purposes, print out values of arguments passed to this | ||
# script. Note that these will be printed out only if VERBOSE is set to | ||
# TRUE. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
print_input_args valid_args | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Get the cycle date and hour (in formats of yyyymmdd and hh, respectively) | ||
# from cdate. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
yyyymmdd=${cdate:0:8} | ||
hh=${cdate:8:2} | ||
cyc=$hh | ||
|
||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Let's save the DA analysis files if needed before run fcst. | ||
# This will copy the data assimilation analysis files from $run_dir/INPUT/ | ||
# to ${nwges_dir}/DA_OUTPUT/, | ||
# this is to prepare for ensemble free forecast after the ensemble data assimilation | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
filelist="fv_core.res.nc coupler.res" | ||
filelistn="fv_core.res.tile1.nc fv_srf_wnd.res.tile1.nc fv_tracer.res.tile1.nc phy_data.nc sfc_data.nc" | ||
filelistcold="gfs_data.tile7.halo0.nc sfc_data.tile7.halo0.nc" | ||
n_iolayouty=$(($IO_LAYOUT_Y-1)) | ||
list_iolayout=$(seq 0 $n_iolayouty) | ||
|
||
if [ ! -r ${nwges_dir}/DA_OUTPUT/gfs_ctrl.nc ]; then | ||
cp_vrfy $run_dir/INPUT/gfs_ctrl.nc ${nwges_dir}/DA_OUTPUT/gfs_ctrl.nc | ||
if [ -r ${run_dir}/INPUT/coupler.res ]; then # warm start | ||
if [ "${IO_LAYOUT_Y}" == "1" ]; then | ||
for file in ${filelistn}; do | ||
cp_vrfy $run_dir/INPUT/${file} ${nwges_dir}/DA_OUTPUT/${file} | ||
done | ||
else | ||
for file in ${filelistn}; do | ||
for ii in ${list_iolayout} | ||
do | ||
iii=$(printf %4.4i $ii) | ||
cp_vrfy $run_dir/INPUT/${file}.${iii} ${nwges_dir}/DA_OUTPUT/${file}.${iii} | ||
done | ||
done | ||
fi | ||
for file in ${filelist}; do | ||
cp_vrfy $run_dir/INPUT/${file} ${nwges_dir}/DA_OUTPUT/${file} | ||
done | ||
else # cold start | ||
for file in ${filelistcold}; do | ||
cp_vrfy $run_dir/INPUT/${file} ${nwges_dir}/DA_OUTPUT/${file} | ||
done | ||
fi | ||
fi | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Print message indicating successful completion of script. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
print_info_msg " | ||
======================================================================== | ||
save DA analysis completed successfully. | ||
Exiting script: \"${scrfunc_fn}\" | ||
In directory: \"${scrfunc_dir}\" | ||
========================================================================" | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# Restore the shell options saved at the beginning of this script/func- | ||
# tion. | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
{ restore_shell_opts; } > /dev/null 2>&1 | ||
|
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.
Do we need so many checks? This only save INPUT from prod cycle.
It does need to generate a nwges directory that has different name from prod.