<div dir="ltr">Sorry I do not understand when you say "script commands need to be performed ..." . What is that supposed to mean?<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 29, 2020 at 8:34 AM Vanúcia Schumacher <<a href="mailto:vanucia-schumacher@hotmail.com">vanucia-schumacher@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">Thanks for the support, however, this is still not working for me </span><span style="font-size:12pt">because the question is not just to save each file "per line" according to the ASCII file, but "per date-day"</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">The ASCII file has some lines with the same date (e.g. lines 2, 3, 4 and 6), and the script commands need to be performed considering all lines from the ASCII file
</span><span style="font-size:12pt">when there is the same date (day and month)</span><span><br>
</span><span style="font-size:12pt">This is the problem that I was not able to do correctly using the if condition.</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">I appreciate the advanced on this issue</span><span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">Best</span></div>
<div id="gmail-m_5041378598787885476appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_5041378598787885476divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>><br>
<b>Enviado:</b> sábado, 29 de fevereiro de 2020 12:50<br>
<b>Para:</b> Vanúcia Schumacher <<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>>; NCL-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>Assunto:</b> Re: [ncl-talk] save 1 file per day-time</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hi Vanucia</div>
<div>Please include ncltalk in subsequent messages. Your script had various issues:</div>
<div><br>
</div>
<div>1. Your first if statement "if (y .eq. 2018 .and. m .eq. 12 .and. d .eq. 30)  then" was inside the loop and you were trying to close it outside the loop, which would not work..</div>
<div><br>
</div>
<div>2.  this "do j=1, nrows-1" should have been  "do j=1, nrows-2" because your nrows includes a count from header line.</div>
<div><br>
</div>
<div>3. when you do:</div>
<div>        ii   := ind(lat.ge.latS .and. lat.le.latN .and. \<br>
                    lon.ge.lonW .and. lon.le.lonE )</div>
<div>There is a possibility that ii may be missing at some iterations so the statements based on this should consider this possibility.</div>
<div><br>
</div>
<div>4.    fout = "<a href="http://rc_2018_12_30.nc" target="_blank">rc_2018_12_30.nc</a>" , This would overwrite the files you create, so this should be set according to y, m and d.</div>
<div><br>
</div>
<div>Please see the attached script that would create all the files. But I am not sure what exactly you are trying accomplish here, so make sure that this what you want. It's up to you!</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Rashed</div>
<div><br>
</div>
<br>
<div>
<div dir="ltr">On Sat, Feb 29, 2020 at 7:01 AM Vanúcia Schumacher <<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">Hi Rashed</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">I am not being able to save the variable (var) for each day in separate files using this ascii file. </span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">I tried to select each day using this command (</span><span style="font-size:12pt">    if (y .eq. 2018 .and. m .eq. 12 .and. d .eq. 30)  then</span><span style="font-size:12pt">), but it is not working, </span><span style="font-size:12pt">and
 not very useful because I would have to calculate for each day of the month.</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">So, how could I save the variable in question for each day in separate files according to this ascii data format?</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span style="font-size:12pt">Thanks for advance</span></div>
<div id="gmail-m_5041378598787885476x_gmail-m_8579096856916505520appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_5041378598787885476x_gmail-m_8579096856916505520divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>><br>
<b>Enviado:</b> sábado, 29 de fevereiro de 2020 11:47<br>
<b>Para:</b> Vanúcia Schumacher <<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>><br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a> <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>Assunto:</b> Re: [ncl-talk] save 1 file per day-time</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div>Hi Vanucia,</div>
<div>What is the error? and which line do you think is problematic?</div>
<div>I think you should use integer for year, month and day numbers:</div>
<div><br>
</div>
<div>        y    := tointeger( str_get_field(data(j), 1, "-") )<br>
        m   := tointeger( str_get_field(data(j), 2, "-") )<br>
        d    := tointeger( str_get_field(data(j), 3, "-") )</div>
<div><br>
</div>
<div>However I am not what is the issue here. It is more helpful when you provide specific error messages and variable summaries etc.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Rashed<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Sat, Feb 29, 2020 at 4:20 AM Vanúcia Schumacher via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<span style="margin:0px;font-size:12pt;color:rgb(51,51,51)">Hi users</span></div>
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<span style="margin:0px;font-size:12pt;color:rgb(51,51,51)">I would like help to save 1 file per day-time.</span></div>
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<span style="margin:0px;font-size:12pt;color:rgb(51,51,51)">The data are in list format, I need to calculate the routine commands (attachment) for the year 2018 by a separate day
<span style="font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">
(e.g. <a href="http://2018.12.30.nc" target="_blank">2018.12.30.nc</a>, <a href="http://2018.12.31.nc" target="_blank">
2018.12.31.nc</a>, ... )</span>, there are several informations for each day </span><span style="margin:0px"><br>
</span><span style="margin:0px;font-size:12pt;color:rgb(51,51,51)">I tried to use the if condition but it is not working</span></div>
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<span style="margin:0px;font-size:12pt;color:rgb(51,51,51)">If someone can help me or guide me in what I am missing.</span><br>
</div>
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<span style="margin:0px"><br>
</span></div>
<div style="margin:0px;font-size:14pt;font-family:Calibri,Helvetica,sans-serif;background-color:rgb(255,255,255)">
<span style="margin:0px;font-size:12pt;color:rgb(51,51,51)">Thanks</span></div>
<br>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>

</blockquote></div>