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

update GSI for GEOS-IT config; minor script adjustments merging 5.27.… #150

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 19 additions & 2 deletions src/Applications/GEOSdas_App/GEOSdas.csm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions src/Applications/GEOSdas_App/fvsetup
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/Applications/GEOSdas_App/gen_silo_arc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 24 additions & 18 deletions src/Applications/GEOSdas_App/monthly.yyyymm.pl.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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_);

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand All @@ -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
#-------------------------------
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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,"
Expand Down
23 changes: 15 additions & 8 deletions src/Applications/GEOSdas_App/monthly_setup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#-----------------
my ($EXPID, $FVETC, $GID, $numnodes, $scriptname, $siteID, $walltime);
my ($rundir, $run_mp_dir, $FVHOME, $FVROOT);
my ($thisnode);

# main program
#-------------
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down