[MITgcm-support] Read NetCDF data (Internal Waves)

Roland Young Roland.Young at physics.ox.ac.uk
Wed Apr 20 07:30:55 EDT 2016


Hi Alejandro,

I’m not entirely sure what you are trying to do; ncdump is useful for looking inside a NetCDF file but not for manipulating its contents, which is what I think you are trying to do.

If you want to view the fields themselves I suggest using ncview, which is very useful for doing this quickly. There are other programs that can read in NetCDF files for viewing, such as xconv and Panoply (the second of which is very powerful).

ncdump -c $file should print the values of all the grid variables in the .nc file, typically X, Y, Z, T for longitude, latitude, pressure/height, time.

ncdump -h $file will just print the headers (i.e. a list of variables in the file).

ncdump -v <variable> $file will print the complete record for a single variable to the screen. For example, ncdump -v U $file will print the entire zonal velocity field in the .nc file to the screen. This is not particularly useful if you want to manipulate the data, however.

You can manipulate NetCDF files directly using the NCO library: http://nco.sourceforge.net

However, most useful for manipulating the data itself rather than just view it using ncview is an interpreter such as IDL, Matlab, or Python. Each of these have libraries to read NetCDF files, after which you can do what you like with the data.

Don’t forget that if you are running a parallel model run you will need to stitch the tiles together using gluemncbig, otherwise each .nc file only contains one tile’s worth of data.

Hope that helps,

Roland





On 20 Apr 2016, at 11:52, Alejandro Jiménez Rico <paulexca at hotmail.com<mailto:paulexca at hotmail.com>> wrote:

Hello, I am trying to figure out how to read all the netcdf data using ncdump. I did $ ndump -c filetoread.nc

But I would want to organize all this data a little bit. How do I do this? I don't find information about the dimensions or the variables of this NetCDF in the mitgcm documentation.

Thank you,
Alejandro
_______________________________________________
MITgcm-support mailing list
MITgcm-support at mitgcm.org<mailto:MITgcm-support at mitgcm.org>
http://mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20160420/8acde763/attachment.htm>


More information about the MITgcm-support mailing list