<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>I face problems when using the IF command in the script. I use the IF command to check for some conditions but there is something wrong. I think it may be due to the difference in the data type of the defined variables.</DIV>
<DIV>The following is the part of my script that I used and encountered the problem.</DIV>
<DIV> </DIV>
<DIV> time=1</DIV>
<DIV> lat1=22.5<BR> lat2=25<BR> lon1=112.5<BR> lon2=115</DIV>
<DIV> 'define levmax=1000'</DIV>
<DIV> 'set lat 'lat1<BR> 'set lev '1000<BR> 'set t 'time<BR> 'define check1=ave(spres,lon='lon1',lon='lon2')'<BR> if (check1 > levmax)<BR> 'define levmax=925'<BR> say '1000'<BR> endif<BR></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>The value of "check1" is about 990 and so it is smaller than 1000 as defined in levmax. So the condition should be false, however the programme did execute the commands under the condition "(check1 > levmax)"<BR></DIV>
<DIV> </DIV>
<DIV>Do you know what is the reason for this? What should I do to correct this? Are there other similar situations that I need to becare of when I use defined variables and IF / WHILE commands?</DIV>
<DIV> </DIV>
<DIV>Thanks a lot for your help!!!</DIV>
<DIV> </DIV>
<DIV>Best,</DIV>
<DIV> </DIV>
<DIV>Henry</DIV></div><br></body></html>