Computational Cluster Programs

Matlab and NetCDF

Matlab now has native support for NetCDF. The use of the old netcdf toolbox is not supported or recommended (see: http://mexcdf.sourceforge.net/).

To use the old netcdf 3rd party toolbox:

  1. Modify your own matlab path.
    • At the shell prompt, enter:

      matlab

    • At the matlab prompt enter:

      addpath /u/local/apps/matlab/netcdf_toolbox/netcdf /u/local/apps/matlab/netcdf_toolbox/netcdf/nctype
      addpath /u/local/apps/matlab/netcdf_toolbox/netcdf/ncutility
      savepath

    This should modify your own matlab path so that it will find the needed toolbox. The default matlab path on the cluster however will not contain the netcdf toolbox.

  2. Modify your LD_LIBRARY_PATH. Note that each command should be contained on a single line.
    • For bash shell users:

      export LD_LIBRARY_PATH=/u/local/apps/matlab/netcdf_toolbox:
      /u/local/apps/matlab/mexcdf_march2011/mexcdf:$LD_LIBRARY_PATH

    • For tcsh shell users:

      setenv LD_LIBRARY_PATH /u/local/apps/matlab/netcdf_toolbox:
      /u/local/apps/matlab/mexcdf_march2011/mexcdf:$LD_LIBRARY_PATH

    The LD_LIBRARY_PATH modification can be placed in your $HOME/.bash_profile or $HOME/.tcshrc file, respectively.

 

March 2011