Skip to content
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 options for Mixed Ensemble and Scale/Variable-Dependent Localization #451

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions fix/gsi/anavinfo.rrfs_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
met_guess::
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the name of this file: should have a name fit to the application. Using "_all" is too general.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed 'all' to 'conv_dbz'.

!var level crtm_use desc orig_name
ps 1 -1 surface_pressure ps
z 1 -1 geopotential_height phis
u 65 2 zonal_wind u
v 65 2 meridional_wind v
w 65 2 vertical velocity w
tv 65 2 virtual_temperature tv
q 65 2 specific_humidity sphu
oz 65 2 ozone ozone
delp 65 -1 fv3 del pressure delp
t2m 1 -1 2-m_T t2m
q2m 1 -1 2-m_Q q2m
ql 65 10 cloud_condensate QCLOUD
qr 65 10 rain QRAIN
qs 65 10 snow QSNOW
qi 65 10 ice QICE
qg 65 10 graupel QGRAUP
dbz 65 10 reflectivity REFL_10CM
::

state_derivatives::
!var level src
ps 1 met_guess
u 65 met_guess
v 65 met_guess
tv 65 met_guess
q 65 met_guess
oz 65 met_guess
cw 65 met_guess
prse 66 met_guess
::

state_tendencies::
!var levels source
u 65 met_guess
v 65 met_guess
tv 65 met_guess
q 65 met_guess
oz 65 met_guess
prse 66 met_guess
::

state_vector::
!var level itracer source funcof
u 65 0 met_guess u
v 65 0 met_guess v
w 65 0 met_guess w
tv 65 0 met_guess tv
tsen 65 0 met_guess tv,q
q 65 1 met_guess q
oz 65 1 met_guess oz
prse 66 0 met_guess prse
ps 1 0 met_guess prse
sst 1 0 met_guess sst
qr 65 1 met_guess qr
ql 65 1 met_guess qc
qs 65 1 met_guess qs
qi 65 1 met_guess qi
qg 65 1 met_guess qg
dbz 65 1 met_guess dbz
::

control_vector::
!var level itracer as/tsfc_sdv an_amp0 source funcof
sf 65 0 0.90 -1.0 state u,v
vp 65 0 0.90 -1.0 state u,v
ps 1 0 1.00 -1.0 state prse
t 65 0 1.40 -1.0 state tv
q 65 1 0.80 -1.0 state q
sst 1 0 1.00 -1.0 state sst
stl 1 0 1.00 -1.0 motley sst
sti 1 0 1.00 -1.0 motley sst
w 65 11 1.00 -1.0 state w
qr 65 11 1.00 -1.0 state qr
qs 65 11 1.00 -1.0 state qs
qi 65 11 1.00 -1.0 state qi
qg 65 11 1.00 -1.0 state qg
ql 65 11 1.00 -1.0 state qc
dbz 65 11 1.00 -1.0 state dbz
::
14 changes: 13 additions & 1 deletion fix/gsi/gsiparm.anl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ OBS_INPUT::
q_hyb_ens=${q_hyb_ens},
aniso_a_en=.false.,generate_ens=.false.,
n_ens=${nummem},
l_both_fv3sar_gfs_ens=${l_both_fv3sar_gfs_ens},n_ens_gfs=${nummem_gfs},n_ens_fv3sar=${nummem_fv3sar},
beta_s0=${beta1_inv},s_ens_h=${ens_h},s_ens_v=${ens_v},
regional_ensemble_option=${regional_ensemble_option},
pseudo_hybens = .false.,
Expand All @@ -159,7 +160,18 @@ OBS_INPUT::
jcap_ens=574,
fv3sar_bg_opt=${fv3lam_bg_type},
readin_localization=${readin_localization},
ens_fast_read=${ens_fast_read},
parallelization_over_ensmembers=${ens_fast_read},
nsclgrp=${nsclgrp},l_timloc_opt=.false.,ngvarloc=${ngvarloc},naensloc=${naensloc},
i_ensloccov4tim=${i_ensloccov4tim},i_ensloccov4var=${i_ensloccov4var},i_ensloccov4scl=${i_ensloccov4scl},
global_spectral_filter_sd=.false.,assign_vdl_nml=${assign_vdl_nml},vdl_scale=${vdl_scale},
vloc_varlist(1,1)='sf ',vloc_varlist(2,1)='w ',vloc_varlist(3,1)='sf ',vloc_varlist(4,1)='w ',
vloc_varlist(1,2)='vp ',vloc_varlist(2,2)='qr ',vloc_varlist(3,2)='vp ',vloc_varlist(4,2)='qr ',
vloc_varlist(1,3)='ps ',vloc_varlist(2,3)='qs ',vloc_varlist(3,3)='ps ',vloc_varlist(4,3)='qs ',
vloc_varlist(1,4)='t ',vloc_varlist(2,4)='qi ',vloc_varlist(3,4)='t ',vloc_varlist(4,4)='qi ',
vloc_varlist(1,5)='q ',vloc_varlist(2,5)='qg ',vloc_varlist(3,5)='q ',vloc_varlist(4,5)='qg ',
vloc_varlist(1,6)='sst',vloc_varlist(2,6)='ql ',vloc_varlist(3,6)='sst',vloc_varlist(4,6)='ql ',
vloc_varlist(1,7)='stl',vloc_varlist(2,7)='dbz',vloc_varlist(3,7)='stl',vloc_varlist(4,7)='dbz',
vloc_varlist(1,8)='sti',vloc_varlist(2,8)='aaa',vloc_varlist(3,8)='sti',vloc_varlist(4,8)='aaa',
/
&RAPIDREFRESH_CLDSURF
dfi_radar_latent_heat_time_period=20.0,
Expand Down
2 changes: 1 addition & 1 deletion scripts/exregional_nonvarcldanl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ fi
if [ ${DO_ENKF_RADAR_REF} == "TRUE" ]; then
l_qnr_from_qr=".true."
fi
if [ -r "${cycle_dir}/anal_radardbz_gsi${cycle_tag}/stdout" ]; then
if [ -r "${cycle_dir}/anal_radardbz_gsi${cycle_tag}/gsi_complete_radar.txt" ] || [ -r "${cycle_dir}/anal_all_gsi${cycle_tag}/gsi_complete_radar.txt" ]; then
l_precip_clear_only=".true."
l_qnr_from_qr=".true."
fi
Expand Down
84 changes: 67 additions & 17 deletions scripts/exregional_run_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ else
regional_ensemble_option=1
fi

if [ ${ob_type} != "conv" ] || [ ${BKTYPE} -eq 1 ]; then #not using GDAS
l_both_fv3sar_gfs_ens=.false.
fi

#---------------------------------------------------------------------
#
# decide regional_ensemble_option: global ensemble (1) or FV3LAM ensemble (5)
Expand Down Expand Up @@ -246,10 +250,11 @@ if [[ ${regional_ensemble_option:-1} -eq 5 ]]; then
if [[ $ifound -ne ${NUM_ENS_MEMBERS} ]] || [[ ${BKTYPE} -eq 1 ]]; then
print_info_msg "Not enough FV3_LAM ensembles, will fall to GDAS"
regional_ensemble_option=1
l_both_fv3sar_gfs_ens=.false.
fi
fi
#
if [[ ${regional_ensemble_option:-1} -eq 1 ]]; then #using GDAS
if [[ ${regional_ensemble_option:-1} -eq 1 || ${l_both_fv3sar_gfs_ens} = ".true." ]]; then #using GDAS
#-----------------------------------------------------------------------
# Make a list of the latest GFS EnKF ensemble
#-----------------------------------------------------------------------
Expand Down Expand Up @@ -349,23 +354,32 @@ niter2=50
lread_obs_save=.false.
lread_obs_skip=.false.
if_model_dbz=.false.
nummem_gfs=0
nummem_fv3sar=0
anav_type=${ob_type}
i_use_2mQ4B=2
i_use_2mT4B=1

# Determine if hybrid option is available
memname='atmf009'

if [ ${regional_ensemble_option:-1} -eq 5 ] && [ ${BKTYPE} != 1 ]; then
nummem=$NUM_ENS_MEMBERS
if [ ${l_both_fv3sar_gfs_ens} = ".true." ]; then
nummem_gfs=$(more filelist03 | wc -l)
nummem_gfs=$((nummem_gfs - 3 ))
fi
nummem_fv3sar=$NUM_ENS_MEMBERS
nummem=`expr ${nummem_gfs} + ${nummem_fv3sar}`
print_info_msg "$VERBOSE" "Do hybrid with FV3LAM ensemble"
ifhyb=.true.
print_info_msg "$VERBOSE" " Cycle ${YYYYMMDDHH}: GSI hybrid uses FV3LAM ensemble with n_ens=${nummem}"
echo " ${YYYYMMDDHH}(${cycle_type}): GSI hybrid uses FV3LAM ensemble with n_ens=${nummem}" >> ${EXPTDIR}/log.cycles
grid_ratio_ens="1"
ens_fast_read=.true.
else
nummem=$(more filelist03 | wc -l)
nummem=$((nummem - 3 ))
nummem_gfs=$(more filelist03 | wc -l)
nummem_gfs=$((nummem_gfs - 3 ))
nummem=${nummem_gfs}
if [[ ${nummem} -ge ${HYBENSMEM_NMIN} ]]; then
print_info_msg "$VERBOSE" "Do hybrid with ${memname}"
ifhyb=.true.
Expand All @@ -376,6 +390,9 @@ else
print_info_msg "$VERBOSE" " Hybrid needs at least ${HYBENSMEM_NMIN} ${memname} ensembles, only ${nummem} available"
echo " ${YYYYMMDDHH}(${cycle_type}): GSI dose pure 3DVAR" >> ${EXPTDIR}/log.cycles
fi
if [[ ${anav_type} == "all" ]]; then
anav_type="conv"
fi
fi

#
Expand Down Expand Up @@ -406,6 +423,17 @@ if [ ${BKTYPE} -eq 1 ]; then # cold start uses background from INPUT
fv3lam_bg_type=1
else # cycle uses background from restart
if [ "${IO_LAYOUT_Y}" == "1" ]; then
if [ -r "${bkpath}/bk_${ob_type}_fv_core.res.tile1.nc" ]; then
cp_vrfy -f ${bkpath}/bk_${ob_type}_fv_core.res.tile1.nc ${bkpath}/fv_core.res.tile1.nc
cp_vrfy -f ${bkpath}/bk_${ob_type}_fv_tracer.res.tile1.nc ${bkpath}/fv_tracer.res.tile1.nc
cp_vrfy -f ${bkpath}/bk_${ob_type}_sfc_data.nc ${bkpath}/sfc_data.nc
cp_vrfy -f ${bkpath}/bk_${ob_type}_phy_data.nc ${bkpath}/phy_data.nc
else
cp_vrfy ${bkpath}/fv_core.res.tile1.nc ${bkpath}/bk_${ob_type}_fv_core.res.tile1.nc
cp_vrfy ${bkpath}/fv_tracer.res.tile1.nc ${bkpath}/bk_${ob_type}_fv_tracer.res.tile1.nc
cp_vrfy ${bkpath}/sfc_data.nc ${bkpath}/bk_${ob_type}_sfc_data.nc
cp_vrfy ${bkpath}/phy_data.nc ${bkpath}/bk_${ob_type}_phy_data.nc
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prep_cyc builds the background and make a link to original background files (named as bk_*).
Why do we need to make a copy of the background files here again?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bk_*" built in prep_cyc is just a link before doing "ncatted -a checksum". To keep the "ncatted" files, this copy process is required. On Orion, overwriting these files by GSI analysis is often failed and this job is automatically rerun. To prevent the duplicate overwriting in the rerun, I added this copy process.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still cannot figure out why this part of copy needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this job, restart files are overwritten. Therefore, if this job is failed after outputting restart files, updated restart files are used as the first guess of EnVar in the rerun job by accident. In fact, such situation frequently occurred on Orion. To prevent from that issue, I added this part.

ln_vrfy -snf ${bkpath}/fv_core.res.tile1.nc fv3_dynvars
ln_vrfy -snf ${bkpath}/fv_tracer.res.tile1.nc fv3_tracer
ln_vrfy -snf ${bkpath}/sfc_data.nc fv3_sfcdata
Expand Down Expand Up @@ -473,7 +501,7 @@ else
esac
fi

if [[ ${gsi_type} == "OBSERVER" || ${ob_type} == "conv" ]]; then
if [[ ${gsi_type} == "OBSERVER" || ${anav_type} == "conv" || ${anav_type} == "all" ]]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using "all" as analysis variable is too general. As this application doing all the thing and cannot be extended?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed 'all' to 'conv_dbz'.


obs_files_source[0]=${obspath_tmp}/${obsfileprefix}.t${HH}${SUBH}z.prepbufr.tm00
obs_files_target[0]=prepbufr
Expand All @@ -486,15 +514,19 @@ if [[ ${gsi_type} == "OBSERVER" || ${ob_type} == "conv" ]]; then
obs_files_source[${obs_number}]=${obspath_tmp}/${obsfileprefix}.t${HH}${SUBH}z.nexrad.tm00.bufr_d
obs_files_target[${obs_number}]=l2rwbufr

if [ ${DO_ENKF_RADAR_REF} == "TRUE" ]; then
if [[ ${DO_ENKF_RADAR_REF} == "TRUE" || ${anav_type} == "all" ]]; then
obs_number=${#obs_files_source[@]}
obs_files_source[${obs_number}]=${cycle_dir}/process_radarref/00/Gridded_ref.nc
if [ ${cycle_type} == "spinup" ]; then
obs_files_source[${obs_number}]=${cycle_dir}/process_radarref_spinup/00/Gridded_ref.nc
else
obs_files_source[${obs_number}]=${cycle_dir}/process_radarref/00/Gridded_ref.nc
fi
obs_files_target[${obs_number}]=dbzobs.nc
fi

else

if [ ${ob_type} == "radardbz" ]; then
if [ ${anav_type} == "radardbz" ]; then

if [ ${cycle_type} == "spinup" ]; then
obs_files_source[0]=${cycle_dir}/process_radarref_spinup/00/Gridded_ref.nc
Expand All @@ -506,7 +538,7 @@ else
fi


if [ ${ob_type} == "AERO" ]; then
if [ ${anav_type} == "AERO" ]; then
obs_files_source[0]=${OBSPATH_PM}/${YYYYMMDD}/pm25.airnow.${YYYYMMDD}${HH}.bufr
obs_files_target[0]=pm25bufr
fi
Expand Down Expand Up @@ -624,27 +656,42 @@ if [ ${DO_ENKF_RADAR_REF} == "TRUE" ]; then
beta1_inv=0.0
if_model_dbz=.true.
fi
if [[ ${gsi_type} == "ANALYSIS" && ${ob_type} == "radardbz" ]]; then
if [[ ${gsi_type} == "ANALYSIS" && ${anav_type} == "radardbz" ]]; then
ANAVINFO=${FIX_GSI}/${ENKF_ANAVINFO_DBZ_FN}
miter=1
niter1=100
niter2=0
bkgerr_vs=0.1
bkgerr_hzscl="0.4,0.5,0.6"
beta1_inv=0.0
ens_h=4.10790
ens_v=-0.30125
readin_localization=.false.
ens_h=${ens_h_radardbz}
ens_v=${ens_v_radardbz}
nsclgrp=1
ngvarloc=1
i_ensloccov4tim=0
i_ensloccov4var=0
i_ensloccov4scl=0
q_hyb_ens=.true.
if_model_dbz=.true.
fi
if [[ ${gsi_type} == "ANALYSIS" && ${anav_type} == "all" ]]; then
ANAVINFO=${FIX_GSI}/${ANAVINFO_ALL_FN}
beta1_inv=0.0
if_model_dbz=.true.
fi
naensloc=`expr ${nsclgrp} \* ${ngvarloc} + ${nsclgrp} - 1`
if [ ${assign_vdl_nml} = ".true." ]; then
nsclgrp=`expr ${nsclgrp} \* ${ngvarloc}`
ngvarloc=1
fi
CONVINFO=${FIX_GSI}/${CONVINFO_FN}
HYBENSINFO=${FIX_GSI}/${HYBENSINFO_FN}
OBERROR=${FIX_GSI}/${OBERROR_FN}
BERROR=${FIX_GSI}/${BERROR_FN}


if [[ ${gsi_type} == "ANALYSIS" && ${ob_type} == "AERO" ]]; then
if [[ ${gsi_type} == "ANALYSIS" && ${anav_type} == "AERO" ]]; then
if [ ${BKTYPE} -eq 1 ]; then
echo "cold start, skip GSI SD DA"
exit 0
Expand Down Expand Up @@ -831,7 +878,7 @@ fi
# skip radar reflectivity analysis if no RRFSE ensemble
#-----------------------------------------------------------------------

if [[ ${gsi_type} == "ANALYSIS" && ${ob_type} == "radardbz" ]]; then
if [[ ${gsi_type} == "ANALYSIS" && ${anav_type} == "radardbz" ]]; then
if [[ ${regional_ensemble_option:-1} -eq 1 ]]; then
echo "No RRFSE ensemble available, cannot do radar reflectivity analysis"
exit 0
Expand Down Expand Up @@ -877,7 +924,7 @@ EOF
#
gsi_exec="${EXECDIR}/gsi.x"

if [[ ${gsi_type} == "ANALYSIS" && ${ob_type} == "AERO" ]]; then
if [[ ${gsi_type} == "ANALYSIS" && ${anav_type} == "AERO" ]]; then
gsi_exec="${EXECDIR}/gsi.x.sd"
fi

Expand Down Expand Up @@ -914,7 +961,7 @@ fi
$APRUN ./gsi.x < gsiparm.anl > stdout 2>&1 || print_err_msg_exit "\
Call to executable to run GSI returned with nonzero exit code."

if [ ${ob_type} == "radardbz" ]; then
if [ ${anav_type} == "radardbz" ]; then
cat fort.238 > $comout/rrfs_a.t${HH}z.fits3.tm00
else
mv fort.207 fit_rad1
Expand All @@ -933,7 +980,7 @@ else

fi

cp stdout $comout/stdout_${ob_type}
cp stdout $comout/stdout_${anav_type}
#
#-----------------------------------------------------------------------
#
Expand All @@ -943,6 +990,9 @@ cp stdout $comout/stdout_${ob_type}
#-----------------------------------------------------------------------
#
touch gsi_complete.txt
if [[ ${anav_type} == "radardbz" || ${anav_type} == "all" ]]; then
touch gsi_complete_radar.txt # for nonvarcldanl
fi
#
#-----------------------------------------------------------------------
#
Expand Down
6 changes: 2 additions & 4 deletions scripts/exregional_run_enkf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,12 @@ CONVINFO=${FIX_GSI}/convinfo.rrfs

if [ ${ob_type} == "conv" ]; then
ANAVINFO=${FIX_GSI}/${ENKF_ANAVINFO_FN}
CORRLENGTH=400
LNSIGCUTOFF=0.5
found_ob_type=1
fi
if [ ${ob_type} == "radardbz" ]; then
ANAVINFO=${FIX_GSI}/${ENKF_ANAVINFO_DBZ_FN}
CORRLENGTH=18
LNSIGCUTOFF=0.5
CORRLENGTH=${CORRLENGTH_radardbz}
LNSIGCUTOFF=${LNSIGCUTOFF_radardbz}
found_ob_type=1
fi
if [ ${found_ob_type} == 0 ]; then
Expand Down
34 changes: 34 additions & 0 deletions ush/config.sh.RRFS_CONUS_13km
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,40 @@ DO_SOIL_ADJUST="TRUE"
DO_RADDA="FALSE"
DO_BUFRSND="FALSE"

l_both_fv3sar_gfs_ens=.false. #if true, ensemble size is increased with GDAS ensemble
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is added in three configuration files: RRFS_CONUS_13km, RRFS_CONUS_3km, RRFS_CONUS_3km.2022HWT. If they are same or mostly same, can make a separate file just like
set_rrfs_config_general.sh and only include special setups in configure. You can also setup grid type related parameters in that file. Please let me know if you need more details on how to simplify this setups.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a separated file (set_rrfs_config_SDL_VDL_MixEn.sh) for setting of MixEn/SDL/VDL.

nsclgrp=1 #number of scales for scale-dependent localization
ngvarloc=1 #number of scales for variable-dependent localization
assign_vdl_nml=.false.
if [[ ${ngvarloc} == "1" ]] && [[ ${nsclgrp} == "2" ]]; then
readin_localization=.false.
ens_h="328.632,82.1580,82.1580"
ens_v="-0.30125,-0.30125,0.0"
ens_h_radardbz="4.10790"
ens_v_radardbz="-0.30125"
elif [[ ${ngvarloc} == "2" ]] && [[ ${nsclgrp} == "1" ]]; then
DO_ENVAR_RADAR_REF_ONCE="TRUE"
readin_localization=.false.
ens_h="82.1580,4.10790"
ens_v="-0.30125,-0.30125"
if [ ${assign_vdl_nml} = ".true." ]; then
vdl_scale="2,2"
else
i_ensloccov4var=1
fi
elif [[ ${ngvarloc} == "2" ]] && [[ ${nsclgrp} == "2" ]]; then
DO_ENVAR_RADAR_REF_ONCE="TRUE"
readin_localization=.false.
if [ ${assign_vdl_nml} = ".true." ]; then
ens_h="82.1580,16.4316,8.21580,4.10790,2.73860"
ens_v="-0.30125,-0.30125,-0.30125,-0.30125,0.0"
vdl_scale="2,2,2,2"
else
ens_h="328.632,82.1580,4.10790,4.10790,82.1580"
ens_v="-0.30125,-0.30125,-0.30125,-0.30125,0.0"
i_ensloccov4var=1
fi
fi

EXTRN_MDL_ICS_OFFSET_HRS="3"
LBC_SPEC_INTVL_HRS="1"
EXTRN_MDL_LBCS_OFFSET_HRS="6"
Expand Down
Loading