From 3723d1a49771ca1b8ba2202356a87ff0fe57912a Mon Sep 17 00:00:00 2001 From: Ricardo Todling Date: Thu, 23 Dec 2021 08:00:51 -0500 Subject: [PATCH] update GSI for GEOS-IT config; minor script adjustments merging 5.27.1-IT with current --- components.yaml | 2 +- src/Applications/GEOSdas_App/GEOSdas.csm | 21 +++++++++- src/Applications/GEOSdas_App/fvsetup | 1 + src/Applications/GEOSdas_App/gen_silo_arc.pl | 1 + .../GEOSdas_App/monthly.yyyymm.pl.tmpl | 42 +++++++++++-------- src/Applications/GEOSdas_App/monthly_setup.pl | 23 ++++++---- 6 files changed, 61 insertions(+), 29 deletions(-) diff --git a/components.yaml b/components.yaml index 52f9ea62..79ae1948 100644 --- a/components.yaml +++ b/components.yaml @@ -46,7 +46,7 @@ FMS: GEOSana_GridComp: local: ./src/Components/@GEOSana_GridComp remote: ../GEOSana_GridComp.git - tag: v1.5.2 + tag: v1.5.3 develop: develop GEOSgcm_GridComp: diff --git a/src/Applications/GEOSdas_App/GEOSdas.csm b/src/Applications/GEOSdas_App/GEOSdas.csm index 5246ab9a..bb71b721 100755 --- a/src/Applications/GEOSdas_App/GEOSdas.csm +++ b/src/Applications/GEOSdas_App/GEOSdas.csm @@ -177,6 +177,12 @@ #_RT if ( !($?STAGE4FCST) ) setenv STAGE4FCST 0 # need to resolve redundancies +# Sanity setting +# -------------- + if ( $SKIPANA ) then + setenv ASYNBKG 360 + endif + if ( $?RUN_OPT_BEGIN ) then set run_opt_begin = ( $RUN_OPT_BEGIN ) else @@ -445,7 +451,7 @@ exit 1 # Cannot do GAASFDBK unless GAAS_ANA is on # ---------------------------------------- if ( ! $FORECAST ) then - if ( $GAAS_ANA && ( ! $GAASFDBK ) ) then + if ( $GAASFDBK && ( ! $GAAS_ANA ) ) then echo $myname": GAAS inconsistency, GAASFDBK=$GAASFDBK, GAAS_ANA=$GAAS_ANA" exit 1 endif @@ -495,6 +501,7 @@ exit 1 # ----------------------------------------------------- if ( !($?obsclass) && !($?req_obsclass) ) then setenv SKIPANA 1 # no ANALYSIS + setenv ASYNBKG 360 endif # For readability, introduce DOING_ANA @@ -4187,7 +4194,12 @@ endif setenv NCPUS_AOD 1 endif - @ xtra = $NCPUS - $NCPUS_GSI + if ( $?SLURM_CPUS_ON_NODE && $?SLURM_JOB_NUM_NODES ) then + @ total_cpus_slurm = $SLURM_CPUS_ON_NODE * $SLURM_JOB_NUM_NODES + @ xtra = $total_cpus_slurm - $NCPUS_GSI + else + @ xtra = $NCPUS - $NCPUS_GSI + endif if ($xtra < $NCPUS_AOD) then setenv aod_parallel_flag 0 @@ -5742,6 +5754,11 @@ endif if ( $FORECAST ) then /bin/rm d_rst mkdrstdate.x $fcst_end # create d_rst with current date and time + else if ( $SKIPANA ) then + set GcmEndDate = $GcmEndEpoch[1] + set GcmEndTime = $GcmEndEpoch[2] + /bin/rm d_rst + mkdrstdate.x $GcmEndDate $GcmEndTime endif set buf = `rst_date d_rst` diff --git a/src/Applications/GEOSdas_App/fvsetup b/src/Applications/GEOSdas_App/fvsetup index 17342508..e06dd36b 100755 --- a/src/Applications/GEOSdas_App/fvsetup +++ b/src/Applications/GEOSdas_App/fvsetup @@ -595,6 +595,7 @@ $ENV{"PATH"} = $FindBin::Bin .":$ENV{PATH}"; . " -expid $expid" . " -fvhome $fvhome" . " -fvroot $fvroot" + . " -nodeflg $nodeflg" . " -res $res"; $cmd .= " -gid $gid" if $gid; print "$cmd\n"; diff --git a/src/Applications/GEOSdas_App/gen_silo_arc.pl b/src/Applications/GEOSdas_App/gen_silo_arc.pl index 032951a9..6d6cd137 100755 --- a/src/Applications/GEOSdas_App/gen_silo_arc.pl +++ b/src/Applications/GEOSdas_App/gen_silo_arc.pl @@ -341,6 +341,7 @@ sub append_other_info { \${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.ana.obs.%y4%m2%d2.ods \${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.ana.obs.%y4%m2%d2_%h2z.ods \${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.prepbufr.%y4%m2%d2.t%h2z.blk +\${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.acft_profl.%y4%m2%d2.t%h2z.bfr \${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.gmao_global_satinfo.%y4%m2%d2_%h2z.txt \${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.gmao_global_ozinfo.%y4%m2%d2_%h2z.txt \${PESTOROOT}%s/obs/Y%y4/M%m2/D%d2/H%h2/%s.sac.nl.%y4%m2%d2_%h2z.txt diff --git a/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl b/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl index bb81c2c1..d33dce9b 100644 --- a/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl +++ b/src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl @@ -49,6 +49,7 @@ BEGIN { } use lib "$fvroot/bin"; use GMAO_utils qw(get_siteID); +use Manipulate_time qw(get_htype token_resolve); use Perl_Config qw(perl_config); use WriteLog qw(chdir_ mkpath_ unlink_ system_); @@ -239,6 +240,7 @@ sub init { $walltime_pf = "2:00:00"; $numnodes_mm = 6; } + $walltime_mm = "1:00:00" if $qos eq "debug"; $walltime_mp = "1:00:00"; $numnodes_mp = 1; @@ -287,7 +289,7 @@ sub fetch_calc_tar_and_clean { my (%opts, $MMWORK, $filestring, $lastFLG); my (@fetchArr, $processflags); my ($max, $label, $num, $job_tarfile, @list); - my ($fileToken, @parts, %ftype, %htype, $ftype, $htype); + my ($fileToken, $fileTemplate, @parts, %ftype, %htype, $ftype, $htype); my (%doFetch, %doTar); # check for existence of work directory @@ -325,10 +327,7 @@ sub fetch_calc_tar_and_clean { # get $htype from $ftype, unless alternate htype value given #----------------------------------------------------------- - unless ($htype) { - if ($ftype =~ /\./) { $htype = $ftype } - else { $htype = (split(/_/, $ftype))[0] } - } + $htype = get_htype($ftype) unless $htype; $ftype{$filestring} = $ftype; $htype{$filestring} = $htype; @@ -351,11 +350,14 @@ sub fetch_calc_tar_and_clean { #------------------------------------- $lastFLG = 0; foreach $filestring (@fetchArr) { + $fileToken = basename($filestring); + $fileTemplate = token_resolve($fileToken, $yyyymm); %opts = (); $opts{"filestring"} = $filestring; $opts{"ftype"} = $ftype{$filestring}; $opts{"htype"} = $htype{$filestring}; + $opts{"fileTemplate"} = $fileTemplate; $opts{"do_dmput"} = 1; $opts{"do_dmput"} = 0 if $doTar{$filestring}; @@ -456,6 +458,7 @@ sub fetch_inputs { $value{"__RUNDIR__"} = $rundir; $value{"__WORKDIR__"} = $workdir; $value{"__DO_DMPUT__"} = $do_dmput; + $value{"__DO_SKIP_CHK__"} = 0; $value{"__DO_TAR__"} = $do_tar; replaceLabels($tmpl, $prefetch_j, %value); @@ -546,6 +549,7 @@ sub calc_monthly_means { $value{"__RUNDIR__"} = $rundir; $value{"__WORKDIR__"} = $workdir; $value{"__DO_DMPUT__"} = $do_dmput; + $value{"__DO_SKIP_CHK__"} = 1; replaceLabels($tmpl, $means_j, %value); @@ -574,7 +578,7 @@ sub calc_monthly_means { # => $lastFLG: flag indicating whether this is last data collection #======================================================================= sub tar_and_clean_inputs { - my (%opts, $filestring, $ftype, $do_tar, $lastFLG); + my (%opts, $filestring, $fileTemplate, $ftype, $do_tar, $lastFLG); my ($tmpl, $tarandclean_j, $jobname, $outfile); my ($job_name, $time, $output, $parFLG, $vFLG); my ($constraint); @@ -583,10 +587,11 @@ sub tar_and_clean_inputs { # input arguments #---------------- %opts = @_; - $filestring = $opts{"filestring"}; - $ftype = $opts{"ftype"}; - $do_tar = $opts{"do_tar"}; - $lastFLG = $opts{"lastFLG"}; + $filestring = $opts{"filestring"}; + $fileTemplate = $opts{"fileTemplate"}; + $ftype = $opts{"ftype"}; + $do_tar = $opts{"do_tar"}; + $lastFLG = $opts{"lastFLG"}; # create tarandclean job script #------------------------------- @@ -621,12 +626,13 @@ sub tar_and_clean_inputs { $value{"__PARTITION__"} = $parFLG; $value{"__CONSTRAINT__"} = $constraint; - $value{"__FILESTRING__"} = $filestring; - $value{"__YYYYMM__"} = $yyyymm; - $value{"__RUNDIR__"} = $rundir; - $value{"__WORKDIR__"} = $workdir; - $value{"__DO_TAR__"} = $do_tar; - $value{"__LASTFLG__"} = $lastFLG; + $value{"__FILESTRING__"} = $filestring; + $value{"__FILETEMPLATE__"} = $fileTemplate; + $value{"__YYYYMM__"} = $yyyymm; + $value{"__RUNDIR__"} = $rundir; + $value{"__WORKDIR__"} = $workdir; + $value{"__DO_TAR__"} = $do_tar; + $value{"__LASTFLG__"} = $lastFLG; replaceLabels($tmpl, $tarandclean_j, %value); @@ -659,7 +665,7 @@ sub archive_monthly_keep_files { # command flags #-------------- - $outfile = "$listdir/$EXPID.KEEParc.$yyyymm.log.$$.txt.FAILED"; + $outfile = "$listdir/$EXPID.KEEParc.$yyyymm.log.$$.txt"; $vars = "arch_type=MKEEP," . "arch_date=$yyyymm," . "outfile=$outfile"; @@ -721,7 +727,7 @@ sub archive_monthly_files { # command flags #-------------- - $outfile = "$listdir/$EXPID.MPParc.$yyyymm.log.$$.txt.FAILED"; + $outfile = "$listdir/$EXPID.MPParc.$yyyymm.log.$$.txt"; $vars = "arch_type=MNTHLY," . "arch_date=$yyyymm," . "outfile=$outfile," diff --git a/src/Applications/GEOSdas_App/monthly_setup.pl b/src/Applications/GEOSdas_App/monthly_setup.pl index 0f570bad..bf91e10a 100755 --- a/src/Applications/GEOSdas_App/monthly_setup.pl +++ b/src/Applications/GEOSdas_App/monthly_setup.pl @@ -54,6 +54,7 @@ #----------------- my ($EXPID, $FVETC, $GID, $numnodes, $scriptname, $siteID, $walltime); my ($rundir, $run_mp_dir, $FVHOME, $FVROOT); +my ($thisnode); # main program #------------- @@ -69,17 +70,18 @@ # purpose - get runtime options; check environment variables #======================================================================= sub init { - my ($res, $hres, $help, %opts); + my ($res, $hres, $help, $nodeflg, %opts); $scriptname = basename($0); $siteID = get_siteID(); - GetOptions( "expid=s" => \$EXPID, - "fvhome=s" => \$FVHOME, - "fvroot=s" => \$FVROOT, - "gid=s" => \$GID, - "res=s" => \$res, - "h" => \$help ); + GetOptions( "expid=s" => \$EXPID, + "fvhome=s" => \$FVHOME, + "fvroot=s" => \$FVROOT, + "gid=s" => \$GID, + "nodeflg=s" => \$nodeflg, + "res=s" => \$res, + "h" => \$help ); usage() if $help; $EXPID = $ENV{"EXPID"} unless $EXPID; @@ -115,6 +117,10 @@ sub init { if ($siteID eq "nccs") { $walltime = "8:00:00" } elsif ($siteID eq "nas") { $walltime = "12:00:00" } + $thisnode = "hasw"; + if ($nodeflg) { + $thisnode = $nodeflg; + } if ($res) { $hres = substr($res, 0, 1) if $res; @@ -174,7 +180,7 @@ sub write_plotfiles { %values = (); $values{"\@PLOT_T"} = "12:00:00"; $values{"\@PLOT_P"} = "SBATCH --nodes=4"; - $values{"\@PLOT_Q"} = "SBATCH --constraint=hasw"; + $values{"\@PLOT_Q"} = "SBATCH --constraint=$thisnode"; $values{"\@BATCH_GROUP"} = "SBATCH --account=$GID"; $values{"\@SITE"} = uc($siteID); $values{"\@GEOSBIN"} = "$FVROOT/bin"; @@ -286,6 +292,7 @@ sub usage { -fvhome fvhomedir FVHOME directory location; defaults to \$ENV{"FVHOME"} -fvroot fvrootdir FVROOT directory location; defaults to \$ENV{"FVROOT"} -gid groupid Group ID; defaults to getsponsor.pl default + -nodeflg Node flag: hasw, sky, cas (default: hasw) -res Horizontal resolution of atmosphere grid EOF exit;