[gradsusr] IF statement problem
AMS EmsiWx Bytča
emsiwx at pocasie-bytca.sk
Sat Feb 17 10:30:30 EST 2018
Hello Jennifer,
thank you for your reply. I have already got helped. I am using older
version under Windows (btw. where can I download the latest pack?) , so
for now I do it like this:
'set prnopts %.0f 1 0'
'd TCDCclm'
cloudbfr = result
oblc = sublin(cloudbfr,3)
if (oblc<10)
obla='J'
endif
............................................................
Kindest regards,
Marian
Dňa 17. 2. 2018 o 15:47 Jennifer M Adams napísal(a):
> The ‘if’ function */in the scripting language/* doesn’t work for
> evaluating the data in a defined variable in GrADS; it is only for
> evaluating script variables. As of version 2.1.1.b0, there is an if()
> function in GrADS and logical operators in the expression syntax for
> doing this type of calculation. If you are using an older version of
> GrADS, then the maskout() and const() functions can be used to achieve
> similar results.
> http://cola.gmu.edu/grads/gadoc/gradfuncif.html
> http://cola.gmu.edu/grads/gadoc/gradfuncconst.html
> http://cola.gmu.edu/grads/gadoc/gradfuncmaskout.html
> —Jennifer
>
>
>> On Feb 15, 2018, at 6:45 PM, AMS EmsiWx Bytča
>> <emsiwx at pocasie-bytca.sk <mailto:emsiwx at pocasie-bytca.sk>> wrote:
>>
>> Dear GrADS users,
>>
>>
>> I have been on this half a day, but still no success.
>>
>> Part of my script:
>>
>> 'define oblc = TCDCclm'
>>
>> if (oblc<10)
>> obla='J'
>> endif
>> if (oblc>=10 & TCDCclm<30)
>> obla='SJ'
>> endif
>> if (oblc>=30 & TCDCclm<60)
>> obla='P'
>> endif
>> if (oblc>=60 & TCDCclm<90)
>> obla='O'
>> endif
>> if (oblc>=90)
>> obla='Z'
>> endif
>>
>> I want to get obla string based on the total cloud cover, but somehow
>> the conditions dont work. I always get the last obla='Z' eventhough
>> the TCDCclm is 34%
>>
>> Could you please guide me on the right track?
>>
>>
>> Thank you in advance for your replies.
>>
>>
>> Marian
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>> http://secure-web.cisco.com/1FXen63CqywdYKxy5unY9GUfI4dpiVxgyxnKPF1xYVDCU7TDbRkBbmrUQIBQGmtrbuNCkCuc-Xk_KnE6MRd7D3nJ6LfyN-pPnRtlyb0gZ2E_03az92IT5vJUJMZ8MejH0GnnVlralkuqCAvqPet3eASPwoQtHqHFqCwp2DjuRLTnwYGHakJ7H8qAdf0AeWLP_mIKPK6oNEd_RctwKpunAHlS7mtSFxjPlOieJlx_TsBVdIRgkAnovlZtWjlBA8KmopzeVKMc0Mz35h4dRbjm2tsJdHQ-8qmr3uBBufekElE0vffM8BOmGbrf5Bf5qcg_QCRe7808ieVZgR2qGpKukgMKCBIwRuYRNAC-HOCnZJhDX8zboNgrhVHJmo6VmbafaLc-Xf9hDpI7fVEkU0VGSKkmG8qEFcf0l9bcmDJ4OtLBDxmZOqfuZ7D1nNTtTBaky/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr
>>
>
> --
> Jennifer Miletta Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> George Mason University
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180217/4eb7974d/attachment-0001.html>
More information about the gradsusr
mailing list