load_netcdf_jd

PURPOSE ^

SYNOPSIS ^

function data_out_netcdf = load_netcdf_jd(filename,listofvariables);

DESCRIPTION ^

 This function loads netcdf data from the file 'filename' and returns a structure containing the variables from 'listofvariables'

 by J. Decker (joan.decker@cea.fr) and Y. Peysson (yves.peysson@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data_out_netcdf = load_netcdf_jd(filename,listofvariables);
0002 %
0003 % This function loads netcdf data from the file 'filename' and returns a structure containing the variables from 'listofvariables'
0004 %
0005 % by J. Decker (joan.decker@cea.fr) and Y. Peysson (yves.peysson@cea.fr)
0006 %
0007 if nargin < 2,
0008     %ncdisp(filename);%for details in the file (units,names,...)
0009     info_filename = ncinfo(filename);
0010     for ivar = 1:length(info_filename.Variables)
0011         listofvariables{ivar} = info_filename.Variables(ivar).Name;
0012     end
0013 end
0014 %****** OBSOLETE NETCDF INTERNAL MATLAB LIBRARY MIUST BE USED *************
0015 if ischar(listofvariables) & strcmp(listofvariables,'toric'),%TORIC code data
0016     listofvariables = { 'Rtor',...
0017                         'Psi',...
0018                         'Den',...
0019                         'Tem',...
0020                         'Epsi',...
0021                         'q',...
0022                         'norqldce',...
0023                         'Vol',...
0024                         'Nu',...
0025                         'Umin',...
0026                         'Umax',...
0027                         'Qldce_LD',...
0028                         'Qldce_MXD',...
0029                         'Qldce_TTM',...
0030                         'Zeff',...
0031                         'johmic'};
0032 end
0033 %
0034 % include test for matlab path of necessary functions
0035 %
0036 for iv = 1:length(listofvariables),
0037     eval(['data_out_netcdf.',listofvariables{iv},' = ncread(filename,listofvariables{iv});']);
0038 end
0039     
0040

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.