Hi,

I'm trying to plot point snowfall accumulation values based on locations I define in a script. The script I use is a heavily modified Leins script, and the formula for plotting the point values is based on a previous posting to this list in regards to plotting point temperatures. I was hoping I could use this in plotting accumulated snowfall point values.

Here is part of my script to show what I'm doing:

########## Accumulated Snow Total ##########

######

###### Uses 10:1 liquid to snow ratio ######

##

## *** I M P O R T A N T ***

## must accumulate snow total via a loop, as the

## WRF 3.7.1.x no longer outputs snow totals directly

##

say 'starting accumulated snowfall production'

'set grads off'

'set gxout shaded'

#'snow_total_color.gs'

'snow100.gs'

if (count >= 1)

'define snowtotal=sum(ASNOWsfc.1, t=1, t='dis_t-freq')'

else

'define snowtotal=0'

endif

'd snowtotal'

# Plot point snowfall accumulation

# Pittsburgh

***First query to get x,y from lat/lon:

lon = -79.99

lat = 40.44

'q w2xy 'lon' 'lat

x = subwrd(result,3)

y = subwrd(result,6)

***Second query to get snow accumulation at i,j rather than x,y:

'q w2gr 'lon' 'lat

x2 = subwrd(result,3)

y2 = subwrd(result,6)

if (count2 >= 1)

'define snowtotal2=sum(ASNOWsfc.1, t=1, t='dis_t-freq')'

else

'define snowtotal2=0'

endif

'd snowtotal2'

***Query (defval) value of snow accum at i,j

'q defval snowtotal2 'x2' 'y2

snowaccum = subwrd(result,3)

**Round snowfall accum value:

snowaccum = math_nint(snowaccum)

'draw string 'x' 'y' 'snowaccum

#

# Plot every 5 for color bar

'run cbarnskip.gs 5 0.75 1'

The map looks like this, however the point snowfall accumulated value is not being displayed for Pittsburgh.

http://www.goldenhorseshoewx.ca/images2 ... 27_syn.png

## Plot Accumulated Snow Points on Snowfall Map

### Re: Plot Accumulated Snow Points on Snowfall Map

I now have the accumulated snowfall points now plotting on my map.

This is the code snippet:

########## Accumulated Snow Total ##########

######

###### Uses 10:1 liquid to snow ratio ######

##

## *** I M P O R T A N T ***

## must accumulate snow total via a loop, as the

## WRF 3.7.1.x no longer outputs snow totals directly

##

say 'starting accumulated snowfall production'

'set grads off'

'set gxout shaded'

'define snowtotal=sum(ASNOWsfc, t=1, t='dis_t')'

'snow100.gs'

'd snowtotal'

# Beginning of point plots of snow accumulation values

'set strsiz 0.08'

'set string 1 c 6'

# Hamilton

***First query to get x,y from lat/lon:

lon = -79.93

lat = 43.17

'q w2xy 'lon' 'lat

x = subwrd(result,3)

y = subwrd(result,6)

***Second query to get temp at i,j rather than x,y:

'q w2gr 'lon' 'lat

x2 = subwrd(result,3)

y2 = subwrd(result,6)

# Don't need to define a parameter here... As some do.

***Query (defval) value of snowfall at i,j

'q defval snowtotal 'x2' 'y2

snowa2 = subwrd(result,3)

**Round snowfall value:

snowa2 = math_nint(snowa2)

'draw string 'x' 'y' 'snowa2

#

# London

***First query to get x,y from lat/lon:

lon = -81.15

lat = 43.03

'q w2xy 'lon' 'lat

x = subwrd(result,3)

y = subwrd(result,6)

***Second query to get temp at i,j rather than x,y:

'q w2gr 'lon' 'lat

x2 = subwrd(result,3)

y2 = subwrd(result,6)

# Don't need to define a parameter here... As some do.

***Query (defval) value of snowfall at i,j

'q defval snowtotal 'x2' 'y2

snowa2 = subwrd(result,3)

**Round snowfall value:

snowa2 = math_nint(snowa2)

'draw string 'x' 'y' 'snowa2

#

(Here, one would add the cbarnskip in order to plot the colorbar.

This is the code snippet:

########## Accumulated Snow Total ##########

######

###### Uses 10:1 liquid to snow ratio ######

##

## *** I M P O R T A N T ***

## must accumulate snow total via a loop, as the

## WRF 3.7.1.x no longer outputs snow totals directly

##

say 'starting accumulated snowfall production'

'set grads off'

'set gxout shaded'

'define snowtotal=sum(ASNOWsfc, t=1, t='dis_t')'

'snow100.gs'

'd snowtotal'

# Beginning of point plots of snow accumulation values

'set strsiz 0.08'

'set string 1 c 6'

# Hamilton

***First query to get x,y from lat/lon:

lon = -79.93

lat = 43.17

'q w2xy 'lon' 'lat

x = subwrd(result,3)

y = subwrd(result,6)

***Second query to get temp at i,j rather than x,y:

'q w2gr 'lon' 'lat

x2 = subwrd(result,3)

y2 = subwrd(result,6)

# Don't need to define a parameter here... As some do.

***Query (defval) value of snowfall at i,j

'q defval snowtotal 'x2' 'y2

snowa2 = subwrd(result,3)

**Round snowfall value:

snowa2 = math_nint(snowa2)

'draw string 'x' 'y' 'snowa2

#

# London

***First query to get x,y from lat/lon:

lon = -81.15

lat = 43.03

'q w2xy 'lon' 'lat

x = subwrd(result,3)

y = subwrd(result,6)

***Second query to get temp at i,j rather than x,y:

'q w2gr 'lon' 'lat

x2 = subwrd(result,3)

y2 = subwrd(result,6)

# Don't need to define a parameter here... As some do.

***Query (defval) value of snowfall at i,j

'q defval snowtotal 'x2' 'y2

snowa2 = subwrd(result,3)

**Round snowfall value:

snowa2 = math_nint(snowa2)

'draw string 'x' 'y' 'snowa2

#

(Here, one would add the cbarnskip in order to plot the colorbar.

### Who is online

Users browsing this forum: No registered users and 3 guests