If Matt's netCDF approach does not work for you, note also that since any
netCDF4 file is also an HDF5 file, you can use the HDF5 API:
https://www.hdfgroup.org/HDF5/examples/api18-fortran.html
> On Apr 25, 2016, at 12:34 PM, Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND
> APPLICATIONS INC] <matthew.thompson@xxxxxxxx> wrote:
>
> On 04/22/2016 10:37 AM, Arlindo Arriaga wrote:
>> Dear all
>>
>>
>> NASA has decided to change formats of MODIS data files with ocean biology
>> products from hdf4 to netcdf-4, and my software turned useless. I was asked
>> to change my Fortran executables from hdf4 to netcdf-4. After training
>> myself to get control on using netcdf-4 library functions of Fortran
>> interface, I hit on a road bloc: the function NF90_GET_VAR to read datasets
>> works well for arrays of single types (integers or reals) but NOT for
>> compound user defined types, like the structure sstdata
>>
>> TYPE binSST
>> real(kind=4) :: sum
>> real(kind=4) :: sum2
>> end TYPE binSST
>>
>> TYPE(binSST), allocatable, dimension(:) :: sstdata
>>
>>
>> In case someone has hit on a similar problem or has a suggestion, I would
>> kindly appreciate the help.
>> I work in Linux (Ubuntu) 64 bits, and the Fortran compiler is gfortran.
>
> Arlindo,
>
> Are you trying to use compound variables using nf90_def_compound, a la:
>
> http://stackoverflow.com/questions/6924073/netcdf-and-fortran-structures
>
> I've used these before and they seem to work well. If not, what does your
> code look like?
>
> Matt
>
>
> --
> Matt Thompson, SSAI, Sr Scientific Programmer/Analyst
> NASA GSFC, Global Modeling and Assimilation Office
> Code 610.1, 8800 Greenbelt Rd, Greenbelt, MD 20771
> Phone: 301-614-6712 Fax: 301-614-6246
> http://science.gsfc.nasa.gov/sed/bio/matthew.thompson
>
> _______________________________________________
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
--
Christopher Lynnes NASA/GSFC 301-614-5185
“We choose to go to the moon in this decade and do the other things, not
because they are easy, but because they are hard..." - John F. Kennedy