<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Marston, <div class="">The problem is I have several arrays where time is one of the variables as you will see in the attached code. </div><div class=""><br class=""></div><div class="">For example, </div><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(184, 45, 24); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> u10 = a->u10 is [76 times] x [801 lats] x [810 lon]</span></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);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span> u = a->u. Is [76 times] x [11 levels] [801 lats] x [810 lon]</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);" class=""><br class=""></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);" class="">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. </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);" class=""><br class=""></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);" class="">Therefore, when I use it like this : </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);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">speed(:,:) = wind_speed(u10(time,0,:,:),v10(time,0,:,:)) * toknots </span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">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. </span></div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Variable: time</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Type: string</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Total Size: 8 bytes</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> 1 values</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number of Dimensions: 1</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>[1]</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Coordinates: </span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number Of Attributes: 1</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> _FillValue :<span class="Apple-tab-span" style="white-space:pre"> </span>-2147483647</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">-2147483647</span></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 19, 2017, at 10:42 AM, Marston Johnston <<a href="mailto:shejo284@gmail.com" class="">shejo284@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; 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; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">It would help if you did a printVarSummary() on the problem array.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">Marston S. Ward, PhD<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">Department of Earth Sciences<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">University of Gothenburg, Sweden<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">Email: <a href="mailto:marston.johnston@gu.se" style="color: rgb(149, 79, 114); text-decoration: underline;" class=""><span style="color: rgb(0, 112, 192);" class="">marston.johnston@gu.se</span></a><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">SkypeID: marston.johnston <o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">Phone: +46-31-7864901 <o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">Only the fruitful thing is true!<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; color: rgb(0, 112, 192);" class="">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 12pt;" class="">From:<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;" class="">ncl-talk <<a href="mailto:ncl-talk-bounces@ucar.edu" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ncl-talk-bounces@ucar.edu</a>> on behalf of Prashanth Bhalachandran <<a href="mailto:prashanth.bhalachandran@gmail.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">prashanth.bhalachandran@gmail.com</a>><br class=""><b class="">Date:<span class="Apple-converted-space"> </span></b>Thursday, 19 October 2017 at 19:31<br class=""><b class="">To:<span class="Apple-converted-space"> </span></b><<a href="mailto:ncl-talk@ucar.edu" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ncl-talk@ucar.edu</a>><br class=""><b class="">Subject:<span class="Apple-converted-space"> </span></b>[ncl-talk] Question regarding the transfer of integer values from shell to NCL<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">Dear NCL team, </span><o:p class=""></o:p></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">Greetings. </span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">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><o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">20121030 13 73.34 51.77 -21.57</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 18pt; font-family: Times, serif;" class=""><br class=""><br class=""></span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 18pt; font-family: Times, serif;" class="">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;" class="">dimensions are time x lev x lat x lon. </span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">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><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">Can one of you please guide me as to how I pass this value as an integer? </span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">Many thanks, </span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">Prashanth </span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 13.5pt; font-family: Times, serif;" class="">Error: </span><o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif; color: rgb(255, 38, 0);" class="">fatal:Illegal subscript. Subscripts must be integer when not using coordinate index</span><span style="font-size: 12pt; font-family: Times, serif;" class="">ing</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><br class=""><br class=""></span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><b class=""><u class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">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><o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">#!bin/bash</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">file="/scratch/conte/s/sbhalach/DATA/RI_compute/CatRW2030.txt"</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">while read f1 f2 f3 f4;</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">do</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> export dirname=$(echo $f1)00post</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> echo $dirname</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> cd $dirname</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> <span style="color: rgb(255, 38, 0);" class=""><span class="Apple-converted-space"> </span>export filename=${f1}.nc</span></span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif; color: rgb(255, 38, 0);" class=""> export time=$f2</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">#*************************************************************************</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> cat > varcalc.ncl << EOF </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> load "/scratch/lustreD/s/sbhalach/DATA/func_center.ncl"</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> load "/scratch/lustreD/s/sbhalach/DATA/func_rtheta.ncl"</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> a = addfile(filename,"r")</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> u10 = a->u10</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> v10 = a->v10</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> slp = a->slp</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> u = a->u</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> v = a->v</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">allvars = new((/40/),float)</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><br class=""><br class=""></span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">slpsub = slp(<span style="color: rgb(255, 38, 0);" class="">time</span>,0,:,:) <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">;<span class="Apple-converted-space"> </span><b class=""><span style="color: rgb(255, 38, 0);" class="">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><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">. <o:p class=""></o:p></span></div></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">;;;;;;;;;;;;;;;;;;;;;; Write to a netcdf file ;;;;;;;;;;;;;;;;;;<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> system("rm -f $f1_$f2_allvars.nc")<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> ncdf = addfile("$f1_$f2_allvars.nc","c")<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> ncdf->allvars = allvars<o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212); min-height: 19px;" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> <o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">EOF<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class="">#*************************************************************************<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> <b class=""><span style="color: rgb(255, 38, 0);" class="">ncl -n 'filename = "$filename"' 'time = "$time"' varcalc.ncl</span></b><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> mv $f1_$f2_allvars.nc ../<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> cd ../<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""> done <"$file”<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><br class=""><br class=""><o:p class=""></o:p></span></div></div></div></div></div></div><div class=""><div class=""><div class=""><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt; font-family: Times, serif;" class=""><br class=""><br class=""><o:p class=""></o:p></span></div></div></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: rgb(237, 234, 212);" class=""><span style="font-size: 12pt;" class=""><br class=""><br class=""><o:p class=""></o:p></span></div></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">_______________________________________________ ncl-talk mailing list<span class="Apple-converted-space"> </span><a href="mailto:ncl-talk@ucar.edu" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ncl-talk@ucar.edu</a><span class="Apple-converted-space"> </span>List instructions, subscriber options, unsubscribe:<span class="Apple-converted-space"> </span><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><o:p class=""></o:p></div></div></div></blockquote></div><br class=""></div></body></html>