function main(arg) datum=subwrd(arg,1) * datum form is yymmdd (190124) 'sdfopen 20'datum'00_3H_DREAM8-ICELAND_AOD.nc' 'sdfopen 20'datum'00_3H_DREAM8-ICELAND_U10.nc' 'sdfopen 20'datum'00_3H_DREAM8-ICELAND_V10.nc' 'set display color white' 'set gxout shaded' 'c' 'set grads off' 'set mpdset hires' 'set mproj nps' 'set mpvals -34 -6 55.8 70' *----- determine forecast start date ------ 'set t 1' 'q time' time=sublin(result,1) print 'time' time stime=subwrd(time,3) print 'stime 'stime days=substr(stime,4,2) months=substr(stime,6,3) years=substr(stime,9,4) ihrs=substr(stime,1,2) fmt = '%02.0f' ihrs= math_format(fmt,ihrs) start=days''months''years' 'ihrs'UTC' *------------------------------------ *time loop for 72 hours ahed it=14 *while(it<26) while(it<15) hh=(it-1)*3 fmt = '%02.0f' hh = math_format(fmt,hh) 'c' 'set grads off' 'set z 1' print it 'set t 'it *----- determine forecast valid date -------- 'q time' time=sublin(result,1) ztime=subwrd(time,3) vmonth=substr(ztime,6,3) vday=substr(ztime,4,2) vyear=substr(ztime,9,4) vihr=substr(ztime,1,2) fmt = '%02.0f' vihr = math_format(fmt,vihr) if (vmonth = 'JAN') ; vcm='01' ; endif if (vmonth = 'FEB') ; vcm='02' ; endif if (vmonth = 'MAR') ; vcm='03' ; endif if (vmonth = 'APR') ; vcm='04' ; endif if (vmonth = 'MAR') ; vcm='05' ; endif if (vmonth = 'JUN') ; vcm='06' ; endif if (vmonth = 'JUL') ; vcm='07' ; endif if (vmonth = 'AUG') ; vcm='08' ; endif if (vmonth = 'SEP') ; vcm='09' ; endif if (vmonth = 'OCT') ; vcm='10' ; endif if (vmonth = 'NOV') ; vcm='11' ; endif if (vmonth = 'DEC') ; vcm='12' ; endif valid=vday''vmonth''vyear' 'vihr'UTC' * valid day month year and hour * vday vmonth vyear vihr * hh hours since forecast start print 'valid date 'valid *------------------------------------ title1='DREAM8-Iceland: Dust Aerosol Optical Depth [AOD] and 10m wind (m/s)' 'set clab forced' 'set gxout shaded' 'set clopts 1 1 0.25' 'run WF_sds.gs' 'set clevs 0.01 0.05 0.1 0.15 0.2 0.4 0.6 0.8 1' 'd OD550_DUST' 'set ccolor 15' 'set arrscl 0.5 20' 'set arrlab off' 'd skip(u10.2,6,6);v10.3' 'set strsiz 0.12 0.13' 'set string 1 bl 5' 'q gxinfo' xline=sublin(result,3) yline=sublin(result,4) rec3 = sublin(result,3) rec4 = sublin(result,4) xlb=subwrd(xline,4) ylb=subwrd(yline,4) xur=subwrd(xline,6) yur=subwrd(yline,6) rec3 = sublin(result,3) rec4 = sublin(result,4) title2='Forecast base time: 'start' Valid time: 'valid ' (+'hh')' 'draw string 'xlb' 'yur+0.3' 'title1 'draw string 'xlb' 'yur+0.1' 'title2 * draw SEEVCCC logo and 20 m/s wind vector legend 'run bwfulllogo_bojan.gs 'xlb' 'ylb-0.33' 1.35' ylo = subwrd(yline,4)-0.55 ymx=ylo+0.07 xlo = subwrd(xline,4) xmx = subwrd(xline,6) fh=0.1 fw=0.1 'xcbar 'xlo' 'xmx' 'ylo' 'ymx' -fh 'fh' -fw 'fw rc=arrow(xlo+7.3,ylo+0.4,0.5,20) 'set line 1 1 1' 'print q.eps' '!convert -rotate 90 -density 300x400 +antialias -flatten q.eps p.gif' '!convert p.gif -resize 40% +antialias q.gif' * if you need some other name of the image you can use variables from above * vday vmonth vyear vihr hh '!cp q.gif AOD_'hh'.gif' '!rm -v q.eps' '!rm -v p.gif' it=it+1 endwhile 'close 3' 'close 2' 'close 1' 'quit' function arrow(x,y,len,scale) 'set line 1 1 4' 'draw line 'x-len/2.' 'y' 'x+len/2.' 'y 'draw line 'x+len/2.-0.05' 'y+0.025' 'x+len/2.' 'y 'draw line 'x+len/2.-0.05' 'y-0.025' 'x+len/2.' 'y 'set string 1 c' 'set strsiz 0.1' 'draw string 'x' 'y-0.1' 'scale return