Skip to content

Commit

Permalink
Fix rotating member bugs (#2443)
Browse files Browse the repository at this point in the history
When PR #2427 introduced the rotating subset of member guess states for
the early-cycle EnKF, the rotating member calculation function was
omitted from the DOSFCANL_ENKF if block in the enkf surface script. This
PR adds this feature to this section. This PR also removes hard coded
values that were included in this function and are replaced with a
variable equal to the number of late cycle members.

Resolves #2441
  • Loading branch information
TravisElless-NOAA committed Apr 2, 2024
1 parent 39ba9d7 commit 0eaa537
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 3 additions & 2 deletions scripts/exgdas_enkf_ecen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ FHMIN=${FHMIN_ECEN:-3}
FHMAX=${FHMAX_ECEN:-9}
FHOUT=${FHOUT_ECEN:-3}
FHSFC=${FHSFC_ECEN:-$FHMIN}
NMEM_ENS_MAX=${NMEM_ENS:-80}
if [ "${RUN}" = "enkfgfs" ]; then
DO_CALC_INCREMENT=${DO_CALC_INCREMENT_ENKF_GFS:-"NO"}
NMEM_ENS=${NMEM_ENS_GFS:-30}
Expand Down Expand Up @@ -111,8 +112,8 @@ for FHR in $(seq $FHMIN $FHOUT $FHMAX); do

for imem in $(seq 1 $NMEM_ENS); do
smem=$((imem + mem_offset))
if (( smem > 80 )); then
smem=$((smem - 80))
if (( smem > NMEM_ENS_MAX )); then
smem=$((smem - NMEM_ENS_MAX))
fi
gmemchar="mem"$(printf %03i $smem)
memchar="mem"$(printf %03i $imem)
Expand Down
11 changes: 8 additions & 3 deletions scripts/exgdas_enkf_sfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ GPREFIX=${GPREFIX:-""}
GPREFIX_ENS=${GPREFIX_ENS:-${GPREFIX}}

# Variables
NMEM_ENS_MAX=${NMEM_ENS:-80}
if [ "${RUN}" = "enkfgfs" ]; then
NMEM_ENS=${NMEM_ENS_GFS:-30}
ec_offset=${NMEM_ENS_GFS_OFFSET:-20}
Expand Down Expand Up @@ -140,8 +141,8 @@ if [ $DOIAU = "YES" ]; then

for imem in $(seq 1 $NMEM_ENS); do
smem=$((imem + mem_offset))
if (( smem > 80 )); then
smem=$((smem - 80))
if (( smem > NMEM_ENS_MAX )); then
smem=$((smem - NMEM_ENS_MAX))
fi
gmemchar="mem"$(printf %03i "$smem")
cmem=$(printf %03i $imem)
Expand Down Expand Up @@ -186,7 +187,11 @@ if [ $DOSFCANL_ENKF = "YES" ]; then
export TILE_NUM=$n

for imem in $(seq 1 $NMEM_ENS); do

smem=$((imem + mem_offset))
if (( smem > NMEM_ENS_MAX )); then
smem=$((smem - NMEM_ENS_MAX))
fi
gmemchar="mem"$(printf %03i "$smem")
cmem=$(printf %03i $imem)
memchar="mem$cmem"

Expand Down
5 changes: 3 additions & 2 deletions scripts/exgdas_enkf_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ cnvw_option=${cnvw_option:-".false."}
netcdf_diag=${netcdf_diag:-".true."}
modelspace_vloc=${modelspace_vloc:-".false."} # if true, 'vlocal_eig.dat' is needed
IAUFHRS_ENKF=${IAUFHRS_ENKF:-6}
NMEM_ENS_MAX=${NMEM_ENS:-80}
if [ "${RUN}" = "enkfgfs" ]; then
DO_CALC_INCREMENT=${DO_CALC_INCREMENT_ENKF_GFS:-"NO"}
NMEM_ENS=${NMEM_ENS_GFS:-30}
Expand Down Expand Up @@ -184,8 +185,8 @@ fi
nfhrs=$(echo $IAUFHRS_ENKF | sed 's/,/ /g')
for imem in $(seq 1 $NMEM_ENS); do
smem=$((imem + mem_offset))
if (( smem > 80 )); then
smem=$((smem - 80))
if (( smem > NMEM_ENS_MAX )); then
smem=$((smem - NMEM_ENS_MAX))
fi
gmemchar="mem"$(printf %03i $smem)
memchar="mem"$(printf %03i $imem)
Expand Down

0 comments on commit 0eaa537

Please sign in to comment.