From 05b559809a8cdf691c37ede114d2618e1ac1851b Mon Sep 17 00:00:00 2001 From: jwolff-ncar Date: Tue, 23 Mar 2021 14:17:30 -0600 Subject: [PATCH] Updating develop branch with updates from the release branch (#457) * Updating develop branch with updates from the release branch mostly focused on python plotting but also including the license. * Changed named of post file read in to account for additional 00 (min placeholder) * Removed 00 to account for subhourly data as that will be handled separately --- LICENSE.md | 21 ++++++++++++ ush/Python/plot_allvars.py | 43 ++++++++++++++----------- ush/Python/plot_allvars_diff.py | 57 ++++++++++++++++++--------------- ush/Python/qsub_job.sh | 50 +++++++++++++++++++++++++++++ ush/Python/qsub_job_diff.sh | 54 +++++++++++++++++++++++++++++++ ush/Python/sq_job.sh | 11 ++++--- ush/Python/sq_job_diff.sh | 12 ++++--- 7 files changed, 193 insertions(+), 55 deletions(-) create mode 100644 LICENSE.md create mode 100755 ush/Python/qsub_job.sh create mode 100755 ush/Python/qsub_job_diff.sh diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000..3ae879af33 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +## Overview + +The regional_workflow code incorporated in the Unified Forecast System (UFS) was jointly developed by the National Oceanic and Atmospheric Administration (NOAA), Cooperative Institute for Research in the Atmosphere (CIRA), Cooperative Institute for Research in Environmental Sciences (CIRES), University Corporation for Atmospheric Research (UCAR), and I. M. Systems Group (IMSG). + +As a work of the United States Government, this project is in the public domain within the United States. +NOAA (IMSG by assignment), CIRA, CIRES, and UCAR waive copyright and related rights in the work worldwide through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). + +## CC0 1.0 Universal Summary + +This is a human-readable summary of the [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode). + +## No copyright + +The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. + +## Other information +In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights. Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. When using or citing the work, you should not imply endorsement by the author or the affirmer. + +## Contributions to this project +All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest. + diff --git a/ush/Python/plot_allvars.py b/ush/Python/plot_allvars.py index 626b941abb..3c12f58901 100755 --- a/ush/Python/plot_allvars.py +++ b/ush/Python/plot_allvars.py @@ -1,6 +1,6 @@ ################################################################################ #### Python Script Documentation Block -# +# # Script name: plot_allvars.py # Script description: Generates plots from FV3-LAM post processed grib2 output # over the CONUS @@ -9,7 +9,7 @@ # David Wright Org: University of Michigan # # Instructions: Make sure all the necessary modules can be imported. -# Five command line arguments are needed: +# Six command line arguments are needed: # 1. Cycle date/time in YYYYMMDDHH format # 2. Starting forecast hour # 3. Ending forecast hour @@ -27,11 +27,11 @@ # -More information regarding files needed to setup # display maps in Cartopy, see SRW App Users' Guide # -# To create plots for forecast hours 20-24 from 5/7 00Z +# To create plots for forecast hours 20-24 from 5/7 00Z # cycle with hourly output: # python plot_allvars.py 2020050700 20 24 1 \ # /path/to/expt_dirs/experiment/name \ -# /path/to/base/cartopy/maps +# /path/to/base/cartopy/maps # # The variable domains in this script can be set to either # 'conus' for a CONUS map or 'regional' where the map @@ -228,7 +228,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): parser.add_argument("Path to experiment directory") parser.add_argument("Path to base directory of cartopy shapefiles") args = parser.parse_args() - + # Read date/time, forecast hour, and directory paths from command line ymdh = str(sys.argv[1]) ymd = ymdh[0:8] @@ -312,7 +312,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): print(Lon0) # Specify plotting domains -# User can add domains here, just need to specify lat/lon information below +# User can add domains here, just need to specify lat/lon information below # (if dom == 'conus' block) domains=['conus'] # Other option is 'regional' @@ -368,7 +368,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): qpf = data1.select(name='Total Precipitation',lengthOfTimeRange=fhr)[0].values * 0.0393701 # Composite reflectivity - refc = data1.select(name='Maximum/Composite radar reflectivity')[0].values + refc = data1.select(name='Maximum/Composite radar reflectivity')[0].values if (fhr > 0): # Max/Min Hourly 2-5 km Updraft Helicity @@ -391,8 +391,13 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): def main(): # Number of processes must coincide with the number of domains to plot - pool = multiprocessing.Pool(len(domains)) - pool.map(plot_all,domains) + #pool = multiprocessing.Pool(len(domains)) + #pool.map(plot_all,domains) + + # To avoid import multiprocessing recursively on MacOS etc. + # Anyway since we only have one domain for SRW application + for dom in domains: + plot_all(dom) def plot_all(dom): @@ -401,7 +406,7 @@ def plot_all(dom): # Map corners for each domain if dom == 'conus': llcrnrlon = -120.5 - llcrnrlat = 21.0 + llcrnrlat = 21.0 urcrnrlon = -64.5 urcrnrlat = 49.0 lat_0 = 35.4 @@ -421,7 +426,7 @@ def plot_all(dom): fig = plt.figure(figsize=(10,10)) ax1 = fig.add_axes([0.1,0.1,0.8,0.8]) - # Define where Cartopy Maps are located + # Define where Cartopy Maps are located cartopy.config['data_dir'] = CARTOPY_DIR back_res='50m' @@ -455,7 +460,7 @@ def plot_all(dom): linewidth=fline_wd,alpha=falpha) # All lat lons are earth relative, so setup the associated projection correct for that data - transform = ccrs.PlateCarree() + transform = ccrs.PlateCarree() # high-resolution background images if back_img=='on': @@ -484,7 +489,7 @@ def plot_all(dom): cm = plt.cm.Spectral_r norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) - cs1_a = plt.pcolormesh(lon_shift,lat_shift,slp,transform=transform,cmap=cm,norm=norm) + cs1_a = plt.pcolormesh(lon_shift,lat_shift,slp,transform=transform,cmap=cm,norm=norm) cbar1 = plt.colorbar(cs1_a,orientation='horizontal',pad=0.05,shrink=0.6,extend='both') cbar1.set_label(units,fontsize=8) cbar1.ax.tick_params(labelsize=8) @@ -583,7 +588,7 @@ def plot_all(dom): cbar1.ax.tick_params(labelsize=8) plt.barbs(lon_shift[::skip,::skip],lat_shift[::skip,::skip],uwind[::skip,::skip],vwind[::skip,::skip],length=barblength,linewidth=0.5,color='black',transform=transform) ax.text(.5,1.03,'FV3-LAM 10-m Winds ('+units+') \n initialized: '+itime+' valid: '+vtime + ' (f'+fhour+')',horizontalalignment='center',fontsize=8,transform=ax.transAxes,bbox=dict(facecolor='white',alpha=0.85,boxstyle='square,pad=0.2')) - + compress_and_save(EXPT_DIR+'/'+ymdh+'/postprd/10mwind_'+dom+'_f'+fhour+'.png') t2 = time.perf_counter() t3 = round(t2-t1, 3) @@ -603,13 +608,13 @@ def plot_all(dom): units = 'J/kg' clevs = [100,250,500,1000,1500,2000,2500,3000,3500,4000,4500,5000] clevs2 = [-2000,-500,-250,-100,-25] - colorlist = ['blue','dodgerblue','cyan','mediumspringgreen','#FAFAD2','#EEEE00','#EEC900','darkorange','crimson','darkred'] + colorlist = ['blue','dodgerblue','cyan','mediumspringgreen','#FAFAD2','#EEEE00','#EEC900','darkorange','crimson','darkred','darkviolet'] cm = matplotlib.colors.ListedColormap(colorlist) norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) cs_1 = plt.pcolormesh(lon_shift,lat_shift,cape,transform=transform,cmap=cm,vmin=100,norm=norm) cs_1.cmap.set_under('white',alpha=0.) - cs_1.cmap.set_over('darkviolet') + cs_1.cmap.set_over('black') cbar1 = plt.colorbar(cs_1,orientation='horizontal',pad=0.05,shrink=0.6,ticks=clevs,extend='max') cbar1.set_label(units,fontsize=8) cbar1.ax.tick_params(labelsize=8) @@ -706,7 +711,7 @@ def plot_all(dom): units = 'in' clevs = [0.01,0.1,0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.5,3,4,5,7,10,15,20] clevsdif = [-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3] - colorlist = ['chartreuse','limegreen','green','blue','dodgerblue','deepskyblue','cyan','mediumpurple','mediumorchid','darkmagenta','darkred','crimson','orangered','darkorange','goldenrod','gold','yellow'] + colorlist = ['chartreuse','limegreen','green','blue','dodgerblue','deepskyblue','cyan','mediumpurple','mediumorchid','darkmagenta','darkred','crimson','orangered','darkorange','goldenrod','gold','yellow'] cm = matplotlib.colors.ListedColormap(colorlist) norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) @@ -740,7 +745,7 @@ def plot_all(dom): colorlist = ['turquoise','dodgerblue','mediumblue','lime','limegreen','green','#EEEE00','#EEC900','darkorange','red','firebrick','darkred','fuchsia'] cm = matplotlib.colors.ListedColormap(colorlist) norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) - + cs_1 = plt.pcolormesh(lon_shift,lat_shift,refc,transform=transform,cmap=cm,vmin=5,norm=norm) cs_1.cmap.set_under('white',alpha=0.) cs_1.cmap.set_over('black') @@ -758,7 +763,7 @@ def plot_all(dom): ################################# # Plot Max/Min Hourly 2-5 km UH ################################# - if (fhr > 0): # Do not make max/min hourly 2-5 km UH plot for forecast hour 0 + if (fhr > 0): # Do not make max/min hourly 2-5 km UH plot for forecast hour 0 t1 = time.perf_counter() print(('Working on Max/Min Hourly 2-5 km UH for '+dom)) diff --git a/ush/Python/plot_allvars_diff.py b/ush/Python/plot_allvars_diff.py index a44a147e9c..ae0d718c6b 100755 --- a/ush/Python/plot_allvars_diff.py +++ b/ush/Python/plot_allvars_diff.py @@ -1,8 +1,8 @@ ################################################################################ #### Python Script Documentation Block -# +# # Script name: plot_allvars_diff.py -# Script description: Generates difference plots from FV3-LAM post processed +# Script description: Generates difference plots from FV3-LAM post processed # grib2 output over the CONUS # # Authors: Ben Blake Org: NOAA/NWS/NCEP/EMC Date: 2020-08-24 @@ -30,11 +30,11 @@ # -More information regarding files needed to setup # display maps in Cartopy, see SRW App Users' Guide # -# To create plots for forecast hours 20-24 from 5/7 00Z +# To create plots for forecast hours 20-24 from 5/7 00Z # cycle with hourly output: -# python plot_allvars_diff.py 2020050700 20 24 1 \ +# python plot_allvars_diff.py 2020050700 20 24 1 \ # /path/to/expt_dir_1 /path/to/expt_dir_2 \ -# /path/to/base/cartopy/maps +# /path/to/base/cartopy/maps # # The variable domains in this script can be set to either # 'conus' for a CONUS map or 'regional' where the map @@ -232,7 +232,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): parser.add_argument("Path to experiment 2 directory") parser.add_argument("Path to base directory of cartopy shapefiles") args = parser.parse_args() - + # Read date/time, forecast hour, and directory paths from command line ymdh = str(sys.argv[1]) ymd = ymdh[0:8] @@ -323,7 +323,7 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): print(Lon0) # Specify plotting domains -# User can add domains here, just need to specify lat/lon information below +# User can add domains here, just need to specify lat/lon information below # (if dom == 'conus' block) domains=['conus'] # Other option is 'regional' @@ -413,8 +413,8 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): qpf_diff = qpf_2 - qpf_1 # Composite reflectivity - refc_1 = data1.select(name='Maximum/Composite radar reflectivity')[0].values - refc_2 = data2.select(name='Maximum/Composite radar reflectivity')[0].values + refc_1 = data1.select(name='Maximum/Composite radar reflectivity')[0].values + refc_2 = data2.select(name='Maximum/Composite radar reflectivity')[0].values if (fhr > 0): # Max/Min Hourly 2-5 km Updraft Helicity @@ -442,9 +442,14 @@ def rotate_wind(true_lat,lov_lon,earth_lons,uin,vin,proj,inverse=False): def main(): - # Number of processes must coincide with the number of domains to plot - pool = multiprocessing.Pool(len(domains)) - pool.map(plot_all,domains) + # Number of processes must coincide with the number of domains to plot + #pool = multiprocessing.Pool(len(domains)) + #pool.map(plot_all,domains) + + # To avoid import multiprocessing recursively on MacOS/Windows etc. + # Anyway since we only have one domain for SRW application + for dom in domains: + plot_all(dom) def plot_all(dom): @@ -453,7 +458,7 @@ def plot_all(dom): # Map corners for each domain if dom == 'conus': llcrnrlon = -120.5 - llcrnrlat = 21.0 + llcrnrlat = 21.0 urcrnrlon = -64.5 urcrnrlat = 49.0 lat_0 = 35.4 @@ -473,7 +478,7 @@ def plot_all(dom): fig = plt.figure(figsize=(10,10)) gs = GridSpec(9,9,wspace=0.0,hspace=0.0) - # Define where Cartopy Maps are located + # Define where Cartopy Maps are located cartopy.config['data_dir'] = CARTOPY_DIR back_res='50m' @@ -511,7 +516,7 @@ def plot_all(dom): linewidth=fline_wd,alpha=falpha) # All lat lons are earth relative, so setup the associated projection correct for that data - transform = ccrs.PlateCarree() + transform = ccrs.PlateCarree() # high-resolution background images if back_img=='on': @@ -557,7 +562,7 @@ def plot_all(dom): norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) normdiff = matplotlib.colors.BoundaryNorm(clevsdiff, cmdiff.N) - cs1_a = ax1.pcolormesh(lon_shift,lat_shift,slp_1,transform=transform,cmap=cm,norm=norm) + cs1_a = ax1.pcolormesh(lon_shift,lat_shift,slp_1,transform=transform,cmap=cm,norm=norm) cbar1 = plt.colorbar(cs1_a,ax=ax1,orientation='horizontal',pad=0.05,shrink=0.6,extend='both') cbar1.set_label(units,fontsize=6) cbar1.ax.tick_params(labelsize=5) @@ -565,7 +570,7 @@ def plot_all(dom): plt.clabel(cs1_b,np.arange(940,1060,4),inline=1,fmt='%d',fontsize=6) ax1.text(.5,1.03,'FV3-LAM SLP ('+units+') \n initialized: '+itime+' valid: '+vtime + ' (f'+fhour+')',horizontalalignment='center',fontsize=8,transform=ax1.transAxes,bbox=dict(facecolor='white',alpha=0.85,boxstyle='square,pad=0.2')) - cs2_a = ax2.pcolormesh(lon2_shift,lat2_shift,slp_2,transform=transform,cmap=cm,norm=norm) + cs2_a = ax2.pcolormesh(lon2_shift,lat2_shift,slp_2,transform=transform,cmap=cm,norm=norm) cbar2 = plt.colorbar(cs2_a,ax=ax2,orientation='horizontal',pad=0.05,shrink=0.6,extend='both') cbar2.set_label(units,fontsize=6) cbar2.ax.tick_params(labelsize=5) @@ -738,7 +743,7 @@ def plot_all(dom): cbar3.set_label(units,fontsize=6) cbar3.ax.tick_params(labelsize=6) ax3.text(.5,1.03,'FV3-LAM-2 - FV3-LAM 10-m Winds ('+units+') \n initialized: '+itime+' valid: '+vtime+' (f'+fhour+')',horizontalalignment='center',fontsize=6,transform=ax3.transAxes,bbox=dict(facecolor='white',alpha=0.85,boxstyle='square,pad=0.2')) - + compress_and_save(EXPT_DIR_1+'/'+ymdh+'/postprd/10mwind_diff_'+dom+'_f'+fhour+'.png') t2 = time.perf_counter() t3 = round(t2-t1, 3) @@ -763,14 +768,14 @@ def plot_all(dom): clevs = [100,250,500,1000,1500,2000,2500,3000,3500,4000,4500,5000] clevs2 = [-2000,-500,-250,-100,-25] clevsdiff = [-2000,-1500,-1000,-500,-250,-100,0,100,250,500,1000,1500,2000] - colorlist = ['blue','dodgerblue','cyan','mediumspringgreen','#FAFAD2','#EEEE00','#EEC900','darkorange','crimson','darkred'] + colorlist = ['blue','dodgerblue','cyan','mediumspringgreen','#FAFAD2','#EEEE00','#EEC900','darkorange','crimson','darkred','darkviolet'] cm = matplotlib.colors.ListedColormap(colorlist) norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) normdiff = matplotlib.colors.BoundaryNorm(clevsdiff, cmdiff.N) cs_1 = ax1.pcolormesh(lon_shift,lat_shift,cape_1,transform=transform,cmap=cm,vmin=100,norm=norm) cs_1.cmap.set_under('white',alpha=0.) - cs_1.cmap.set_over('darkviolet') + cs_1.cmap.set_over('black') cbar1 = plt.colorbar(cs_1,ax=ax1,orientation='horizontal',pad=0.05,shrink=0.6,ticks=clevs,extend='max') cbar1.set_label(units,fontsize=6) cbar1.ax.tick_params(labelsize=4) @@ -779,7 +784,7 @@ def plot_all(dom): cs_2 = ax2.pcolormesh(lon2_shift,lat2_shift,cape_2,transform=transform,cmap=cm,vmin=100,norm=norm) cs_2.cmap.set_under('white',alpha=0.) - cs_2.cmap.set_over('darkviolet') + cs_2.cmap.set_over('black') cbar2 = plt.colorbar(cs_2,ax=ax2,orientation='horizontal',pad=0.05,shrink=0.6,ticks=clevs,extend='max') cbar2.set_label(units,fontsize=6) cbar2.ax.tick_params(labelsize=4) @@ -816,7 +821,7 @@ def plot_all(dom): units = 'x10${^5}$ s${^{-1}}$' skip = round(177.28*(dx/1000.)**-.97) - print('skipping every '+str(skip)+' grid points to plot') + print('skipping every '+str(skip)+' grid points to plot') barblength = 4 vortlevs = [16,20,24,28,32,36,40] @@ -878,7 +883,7 @@ def plot_all(dom): units = 'kts' skip = round(177.28*(dx/1000.)**-.97) - print('skipping every '+str(skip)+' grid points to plot') + print('skipping every '+str(skip)+' grid points to plot') barblength = 4 clevs = [50,60,70,80,90,100,110,120,130,140,150] @@ -938,7 +943,7 @@ def plot_all(dom): units = 'in' clevs = [0.01,0.1,0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.5,3,4,5,7,10,15,20] clevsdiff = [-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3] - colorlist = ['chartreuse','limegreen','green','blue','dodgerblue','deepskyblue','cyan','mediumpurple','mediumorchid','darkmagenta','darkred','crimson','orangered','darkorange','goldenrod','gold','yellow'] + colorlist = ['chartreuse','limegreen','green','blue','dodgerblue','deepskyblue','cyan','mediumpurple','mediumorchid','darkmagenta','darkred','crimson','orangered','darkorange','goldenrod','gold','yellow'] cm = matplotlib.colors.ListedColormap(colorlist) norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) normdiff = matplotlib.colors.BoundaryNorm(clevsdiff, cmdiff.N) @@ -978,7 +983,7 @@ def plot_all(dom): ################################# # Plot Max/Min Hourly 2-5 km UH ################################# -# Do not make max/min hourly 2-5 km UH plot for forecast hour 0 +# Do not make max/min hourly 2-5 km UH plot for forecast hour 0 t1 = time.perf_counter() print(('Working on Max/Min Hourly 2-5 km UH for '+dom)) @@ -1050,7 +1055,7 @@ def plot_all(dom): colorlist = ['turquoise','dodgerblue','mediumblue','lime','limegreen','green','#EEEE00','#EEC900','darkorange','red','firebrick','darkred','fuchsia'] cm = matplotlib.colors.ListedColormap(colorlist) norm = matplotlib.colors.BoundaryNorm(clevs, cm.N) - + cs_1 = ax1.pcolormesh(lon_shift,lat_shift,refc_1,transform=transform,cmap=cm,vmin=5,norm=norm) cs_1.cmap.set_under('white',alpha=0.) cs_1.cmap.set_over('black') diff --git a/ush/Python/qsub_job.sh b/ush/Python/qsub_job.sh new file mode 100755 index 0000000000..25e8814189 --- /dev/null +++ b/ush/Python/qsub_job.sh @@ -0,0 +1,50 @@ +#!/bin/sh +#PBS -A an_account +#PBS -q regular +#PBS -l select=1:mpiprocs=24:ncpus=24 +#PBS -l walltime=00:20:00 +#PBS -N plot_allvars +#PBS -j oe -o plot_allvars.out + +# Prior to submitting the script the following environment variables +# must be set using export or setenv +# HOMErrfs=/path-to/ufs-srweather-app/regional_workflow +# EXPTDIR=/path-to/expt_dirs/your_experiment + +cd ${HOMErrfs}/ush/Python +set -x + +source /etc/profile.d/modules.sh + +############ +# Python environment for Cheyenne +############ +ncar_pylib /glade/p/ral/jntp/UFS_SRW_app/ncar_pylib/python_graphics + +############ +# Path to shape files +############ +#Cheyenne: +SHAPE_FILES=/glade/p/ral/jntp/UFS_SRW_app/tools/NaturalEarth + +export GLOBAL_VAR_DEFNS_FP="${EXPTDIR}/var_defns.sh" +source ${GLOBAL_VAR_DEFNS_FP} +export CDATE=${DATE_FIRST_CYCL}${CYCL_HRS} +export FCST_START=3 +export FCST_END=${FCST_LEN_HRS} +export FCST_INC=3 + +# Usage statement: Make sure all the necessary modules can be imported. +# Five command line arguments are needed: +# 1. Cycle date/time in YYYYMMDDHH format +# 2. Starting forecast hour in HHH format +# 3. Ending forecast hour in HHH format +# 4. Forecast hour increment +# 5. EXPT_DIR: Experiment directory +# -Postprocessed data should be found in the directory: +# EXPT_DIR/YYYYMMDDHH/postprd/ +# 6. CARTOPY_DIR: Base directory of cartopy shapefiles +# -File structure should be: +# CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp + +python plot_allvars.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} ${EXPTDIR} ${SHAPE_FILES} diff --git a/ush/Python/qsub_job_diff.sh b/ush/Python/qsub_job_diff.sh new file mode 100755 index 0000000000..e0a6383863 --- /dev/null +++ b/ush/Python/qsub_job_diff.sh @@ -0,0 +1,54 @@ +#!/bin/sh +#PBS -A an_account +#PBS -q regular +#PBS -l select=1:mpiprocs=24:ncpus=24 +#PBS -l walltime=00:30:00 +#PBS -N plot_allvars_diff +#PBS -j oe -o plot_allvars_diff.out + +# Prior to submitting the script the following environment variables +# must be set using export or setenv +# HOMErrfs=/path-to/ufs-srweather-app/regional_workflow +# EXPTDIR1=/path-to/expt_dirs/your_experiment1 +# EXPTDIR2=/path-to/expt_dirs/your_experiment2 + +cd ${HOMErrfs}/ush/Python +set -x + +source /etc/profile.d/modules.sh + +############ +# Python environment for Cheyenne +############ +ncar_pylib /glade/p/ral/jntp/UFS_SRW_app/ncar_pylib/python_graphics + +############ +# Path to shape files +############ +#Cheyenne: +SHAPE_FILES=/glade/p/ral/jntp/UFS_SRW_app/tools/NaturalEarth + +export GLOBAL_VAR_DEFNS_FP="${EXPTDIR}/var_defns.sh" +source ${GLOBAL_VAR_DEFNS_FP} +export CDATE=${DATE_FIRST_CYCL}${CYCL_HRS} +export FCST_START=3 +export FCST_END=${FCST_LEN_HRS} +export FCST_INC=3 + +# Usage statement: Make sure all the necessary modules can be imported. +# Seven command line arguments are needed: +# 1. Cycle date/time in YYYYMMDDHH format +# 2. Starting forecast hour in HHH format +# 3. Ending forecast hour in HHH format +# 4. Forecast hour increment +# 5. EXPT_DIR_1: Experiment 1 directory +# -Postprocessed data should be found in the directory: +# EXPT_DIR_1/YYYYMMDDHH/postprd/ +# 6. EXPT_DIR_2: Experiment 2 directory +# -Postprocessed data should be found in the directory: +# EXPT_DIR_2/YYYYMMDDHH/postprd/ +# 7. CARTOPY_DIR: Base directory of cartopy shapefiles +# -File structure should be: +# CARTOPY_DIR/shapefiles/natural_earth/cultural/*.shp + +python plot_allvars_diff.py ${CDATE} ${FCST_START} ${FCST_END} ${FCST_INC} ${EXPTDIR1} ${EXPTDIR2} ${SHAPE_FILES} diff --git a/ush/Python/sq_job.sh b/ush/Python/sq_job.sh index ec8317ebb9..1c594efd46 100755 --- a/ush/Python/sq_job.sh +++ b/ush/Python/sq_job.sh @@ -35,19 +35,20 @@ conda activate pygraf ############ # Python environment for Gaea ############ -#module use -a /apps/contrib/miniconda3-noaa-gsl/modulefiles -#module load miniconda3 -#conda activate pygraf +#module use /lustre/f2/pdata/esrl/gsd/contrib/modulefiles +#module load miniconda3/4.8.3-regional-workflow ############ # Path to shape files ############ #Hera: -SHAPE_FILES=/scratch2/NCEPDEV/fv3-cam/Chan-hoo.Jeon/tools/NaturalEarth +SHAPE_FILES=/scratch2/BMC/det/UFS_SRW_app/v1p0/fix_files/NaturalEarth #Jet: +#SHAPE_FILES=/lfs4/BMC/wrfruc/FV3-LAM/NaturalEarth #Orion: -#SHAPE_FILES=/home/chjeon/tools/NaturalEarth +#SHAPE_FILES=/work/noaa/gsd-fv3-dev/UFS_SRW_App/v1p0/fix_files/NaturalEarth #Gaea: +#SHAPE_FILES=/lustre/f2/pdata/esrl/gsd/ufs/NaturalEarth export GLOBAL_VAR_DEFNS_FP="${EXPTDIR}/var_defns.sh" source ${GLOBAL_VAR_DEFNS_FP} diff --git a/ush/Python/sq_job_diff.sh b/ush/Python/sq_job_diff.sh index 9c49a7a1a7..84143ffd86 100755 --- a/ush/Python/sq_job_diff.sh +++ b/ush/Python/sq_job_diff.sh @@ -22,6 +22,7 @@ module load hpss ############ # Python environment for Jet and Hera +############ module use -a /contrib/miniconda3/modulefiles module load miniconda3 conda activate pygraf @@ -36,19 +37,20 @@ conda activate pygraf ############ # Python environment for Gaea ############ -#module use -a /apps/contrib/miniconda3-noaa-gsl/modulefiles -#module load miniconda3 -#conda activate pygraf +#module use /lustre/f2/pdata/esrl/gsd/contrib/modulefiles +#module load miniconda3/4.8.3-regional-workflow ############ # Path to shape files ############ #Hera: -SHAPE_FILES=/scratch2/NCEPDEV/fv3-cam/Chan-hoo.Jeon/tools/NaturalEarth +SHAPE_FILES=/scratch2/BMC/det/UFS_SRW_app/v1p0/fix_files/NaturalEarth #Jet: +#SHAPE_FILES=/lfs4/BMC/wrfruc/FV3-LAM/NaturalEarth #Orion: -#SHAPE_FILES=/home/chjeon/tools/NaturalEarth +#SHAPE_FILES=/work/noaa/gsd-fv3-dev/UFS_SRW_App/v1p0/fix_files/NaturalEarth #Gaea: +#SHAPE_FILES=/lustre/f2/pdata/esrl/gsd/ufs/NaturalEarth export GLOBAL_VAR_DEFNS_FP="${EXPTDIR}/var_defns.sh" source ${GLOBAL_VAR_DEFNS_FP}