Hello first of all i am new to the forum i was not sure where to start but i have installed openGrads on my windows 10 but keeps failing to load what i am trying to do is get the Australia weather charts so i can upload them to my website can someone please help me out keep getting errors
Welcome to the forum.
It might help if you could tell us:
- What fails to load? Do you get the error When opening OpenGrads or when running an OG script or when an OG script tries to load data?
- What the error(s) say.
Hi Chris this is the error i am getting
Starting X server under C:\OPENGR~1.2\Contents\Resources\Xming Starting OPENGR~1 under C:\OPENGR~1.2\Contents\Cygwin\Versions\221OGA~1.1\i686 ...Grid Analysis and Display System (GrADS) Version 2.2.1.oga.1
Copyright (C) 1988-2018 by George Mason University
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more informationConfig: v2.2.1.oga.1 little-endian readline grib2 netcdf hdf4-sds hdf5 opendap-grids,stn athena geotiff shapefile
Issue ‘q config’ and ‘q gxconfig’ commands for more detailed configuration information
Loading User Defined Extensions table </cygdrive/c/OPENGR~1.2/Contents/Cygwin/Versions/221OGA~1.1/i686/gex/udxt> … ok.
Landscape mode? (‘n’ for portrait):
GX Package Initialization: Size = 11 8.5
Command line history in \Users\Michael/.grads.log
ga-> Run C:\OpenGrADS-2.2\Contents\Cygwin\Versions\2.2.1.oga.1\i686\Tasman_prec_0.25_gsfv16.gs
Non-numeric args to numeric operation
Error occurred on line 18
In file C:\OpenGrADS-2.2\Contents\Cygwin\Versions\2.2.1.oga.1\i686\Tasman_prec_0.25_gsfv16.gs
ga-> C:\OpenGrADS-2.2\Contents\Cygwin\Versions\2.2.1.oga.1\i686\Tasman_prec_0.25_gsfv16.gs
Non-numeric args to numeric operation
Error occurred on line 18
In file C:\OpenGrADS-2.2\Contents\Cygwin\Versions\2.2.1.oga.1\i686\Tasman_prec_0.25_gsfv16.gs
ga->
but i trying to get the Australia Map mike
function main( args )
base= 'nomads.ncep.noaa.gov/dods'
*base= 'nomads6.ncdc.noaa.gov:9090/dods'
*base= 'nomad5.ncep.noaa.gov:9090/dods/nomad1-raid1'
*base= 'nomad3.ncep.noaa.gov:9090/dods'
*base= 'monsoondata.org:9090/dods'
date= subwrd( args, 1 )
hour= subwrd( args, 2 )
valid= subwrd( args, 3 )
year= substr( date, 1, 4 )
mon= substr( date, 6, 2 )
day= substr( date, 9, 2 )
date= year mon day
hour= substr( hour, 1, 2 )
offs= valid / 3
if ( valid < 100 ); if ( valid < 10 ); valid= '0' valid; endif; valid= '0' valid; endif
'reinit'
'set display color white'
'c'
'set rgb 16 128 128 128'
'set rgb 17 64 64 64'
'set rgb 66 0 0 0'
*drizzle scattered showers 0-2 light blue
'set rgb 18 238 250 250'
'set rgb 19 214 244 244'
'set rgb 20 163 244 244'
'set rgb 21 112 244 244'
'set rgb 22 50 244 244'
*showers to patchy rain 3-6 light green
'set rgb 23 145 253 57'
'set rgb 24 38 255 9'
'set rgb 25 1 235 1'
'set rgb 26 4 184 4'
*light rain to steady rain 8 - 15 blue to blonde
'set rgb 27 118 170 248'
'set rgb 28 64 139 252'
'set rgb 29 25 63 255'
'set rgb 30 249 233 101'
*light rain 18 to 23 blonde to brown
'set rgb 31 252 255 25'
'set rgb 32 231 190 1'
'set rgb 33 171 142 5'
*heavy rain levels 26 red to pink
'set rgb 34 253 62 53'
'set rgb 35 255 34 23'
'set rgb 36 250 88 248'
'set rgb 37 255 7 211'
*rain to heavy rain 18-35 pink cont to purple
'set rgb 38 231 1 222'
'set rgb 39 178 59 253'
'set rgb 40 147 1 235'
'set rgb 41 96 7 153'
'set rgb 100 249 215 2'
*Jet stream colors
'set rgb 154 255 255 255 0'
'set rgb 155 255 7 211 20'
'set rgb 156 240 7 200 60'
'set rgb 157 220 7 170 100'
'sdfopen https://' base '/gfs_0p25/gfs' date '/gfs_0p25_' hour 'z'
if ( rc ); return; endif
valid = valid -1
count = 1
While (count <82)
'set t ' count
'set lat -65 -13'
'set lon 125 220'
'set grads off'
'set grid off'
'set xlab on'
'set parea 0.2 10.8 0.2 8.2'
'set frame on'
'set cstyle 3'
'set mpdset hires'
'set mpt 17 0 1 5'
'set mproj sps'
'set mpvals 150 195 -57 -24'
'set cterp off'
if t > 1
'set gxout shaded'
'define precip = const(pratesfc,0,-u) * 3600 * 3'
'set clevs 0 .5 1 1.5 2 3 4 5 6 8 10 12 15 18 20 23 26 30 35 40 50 70 100'
'set ccols 0 18 19 20 21 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41'
'set cterp on'
'set csmooth on'
'set clab on'
'set ccolor 15'
'set clevs 0 .5 1 1.5 2 3 4 5 6 8 10 12 15 18 20 23 26 30 35 40 50 70 100'
'd precip'
endif
'define mslp = msletmsl / 100'
'set gxout contour'
'set csmooth on'
'set clab masked'
'set cterp on'
'set cint 2'
'set ccolor 66'
'd mslp'
'set gxout contour'
'define frzlevel = tmpsig995 - 273.15'
'set clevs 0 3'
'set ccols 9 7'
'd frzlevel'
'define h500 = hgtprs(lev=500)/10'
'define h1000 = hgtprs(lev=1000)/10'
'define thk = h500 - h1000'
'set gxout contour'
'set clevs 540'
'set ccolor 9'
'set clab forced'
'set cthick 5'
'd thk'
* Jetstream visualisation
'set gxout shade2b'
'set lev 200'
'set clevs 120 180 220 350'
'set ccols 154 155 156 157'
'd mag(ugrdprs * 3.6,vgrdprs * 3.6)'
***************************** stream lines
'set gxout contour'
'set ccolor 9'
'set cstyle 3'
'set cthick 3'
'set cint 20'
'set clab masked'
'define upperair = (h500 - h1000)*10'
'd upperair'
'set string 1 bc 6'
'set strsiz .12 .14'
* Format of q time result 00Z02JAN1987 ... Fri
'q time'
daystr = subwrd(result, 6)
timestr = subwrd(result, 3)
hourstr = substr(timestr, 1, 2)
datenum = substr(timestr, 4, 2)
monstr = substr(timestr, 6, 3)
yearnum = substr(timestr, 9, 4)
* create numeric hour
if substr(hourstr, 1, 1) = "0"
hournum = substr(hourstr, 2, 1)
else
hournum = hourstr
endif
if substr(datenum, 1, 1) = 0
datenum = substr(datenum, 2, 1)
endif
* adjust time add 12hrs to get NZ std time
hournum = hournum + 12
* convert hour str to 12hr time
if hournum >= 24 & hournum <= 33
* new day
datenum = datenum + 1
* increase date
maxday = monthdays( monstr)
daystr = datetrans( daystr)
* change day string
endif
if monstr = "DEC" & maxday < datenum
* new year
yearnum = yearnum + 1
endif
if maxday < datenum
*New month
nxtmonth = nextmonth( monstr)
monstr = nxtmonth
datenum = datenum - maxday
endif
if hournum > 24
hournz = hournum - 24
hourstr = '0'hournz ':00AM'
endif
if hournum = 12
hourstr = hournum ':00PM'
endif
if hournum > 12 & hournum < 23
hournz = hournum - 12
hourstr = '0'hournz ':00PM'
endif
if hournum = 24
hournz = hournum - 12
hourstr = hournz ':00AM'
endif
* code work around for 2021 correcting daystr error
if yearnum = "2021"
daystr = daystring( monstr, datenum)
endif
'set strsiz 0.12 0.12'
'set string 1 bc 6'
'draw string 7.5 8.2 'hourstr%' '%daystr%' '%datenum%' '%monstr%' '%yearnum
'set strsiz 0.09 0.09'
'draw string 3.8 8.2 3hr Precipitation NZ , Valid +' valid 'hr '
'set string 1 bl 5'
'set strsiz .0.09 .0.09'
'draw string 10 8.3 mm'
pathn='C:\Users\Public\Server\Tasman\'
filen='swp_prec.' year '-' mon '-' day '.' hour 'z+' valid '.png'
'gxprint 'pathn%filen' x975 y753'
count = count + 1
valid = valid + 3
'c'
endwhile
************************************************************FUNCTIONS
function datetrans( daystr)
daystr = subwrd( daystr, 1)
if daystr = "Mon"
nxtday = "Tue"
endif
if daystr = "Tue"
nxtday = "Wed"
endif
if daystr = "Wed"
nxtday = "Thu"
endif
if daystr = "Thu"
nxtday = "Fri"
endif
if daystr = "Fri"
nxtday = "Sat"
endif
if daystr = "Sat"
nxtday = "Sun"
endif
if daystr = "Sun"
nxtday = "Mon"
endif
daystr = nxtday
return daystr
******************************************************
function monthdays( monstr)
monthis = subwrd( monstr, 1 )
if monthis = 'JAN'
maxday = 31
endif
if monthis = 'FEB'
maxday = 29
endif
if monthis = 'MAR'
maxday = 31
endif
if monthis = 'APR'
maxday = 30
endif
if monthis = "MAY"
maxday = 31
endif
if monthis = JUN
maxday = 30
endif
if monthis = JUL
maxday = 31
endif
if monthis = AUG
maxday = 31
endif
if monthis = SEP
maxday = 30
endif
if monthis = OCT
maxday = 31
endif
if monthis = NOV
maxday = 30
endif
if monthis = DEC
maxday = 31
endif
return maxday
**********************************************************
function nextmonth( monstr)
monthis = subwrd( monstr, 1)
if monthis = 'JAN'
nextmon = 'FEB'
endif
if monthis = 'FEB'
nextmon = 'MAR'
endif
if monthis = 'MAR'
nextmon = 'APR'
endif
if monthis = 'APR'
nextmon = 'MAY'
endif
if monthis = "MAY"
nextmon = "JUN"
endif
if monthis = JUN
nextmon = JUL
endif
if monthis = JUL
nextmon = AUG
endif
if monthis = AUG
nextmon = SEP
endif
if monthis = SEP
nextmon = OCT
endif
if monthis = OCT
nextmon = NOV
endif
if monthis = NOV
nextmon = DEC
endif
if monthis = DEC
nextmon = JAN
endif
return nextmon
***********************************************
function daystring( monstr, datenum)
monname = subwrd (monstr,1)
daynum = subwrd (datenum,1)
if (monname = JAN)
cposition = 5
endif
if (monname = FEB)
cposition = 1
endif
if (monname = MAR)
cposition = 1
endif
if (monname = APR)
cposition = 4
endif
if (monname = MAY)
cposition = 6
endif
if (monname = JUN)
cposition = 2
endif
if (monname = JUL)
cposition = 4
endif
if (monname = AUG)
cposition = 7
endif
if (monname = SEP)
cposition = 3
endif
if (monname = OCT)
cposition = 5
endif
if (monname = NOV)
cposition = 1
endif
if (monname = DEC)
cposition = 3
endif
while (daynum > 1)
cposition = cposition + 1
** end array correction
if cposition > 7
cposition = 1
endif
daynum = daynum - 1
endwhile
* Calculate the day name
dayarray = 'MON TUE WED THU FRI SAT SUN ????'
dayname = subwrd(dayarray,cposition)
return dayname