[gradsusr] If Statements for Gridded Model Data Open GrADS
Becker, Bernd
bernd.becker at metoffice.gov.uk
Wed Jun 22 10:04:13 EDT 2016
Matt,
read up on maskout and const:
'define mx = const( const( maskout(tmax ,tmax -30),1),0,-u)'
'define mn =const( const( maskout(tmin ,tmin -15),1),0,-u)'
in your case something like:
'define mx = const( const( maskout(NAMcape ,NAMcape -1500),1),0,-u)'
might work .
Cheers,
Bernd.
From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Baker, Matt (Quebec - Atlantic)
Sent: 22 June 2016 14:25
To: gradsusr at gradsusr.org
Subject: [gradsusr] If Statements for Gridded Model Data Open GrADS
Hi all,
I have a question regarding Open GrADS.
I’m trying to use if statements for scalar model data (eg. GFS and NAM) over a grid and I’m wondering if it’s possible to do this. As an example, I’m using if statements for these parameters: surface based CAPE, LI, and 500 mb relative humidity to create an index to plot on a map. So far GrADS isn’t showing that this is working, however, I can plot the model data individually so I don’t think it’s a case of missing data.
Here’s some of the code for the NAM model. Note that I define the variable NAMHail to equal 0 at the start of the function.
if (modelNumberNAM>0)
set_maps(_map,_hasNegativeNAM)
'set grads off'
'set grid off'
'set gxout contour'
'set ccolor 0'
'set clopts -1 1 0.15'
'set cint 1'
'set cthick 6'
'set clab on'
'set csmooth on'
'NAMcape = CAPEsfc.'modelNumberNAM
if (NAMcape > 1500 & NAMcape < 2200)
'NAMHail = NAMHail + 1'
endif
if (NAMcape > 2199 & NAMcape < 3100)
'NAMHail = NAMHail + 2'
endif
if (NAMcape > 3099)
'NAMHail = NAMHail + 3'
endif
'set lev 500'
'NAMrh500=RHprs.'modelNumberNAM
if (NAMrh500 < 35)
'NAMHail = NAMHail + 3'
endif
if (NAMrh500 > 35 & NAMrh500 < 44)
'NAMHail = NAMHail + 1'
endif
endif
'set gxout contour'
'set ccolor 0'
'set clopts -1 1 0.15'
'set cint 200'
'set cthick 6'
'set clab on'
'set csmooth on'
'd NAMcape'
Thanks!
Matt Baker
Meteorologist, Met-Ocean Services, Amec Foster Wheeler Environment & Infrastructure
133 Crosbie Road, PO Box 13216, St. John’s, NL A1B 4A5, Canada
matt.baker at amecfw.com<mailto:matt.baker at amecfw.com> amecfw.com
ISO 9001:2008 Quality Management System (St. John's)
[cid:image001.jpg at 01D1CC97.56017880]
This message is the property of Amec Foster Wheeler plc and/or its subsidiaries and/or affiliates and is intended only for the named recipient(s). Its contents (including any attachments) may be confidential, legally privileged or otherwise protected from disclosure by law. Unauthorised use, copying, distribution or disclosure of any of it may be unlawful and is strictly prohibited. We assume no responsibility to persons other than the intended named recipient(s) and do not accept liability for any errors or omissions which are a result of email transmission. If you have received this message in error, please notify us immediately by reply email to the sender and confirm that the original message and any attachments and copies have been destroyed and deleted from your system. This disclaimer applies to any and all messages originating from us and set out above. If you do not wish to receive future unsolicited commercial electronic messages from us, please forward this email to: unsubscribe at amecfw.com and include “Unsubscribe” in the subject line. If applicable, you will continue to receive invoices, project communications and similar factual, non-commercial electronic communications.
Please click http://amecfw.com/email-disclaimer for notices and company information in relation to emails originating in the UK, Italy or France.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160622/1608c8fa/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 5712 bytes
Desc: image001.jpg
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20160622/1608c8fa/attachment-0001.jpg
More information about the gradsusr
mailing list