[ncl-talk] save 1 file per day-time

Rashed Mahmood rashidcomsis at gmail.com
Sat Feb 29 09:59:56 MST 2020


Sorry I do not understand when you say "script commands need to be
performed ..." . What is that supposed to mean?

On Sat, Feb 29, 2020 at 8:34 AM Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:

> Thanks for the support, however, this is still not working for me because
> the question is not just to save each file "per line" according to the
> ASCII file, but "per date-day"
>
> 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 when there is the same date (day and month)
> This is the problem that I was not able to do correctly using the if
> condition.
>
> I appreciate the advanced on this issue
>
> Best
> ------------------------------
> *De:* Rashed Mahmood <rashidcomsis at gmail.com>
> *Enviado:* sábado, 29 de fevereiro de 2020 12:50
> *Para:* Vanúcia Schumacher <vanucia-schumacher at hotmail.com>; NCL-talk <
> ncl-talk at ucar.edu>
> *Assunto:* Re: [ncl-talk] save 1 file per day-time
>
> Hi Vanucia
> Please include ncltalk in subsequent messages. Your script had various
> issues:
>
> 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..
>
> 2.  this "do j=1, nrows-1" should have been  "do j=1, nrows-2" because
> your nrows includes a count from header line.
>
> 3. when you do:
>         ii   := ind(lat.ge.latS .and. lat.le.latN .and. \
>                     lon.ge.lonW .and. lon.le.lonE )
> There is a possibility that ii may be missing at some iterations so the
> statements based on this should consider this possibility.
>
> 4.    fout = "rc_2018_12_30.nc" , This would overwrite the files you
> create, so this should be set according to y, m and d.
>
> 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!
>
> Cheers,
> Rashed
>
>
> On Sat, Feb 29, 2020 at 7:01 AM Vanúcia Schumacher <
> vanucia-schumacher at hotmail.com> wrote:
>
> Hi Rashed
>
> I am not being able to save the variable (var) for each day in separate
> files using this ascii file.
> I tried to select each day using this command (    if (y .eq. 2018 .and.
> m .eq. 12 .and. d .eq. 30)  then), but it is not working, and not very
> useful because I would have to calculate for each day of the month.
> So, how could I save the variable in question for each day in separate
> files according to this ascii data format?
>
> Thanks for advance
> ------------------------------
> *De:* Rashed Mahmood <rashidcomsis at gmail.com>
> *Enviado:* sábado, 29 de fevereiro de 2020 11:47
> *Para:* Vanúcia Schumacher <vanucia-schumacher at hotmail.com>
> *Cc:* ncl-talk at ucar.edu <ncl-talk at ucar.edu>
> *Assunto:* Re: [ncl-talk] save 1 file per day-time
>
> Hi Vanucia,
> What is the error? and which line do you think is problematic?
> I think you should use integer for year, month and day numbers:
>
>         y    := tointeger( str_get_field(data(j), 1, "-") )
>         m   := tointeger( str_get_field(data(j), 2, "-") )
>         d    := tointeger( str_get_field(data(j), 3, "-") )
>
> However I am not what is the issue here. It is more helpful when you
> provide specific error messages and variable summaries etc.
>
> Cheers,
> Rashed
>
>
>
>
> On Sat, Feb 29, 2020 at 4:20 AM Vanúcia Schumacher via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Hi users
>
> I would like help to save 1 file per day-time.
> The data are in list format, I need to calculate the routine commands
> (attachment) for the year 2018 by a separate day (e.g. 2018.12.30.nc,
> 2018.12.31.nc, ... ), there are several informations for each day
> I tried to use the if condition but it is not working
> If someone can help me or guide me in what I am missing.
>
> Thanks
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200229/c72de95a/attachment.html>


More information about the ncl-talk mailing list