9
9
# David Wright Org: University of Michigan
10
10
#
11
11
# Instructions: Make sure all the necessary modules can be imported.
12
- # Seven command line arguments are needed:
12
+ # The following command line arguments are needed:
13
13
# 1. Cycle date/time in YYYYMMDDHH format
14
14
# 2. Starting forecast hour
15
15
# 3. Ending forecast hour
29
29
# CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp
30
30
# -More information regarding files needed to setup
31
31
# display maps in Cartopy, see SRW App Users' Guide
32
+ # 8. POST_OUTPUT_DOMAIN_NAME: Name of native domain
33
+ # used in forecasts and in constructing the names
34
+ # of the post output files. This must be the same
35
+ # for both forecasts.
32
36
#
33
- # To create plots for forecast hours 20-24 from 5/7 00Z
34
- # cycle with hourly output:
37
+ # To create difference plots for two forecasts on the
38
+ # RRFS_CONUS_25km grid for hours 20-24 from the 5/7
39
+ # 00Z cycle with hourly output:
35
40
# python plot_allvars_diff.py 2020050700 20 24 1 \
36
41
# /path/to/expt_dir_1 /path/to/expt_dir_2 \
37
- # /path/to/base/cartopy/maps
42
+ # /path/to/base/cartopy/maps RRFS_CONUS_25km
38
43
#
39
44
# The variable domains in this script can be set to either
40
45
# 'conus' for a CONUS map or 'regional' where the map
@@ -231,6 +236,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False):
231
236
parser .add_argument ("Path to experiment 1 directory" )
232
237
parser .add_argument ("Path to experiment 2 directory" )
233
238
parser .add_argument ("Path to base directory of cartopy shapefiles" )
239
+ parser .add_argument ("Name of native domain used in forecasts (and in constructing post file names)" )
234
240
args = parser .parse_args ()
235
241
236
242
# Read date/time, forecast hour, and directory paths from command line
@@ -257,6 +263,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False):
257
263
EXPT_DIR_1 = str (sys .argv [5 ])
258
264
EXPT_DIR_2 = str (sys .argv [6 ])
259
265
CARTOPY_DIR = str (sys .argv [7 ])
266
+ POST_OUTPUT_DOMAIN_NAME = str (sys .argv [8 ]).lower ()
260
267
261
268
# Loop over forecast hours
262
269
for fhr in fhours :
@@ -267,8 +274,8 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False):
267
274
268
275
269
276
# Define the location of the input files
270
- data1 = pygrib .open (EXPT_DIR_1 + '/' + ymdh + '/postprd/rrfs.t' + cyc + 'z.prslevf ' + fhour + '.tm00 .grib2' )
271
- data2 = pygrib .open (EXPT_DIR_2 + '/' + ymdh + '/postprd/rrfs.t' + cyc + 'z.prslevf ' + fhour + '.tm00 .grib2' )
277
+ data1 = pygrib .open (EXPT_DIR_1 + '/' + ymdh + '/postprd/rrfs.t' + cyc + 'z.prslev.f ' + fhour + '.' + POST_OUTPUT_DOMAIN_NAME + ' .grib2' )
278
+ data2 = pygrib .open (EXPT_DIR_2 + '/' + ymdh + '/postprd/rrfs.t' + cyc + 'z.prslev.f ' + fhour + '.' + POST_OUTPUT_DOMAIN_NAME + ' .grib2' )
272
279
273
280
# Get the lats and lons
274
281
grids = [data1 , data2 ]
0 commit comments