NOAA

Geophysical Fluid
Dynamics Laboratory

Skip to: [content] [navigation]
If you are using Navigator 4.x or Internet Explorer 4.x or Omni Web 4.x , this site will not render correctly!

Vis > data > conversion > netcdf2vis5d > Converting NetCDF to Vis5d

Converting NetCDF to Vis5d

Converting NetCDF to Vis5d

The steps below apply to data of any dimensionality, but special processing needs to be done for 2D time series as described in the optional step 1.



Files Needed


File GFDL Location
nc2dto3d.pl (PERL) /home/rsz/util
nc2dto3d_template.m (MATLAB) /home/rsz/util
cdf2hdf (Win32) c:\cdf2hdf (Citrix)
convert.bat (Win32) c:\cdf2hdf (Citrix)
h4tov5d.pl (PERL) /home/rsz/util
hdf2v5d.pl (PERL) /home/rsz/util

If you're external to GFDL, you will need to get the H5utils in addition to those listed.




How To Do It

  1. NetCDf -> NetCDF Optional Preprocess 2D time series.
    1. Put all your NetCDF files in a directory called "in".
    2. Make a directory "out".
    3. Create a file with all the 2D variables that need to be converted. For example, the file "vars.txt" would look like
      ps ts snow
      if you wanted those 3 2D variables.
    4. Execute the script:
              nc3dto4d /net/rsz/in /net/rsz/out vars.txt
      
    All the new NetCDF files will be in your "out" directory.
  2. NetCDF -> HDF4 Within DOS, convert your NetCDF files to HDF4.
    GFDL Internal Example
    1. Log onto Citrix, select Start->Run, type in
      command
      and press Enter.
    2. Type at the prompt
      c:
    3. Change directories
      cd cdf2hdf
    4. Convert all NetCDF files in your folder.
      convert O:\out
      Note: You will need to press Enter after each file conversion. Sorry, but that's how the program works. Also, your data files should be somewhere on a /net directory for Citrix to see them. Drive O: is mapped to /net/rsz in this example.

  3. HDF4 -> Vis5d Create the Vis5d data files. Supply the path where your HDF4 files are and what the output file should be called. For example,
       hdf2v5d /home/rsz/projects/rjw/mars2003/data/hdf out.v5d
    This means that all the HDF files found in the directory will be combined into 1 Vis5d file.
    Note: One defect of conversion to Vis5d is that only 1 variable within an HDF file will be extracted.
smaller bigger reset
last modified: February 20 2004.