[ncl-talk] avoiding loops

Rashed Mahmood rashidcomsis at gmail.com
Sun Sep 22 06:02:15 MDT 2019


Hi Micah,
Did you try using the addfiles function in NCL:

https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml

For example:

   fils = *systemfunc*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml>
("ls *.nc") ; file paths
   f    = *addfiles* (fils, "r")


You would need to make sure that "ls *.nc" results in the correct order
with respect to time and day.

Cheers,
Rashed




On Sat, Sep 21, 2019 at 1:53 PM Micah Sklut via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hi,
>
> I have a task to take GFS data and concatenate variables across all the
> forecast hours, for each grid point.
>
> For example, taking a temperature variable for each grid point, for all
> latitude and longitudes, and creating a string that represents the values
> for each forecast hour.
> So, if we have for latitude y, and longitude x, there would be a string
> value like "70.5,71.5,71.5,72.0,...nHours".  The end product will be a line
> for each grid point for the variables i"m looking at that will be written
> to a file to be imported into a database.
>
> Creating loops through all hours, latitudes, and longitudes will get the
> job done, but is expensive and was looking to see if there were any NCL
> functions that would help here.
>
> Thank you.
>
> _______________________________________________
> 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/20190922/9a53e21e/attachment.html>


More information about the ncl-talk mailing list