Skip to content

Commit

Permalink
revise HISTORY handling of gcm diag fields (during corrector); and ha…
Browse files Browse the repository at this point in the history
…ndling of post_egcm
  • Loading branch information
rtodling committed Nov 4, 2024
1 parent 5bdd164 commit 892e103
Show file tree
Hide file tree
Showing 21 changed files with 158 additions and 195 deletions.
17 changes: 14 additions & 3 deletions src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/atm_ens.j
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
# -------------------------------------------
if ( $RUN_PEANA || $DO_ATM_ENS ) then
zeit_ci.x post_eana
post_eana.csh $EXPID $anymd $anhms |& tee -a atm_ens.log
post_eana.csh $EXPID $anymd $anhms spread |& tee -a atm_ens.log
if( $status) then
echo "post_eana failed"
exit(1)
Expand Down Expand Up @@ -595,11 +595,22 @@
set arch_nhms = $nhmsb
if( $RUN_AENSFCST || $DO_ATM_ENS ) then
zeit_ci.x post_egcm
post_egcm.csh $EXPID $nymdb $nhmsb $TIMEINC $FVHOME/atmens
set myrc = $ATMENSETC/post_egcm.rc
if ( -e $ATMENSETC/post_egcm_${hhb}.rc ) set myrc = $ATMENSETC/post_egcm_${hhb}.rc
post_egcm.csh $EXPID $nymdb $nhmsb $TIMEINC spread $myrc $FVHOME/atmens
if ($status) then
echo "post_egcm failed"
echo "post_egcm (bkg) failed"
exit(1)
endif
set myrc = $ATMENSETC/post_egcm_diag.rc
if ( -e $ATMENSETC/post_egcm_diag_${hhb}.rc ) set myrc = $ATMENSETC/post_egcm_diag_${hhb}.rc
if ( -e $myrc ) then
post_egcm.csh $EXPID $nymdb $nhmsb 0 variance $myrc $FVHOME/atmens/ensdiag
if ($status) then
echo "post_egcm (diag) failed"
exit(1)
endif
endif
zeit_co.x post_egcm
endif

Expand Down
6 changes: 4 additions & 2 deletions src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/atm_ose.j
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,11 @@
set arch_nhms = $nhmsb
if( ($RUN_POSTEGCM && $RUN_AENSFCST) || $DO_ATM_ENS ) then
zeit_ci.x post_egcm
post_egcm.csh $EXPID $nymdb $nhmsb $TIMEINC $FVHOME/atmens
set myrc = $ATMENSETC/post_egcm.rc
if ( -e $ATMENSETC/post_egcm_${hhb}.rc ) set myrc = $ATMENSETC/post_egcm_${hhb}.rc
post_egcm.csh $EXPID $nymdb $nhmsb $TIMEINC spread $myrc $FVHOME/atmens
if ($status) then
echo "post_egcm failed"
echo "post_egcm (bkg) failed"
exit(1)
endif
zeit_co.x post_egcm
Expand Down
22 changes: 5 additions & 17 deletions src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/atmens_efsens.csh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ setenv DRYRUN
#
# 23Apr2017 Todling Initial script
# 03May2020 Todling Logic not to over-subscribe node
# 03Nov2024 Todling Revised job distribution
#------------------------------------------------------------------

if ( !($?ATMENS_VERBOSE) ) then
Expand Down Expand Up @@ -97,6 +98,7 @@ if ( $ENSPARALLEL ) then
setenv FAILED 1
else
setenv JOBGEN_NCPUS $ENSGCMADJ_NCPUS
setenv JOBGEN_NCPUS_PER_NODE -1
endif
endif

Expand Down Expand Up @@ -289,23 +291,9 @@ set nmem = $members[1]
endif

if ( ($ipoe == $AENS_GCMADJ_DSTJOB) || (($fpoe == $ntodo) && ($ipoe < $AENS_GCMADJ_DSTJOB) ) ) then
set this_ntasks_per_node = `facter processorcount`
@ ncores_needed = $ENSGCMADJ_NCPUS / $this_ntasks_per_node
if ( $ncores_needed == 0 ) then
@ myncpus = $this_ntasks_per_node
else
if ( $ENSGCMADJ_NCPUS == $ncores_needed * $this_ntasks_per_node ) then
@ myncpus = $ENSGCMADJ_NCPUS
else
@ myncpus = $ENSGCMADJ_NCPUS / $this_ntasks_per_node
@ module = $myncpus * $this_ntasks_per_node - $ENSGCMADJ_NCPUS
if ( $module != 0 ) @ myncpus = $myncpus + 1
@ myncpus = $myncpus * $this_ntasks_per_node
endif
endif
@ myncpus = $ipoe * $myncpus
#_ @ myncpus = $ipoe * $ENSGCMADJ_NCPUS
setenv JOBGEN_NCPUS $myncpus
set mydist = (`atmens_ntasks.pl $ENSGCMADJ_NCPUS $ipoe`)
setenv JOBGEN_NCPUS $mydist[1]
setenv JOBGEN_NCPUS_PER_NODE $mydist[2]
jobgen.pl \
-egress AGCMADJ_DST_EGRESS -q $AGCMADJ_QNAME \
agcmadj_dst${npoe} \
Expand Down
51 changes: 24 additions & 27 deletions src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/atmens_stats.csh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# 25Mar2013 Todling Allow mp_stats to run under mpi
# 21Feb2020 Todling Allow for high freq bkg (up to 1mn)
# 02May2020 Todling Allow for user-spec freq of bkg stat calc
# 01Nov2024 Todling Design fix: hidden files belong to parent dir
# 01Nov2024 Todling - Design fix: hidden files belong to parent dir
# - Enhanced flexibility in handling mp_stats.rc
#------------------------------------------------------------------

if ( !($?ATMENS_VERBOSE) ) then
Expand All @@ -28,7 +29,7 @@ setenv MYNAME atmens_stats.csh

# need usage here
# ---------------
if ( $#argv < 5 ) then
if ( $#argv < 6 ) then
echo " "
echo " \\begin{verbatim} "
echo " "
Expand All @@ -43,6 +44,7 @@ if ( $#argv < 5 ) then
echo " where"
echo " nmem - number of members to be created"
echo " ftype - file type (e.g., bkg.eta, bkg.sfc, ana.eta)"
echo " xstat - extra statistics (e.g., spread or variance"
echo " ensloc - location to place generated ensemble"
echo " nymd - date of members to calc stats for (as YYYYMMDD)"
echo " nhms - time of members to calc stats for (as HHMMSS)"
Expand All @@ -59,7 +61,7 @@ if ( $#argv < 5 ) then
echo " of RMS; and finally performing (iv) calculation of energy-based spread."
echo " "
echo " Example of valid command line:"
echo " $MYNAME 10 /archive/u/$user/u000_c72/atmens 20111201 210000"
echo " $MYNAME 10 bkg.eta spread /archive/u/$user/u000_c72/atmens 20111201 210000"
echo " "
echo " REQUIRED RESOURCE FILES"
echo " "
Expand All @@ -81,6 +83,7 @@ if ( $#argv < 5 ) then
echo " AENSTAT_NCPUS - number of cpus to use for this procedure"
echo " (NOTE: required when ENSPARALLEL is on)"
echo " ATMENS_BKGSTATFRQ - specific bkg freq for stats calculation"
echo " "
echo " SEE ALSO"
echo " mp_stats.x - program to calculate statistics from fields in SDF files"
echo " dyn_diff.x - program to calculate difference between dyn-vector files"
Expand Down Expand Up @@ -143,9 +146,10 @@ endif
# -----------------------
set nmem = $1 # number of ensemble members
set ftype = $2 # file type (e.g, bkg.eta)
set ensloc = $3 # root location for members and mean
set nymd = $4 # date of members to calc stats for (YYYYMMDD)
set nhms = $5 # time of members to calc stats for (HHMMSS)
set xstat = $3 # file type (e.g, bkg.eta)
set ensloc = $4 # root location for members and mean
set nymd = $5 # date of members to calc stats for (YYYYMMDD)
set nhms = $6 # time of members to calc stats for (HHMMSS)

setenv BKGFREQ $ASYNBKG
if ($?ATMENS_BKGSTATFRQ) then
Expand Down Expand Up @@ -175,7 +179,7 @@ endif

# Inquire from HISTORY
# --------------------
set timetagz = ${nymd}_${hhmm}z
set timetagz = ${nymd}_${hhmn}z
if ( $ftype != "ana.eta" && $ftype != "inc.eta" ) then # these types are not in HISTORY
set hist = (`ls $ATMENSETC/HIST*.rc.tmpl`)
if ( $#hist != 1 ) then
Expand All @@ -186,20 +190,11 @@ if ( $ftype != "ana.eta" && $ftype != "inc.eta" ) then # these types are not in
set timetagz = `echo $ttemplate | cut -d. -f1`
endif

###set lmtype = `echorc.x -rc HISTAENS.rc.tmpl $ftype`
set lmtype = `echo $ftype | cut -d_ -f6`
if (("$lmtype" == "p48") || ("$lmtype" == "z17") || ("$lmtype" == "slv")) then
setenv MYLOC $ensloc/ensdiag
else
setenv MYLOC $ensloc
endif

set etag = "NULL"

# get positioned ...
# ------------------
#cd $ensloc/
cd $MYLOC/
cd $ensloc/
if( !($?ENSWORK) ) then
setenv ENSWORK $ensloc
endif
Expand All @@ -212,25 +207,27 @@ if( ($?ATMENSETC) ) then
echo " ${MYNAME}: env(AENSTAT_MPIRUN) not defined, aborting ..."
exit 1
endif
if(! -d ensmean ) mkdir -p $MYLOC/ensmean
if(! -d ensrms ) mkdir -p $MYLOC/ensrms
cd $MYLOC/mem001
if(! -d ensmean ) mkdir -p $ensloc/ensmean
if( $xstat == "spread" && (! -d ensrms) ) mkdir -p $ensloc/ensrms
if( $xstat == "variance" && (! -d ensvar) ) mkdir -p $ensloc/ensvar
cd $ensloc/mem001
set alltype = `ls *.${ftype}.*${timetagz}.$NCSUFFIX`
cd -
foreach fn ( $alltype )
set mopt = "-o $MYLOC/ensmean/$fn"
set sopt = "-stdv $MYLOC/ensrms/$fn"
set mopt = "-o $ensloc/ensmean/$fn"
if ( -d $ensloc/ensrms ) then
set sopt = "-stdv $ensloc/ensrms/$fn"
endif
if ( -d $ensloc/ensvar ) then
set sopt = "-variance $ensloc/ensvar/$fn"
endif
set eopt = ""
if ("$ftype" == "bkg.eta" || "$ftype" == "ana.eta" || "$ftype" == "prog.eta" ) then
if("$ftype" == "bkg.eta" ) set etype = "bene.err"
if("$ftype" == "ana.eta" ) set etype = "aene.err"
if("$ftype" == "prog.eta") set etype = "pene.err"
set eopt = "-ene ensrms/$EXPID.${etype}.${timetagz}.$NCSUFFIX"
endif
if (("$lmtype" == "p48") || ("$lmtype" == "z17") || ("$lmtype" == "slv")) then
if(! -d ensvar ) mkdir -p $MYLOC/ensvar
set sopt = "-variance $MYLOC/ensvar/$fn"
endif
set dims = (`getgfiodim.x mem001/$fn` )
setenv MP_STATS_LM $dims[3]
if ( $MP_STATS_LM == 0 ) then
Expand All @@ -253,7 +250,7 @@ if( ($?ATMENSETC) ) then
exit (0)
endif
endif
/bin/rm mp_stats.*.rc
/bin/rm $ensloc/mp_stats.*.rc

setenv NCPUS 1 # NOTE: for now since there is a memory issue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ if ( $ENSPARALLEL ) then
setenv FAILED 1
else
setenv JOBGEN_NCPUS $ENSVTRK_NCPUS
setenv JOBGEN_NCPUS_PER_NODE -1
endif
endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ if ( "$doing_gaas" == ".TRUE." ) then
# Launch acquire job to retrieve pre-existing ensemble
# ----------------------------------------------------
#setenv JOBGEN_NCPUS 1
#setenv JOBGEN_NCPUS_PER_NODE 1
setenv JOBGEN_NCPUS_PER_NODE -1
jobgen.pl \
-expid $expid \
acq_aodana \
Expand Down
22 changes: 5 additions & 17 deletions src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/atmos_egsi.csh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# 24Nov2011 Todling Initial script
# 20Jun2020 Todling Revampped (based on observer)
# 23Jun2020 Todling Redef meaning of ATMENSLOC
# 03Nov2024 Todling Revised job distribution
#------------------------------------------------------------------

if ( !($?ATMENS_VERBOSE) ) then
Expand Down Expand Up @@ -125,6 +126,7 @@ if ( $ENSPARALLEL ) then
setenv FAILED 1
else
setenv JOBGEN_NCPUS $ENSGSI_NCPUS
setenv JOBGEN_NCPUS_PER_NODE -1
endif
endif

Expand Down Expand Up @@ -605,23 +607,9 @@ while ( $n < $nmem )
endif

if ( ($ipoe == $AENS_OBSVR_DSTJOB) || (($fpoe == $ntodo ) && ($ipoe < $AENS_OBSVR_DSTJOB) ) ) then
set this_ntasks_per_node = `facter processorcount`
@ ncores_needed = $ENSGSI_NCPUS / $this_ntasks_per_node
if ( $ncores_needed == 0 ) then
@ myncpus = $this_ntasks_per_node
else
if ( $ENSGSI_NCPUS == $ncores_needed * $this_ntasks_per_node ) then
@ myncpus = $ENSGSI_NCPUS
else
@ myncpus = $ENSGSI_NCPUS / $this_ntasks_per_node
@ module = $myncpus * $this_ntasks_per_node - $ENSGSI_NCPUS
if ( $module != 0 ) @ myncpus = $myncpus + 1
@ myncpus = $myncpus * $this_ntasks_per_node
endif
endif
@ myncpus = $ipoe * $myncpus
#_ @ myncpus = $ipoe * $ENSGSI_NCPUS
setenv JOBGEN_NCPUS $myncpus
set mydist = (`atmens_ntasks.pl $ENSGSI_NCPUS $ipoe`)
setenv JOBGEN_NCPUS $mydist[1]
setenv JOBGEN_NCPUS_PER_NODE $mydist[2]
jobgen.pl \
-q $OBSVR_QNAME \
egsi_dst${npoe} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ if ( $ENSPARALLEL ) then
setenv FAILED 1
else
setenv JOBGEN_NCPUS $AENKF_NCPUS
setenv JOBGEN_NCPUS_PER_NODE -1
endif
endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

MAPLROOT_COMPNAME: GCS
ROOT_NAME: GCS
MAPLROOT_COMPNAME: GCM
ROOT_NAME: GCM
ROOT_CF: AGCM.rc
HIST_CF: HISTORY.rc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ install (
)

set (R21C_files
R21C/atmos_enkf.nml.tmpl
R21C/obs1gsi_mean.rc
R21C/obs1gsi_member.rc
R21C/HISTAENS.rc.tmpl
R21C/post_egcm.rc
R21C/CAP.rc.tmpl
R21C/atmens_storage.arc
R21C/AtmEnsConfig.csh
R21C/AtmEnsConfig.csh
R21C/atmens_storage.arc
R21C/atmos_enkf.nml.tmpl
R21C/HISTAENS.rc.tmpl
R21C/obs1gsi_mean.rc
R21C/obs1gsi_member.rc
R21C/post_egcm_diag.rc
R21C/post_egcm.rc
)

install (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ setenv AENS_DONORECENTER 0 # do not recenter ensemble
setenv ADDINF_FACTOR 0.35 # additive inflation coeff (seems small after mass-div fix)
setenv ADDINF_FACTOR_SPPT 0.2 # additive inflation for when SPPT is used

setenv RECENTER_WALLCLOCK 1:00:00
setenv RECENTER_WALLCLOCK 0:30:00
setenv ENSRECENTER_NCPUS 1
setenv RECENTER_QNAME $ATMENS_QNAME
setenv AENS_RECENTER_DSTJOB 16
Expand Down Expand Up @@ -137,7 +137,7 @@ setenv MPIRUN_ENSANA "$ATMENS_MPIRUN -np $ENSGSI_NCPUS GSIsa.x" # esma_mpir

# setup_perts.csh
#----------------
setenv AENS_PERTS_DSTJOB 8
# setenv AENS_PERTS_DSTJOB 8
setenv PERTS_QNAME $ATMENS_QNAME
setenv PERTS_WALLCLOCK 1:00:00
setenv PERTS_NCPUS 24
Expand All @@ -160,5 +160,8 @@ setenv PEGCM_QNAME $ATMENS_QNAME

# NOTES:
setenv OBSCLASS1 "r21c_loon_bufr,r21c_gmao_mlst_bufr,r21c_prep_bufr,r21c_acftpfl_bufr,r21c_satwnd_bufr,r21c_avhrr_satwnd_bufr,r21c_ncep_tcvitals,r21c_tmi_bufr,r21c_gpsro_bufr,r21c_sevcsr_bufr,r21c_1bamua_bufr,r21c_1bamub_bufr,r21c_1bhrs2_bufr,r21c_1bhrs3_bufr,r21c_1bhrs4_bufr,r21c_1bmsu_bufr,r21c_1bmhs_bufr,r21c_1bssu_bufr,r21c_eosairs_bufr,r21c_eosamsua_bufr,r21c_mtiasi_bufr,r21c_atms_bufr,r21c_ssmit11_bufr,r21c_ssmit13_bufr,r21c_ssmit14_bufr,r21c_ssmit15_bufr,r21c_amsre_bufr,r21c_osbuv8_bufr,r21c_mls_nc,r21c_npp_ompslp_nc,r21c_aura_omieff_nc,r21c_npp_ompsnmeff_nc,r21c_avcsam_bufr,r21c_avcspm_bufr,r21c_amsr2_bufr,r21c_crisfsr_bufr,r21c_gmi_bufr,r21c_prep_bufr,r21c_acftpfl_bufr"

# NONSENS
#setenv OBSCLASS1 "r21c_igra2_raob_pre-qc_bufr,r21c_cdas_conv_pre-qc_bufr,r21c_prof_pre-qc_bufr,r21c_avhrrwnd_pre-qc_bufr,r21c_nmodis_pre-qc_bufr,r21c_goes_pre-qc_prep_bufr,r21c_metsat_pre-qc_prep_bufr,r21c_jma_pre-qc_prep_bufr,r21c_ascat_pre-qc_bufr,r21c_repro_ers2_pre-qc_bufr,r21c_qscat_jpl_pre-qc_bufr,r21c_loon_bufr,r21c_gmao_mlst_bufr,r21c_prep_bufr,r21c_acftpfl_bufr,r21c_satwnd_bufr,r21c_avhrr_satwnd_bufr,r21c_ncep_tcvitals,r21c_tmi_bufr,r21c_gpsro_bufr,r21c_sevcsr_bufr,r21c_1bamua_bufr,r21c_1bamub_bufr,r21c_1bhrs2_bufr,r21c_1bhrs3_bufr,r21c_1bhrs4_bufr,r21c_1bmsu_bufr,r21c_1bmhs_bufr,r21c_1bssu_bufr,r21c_eosairs_bufr,r21c_eosamsua_bufr,r21c_mtiasi_bufr,r21c_atms_bufr,r21c_ssmit11_bufr,r21c_ssmit13_bufr,r21c_ssmit14_bufr,r21c_ssmit15_bufr,r21c_amsre_bufr,r21c_osbuv8_bufr,r21c_mls_nc,r21c_npp_ompslp_nc,r21c_aura_omieff_nc,r21c_npp_ompsnmeff_nc,r21c_avcsam_bufr,r21c_avcspm_bufr,r21c_amsr2_bufr,r21c_crisfsr_bufr,r21c_gmi_bufr,r21c_prep_bufr,r21c_acftpfl_bufr"
setenv OBSCLASS "gmao_prep_bufr,gmao_acftpfl_bufr,$OBSCLASS1"

This file was deleted.

Loading

0 comments on commit 892e103

Please sign in to comment.