matlab error in tidal forcing

Facts, news, and guidance about ROMS software

Moderators: arango, robertson

Post Reply
Message
Author
asujrpv

matlab error in tidal forcing

#1 Post by asujrpv » Sun Jul 31, 2011 9:08 pm

Hello everybody,

I am having a little problem using the matlab to create tidal forcing. I wonder if anyone could help me to find out how to solve this. Below you can find the error, I can create the output file, but cannot convert to netcdf.

Thanks!
Rafael


Check DATA/Model_tpxo7

*******************************************
Reading otps_harmonics_z...
Reading otps_harmonics_u...
Reading otps_harmonics_v...

iconst =

57


iconst =

57 48


iconst =

57 48 21


iconst =

57 48 21 13

??? Undefined function or method 'finite' for input arguments of type 'double'.

Error in ==> t_getconsts at 167
ii=finite(const.ishallow); % diffs are in the 10th decimal place (9th sig fig).

Error in ==> t_vuf at 30
[const,sat,shallow]=t_getconsts(ctime);

Error in ==> otps2frc_v3 at 146
[V,U,F]=t_vuf(base_date,iconst,reflat);

User avatar
cvl
Posts: 18
Joined: Tue Jun 03, 2003 7:39 pm
Location: NATO Undersea Research Centre
Contact:

Re: matlab error in tidal forcing

#2 Post by cvl » Mon Aug 01, 2011 6:43 am

I suspect you're dealing with old code and a new MATLAB version. Try replacing

Code: Select all

finite
with

Code: Select all

isfinite
.

Code: Select all

                             < M A T L A B >
                  Copyright 1984-2007 The MathWorks, Inc.
                         Version 7.5.0.338 (R2007b)
                               August 9, 2007

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> finite
Warning: FINITE is obsolete and will be removed in future versions. Use
ISFINITE instead.
(Type "warning off MATLAB:FINITE:obsoleteFunction" to suppress this warning.)
??? Error using ==> finite

elhunter
Posts: 9
Joined: Mon Dec 11, 2006 6:13 pm
Location: IMCS

Re: matlab error in tidal forcing

#3 Post by elhunter » Mon Aug 01, 2011 2:56 pm

Hello,

Yep, this error is due to an older version of the t_tide toolbox used with newer versions of MATLAB. Rich Pawlowicz has an updated version of t_tide on his website http://www.eos.ubc.ca/~rich/#T_Tide. I have posted a note on the Wikiroms tidal forcing page and the undated t_tide zip file at http://marine.rutgers.edu/~hunter/roms/ ... .3beta.zip.


Eli

asujrpv

Re: matlab error in tidal forcing

#4 Post by asujrpv » Tue Aug 02, 2011 2:42 am

cvl wrote:I suspect you're dealing with old code and a new MATLAB version. Try replacing

Code: Select all

finite
with

Code: Select all

isfinite
.

Code: Select all

                             < M A T L A B >
                  Copyright 1984-2007 The MathWorks, Inc.
                         Version 7.5.0.338 (R2007b)
                               August 9, 2007

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>> finite
Warning: FINITE is obsolete and will be removed in future versions. Use
ISFINITE instead.
(Type "warning off MATLAB:FINITE:obsoleteFunction" to suppress this warning.)
??? Error using ==> finite
Eli,
many thanks, an error persists, I am using the newer version. I will be grateful for your help.
Rafael
iconst =

57 48 21


iconst =

57 48 21 13

??? In an assignment A(I) = B, the number of elements in B and
I must be the same.

Error in ==> t_getconsts at 168
const.freq(~ii) = (const.doodson(~ii,:)*ader)/(24);

Error in ==> t_vuf at 50
[const,sat,shallow]=t_getconsts(ctime);

Error in ==> otps2frc_v3 at 146
[V,U,F]=t_vuf(base_date,iconst,reflat);

elhunter
Posts: 9
Joined: Mon Dec 11, 2006 6:13 pm
Location: IMCS

Re: matlab error in tidal forcing

#5 Post by elhunter » Tue Aug 02, 2011 2:39 pm

This is yet another version compatibility problem.

Newer versions of t_vuf in the t_tide toolbox require another input variable.

e.g.

[V,U,F]=t_vuf(base_date,iconst,reflat);

becomes

[V,U,F]=t_vuf('nodal',base_date,iconst,reflat);


I put an updated version of otps2frc*.m on:

http://marine.rutgers.edu/~hunter/roms/ ... s2frc_v4.m

Eli

asujrpv

Re: matlab error in tidal forcing

#6 Post by asujrpv » Wed Aug 03, 2011 1:57 am

elhunter wrote:This is yet another version compatibility problem.

Newer versions of t_vuf in the t_tide toolbox require another input variable.

e.g.

[V,U,F]=t_vuf(base_date,iconst,reflat);

becomes

[V,U,F]=t_vuf('nodal',base_date,iconst,reflat);


I put an updated version of otps2frc*.m on:

http://marine.rutgers.edu/~hunter/roms/ ... s2frc_v4.m

Eli
Eli, I am most grateful- it worked. On a side note, would you be kind to tell me what is it that you would write when prompt by the program to the following:
Enter domain name for NetCDf attribute:

Thanks!
Rafael

elhunter
Posts: 9
Joined: Mon Dec 11, 2006 6:13 pm
Location: IMCS

Re: matlab error in tidal forcing

#7 Post by elhunter » Wed Aug 03, 2011 11:16 am

Hi Rafael,

The domain name is just a string describing your grid domain. It ends up as an attribute in the NetCDF file.


Eli

asujrpv

Re: matlab error in tidal forcing

#8 Post by asujrpv » Tue Aug 09, 2011 4:12 am

Eli et al.
I come back with a question. The tidal forcing is not working properly for me right now, so I wonder if I am doing something wrong. I need to simulate 5 days from september 1 2006 to september 6, so I put the the following commands in the matlab:

t=datenum(2006,9,1);
tpred=datenum(2006,9,6);
base_dir='/home/rpacheco/SRC/MyTest/cdw/Data/';
gfile=[base_dir,'roms_grdJul2011_nolandmask.nc'];
tideout=[base_dir,'roms_tides_frc_nolandmaskRP.nc'];
otps2frc_v4(gfile,t,tpred,tideout,'DATA/Model_tpxo7')

I get the frc nc file, but I wonder if the datenum t and tpred are correctly set for my simulation

I am most grateful.
Rafael

Post Reply