netcdf file reading with FORTRAN

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
dhtjtks
Posts: 36
Joined: Thu Apr 19, 2007 12:18 am
Location: University of Florida

netcdf file reading with FORTRAN

#1 Unread post by dhtjtks »

Hi everyone!

Now I am using MATLAB for reading '*.nc' file but it is too slow. So I want to use fortran or C. I read several scripts about reading netcdf file with fortran and C but still don't know how to read. Does anyone know how to do it? Any suggestion will be helpful for me.

Thanks.

JW

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: netcdf file reading with FORTRAN

#2 Unread post by m.hadfield »

dhtjtks wrote:Now I am using MATLAB for reading '*.nc' file but it is too slow. So I want to use fortran or C. I read several scripts about reading netcdf file with fortran and C but still don't know how to read. Does anyone know how to do it? Any suggestion will be helpful for me.
Before abandoing Matlab, you might be better off looking critically at the way you are reading the netCDF data. Are you making many retrievals of small chunks of data? Are you reading files over a network link and could you make a copy on your hard disk instead? What do you mean by "too slow"?

dhtjtks
Posts: 36
Joined: Thu Apr 19, 2007 12:18 am
Location: University of Florida

Re: netcdf file reading with FORTRAN

#3 Unread post by dhtjtks »

m.hadfield wrote:
dhtjtks wrote:Now I am using MATLAB for reading '*.nc' file but it is too slow. So I want to use fortran or C. I read several scripts about reading netcdf file with fortran and C but still don't know how to read. Does anyone know how to do it? Any suggestion will be helpful for me.
Before abandoing Matlab, you might be better off looking critically at the way you are reading the netCDF data. Are you making many retrievals of small chunks of data? Are you reading files over a network link and could you make a copy on your hard disk instead? What do you mean by "too slow"?

After simulating ROMS, I download history file from unix computer to my desktop. After downloading, I use MATLAB to read history file and to generate TECPLOT file to see the result. Sometimes I use MATLAB to see the result but usually I use TECPLOT to see the result. Then I need a lot of for loop and it makes MATLAB slow. I think if I can use fortran or C to read netcdf file it will not take too long. That's why I want to use fortran or C.

JW

linzhenhua
Posts: 64
Joined: Mon Oct 17, 2005 2:02 am
Location: Institute of Oceanology,Chinese Academy of Sciences

Re: netcdf file reading with FORTRAN

#4 Unread post by linzhenhua »

there are manuals for Fortran and C to read and write NETCDF on the Unidata website.

http://www.unidata.ucar.edu/software/netcdf/docs/

Post Reply