-
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
Merged
+358
−17
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b50c120
addtional fstats customized for screen-level Q and T
saraqzhang 9476b6c
add install g5fcst_statsNx.pl to BIN
saraqzhang cc6d96c
merge statsNx.F90 to stats.F90
saraqzhang 9ca8240
merge modifications for screen level variable stats
saraqzhang 2add96a
modification of comments
saraqzhang e26c21f
remove statsNx script and code
saraqzhang 3268d4e
remove statsNx from installation in CMakeLists
saraqzhang 14794e6
add exit & error message if landmask file not found (landonly…
saraqzhang bd3b303
Merge branch 'main' into feature/saraqzhang/fstats2mQT
saraqzhang 0fcd85e
Merge branch 'main' into feature/saraqzhang/fstats2mQT
sdrabenh 93ba5e2
add MAPL_Const in stats.F90, and comment line edits
saraqzhang 262419d
Merge branch 'feature/saraqzhang/fstats2mQT' of github.com:GEOS-ESM/G…
saraqzhang 7b1f1e0
update CHANGELOG.md
saraqzhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env perl | ||
#======================================================================= | ||
# name - g5fcst_stats.pl | ||
# purpose - script to submit jobs to calculate forecast statistics | ||
# name - g5fcst_stats.pl | ||
# 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 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 +29,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 +139,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 +175,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 +204,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 +236,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 +305,8 @@ | |
$args{"vhh0"} = $vhh0; | ||
$args{"vhh1"} = $vhh1; | ||
$args{"nodes"} = $nodes; | ||
$args{"landonly"} = $landonly; | ||
$args{"nxonly"} = $nxonly; | ||
|
||
# submit job to calculate stats | ||
#------------------------------ | ||
|
@@ -344,6 +369,10 @@ sub init { | |
|
||
"nodes=s" => \$nodes, | ||
|
||
"landonly=s" => \$landonly, | ||
|
||
"nxonly=s" => \$nxonly, | ||
|
||
"das" => \$dasFLG, | ||
"np" => \$noprompt, | ||
|
||
|
@@ -359,7 +388,15 @@ 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; | ||
|
||
# initial fcst hour and offset | ||
#----------------------------- | ||
unless ($ihh) { | ||
|
@@ -536,7 +573,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 +677,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 +695,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 +714,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 +794,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 +1010,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 +1057,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; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 .