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}}(:))
'ncload' problem in MATLAB
Re: 'ncload' problem in MATLAB
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 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}}(:))
Re: 'ncload' problem in MATLAB
Thanks Meiw!
I figured it out yesterday. It works! Thanks again.
dhtjtks
I figured it out yesterday. It works! Thanks again.
dhtjtks
meiw wrote: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 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}}(:))