Skip to content

Commit

Permalink
Script changes for generating and using NetCDF diag files (NOAA-EMC#423)
Browse files Browse the repository at this point in the history
* Changes for using netcdf diag in GSI and EnKF

* Correct diag name for dbz

* Fix the diag files
  • Loading branch information
chunhuazhou authored Sep 21, 2022
1 parent 6f247ae commit 17c57f3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
16 changes: 8 additions & 8 deletions scripts/exregional_run_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ if [ $binary_diag = ".true." ]; then
fi

if [ $netcdf_diag = ".true." ]; then
listall_cnv="conv_ps conv_q conv_t conv_uv conv_pw conv_rw conv_sst radardbz"
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"

cat_exec="${EXECDIR}/nc_diag_cat.x"
Expand All @@ -937,8 +937,8 @@ if [ $netcdf_diag = ".true." ]; then
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 ncdiag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4
gzip ncdiag_${type}_${string}.${YYYYMMDDHH}.nc4*
${APRUN} ./nc_diag_cat.x -o diag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4
gzip diag_${type}_${string}.${YYYYMMDDHH}.nc4*
echo "diag_${type}_${string}.${YYYYMMDDHH}.nc4*" >> listcnv
numfile_cnv=`expr ${numfile_cnv} + 1`
fi
Expand All @@ -947,8 +947,8 @@ 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 ncdiag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4
gzip ncdiag_${type}_${string}.${YYYYMMDDHH}.nc4*
${APRUN} ./nc_diag_cat.x -o diag_${type}_${string}.${YYYYMMDDHH}.nc4 pe*.${type}_${loop}.nc4
gzip diag_${type}_${string}.${YYYYMMDDHH}.nc4*
echo "diag_${type}_${string}.${YYYYMMDDHH}.nc4*" >> listrad
numfile_rad=`expr ${numfile_rad} + 1`
else
Expand All @@ -960,13 +960,13 @@ fi
done

if [ ${gsi_type} == "OBSERVER" ]; then
cp_vrfy *diag* ${observer_nwges_dir}/.
cp_vrfy *diag*ges* ${observer_nwges_dir}/.
if [ ${mem_type} == "MEAN" ]; then
mkdir_vrfy -p ${observer_nwges_dir}/../../../observer_diag/${YYYYMMDDHH}/ensmean/observer_gsi
cp_vrfy *diag* ${observer_nwges_dir}/../../../observer_diag/${YYYYMMDDHH}/ensmean/observer_gsi/.
cp_vrfy *diag*ges* ${observer_nwges_dir}/../../../observer_diag/${YYYYMMDDHH}/ensmean/observer_gsi/.
else
mkdir_vrfy -p ${observer_nwges_dir}/../../../observer_diag/${YYYYMMDDHH}/${slash_ensmem_subdir}/observer_gsi
cp_vrfy *diag* ${observer_nwges_dir}/../../../observer_diag/${YYYYMMDDHH}/${slash_ensmem_subdir}/observer_gsi/.
cp_vrfy *diag*ges* ${observer_nwges_dir}/../../../observer_diag/${YYYYMMDDHH}/${slash_ensmem_subdir}/observer_gsi/.
fi
fi

Expand Down
30 changes: 27 additions & 3 deletions scripts/exregional_run_enkf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,36 @@ mkdir_vrfy -p ${enkfanal_nwges_dir}
#
#-----------------------------------------------------------------------
#
for diagfile0 in $(ls ${observer_nwges_dir}/diag_${ob_type}_ges*) ; do

if [ ${netcdf_diag} == ".true." ] ; then
if [ ${ob_type} == "conv" ]; then
list_ob_type="conv_ps conv_q conv_t conv_uv conv_pw conv_rw conv_sst"
fi
if [ ${ob_type} == "radardbz" ]; then
list_ob_type="conv_dbz"
fi
for sub_ob_type in ${list_ob_type} ; do
diagfile0=${observer_nwges_dir}/diag_${sub_ob_type}_ges.${YYYYMMDDHH}.nc4.gz
if [ -s $diagfile0 ]; then
diagfile=$(basename $diagfile0)
cp_vrfy $diagfile0 $diagfile
gzip -d $diagfile && rm -f $diagfile
ncfile0=$(basename -s .gz $diagfile)
ncfile=$(basename -s .nc4 $ncfile0)
mv_vrfy $ncfile0 ${ncfile}_${memcharv0}.nc4
fi
done
else
for diagfile0 in $(ls ${observer_nwges_dir}/diag*${ob_type}*ges* ) ; do
if [ -s $diagfile0 ]; then
diagfile=$(basename $diagfile0)
cp_vrfy $diagfile0 diag_conv_ges.$memcharv0
done
cp_vrfy $diagfile0 diag_conv_ges.$memcharv0
fi
done
fi

done

#
#-----------------------------------------------------------------------
#
Expand Down

0 comments on commit 17c57f3

Please sign in to comment.