Re: loops with linint1_n_Wrap

From: Jiaxin Zhang <jiaxinzhang3_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 31 2014 - 18:40:48 MDT

It works very well.
Thank you so much, Dennis.

Jiaxin

2014-03-31 6:30 GMT-07:00 Dennis Shea <shea@ucar.edu>:

> see attached
>
>
> On 3/30/14, 6:03 PM, Jiaxin Zhang wrote:
>
>> Dear NCL users,
>>
>>
>>
>> I have one question related with using loops (for different netcdf files)
>> with linint1_n_Wrap.
>>
>>
>>
>> I had to do a temporal interpolation of air temperature from 6-hour to
>> 1-hour using linint1_n_Wrap and it works for 1 file. Attached are ncl code
>> and netcdf input file with tair values for one month (the file name means
>> site1_tair_year2010_month01.nc).
>>
>>
>>
>> The main problem is that I need to modify this code to use a series of
>> loops for all my netcdf input files (netcdf for several years and months)
>> and I am not familiar with this part. For instance, I have netcdf files
>> for
>> different years and months where I need to apply the interpolation with
>> linint1_n_Wrap:
>>
>>
>>
>> site1_tair_1980_01.nc, site1_tair_1980_02.nc, site1_tair_1980_03.nc,
>> site1_tair_1980_04.nc, ..., site1_tair_1980_10.nc, site1_tair_1980_11.nc,
>> site1_tair_1980_12.nc, site1_tair_1981_01.nc, site1_tair_1981_02.nc, ...,
>> site1_tair_1981_12.nc, site1_tair_1982_01.nc, ..., and so on until
>> site1_tair_2012_12.nc.
>>
>>
>>
>> Could someone please explain me what do I need to modify in the attached
>> ncl code to include a loop for years and months? I would need to do a loop
>> first for year, and then for each month in that year.
>>
>>
>>
>> Would it be is possible to include files with different climate variables
>> in the loop? For instance, do the loop not only for "year" and "month",
>> but
>> also for different climate variables like "tair", "precip", "wind", ...
>> for
>> site1.
>>
>>
>>
>> I have checked the NCL "Mini_Language Reference Manual" and it says that
>> the use of loops should be minimized. So, I was wondering if using loops
>> maybe is not a good idea. Are there any other more recommended ways to
>> solve this problem with NCL?
>>
>>
>>
>> Thank you in advance for your help.
>>
>>
>>
>> Jiaxin
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 31 18:41:17 2014

This archive was generated by hypermail 2.1.8 : Thu Apr 03 2014 - 13:36:27 MDT