Adding netcdf files....

From: Erick Rivera Lemus <lemus_at_nyahnyahspammersnyahnyah>
Date: Mon Aug 16 2010 - 06:57:50 MDT

Hello Ncl Users,

I am working with an hourly database of netcdf files. The data is a
snapshot of sea surface currents. So it has [time Lat Lon] Every hour
of sea-surface currents u and v. I have monthly data which in total
are 743 netcdf files. I am running the NCL opendap support and I
understand that it only reads 64 files and that I am trying to add the
743 files into one single variable call Month. I was able to add the
743 files by following one of the ncl-talk archives that I can set the
following setfileoption("nc","SuppressClose",False)

Now that I have it on one single variable call Month. I am trying to
grab for each hour the u and v o on each one and retrieve the u and v
to make calculations and to put it on a new file. I was trying to
retrieve each u and v for all the times but the error that I was
getting said
warning:FileReadVar: time contains a 0 length dimension
fatal:Subscript out of range, error in subscript #0
fatal:Memory allocation failure:[errno=12]
fatal:Execute: Error occurred at or near line 37 in file addfiles_2.ncl

I notice a memory allocation and decided to retrieve less files no
problem retrieving 51 files. This is the result
Variable: v
Type: float
Total Size: 3659760 bytes
            914940 values
Number of Dimensions: 3
Dimensions and sizes: [time | 51] x [lat | 130] x [lon | 138]
Coordinates:
            time: [2922..2924.083333333372]
            lat: [35.0052..41.96346]
            lon: [-75.9895..-68.0332]

This is my following script

flista=systemfunc("ls " + codDir + "OI_MARC_2009_01_*_*.nc");
print(flista);
month=addfiles(flista,"r");
print(month);
ListSetType(month, "cat") ; default

do i=0,743
u=month[:]->u(i,:,:);
v=month[:]->v(i,:,:)
end do
printVarSummary(u);
printVarSummary(v);

My goal is to put the 743 files on to one single netcdf file. So that
I can use it to calculate monthly means, coverages. Is this possible
or should I just create files in sections and then concatenate to have
the entire month. In the end I would also like to have my hourly data
of netcdf files every three months to calculate seasonal statistics as
well. Any ideas suggestions are welcome and really appreciate it.

Cheers,
Erick Rafael Rivera Lemus
Software Technician
Institute of Marine and Coastal Sciences
Coastal Ocean Observation Laboratory

Rutgers, The State University of New Jersey
71 Dudley Road New Brunswick, NJ 08901 Phone: 732-932-6555 ext. 503
Fax: 732-932-1821
Cell: 617-447-5106

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Aug 16 06:57:58 2010

This archive was generated by hypermail 2.1.8 : Mon Sep 20 2010 - 15:45:07 MDT