'open imergl.ctl'
'set display color white'
'clear'
'environ_shaded.ch'
'set grads off'
'set poli on'
'set mpdset hires'
'run rgbset.gs'
'set map 1 1 11'
'set lat LATLL LATUR'
'set lon LONLL LONUR'
'set xlint XLINT'
'set ylint YLINT'
*'set parea 0 10 0 15'

count=1
'sumprecip = 0.5*prate'
while (count < MAXLOOP)
count=count+1
sat 'count = 'count
'set t ' count
'tempprecip = sumprecip'
'sumprecip = tempprecip + 0.5*prate'
endwhile

'set grads off'
'set gxout shaded'
'set clevs CLEVS'
'set ccols CCOLS'
'd sumprecip'
'run cbar.gs'

'set gxout contour'
* Draw Kenya county shapefiles
'set line 1 1 3'
* Updated on 2/18/2016
'draw shp Kenya_admin_2014_WGS84 1 46'
*'draw shp kenya_counties'

'set string 1 c 10 0'
'set strsiz 0.19'
'draw string 5.5 10.75 IMERG Late ACCUM-h Accumulated Precipitation (mm)'
'set strsiz 0.14'
'draw string 5.5 10.45 Valid for period ending HHz DD MON YYYY'

text = "Writing PNG file for IMERG-L ACCUM-h precip at YYYYMMDD_HHz"
'gxprint ./imerglACCUMh.png png xXPIX yYPIX white'

* Placeholder for google earth image production.
*'set gxout kml'

* Close the control files and get outta here!
'close 1'
'quit'

