-
Notifications
You must be signed in to change notification settings - Fork 9
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 fstats customized for screen-level Q and T with "land only" option #246
Changes from 4 commits
b50c120
9476b6c
cc6d96c
9ca8240
2add96a
e26c21f
3268d4e
14794e6
bd3b303
0fcd85e
93ba5e2
262419d
7b1f1e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/usr/bin/env perl | ||
#======================================================================= | ||
# name - g5fcst_stats.pl | ||
# purpose - script to submit jobs to calculate forecast statistics | ||
# name - g5fcst_stats.pl | ||
# with options of land only and 2d Nx with screen level variables only | ||
# purpose - script to submit jobs to calculate screen level forecast statistics | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The help text here seems wrong. Should it be something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The edit in this comment doesn't seem to be correct. Isn't this the merged script that does the regular atm stats and now also screen-level? |
||
# | ||
# key global variables - | ||
# => $storedir: directory where output files get copied | ||
|
@@ -29,7 +30,11 @@ | |
my ($offset_sec, $pesto, $progdir, $progtype, $secs_per_day, $secs_per_hour); | ||
my ($statsX, $storedir, $tau_freq, $tau_fsec, $vanadir, $vanatype, $vexpid); | ||
my (%opts, @acqIDs, @statsIDs); | ||
my ($landonly, $landonly_dflt); | ||
my ($nxonly, $nxonly_dflt); | ||
|
||
$landonly_dflt = "no"; | ||
$nxonly_dflt = "no" ; | ||
$fhours_dflt = 123; | ||
$localID = $$; | ||
$ncsuffix = ".nc4"; | ||
|
@@ -135,7 +140,11 @@ | |
|
||
if ($ihh eq "00" and $nv == 1) { | ||
$fdir = "$vanadir/Y$nyyyy/M$nmm"; | ||
$fname = "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}${vmn}z"; | ||
if ($nxonly eq "yes") { | ||
$fname = "$vexpid.$vanatype.${vdate}_${vhh}${vmn}z"; | ||
} else { | ||
$fname = "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}${vmn}z"; | ||
} | ||
$ffile0 = "$fdir/$fname$ncsuffix"; | ||
} | ||
else { | ||
|
@@ -167,7 +176,11 @@ | |
push @alist, "$vexpid.$vanatype.${vdate}_${vhh}z+${vdate}_${vhh}${vmn}z"; | ||
} | ||
else { | ||
push @alist, "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}${vmn}z"; | ||
if ($nxonly eq "yes" ) { | ||
push @alist, "$vexpid.$vanatype.${vdate}_${vhh}${vmn}z"; | ||
} else { | ||
push @alist, "$vexpid.$vanatype.inst3d_met_p.${vdate}_${vhh}${vmn}z"; | ||
} | ||
} | ||
|
||
# loop through naming convention options | ||
|
@@ -192,9 +205,12 @@ | |
#---------------------------------------------------- | ||
($vdate, $vtime) = tick($vdate, $vtime, $tau_fsec); | ||
} | ||
|
||
if ($nxonly eq "yes") { | ||
@climfiles = (<$ENV{SHARE}/dao_ops/verification/stats/MERRA-2.inst1_2d_asm_Nx.198501_201412.clim_??z.576x361.data.nc4>); | ||
} else { | ||
@climfiles = (<$ENV{SHARE}/dao_ops/verification/stats/MERRA-2.inst3_3d_asm_Np.198501_201412.clim_??z.576x361.data.nc4>); | ||
#--@climfiles = (<$ENV{SHARE}/dao_ops/verification/stats/merrasc.197901-200812.clim_??z.144x91.data.nc>); | ||
} | ||
$climfilecnt = scalar(@climfiles); | ||
if ($climfilecnt < 4) { | ||
rmtree($fstatswork) if -d $fstatswork; | ||
|
@@ -221,15 +237,23 @@ | |
} | ||
else { | ||
push @fcst_fnames, $ffile0 if $ffile0; | ||
push @fcst_fnames, "$expid.prog.$progtype.${ndate}_${ihh}z+*$ncsuffix"; | ||
push @ana_fnames, "$vexpid.asm.inst3d_met_p.*$ncsuffix"; | ||
push @fcst_fnames, "$expid.prog.$progtype.${ndate}_${ihh}z+*$ncsuffix"; | ||
if ($nxonly eq "yes" ) { | ||
push @ana_fnames, "$vexpid.$vanatype.*$ncsuffix"; | ||
} else { | ||
push @ana_fnames, "$vexpid.asm.inst3d_met_p.*$ncsuffix"; | ||
} | ||
} | ||
} | ||
else { | ||
push @fcst_fnames, $ffile0 if $ffile0; | ||
push @fcst_fnames, "$expid.prog.$progtype.${ndate}_${ihh}z+*$ncsuffix"; | ||
push @ana_fnames, "$vexpid.asm.inst3d_met_p.*$ncsuffix"; | ||
push @ana_fnames, "$vexpid.ana.inst3d_met_p.*$ncsuffix"; | ||
if ($nxonly eq "yes" ) { | ||
push @ana_fnames, "$vexpid.$vanatype.*$ncsuffix" | ||
} else { | ||
push @ana_fnames, "$vexpid.asm.inst3d_met_p.*$ncsuffix"; | ||
push @ana_fnames, "$vexpid.ana.inst3d_met_p.*$ncsuffix"; | ||
} | ||
} | ||
@fcstlist = sort keys %fcsthash; | ||
@vanalist = sort keys %vanahash; | ||
|
@@ -282,6 +306,8 @@ | |
$args{"vhh0"} = $vhh0; | ||
$args{"vhh1"} = $vhh1; | ||
$args{"nodes"} = $nodes; | ||
$args{"landonly"} = $landonly; | ||
$args{"nxonly"} = $nxonly; | ||
|
||
# submit job to calculate stats | ||
#------------------------------ | ||
|
@@ -344,6 +370,10 @@ sub init { | |
|
||
"nodes=s" => \$nodes, | ||
|
||
"landonly=s" => \$landonly, | ||
|
||
"nxonly=s" => \$nxonly, | ||
|
||
"das" => \$dasFLG, | ||
"np" => \$noprompt, | ||
|
||
|
@@ -359,7 +389,17 @@ sub init { | |
$expid = shift @ARGV; | ||
$idate = shift @ARGV; | ||
$ndays = shift @ARGV; | ||
|
||
|
||
# landonly option | ||
#---------------- | ||
$landonly = $landonly_dflt unless $landonly; | ||
|
||
#nxonly option | ||
#-------------- | ||
$nxonly = $nxonly_dflt unless $nxonly; | ||
#print ("nxonly option: $nxonly\n"); | ||
#print ("landonly option: $nxonly\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines should probably be deleted. (The commented-out "landonly" print statement isn't right anyway.) |
||
|
||
# initial fcst hour and offset | ||
#----------------------------- | ||
unless ($ihh) { | ||
|
@@ -536,7 +576,11 @@ sub init { | |
# find stats.rc | ||
#-------------- | ||
$fv_etcdir = dirname($Bin) ."/etc"; | ||
die "Error. Cannot find $fv_etcdir/stats.rc" unless -e "$fv_etcdir/stats.rc"; | ||
if ($nxonly eq "yes" ) { | ||
die "Error. Cannot find $fv_etcdir/statsNx.rc" unless -e "$fv_etcdir/statsNx.rc"; | ||
} else { | ||
die "Error. Cannot find $fv_etcdir/stats.rc" unless -e "$fv_etcdir/stats.rc"; | ||
} | ||
} | ||
|
||
#======================================================================= | ||
|
@@ -636,11 +680,14 @@ sub submit_calcjob { | |
my (@rmfilelist, $yyyy, $mm, $dd); | ||
my ($logdir, $logfile1, $logfile2, $jobname, $jobdate, $jobfile, $jobtype); | ||
my ($cmd, $jobID, $jobIDline); | ||
my (@levs, @levels_19, @levels_11); | ||
my (@levs, @levels_19, @levels_11, @levels_1); | ||
my ($mynodes,$usrnodes); | ||
my ($qos, $partition); | ||
my ($ntspn, $npn); | ||
|
||
my ($landonly, $landmaskdirfile); | ||
my ($nxonly); | ||
my ($whichrc); | ||
|
||
@levels_19 = ( 1000.0, 975.0, 950.0, 925.0, | ||
900.0, 850.0, 800.0, 750.0, | ||
700.0, 600.0, 500.0, 400.0, | ||
|
@@ -651,6 +698,8 @@ sub submit_calcjob { | |
500.0, 400.0, 300.0, 250.0, | ||
200.0, 150.0, 100.0 ); | ||
|
||
@levels_1 = ( 1000.0 ) ; | ||
|
||
if ($vexpid eq "ecmwf") { @levs = @levels_11 } | ||
else { @levs = @levels_19 } | ||
|
||
|
@@ -668,6 +717,18 @@ sub submit_calcjob { | |
$vdate1 = $args{"vdate1"}; | ||
$vhh1 = $args{"vhh1"}; | ||
$usrnodes = $args{"nodes"}; | ||
$landonly = $args{"landonly"}; | ||
$nxonly = $args{"nxonly"}; | ||
if ($landonly eq "yes") { $landmaskdirfile = "$jobdir/landmaskfile.nc4"} | ||
print "nxonly: $nxonly\n"; | ||
print "landonly: $landonly\n"; | ||
|
||
$whichrc = "stats.rc"; | ||
if ($nxonly eq "yes") { | ||
@levs = @levels_1; | ||
$whichrc = "statsNx.rc"; | ||
print "whichrc: $whichrc\n"; | ||
} | ||
|
||
foreach (@fcstlist, @vanalist) { push @rmfilelist, basename($_) }; | ||
|
||
|
@@ -736,12 +797,24 @@ sub submit_calcjob { | |
-cli @climfiles \\ | ||
-tag $expid.${ihh}z \\ | ||
-nfreq ${tau_freq}0000 \\ | ||
EOF | ||
if ( $landonly eq "yes" ) { | ||
print FH <<"EOF"; | ||
-land ${landmaskdirfile} \\ | ||
EOF | ||
} | ||
|
||
print FH <<"EOF"; | ||
-levs @levs \\ | ||
-o $expid.fstats.log.$jobdate.txt \\ | ||
-verif gmao \\ | ||
-fcsrc gmao \\ | ||
-fhour $fhours \\ | ||
-rc $fv_etcdir/stats.rc | ||
-rc $fv_etcdir/$whichrc | ||
EOF | ||
|
||
print FH <<"EOF"; | ||
|
||
@ calc_status = \$status | ||
|
||
$pesto -arc $arcfile \\ | ||
|
@@ -940,7 +1013,8 @@ sub verify_values { | |
print "progdir: $progdir\n"; | ||
print "progtype: $progtype\n"; | ||
print "fs_tag: $fs_tag\n\n"; | ||
|
||
print "landonly: $landonly\n\n"; | ||
print "nxonly: $nxonly\n\n"; | ||
print "dryrun: $dryrun\n\n" if $dryrun; | ||
|
||
$ans = query("Continue (y/n):", "y"); | ||
|
@@ -986,6 +1060,12 @@ sub usage { | |
[dirname(\$FVHOME) or \$NOBACKUP] | ||
-noarchive do not archive outputs [archives by default] | ||
|
||
-landonly calculate stats only over land surface (yes/no) | ||
[no by default] | ||
|
||
-nxonly calculate stats of 2d Nx collection only (yes/no) | ||
[no by default] | ||
|
||
-nodes nodesname specify nodes (e.g., sky, hasw, or cas) | ||
-das check for DAS hidden files before attempting to fetch files | ||
and set no prompt; requires \$FVHOME environment variable; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you also need to remove "statsNx" here and below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMakelists is just updated . we still keep statsNx.rc .