* * map2_2.gs : GrADS wave heigt and mean direction for ww3_tp2.2 * ---------------------------------------------------------------- * Data set with multiple times expected. * Input from ww3.ctl ww3.grads * Scripts used : * colorset.gs : Sets up shading colors * * General set up 'set display color white' 'clear' 'run colorset.gs' gdate="yyyy/mm/dd" '!date -u "+%Y/%m/%d" > tmp_grads_gdate' result = read (tmp_grads_gdate) gdate = sublin(result,2) '!rm -f tmp_grads_gdate' * Get the data, loop through times ... 'open ww3' t = 1 while ( t <= 13 ) 'set t ' t 'query time' gradsdate = subwrd(result,3) test = substr ( gradsdate, 3, 1 ) if ( test='Z' ) year = substr ( gradsdate, 9, 4 ) mnth = substr ( gradsdate, 6, 3 ) day = substr ( gradsdate, 4, 2 ) hour = substr ( gradsdate, 1, 2 ) min = '00' else year = substr ( gradsdate, 12, 4 ) mnth = substr ( gradsdate, 9, 3 ) day = substr ( gradsdate, 7, 2 ) hour = substr ( gradsdate, 1, 2 ) min = substr ( gradsdate, 4, 2 ) endif month= '??' if (mnth='JAN'); month= '01'; endif; if (mnth='FEB'); month= '02'; endif; if (mnth='MAR'); month= '03'; endif; if (mnth='APR'); month= '04'; endif; if (mnth='MAY'); month= '05'; endif; if (mnth='JUN'); month= '06'; endif; if (mnth='JUL'); month= '07'; endif; if (mnth='AUG'); month= '08'; endif; if (mnth='SEP'); month= '09'; endif; if (mnth='OCT'); month= '10'; endif; if (mnth='NOV'); month= '11'; endif; if (mnth='DEC'); month= '12'; endif; vdate = year '/' month '/' day ' ' hour ':' min 'z' * Basic plot set up 'set grads off' 'set lon -5 185' 'set lat -45 45' 'set xlint 10' 'set ylint 10' 'set grid on 3 60' 'set mpdraw off' * 'set parea 1. 7.5 2.5 9.' 'set mproj latlon' * Land sea and ice map 'set gxout grfill' 'set clevs -0.5 0.5' 'set ccols 63 62 0' 'd map' * Plot wave heights 'set gxout shaded' 'set clevs 0.05 0.1 0.15 0.2 0.25 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.25 1.5 2. 3' 'set ccols 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38' 'd hs' 'run cbarn' * Plot mean directions 'set gxout vector' 'set cthick 3' 'set arrscl 0.25' 'set arrlab off' 'set ccolor 0' 'd skip(cos(dir),5);skip(sin(dir),5)' * Text around plot 'set strsiz 0.18' 'set string 1 c 5' 'draw string 5.5 7.7 WAVEWATCH III TEST' 'set strsiz 0.12' 'set string 1 l' 'draw string 0.5 7.3 Propagation test ww3_tp2.2' 'set string 1 r' 'draw string 10.5 7.3 valid ' vdate 'set string 1 c' 'draw string 5.5 1.0 wave height (shaded, m) and mean direction (vector, not scaled)' 'draw string 5.5 7.3 plot generated ' gdate * Print this page and clear 'printim map2_2_'t'.png' 'clear' 'set grads off' t = t + 1 endwhile 'quit' * end of map2_2.gs