rnc_CreateForcFile.m

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
Entrapmen
Posts: 14
Joined: Thu Jul 17, 2008 3:28 pm
Location: IMS/METU and AWI

rnc_CreateForcFile.m

#1 Unread post by Entrapmen »

I try to create my own ECMWF forcing file using rnt toolbox from Mr.Lorenzo. I get stuck with the following error. If I do not pass the opt argument and use the default values like;

opt.sms_time=360; opt.sms_time_cycle=0; opt.sms_timeVal=[15:30:360];

then everything works fine. However, If I pass the values for the parameters above usinf opt structure, I get the following error.



Thanks for the help in advance.

Ozgur
----------------------------------------------------
rnc_CreateForcFile(grd, forcfile, opt);


NetCDF_File: [1x53 char]
nDimensions: 7
nVariables: 3
nGlobalAttributes: 5
RecordDimension: ''
nRecords: 0
Permission: 'clobber'
DefineMode: 'data'
FillMode: 'fill'
MaxNameLen: 0

>> endef(nc)
close(nc)

myException =

MException

Properties:
identifier: 'MATLAB:netcdf:endDef:formatSizeConstraintsViolated'
message: [1x110 char]
cause: {}
stack: [9x1 struct]

Methods


ans =

file: [1x71 char]
name: 'endDef'
line: 37


ans =

file: [1x79 char]
name: 'endef'
line: 17

??? Error using ==> mexnc>exception2status at 3057
Encountered an unhandled exception.

Error in ==> mexnc>handle_enddef at 895
status = exception2status(myException);

Error in ==> mexnc>handle_endef at 2460
status = handle_enddef(varargin{:});

Error in ==> mexnc>mexnc_tmw at 648
[varargout{:}] = handler ( varargin{:} );

Error in ==> mexnc at 532
[varargout{:}] = mexnc_method(varargin{:});

Error in ==> mexcdf53 at 9
[varargout{:}] = feval('mexnc', varargin{:});

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

Error in ==> netcdf.redef at 30
status = ncmex('endef', ncid(self));

Error in ==> netcdf.endef at 17
result = redef(self, 'data');

leon
Posts: 78
Joined: Mon Mar 03, 2008 4:14 am

Re: rnc_CreateForcFile.m

#2 Unread post by leon »

hi, I think it's the problem of netcdf.
Maybe you should choose the appropriate mexnc netcdf snctool for your version of matlab.
You can check follow link for more details.
https://www.myroms.org/wiki/index.php/MEXNC

Good luck!

DongniWei
Posts: 5
Joined: Thu Aug 04, 2011 1:50 am
Location: Ocean University of China

Re: rnc_CreateForcFile.m

#3 Unread post by DongniWei »

open rnc_CreateForfile.m, uncomment nc.out_file=ncchar('') and nc.oa_file=ncchar(''); look like:
------------------------
%% Global attributes:

nc.title = ncchar(grd.name);
%nc.out_file = ncchar('');
nc.grd_file = ncchar(grd.grdfile);
%nc.oa_file = ncchar('');
nc.version = ncchar('RNC - Matlab Toolbox by E. Di Lorenzo');
nc.history = ncchar(datestr(now));
nc.type = ncchar('FORCING file');
----------------------------------

on Windows it will works fine,but not on ubuntu, i don't know why

osio
Posts: 1
Joined: Tue Feb 07, 2012 7:30 pm
Location: Sun Yat-Sen University

Re: rnc_CreateForcFile.m

#4 Unread post by osio »

leon wrote:hi, I think it's the problem of netcdf.
Maybe you should choose the appropriate mexnc netcdf snctool for your version of matlab.
You can check follow link for more details.
https://www.myroms.org/wiki/index.php/MEXNC

Good luck!

How to install MEXNC?

You have to download the MEXNC version that matches BOTH, your specific Matlab version and your operating system.

First determine what Matlab version you have by typing on the Matlab command line:
version('-release')
Then, go to the download area, scroll down and click on your Matlab version (verify that you operating system is listed as an option).
Download the latest release
Extract (i.e. unzip or unpack) the file in a location where it can stay indefinitely
In Matlab, add the path of your recently extracted mexnc directory. To do this...
Click on File > Set Path... (a GUI will pop-up)
Click on the Add with Subfolders... button, and add the path to your new mexnc folder
Click on the Save button, and close the GUI

Post Reply