'ncload' problem in MATLAB

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

'ncload' problem in MATLAB

#1 Unread post by dhtjtks »

Hi all,

First question:

I am using MATLAB to read output file, 'ocean_his.nc'. If I use small grid numbers such as 100 * 100 *10, it works o.k.. But if I used many grids (not that many I think) such as 500 * 500 * 10, I cannot load output file in MATLAB. If I used 'ncload', it shows like below. Does anybody has a solution for this problem?

Second question:

If I generate evenly spaced grids, it works good. But if I generate un-evenly spaced grids, it doesn't work. Actually, it works if I use a single cpu. However, if I use multi-cpus, my grids are not good. I think multi-processing system makes it happen but I am not sure. I am using 'ana_grid.h' file to change or create my grids. So what I am thinking is that if I can compile grid generating part with single process and compile other parts with multi-processing, it may works. Usually I am using 'make -j 4', 4 cpus, when I compile. Does anybody can help me?

Thank you.


%%%%%% This is the script I had when I use 'ncload' in MATLAB' %%%%%%%%%%%

??? Out of memory. Type HELP MEMORY for your options.

Error in ==> ncmex at 139
[varargout{:}] = feval(fcn, varargin{:});

Error in ==> ncvar.subsref at 274
[result, status] = ncmex('varget', ncid(self), varid(self), ...

Error in ==> netcdf.subsref at 74
result = subsref(result, s);

Error in ==> ncload at 30
assignin('caller', varargin{i}, f{varargin{i}}(:))

meiw
Posts: 8
Joined: Fri Oct 12, 2007 5:59 pm
Location: University of California, Irvine

Re: 'ncload' problem in MATLAB

#2 Unread post by meiw »

dhtjtks wrote:Hi all,

First question:

I am using MATLAB to read output file, 'ocean_his.nc'. If I use small grid numbers such as 100 * 100 *10, it works o.k.. But if I used many grids (not that many I think) such as 500 * 500 * 10, I cannot load output file in MATLAB. If I used 'ncload', it shows like below. Does anybody has a solution for this problem?

%%%%%% This is the script I had when I use 'ncload' in MATLAB' %%%%%%%%%%%

??? Out of memory. Type HELP MEMORY for your options.

Error in ==> ncmex at 139
[varargout{:}] = feval(fcn, varargin{:});

Error in ==> ncvar.subsref at 274
[result, status] = ncmex('varget', ncid(self), varid(self), ...

Error in ==> netcdf.subsref at 74
result = subsref(result, s);

Error in ==> ncload at 30
assignin('caller', varargin{i}, f{varargin{i}}(:))
Your file is too large, so you can't load the entire contents of the file into the matlab's memory buffer. You can use "var1=nc_varget('ocean_his.nc', 'var1')" or "ncload('ocean_his.nc', 'var1', 'var2', ...)" to extract the variables you need. Hope this is helpful.

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

Re: 'ncload' problem in MATLAB

#3 Unread post by dhtjtks »

Thanks Meiw!

I figured it out yesterday. It works! Thanks again.

dhtjtks
meiw wrote:
dhtjtks wrote:Hi all,

First question:

I am using MATLAB to read output file, 'ocean_his.nc'. If I use small grid numbers such as 100 * 100 *10, it works o.k.. But if I used many grids (not that many I think) such as 500 * 500 * 10, I cannot load output file in MATLAB. If I used 'ncload', it shows like below. Does anybody has a solution for this problem?

%%%%%% This is the script I had when I use 'ncload' in MATLAB' %%%%%%%%%%%

??? Out of memory. Type HELP MEMORY for your options.

Error in ==> ncmex at 139
[varargout{:}] = feval(fcn, varargin{:});

Error in ==> ncvar.subsref at 274
[result, status] = ncmex('varget', ncid(self), varid(self), ...

Error in ==> netcdf.subsref at 74
result = subsref(result, s);

Error in ==> ncload at 30
assignin('caller', varargin{i}, f{varargin{i}}(:))
Your file is too large, so you can't load the entire contents of the file into the matlab's memory buffer. You can use "var1=nc_varget('ocean_his.nc', 'var1')" or "ncload('ocean_his.nc', 'var1', 'var2', ...)" to extract the variables you need. Hope this is helpful.

Post Reply