Re: [netcdfgroup] [netCDF #KJX-899747]: Ragged Arrays in Fortran and netcdf4

Hi Ed:

For the type of data, think of subsurface profiles, where each profile has a different number of depths, and the depths themselves differ.

I am in Fortran 90. I can set up a structure (derived type), just as in C, that has the number of depths, and two arrays of size (number of depths) that has the depth of the observation and the observation itself, and then I have an array of that structure. It strikes me that this is what Vlenare for, and is what is in the C example. So how do I define and write this using the Fortran 90 calls?

-Roy


On Apr 10, 2008, at 10:52 AM, Unidata netCDF Support wrote:
Hi All:

I am working on creating a netcdf4 file with the structure we are
trying to achieve.  I have a file with Box10 groups and B0x2
subgroups, works great.  Now I am trying to do ragged arrays.  Below
is the only fortran example I can find that does ragged arrays.  It
is only writing one,1-dimensional array, so I am unsure what I do
when I am writing an N-dimensional ragged array.   Do I just write
each "column" in a loop - if so how does it know that it is writing
to the same structure?  Or if I can do multiple "columns" at once,
how do I set that up.  More realistic examples would be very helpful,
including an example that writes an N-dimensional ragged array, and
an example that adds one more column to an existing ragged array.
Even just the fortran equivalent of the program tst_vl.c would be
very helpful

It is clear how to do it in C (I set up an array of structures of the
given form), but not in either version of FORTRAN.

Thanks,

-Roy


Hmmm, that's a bit of a stumper, really.

Can you tell me how you are storing these in fortran? You have an array of what?

Thanks,

Ed

Ticket Details
===================
Ticket ID: KJX-899747
Department: Support netCDF
Priority: Normal
Status: Open


**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division 
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."





  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: