count=1
while (count<22)

if (count=1)
varshort="SfcSoilMst"
variable="MOSAIC Surface Soil Moisture"
correction="-0"
correction2="1"
units="(mm)"
 colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
 barunits="0 1 2 3 4 5 6 7 8 9 10 11 12"
endif

if (count=2)
varshort="MidSoilMst"
variable="MOSAIC Middle Soil Moisture"
correction="-0"
correction2="1"
units="(mm)"
 colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
 barunits="0 50 100 150 200 250 300 350 400 450 500 550 600"
endif

if (count=3)
varshort="DeepSoilMst"
variable="MOSAIC Deep Soil Moisture"
correction="-0"
correction2="1"
units="(mm)"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 75 150 225 300 375 425 500 575 625 700 775 850"
endif

if (count=4)
varshort="DeepSoilMst"
variable="MOSAIC Total Soil Moisture"
correction="-0"
correction2="1"
units="(mm)"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
barunits="100 200 300 400 500 600 700 800 900 1000 1100 1200 1300"
endif

if (count=5)
varshort="SensHeatFlux"
variable="MOSAIC Sensible Heat Flux"
correction="-0"
correction2="1"
units="(W/m`a2`n)"
barunits="-400 -360 -320 -280 -240 -200 -160 -120 -80 -40 0 40 80"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=6)
varshort="LatentHeatFlux"
variable="MOSAIC Latent Heat Flux"
correction="-0"
correction2="1"
units="(W/m`a2`n)"
barunits="-330 -300 -270 -240 -210 -180 -150 -120 -90 -60 -30 0 30"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=7)
varshort="LWRadiation"
variable="MOSAIC Long Wave Radiation"
correction="-0"
correction2="1"
units="(W/m`a2`n)"
barunits="100 125 150 175 200 225 250 275 300 325 350 375 400"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"

endif

if (count=8)
varshort="SWRadiation"
variable="MOSAIC Short Wave Radiation"
correction="-0"
correction2="1"
units="(W/m`a2`n)"
barunits="0 90 180 270 360 450 540 630 720 810 900 990 1080"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"

endif

if (count=9)
varshort="CanopyTemp"
variable="MOSAIC Surface/Canopy System\Temperature"
correction="-273.15"
correction2="1"
units="(`3.`0C)"
barunits="-15 -10 -5 0 5 10 15 20 25 30 35 40 45"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"

endif

if (count=10)
varshort="DeepSoilTemp"
variable="MOSAIC Deep Soil Temperature"
correction="-273.15"
correction2="1"
units="(`3.`0C)"
barunits="-25 -20 -15 -10 -5 0 5 10 15 20 25 30 35"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=11)
varshort="TotalPrecip"
variable="MOSAIC Total Precipitation"
correction="*10800"
correction2="1"
units="(mm over 3hr)"
barunits="0 1 2 3 4 5 6 7 8 9 10 11"
colors="15 9 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=12)
varshort="SnowDepth"
variable="MOSAIC Liquid Equiv. Snow Depth"
correction="*1"
correction2="1"
units="(mm)"
barunits="0 7 14 21 28 35 42 49 56 63 70 77 84"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=13)
varshort="AirTemp"
variable="MOSAIC 2 Meter Air Temperature"
correction="-273.15"
correction2="1"
units="(`3.`0C)"
barunits="-35 -28 -21 -14 -7 0 7 14 21 28 35 42 49"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=14)
varshort="TotalRunoff"
variable="MOSAIC Total Runoff"
correction="*10800"
correction2="1"
units="(mm over 3 hours)"
barunits=".5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=15)
varshort="GroundHeatFlux"
variable="MOSAIC Ground Heat Flux"
correction="*1"
correction2="1"
units="(W/m`a2`n)"
barunits="-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
endif

if (count=16)
varshort="SfcSoilWet"
variable="MOSAIC Volumetric Surface Soil\Moisture"
correction="-0"
correction2="1"
units="(m`a3`n/m`a3`n)"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 .05 .1 .15 .2 .25 .3 .35 .4 .45 .5 .55 .6"
endif

if (count=17)
varshort="MidSoilWet"
variable="MOSAIC Volumetric Middle Soil\Moisture"
correction="-0"
correction2="1"
units="(m`a3`n/m`a3`n)"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 .05 .1 .15 .2 .25 .3 .35 .4 .45 .5 .55 .6"
endif

if (count=18)
varshort="DeepSoilWet"
variable="MOSAIC Volumetric Deep Soil\Moisture"
correction="-0"
correction2="1"
units="(m`a3`n/m`a3`n)"
colors="15 9 14 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 .05 .1 .15 .2 .25 .3 .35 .4 .45 .5 .55 .6"
endif

if (count=19)
varshort="SfcSoilRel"
variable="MOSAIC Relative Surface Soil\Moisture"
correction="*100"
correction2="1"
units="(%)"
colors="9 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 10 20 30 40 50 60 70 80 90 100"
endif

if (count=20)
varshort="MidSoilRel"
variable="MOSAIC Relative Mid Soil\Moisture"
correction="*100"
correction2="1"
units="(%)"
colors="9 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 10 20 30 40 50 60 70 80 90 100"
endif

if (count=21)
varshort="DeepSoilRel"
variable="MOSAIC Relative Deep Soil\Moisture"
correction="*100"
correction2="1"
units="(%)"
colors="9 4 11 5 13 3 10 7 12 8 2 6"
barunits="0 10 20 30 40 50 60 70 80 90 100"
endif

t=1
while (t<9)
if (variable = 'MOSAIC Total Soil Moisture')
"enable print /usr/local/www/LDAS/LDASpredictions/wrkdir/TotSoilMst."t".raw"
else
"enable print /usr/local/www/LDAS/LDASpredictions/wrkdir/"varshort"."t".raw"
endif
"set t "t
 "set grads off"
 var2=varshort           "(t=          "t")"
"var3=("var2 correction")"
"var=("var3"*"correction2")"

 "set mpdset hires"
 "set gxout grfill"
 "set clevs "barunits
 "set ccols "colors
if (variable = 'MOSAIC Total Soil Moisture')
"display SfcSoilMst (t="t") + MidSoilMst (t="t")+ DeepSoilMst (t="t")"
else
"display var"
endif

if (t='1')
time='15Z'
"draw title "variable " "units " at "time " on "startdate
endif
if (t='2')
time='18Z'
"draw title "variable " "units " at "time " on "startdate
endif
if (t='3')
time='21Z'
"draw title "variable " "units " at "time " on "startdate
endif
if (t='4')
time='00Z'
"draw title "variable " "units " at "time " on "startdate
endif
if (t='5')
time='03Z'
"draw title "variable " "units " at "time " on "enddate1
endif
if (t='6')
time='06Z'
"draw title "variable " "units " at "time " on "enddate1
endif
if (t='7')
time='09Z'
"draw title "variable " "units " at "time " on "enddate1
endif

if (t='8')
time='12Z'
"draw title "variable " "units " at "time " on "enddate1
endif
"run /usr/local/www/LDAS/LDASpredictions/cbarn.gs"
 var2=varshort           "(t=          "t")"
"var3=("var2 correction")"
"var=("var3"*"correction2")"
 "set clevs "barunits
"set gxout contour"
"set clab off"
"set ccols 1 1 1 1 1 1 1 1 1 1 1 1 1 1"
if (variable = 'MOSAIC Total Soil Moisture')
"display SfcSoilMst (t="t") + MidSoilMst (t="t")+ DeepSoilMst (t="t")"
else
"display var"
endif
"set strsiz .12 .12"
"draw string 9.65 .2 ldas.gsfc.nasa.gov"
"draw string 1.41 .2 LDAS Images"
"print"
"clear"
if (variable = 'MOSAIC Total Soil Moisture')
"disable print /usr/local/www/LDAS/LDASpredictions/wrkdir/TotSoilMst."t".raw"
else
"disable print /usr/local/www/LDAS/LDASpredictions/wrkdir/"varshort"."t".raw"
endif

t=t+1
endwhile
count=count+1
endwhile
"quit"