plotting windchill with grads

Frank Bandle frank at BANDLE.COM
Fri Jan 26 12:04:19 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

thanks - i solved it. I saw my mistake. It was the wrong function i
was using, a simple problem.

Regards
Frank


Am 26.01.2007 um 17:34 schrieb martynas kazlauskas:

> Hi Frank,
>
> Now if I got that correctly, >>>
>
> 'define wis = (mag(u10,v10)*3.6' should be:
> 'define wis = mag(u10,v10)*3.6',
>
> I hope it's just a typing mistake (consider this is a
> small notice).
>
> And it should work if you use:
>
> pow(expr1,expr2) (Check Grads documentation)
>
> instead of math_pow - (I believe that this may be used
> as well, but requires some extra lines to be added to
> the script)
>
> So, just
>
> 'define wis=pow(wis,0,16)' And replace the "rc" in the
> temperature formula with "wis".
>
> I attach a small script to plot wind chill, so you can
> try to make use of it. Note - this is not a *.gs
> script, it's a part of a shell script, so don't be
> suprised if you see some variables like ${takas3} and
> etc. Modify it if you see some use.
>
> Regards,
> Martynas Kazlauskas
> LHMS
> martynas(at)meteo(dot)lt
>
>
>
>
>
>
>
> --- Frank Bandle <frank at BANDLE.COM> wrote:
>
>> Hi
>>
>> i try to make a windchill-chart. But it´s hard :-)
>> I have all needed parameters defined here in my
>> script, but i got
>> errors by doing things with the
>> grads math functions.
>>
>>
>> -----  snip
>> 'define t3=TMP2m-273.16'
>> 'define u10=UGRD10m'
>> 'define v10=VGRD10m'
>>
>> * // Windspeed in km/h  = (m/s) *3.6
>> * // try with math_pow
>> * // wis = Windspeed in km/h (10m)
>> * // t2 = 13.12 + 0.6215 * T(2m) - 11.37*
>> (wis)pot(0.16) + 0.3965 * T
>> (2m)* (wis)pot(0.16)
>> *
>> 'define wis = (mag(u10,v10)*3.6'
>> rc = math_pow(wis,0.16)
>>
>> t2=13.12 + 0.6215*t3 - 11-37*rc + 0.3965*t3*rc
>>
>> 'set gxout contour'
>> 'd t2'
>> ....
>> ---  snip -----------
>>
>>
>> Error comes up doing math_pow with a data field -
>> here with "wis".
>> If i use a fixed value instead of "wis" - math_pow
>> is working, but
>> this is not helping.
>>
>> Anybody, any ideas.
>> It looks simple, but i cannot see the solution at
>> the moment.
>>
>> Regards and thank you
>>
>> Frank
>>
>>
>>
>> Dipl. Met. Frank Bandle
>> frank at bandle.com * FeMax Wetteragentur IT &
>> Medienberatung
>> www.wetter365.net * www.femax.de
>> ICQ/AIM: f2topcat *Skype: fraban
>> GnuPG/PGP Key-ID: 0x8B8BCC29
>>
>>
>>
>
>
>
>
> ______________________________________________________________________
> ______________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://
> new.mail.yahoo.com####################################################
> #########################
> #Script to plot wind
> chill.                                                 #
> #Note-uses modified version of a colorbar
> cbarm.gs                          #
> #Martynas K.
> 2006-11-09                                                     #
> ######################################################################
> #######
> cat >> ${takas3}./windchill.gs <<EOF
> 'open ${file1}.ctl'
> 'q dims'
> initial=subwrd(result,46)
> _times=getinfo()
> valandos=0
> timestep=1
> while (timestep <= _times)
> 'set datawarn off'
> 'set grads off'
> 'set grid off'
> 'run ${takas3}map.gs 1 1 6'
> 'set t ' timestep
> 'q dims'
> name=subwrd(result,46)
> 'run ${takas3}colorgen.gs'
>
> *Here you calculate the wind chill
>
> 'define temp=0.6215*(t2-273.16)'
> 'define wind=mag(u10,v10)*3.6'
> 'define wp=pow(wind,0.16)'
> 'define chill=13.12+temp-(11.37*wp)+(0.3965*temp*wp)'
>
> * Plotting shaded wind chill, levels -40 to +10, interval 1.
>
> 'set gxout shaded'
> 'run ${takas3}colorgen.gs'
> 'set clevs -40 -39 -38 -37 -36 -35 -34 -33 -32 -31 -30 -29 -28 -27
> -26 -25 -24 -23 -22 -21 -20 -19  -18 -17 -16 -15 -14 -13 -12 -11
> -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10'
> 'set ccols 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56
> 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 55 54 53
> 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37'
> 'd chill'
> 'run ${takas4}cbarm.gs'
>
>
> *Plotting contoured wind chill
>
> 'set gxout contour'
> 'set clevs -40 -38 -36 -34 -32 -30 -28 -26 -24 -22 -20 -18 -16 -14
> -12 -10 -8 -6 -4 -2 0 2 4 6 8 10'
> 'set rgb 17 191 191 191'
> 'set ccols  17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17
> 17 17 17 17 17 17 17 17 17'
> 'set cthick 5'
> 'set cstyle 1'
> 'set clab on'
> 'd chill'
>
>
> *Masking temperatures that are higher than +10 degrees Celcius -
> *Assume that the grey filled areas equal the actual 2 meter
> temperature
> *
> 'define tp=temp'
> 'define tp=temp+40'
> 'define tmp=maskout(temp,tp-50)'
> 'set rbcols 16'
> 'd tmp'
>
> *Masking wind speeds that are lower than 5 km/hr.
> *Assume that the grey filled areas equal the actual 2 meter
> temperature
> *
>
> 'set gxout shaded'
> 'set rbcols 16'
> 'define lowspeed=wind*(-1)'
> 'define lowspeed=lowspeed+150'
> 'define wnd=maskout(wind,lowspeed-145)'
> 'd wnd'
>
>
> * Other stuff, printing, etc...
> *Not related with wind chill directly.
>
>
>
> 'set clopts 1 1 0.1'
> 'run ${takas1}title.gs Windchill 'initial' 'valandos' 'name''
> 'exec ${takas4}regulars. reglon reglat 0 -30'
> 'run ${takas4}platlon reglon reglat 1 1 3 10 10 off'
> 'run ${takas4}ispejimas.gs'
> 'run ${takas1}putmark1.gs 3 0.05'
> 'printim ${takas2}windchill+'valandos'.png white'
> 'clear'
>
> timestep=timestep+1
> valandos=valandos+3
> endwhile
> *funkcija laiko zingsniu skaiciui
> function getinfo()
> "set gxout stat"
> "set stnprint on"
> "q file"
> res=result
> time=sublin(res,5)
> times=subwrd(time,12)
> *say times
> return(times)
> EOF

Dipl. Met. Frank Bandle
frank at bandle.com * FeMax Wetteragentur IT & Medienberatung
www.wetter365.net * www.femax.de


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFujSTMFroz4uLzCkRAukUAKCcpybzgft/ABIGQEXcjK/MmwuZkwCfeA8D
NxU1KF+UAk2ZUJVcOQ449Iw=
=jGJG
-----END PGP SIGNATURE-----



More information about the gradsusr mailing list