[gradsusr] Q Time

Chorley Weather weatherstu at chorleyweather.com
Wed Jul 29 11:56:40 EDT 2015


On 29-07-2015 14:09, Bill Reilly wrote:
> Stuart:
> 
> You can put this anywhere you want in your code, but it must be after
> you've opened the data file and before you need to acces the variables
> (dayofweek, day, etc.).
> 
> Regards,
> 
> Bill
> 
> --
> 
> Bill Reilly
> (+34) 686-110-748
> 
> bill at passageweather.com
> www.passageweather.com
> 
> bill at brwebworks.com
> www.brwebworks.com
> 
> On 7/29/2015 2:54 PM, Chorley Weather wrote:
>> On 29-07-2015 12:12, Bill Reilly wrote:
>>> Stuart:
>>> 
>>> 'q time'
>>> dayofweek = subwrd(result,8)
>>> day = substr(result, 11,2)
>>> month = substr(result, 13,3)
>>> year = substr(result, 16,4)
>>> hour = substr(result,8,2)
>>> 
>>> I hope this helps.
>>> 
>>> Bill
>>> 
>>> --
>>> 
>>> Bill Reilly
>>> (+34) 686-110-748
>>> 
>>> bill at passageweather.com
>>> www.passageweather.com
>>> 
>>> bill at brwebworks.com
>>> www.brwebworks.com
>>> 
>>> On 7/29/2015 12:05 PM, Chorley Weather wrote:
>>>> Hi Guys,
>>>> 
>>>> I have been trying to add the day of the week to my output which is
>>>> currently as such Valid: 06z05AUG2015 I have tried using a Q time 
>>>> code
>>>> but I cant seem to get it working. I have attached a scrip, so if
>>>> anybody can help I would be eternally grateful. There is probably an
>>>> easy solution but I have not managed to work this out.
>>>> 
>>>> Regards,
>>>> Stuart.
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> gradsusr mailing list
>>>> gradsusr at gradsusr.org
>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>> 
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>> Thanks for the Reply Bill, I have this code but the question is, where
>> in the script should I place it and should i remove any of the 
>> original
>> script to make room so to speak!!!
>> 
>> Regards,
>> Stuart.
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
Hi Bill,

This I have tried before but i think i need to adjust the code to allow 
the day of the week to show, just don't know how to manage it. My script 
is below, if you can see anything that stand out and need changing then 
I would be grateful for any advice. I'm rather new to grads so learning 
as I go I'm afraid!!!

function main(args)

* Parse the arguments: date, hour
   if (args = '')
   prompt 'Enter forecast date (example, 20110717) --> '
   pull date
   prompt 'Enter forecast hour (example, 00 or 06 or 12 or 18) --> '
   pull hour
   else
   date = subwrd(args,1)
   hour  = subwrd(args,2)
   endif

'reinit'
'sdfopen 
http://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs'date'/gfs_0p25_'hour'z'


'q time'
dayofweek = subwrd(result,8)
day = substr(result, 11,2)
month = substr(result, 13,3)
year = substr(result, 16,4)
hour = substr(result,8,2)

* Get info from the descriptor file
'q ctlinfo'
_ctl = result
_undef = getctl(undef)
_tdef = getctl(tdef)
_zdef = getctl(zdef)

maps = 82

* Get the Time axis info


'q time'
dayofweek = subwrd(result,8)
day = substr(result, 11,2)
month = substr(result, 13,3)
year = substr(result, 16,4)
hour = substr(result,8,2)
tsize = subwrd(_tdef,2)

_t1 = 1       ;* 2nd half of timeseries
_t2 = 45
tsize = _t2 - _t1 + 1
'set t '_t1' '_t2
'q dims'
times  = sublin(result,5)
_time1 = subwrd(times,6)
_time2 = subwrd(times,8)
_tdim = _time1' '_time2

tincr = subwrd(_tdef,5)
_tdef = 'tdef 'tsize' linear '_time1' 'tincr

huh = subwrd(_tdef,4)




****************************************
* CLOUD COVER
****************************************

   i = 3
   while ( i<maps )

* Set up a few preliminary characteristics
setmap(1)
setSMcols(1)

'set t 'i

*'define dew  = const((dewpt(tmp2m,rh2m)-273.16),0,-u)'
'set gxout shaded'
'set csmooth on'
'set clevs 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100'
'set ccols 0 63 62 61 60 59 58 57 56 55 54 53 52 51 50 47 46 45 44 43 42 
41 17 39 38 37 36 35 34 33'

'd tcdcclm'

'set gxout contour'

'set ccolor 16'
'set cint 10'
'set clopts 1'
*'d dew'

'cbar'

'define slp  = const((prmslmsl*0.01),0,-u)'

setstucols(1)
'set gxout contour'
'set csmooth on'
'set cthick 6'
'set cint 4'
'set clopts 1'
'set clab masked'
'set clevs 930 940 950 955 960 965 970 975 980 985 990 995 1000 1004 
1008 1012 1016 1020 1024 1028 1032 1036 1040 1045 1050'
'set ccols 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58  26 26 26 26 
26 26 26 26 26 26 26'


'd slp'


'q dims'
times  = sublin(result,5)
hub = subwrd(times,6)





'set strsiz 0.16'
'set string 1 r 6 90' ; 'draw string 9.5 5.0 Cloud Cover'
'set string 2 r 6 0' ; 'draw string 9.27 0.6 Valid: 'hub
'set string 1 l 6 0' ; 'draw string 0.25 0.6 GFS Run: 'huh

* Draw Labels at the top of the page
'set string 1 r 11 0'
'set strsiz 0.14'
'set string 9 l 6 0' ; 'draw string 0.30 1.0 chorleyweather.com (c)'



'printim gfs_ukcloudcover'i'.png x1100 y'675

i = i+1
endwhile

Regards,
Stuart.
-- 
Chief Forecaster & Owner


More information about the gradsusr mailing list