<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Matt,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">read up on maskout and const:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">'define mx = const( const( maskout(tmax ,tmax -30),1),0,-u)'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">'define mn =const( const( maskout(tmin ,tmin -15),1),0,-u)'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">in your case something like:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">'define mx = const( const( maskout(NAMcape ,NAMcape -1500),1),0,-u)'
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">might work .<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Bernd.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> gradsusr-bounces@gradsusr.org [mailto:gradsusr-bounces@gradsusr.org]
<b>On Behalf Of </b>Baker, Matt (Quebec - Atlantic)<br>
<b>Sent:</b> 22 June 2016 14:25<br>
<b>To:</b> gradsusr@gradsusr.org<br>
<b>Subject:</b> [gradsusr] If Statements for Gridded Model Data Open GrADS<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-CA">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I have a question regarding Open GrADS.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I’m trying to use <i>if statements</i> 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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> if (modelNumberNAM>0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> set_maps(_map,_hasNegativeNAM)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set grads off'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set grid off'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set gxout contour'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set ccolor 0'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set clopts -1 1 0.15'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set cint 1'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set cthick 6'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set clab on'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set csmooth on'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMcape = CAPEsfc.'modelNumberNAM<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> if (NAMcape > 1500 & NAMcape < 2200)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMHail = NAMHail + 1'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> if (NAMcape > 2199 & NAMcape < 3100)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMHail = NAMHail + 2'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> if (NAMcape > 3099)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMHail = NAMHail + 3'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set lev 500'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMrh500=RHprs.'modelNumberNAM<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> if (NAMrh500 < 35)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMHail = NAMHail + 3'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> if (NAMrh500 > 35 & NAMrh500 < 44)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'NAMHail = NAMHail + 1'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set gxout contour'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set ccolor 0'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set clopts -1 1 0.15'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set cint 200'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set cthick 6'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set clab on'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'set csmooth on'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> 'd NAMcape'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span lang="EN-CA" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#5F2167">Matt Baker</span></b><span lang="EN-CA" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#5F2167"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-CA" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#5F2167">Meteorologist, Met-Ocean Services, Amec Foster Wheeler Environment & Infrastructure
</span><b><span lang="EN-CA" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#5F2167"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-CA" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#5F2167">133 Crosbie Road, PO Box 13216, St. John’s, NL A1B 4A5, Canada</span><b><span lang="EN-CA" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#5F2167"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-autospace:none"><u><span lang="EN-CA" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#5D2167"><a href="mailto:matt.baker@amecfw.com"><span style="color:blue">matt.baker@amecfw.com</span></a></span></u><u><span lang="EN-CA" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#5F2167"></span></u><span lang="EN-CA" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#5F2167">
amecfw.com</span><span lang="EN-CA" style="font-family:"Arial","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-CA" style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#5F2167">ISO 9001:2008 Quality Management System (St. John's)</span><span lang="EN-CA" style="font-size:8.0pt;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><img border="0" width="115" height="118" id="_x0000_i1025" src="cid:image001.jpg@01D1CC97.56017880"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
</span><span lang="EN-CA" style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#5F2167">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, <b>please forward this email to: unsubscribe@amecfw.com and include “Unsubscribe” in the subject line</b>. If applicable, you will continue to receive invoices, project communications and similar factual, non-commercial electronic communications.<br>
<br>
Please click <a href="http://amecfw.com/email-disclaimer" target="_blank">http://amecfw.com/email-disclaimer</a> for notices and company information in relation to emails originating in the UK, Italy or France.</span><span lang="EN-CA" style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p></o:p></span></p>
</div>
</body>
</html>