<div dir="ltr">Hi:<div><br></div><div>printMinMax(time,False) shows no min/max?</div><div><br></div><div>You can handle missing values by checking for them with "ismissing."  If it is true, then you can't use the time variable.</div><div><br></div><div>Barry</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 19, 2017 at 9:20 PM, Prashanth Bhalachandran <span dir="ltr"><<a href="mailto:prashanth.bhalachandran@gmail.com" target="_blank">prashanth.bhalachandran@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Marston, <div>I did this previously too. The problem is as follows. It is being assigned a missing value. </div><div><br></div><div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Courier;color:rgb(184,45,24);background-color:rgb(237,234,212)"><span style="font-variant-ligatures:no-common-ligatures"> time        := stringtointeger(time)</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Courier;color:rgb(184,45,24);background-color:rgb(237,234,212)"><span style="font-variant-ligatures:no-common-ligatures"> printVarSummary(time)</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Courier;color:rgb(184,45,24);background-color:rgb(237,234,212)"><span style="font-variant-ligatures:no-common-ligatures"> print(time)</span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Courier;color:rgb(184,45,24);background-color:rgb(237,234,212)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Courier;color:rgb(184,45,24);background-color:rgb(237,234,212)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Courier;color:rgb(184,45,24);background-color:rgb(237,234,212)"><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Variable: time</span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Type: integer</span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 4 bytes</span></div><span class=""><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">            1 values</span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="m_-256501566104331939Apple-tab-span" style="white-space:pre-wrap">        </span>[1]</span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 1</span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">  _FillValue :<span class="m_-256501566104331939Apple-tab-span" style="white-space:pre-wrap">        </span>-<a href="tel:(214)%20748-3647" value="+12147483647" target="_blank">2147483647</a></span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures">-<a href="tel:(214)%20748-3647" value="+12147483647" target="_blank">2147483647</a></span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;line-height:normal;color:rgb(77,47,45)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></span></span></div><div><div class="h5"><div><blockquote type="cite"><div>On Oct 19, 2017, at 11:16 AM, Marston Johnston <<a href="mailto:shejo284@gmail.com" target="_blank">shejo284@gmail.com</a>> wrote:</div><br class="m_-256501566104331939Apple-interchange-newline"><div><div class="m_-256501566104331939WordSection1" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span>Correction:<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span><u></u> <u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span>Why not convert time once at the beginning?<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span><u></u> <u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span>time := stringtointeger(time)<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span><u></u> <u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span>/M<u></u><u></u></span></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Marston S. Ward, PhD<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Department of Earth Sciences<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">University of Gothenburg, Sweden<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Email: <a href="mailto:marston.johnston@gu.se" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(0,112,192)">marston.johnston@gu.se</span></a><u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">SkypeID: marston.johnston <u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Phone: <a href="tel:+46%2031%20786%2049%2001" value="+46317864901" target="_blank">+46-31-7864901</a> <u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Only the fruitful thing is true!<u></u><u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<u></u><u></u></span></div></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span><u></u> <u></u></span></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span><u></u> <u></u></span></div><div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0cm 0cm"><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b><span style="font-size:12pt">From:<span class="m_-256501566104331939Apple-converted-space"> </span></span></b><span style="font-size:12pt">Prashanth Bhalachandran <<a href="mailto:prashanth.bhalachandran@gmail.com" style="color:purple;text-decoration:underline" target="_blank">prashanth.bhalachandran@<wbr>gmail.com</a>><br><b>Date:<span class="m_-256501566104331939Apple-converted-space"> </span></b>Thursday, 19 October 2017 at 20:08<br><b>To:<span class="m_-256501566104331939Apple-converted-space"> </span></b>Marston Johnston <<a href="mailto:shejo284@gmail.com" style="color:purple;text-decoration:underline" target="_blank">shejo284@gmail.com</a>><br><b>Cc:<span class="m_-256501566104331939Apple-converted-space"> </span></b><<a href="mailto:ncl-talk@ucar.edu" style="color:purple;text-decoration:underline" target="_blank">ncl-talk@ucar.edu</a>><br><b>Subject:<span class="m_-256501566104331939Apple-converted-space"> </span></b>Re: [ncl-talk] Question regarding the transfer of integer values from shell to NCL<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Marston, <u></u><u></u></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">The problem is I have several arrays where time is one of the variables as you will see in the attached code. <u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">For example, <u></u><u></u></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)"> u10  = a->u10 is [76 times] x [801 lats] x [810 lon]<u></u><u></u></span></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)">  u   = a->u.  Is [76 times] x [11 levels] [801 lats] x [810 lon]<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)"><u></u> <u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)">Using the input argument from the shell script, I am reading these variables at particular times. That is, the text file contains the name of the file and the particular time. <u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)"><u></u> <u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)">Therefore, when I use it like this : <u></u><u></u></span></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)">speed(:,:)   = wind_speed(u10(time,0,:,:),<wbr>v10(time,0,:,:)) * toknots <u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)"><br><br><u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(184,45,24)">Or any such line, there will be an error primarily because the time input from the shell script is a string. As you can see from the printVarSummary of the received time from the shell script. <u></u><u></u></span></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Variable: time<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Type: string<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Total Size: 8 bytes<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">            1 values<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Number of Dimensions: 1<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Dimensions and sizes:<span class="m_-256501566104331939apple-tab-span">  <span class="m_-256501566104331939Apple-converted-space"> </span></span>[1]<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Coordinates: <u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">Number Of Attributes: 1<u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">  _FillValue :<span class="m_-256501566104331939apple-tab-span"><span class="m_-256501566104331939Apple-converted-space"> </span></span>-<a href="tel:(214)%20748-3647" value="+12147483647" target="_blank">2147483647</a><u></u><u></u></span></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Courier,serif;color:rgb(77,47,45)">-<a href="tel:(214)%20748-3647" value="+12147483647" target="_blank">2147483647</a><u></u><u></u></span></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div><blockquote style="margin-top:5pt;margin-bottom:5pt" type="cite"><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">On Oct 19, 2017, at 10:42 AM, Marston Johnston <<a href="mailto:shejo284@gmail.com" style="color:purple;text-decoration:underline" target="_blank">shejo284@gmail.com</a>> wrote:<u></u><u></u></div></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white">It would help if you did a printVarSummary() on the problem array.<u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"> <u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"> <u></u><u></u></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Marston S. Ward, PhD</span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Department of Earth Sciences</span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">University of Gothenburg, Sweden</span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Email: <a href="mailto:marston.johnston@gu.se" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(0,112,192)">marston.johnston@gu.se</span></a></span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">SkypeID: marston.johnston </span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Phone: <a href="tel:+46%2031%20786%2049%2001" value="+46317864901" target="_blank">+46-31-7864901</a> </span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">Only the fruitful thing is true!</span><u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(0,112,192)">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><u></u><u></u></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"> <u></u><u></u></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"> <u></u><u></u></div></div><div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0cm 0cm"><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><b><span style="font-size:12pt">From:<span class="m_-256501566104331939apple-converted-space"> </span></span></b><span style="font-size:12pt">ncl-talk <<a href="mailto:ncl-talk-bounces@ucar.edu" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(149,79,114)">ncl-talk-bounces@ucar.edu</span></a>> on behalf of Prashanth Bhalachandran <<a href="mailto:prashanth.bhalachandran@gmail.com" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(149,79,114)">prashanth.bhalachandran@<wbr>gmail.com</span></a>><br><b>Date:<span class="m_-256501566104331939apple-converted-space"> </span></b>Thursday, 19 October 2017 at 19:31<br><b>To:<span class="m_-256501566104331939apple-converted-space"> </span></b><<a href="mailto:ncl-talk@ucar.edu" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(149,79,114)">ncl-talk@ucar.edu</span></a>><br><b>Subject:<span class="m_-256501566104331939apple-converted-space"> </span></b>[ncl-talk] Question regarding the transfer of integer values from shell to NCL</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"> <u></u><u></u></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:13.5pt;font-family:Times,serif">Dear NCL team, </span><u></u><u></u></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:13.5pt;font-family:Times,serif">Greetings. </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"> <u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white"><span style="font-size:13.5pt;font-family:Times,serif">I have a shell script that does the following : Read from a text file which has a list of dates (yyyyddmm) format and times. For example, the first column in the text represents the date and the second the time. </span><u></u><u></u></div></div></div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">20121030        13     73.34     51.77    -21.57</span><u></u><u></u></div></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:18pt;font-family:Times,serif"><br><br><br></span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:18pt;font-family:Times,serif">My shell script reads in the first and second column and stores those values and passes off as arguments to my NCL script. My NCL script reads the first argument as the filename and the second as time. I use this time as an index in several of my arrays in my NCL script since my variable </span><span style="font-size:13.5pt;font-family:Times,serif">dimensions are time x lev x lat x lon. </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:13.5pt;font-family:Times,serif">The problem here is that shell reads these values as strings and I am unable to get it as an integer, which is compulsory if I want to use it as an array index. Please see the below error. </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:13.5pt;font-family:Times,serif">Can one of you please guide me as to how I pass this value as an integer? </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"> <u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:13.5pt;font-family:Times,serif">Many thanks, </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:13.5pt;font-family:Times,serif">Prashanth </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"> <u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:13.5pt;font-family:Times,serif">Error: </span><u></u><u></u></div></div></div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif;color:rgb(255,38,0)">fatal:Illegal subscript. Subscripts must be integer when not using coordinate index</span><span style="font-size:12pt;font-family:Times,serif">ing</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"><br><br><br></span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><b><u><span style="font-size:12pt;font-family:Times,serif">My code (I’m attaching the entire code in case you want to have a look, but I am pasting the necessary portions here) : </span></u></b><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt"> </span><u></u><u></u></div></div></div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">#!bin/bash</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">file="/scratch/conte/s/<wbr>sbhalach/DATA/RI_compute/<wbr>CatRW2030.txt"</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">while read f1 f2 f3 f4;</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">do</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  export dirname=$(echo $f1)00post</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  echo $dirname</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  cd $dirname</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> <span class="m_-256501566104331939apple-converted-space"><span style="color:rgb(255,38,0)"> </span></span><span style="color:rgb(255,38,0)">export filename=${f1}.nc</span></span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif;color:rgb(255,38,0)">  export time=$f2</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">#*****************************<wbr>******************************<wbr>**************</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  cat > varcalc.ncl << EOF </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;  </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;  </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> load "/scratch/lustreD/s/sbhalach/<wbr>DATA/func_center.ncl"</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> load "/scratch/lustreD/s/sbhalach/<wbr>DATA/func_rtheta.ncl"</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> a    = addfile(filename,"r")</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> u10  = a->u10</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> v10  = a->v10</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> slp  = a->slp</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> u    = a->u</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> v    = a->v</span><u></u><u></u></div></div></div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">allvars   = new((/40/),float)</span><u></u><u></u></div></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"><br><br><br></span><u></u><u></u></div></div></div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">slpsub       = slp(<span style="color:rgb(255,38,0)">time</span>,0,:,:) </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">;<span class="m_-256501566104331939apple-converted-space"> </span><b><span style="color:rgb(255,38,0)">Note that the time here is taken as string and hence the error. I obviously tried the toint() and strongpoint() functions but then the function only returns missing values. </span></b></span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">.</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">.</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">. </span><u></u><u></u></div></div></div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">;;;;;;;;;;;;;;;;;;;;;; Write to a netcdf file ;;;;;;;;;;;;;;;;;;</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  system("rm -f $f1_$<a href="http://f2_allvars.nc" target="_blank">f2_allvars.nc</a>")</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  ncdf = addfile("$f1_$<a href="http://f2_allvars.nc" target="_blank">f2_allvars.nc</a>","<wbr>c")</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">  ncdf->allvars = allvars</span><u></u><u></u></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> </span><u></u><u></u></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">EOF</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif">#*****************************<wbr>******************************<wbr>**************</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> </span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> <b><span style="color:rgb(255,38,0)">ncl -n 'filename = "$filename"' 'time = "$time"' varcalc.ncl</span></b></span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> mv $f1_$<a href="http://f2_allvars.nc" target="_blank">f2_allvars.nc</a> ../</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> cd ../</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"> done <"$file”</span><u></u><u></u></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"><br><br><br></span><u></u><u></u></div></div></div></div></div></div></div><div><div><div><div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt;font-family:Times,serif"><br><br><br></span><u></u><u></u></div></div></div></div></div><div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:rgb(237,234,212)"><span style="font-size:12pt"><br><br><br></span><u></u><u></u></div></div></div></div></div><div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;background-color:white">______________________________<wbr>_________________ ncl-talk mailing list<span class="m_-256501566104331939apple-converted-space"> </span><a href="mailto:ncl-talk@ucar.edu" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(149,79,114)">ncl-talk@ucar.edu</span></a><span class="m_-256501566104331939apple-converted-space"> </span>List instructions, subscriber options, unsubscribe:<span class="m_-256501566104331939apple-converted-space"> </span><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="color:purple;text-decoration:underline" target="_blank"><span style="color:rgb(149,79,114)">http://mailman.<wbr>ucar.edu/mailman/listinfo/ncl-<wbr>talk</span></a><u></u><u></u></div></div></div></blockquote></div><div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div></div></div></blockquote></div><br></div></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>