matlab error in tidal forcing
matlab error in tidal forcing
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);
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);
Re: matlab error in tidal forcing
I suspect you're dealing with old code and a new MATLAB version. Try replacing with .
Code: Select all
finite
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
Re: matlab error in tidal forcing
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
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
Re: matlab error in tidal forcing
Eli,cvl wrote:I suspect you're dealing with old code and a new MATLAB version. Try replacingwithCode: Select all
finite
.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
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);
Re: matlab error in tidal forcing
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
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
Re: matlab error in tidal forcing
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: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
Enter domain name for NetCDf attribute:
Thanks!
Rafael
Re: matlab error in tidal forcing
Hi Rafael,
The domain name is just a string describing your grid domain. It ends up as an attribute in the NetCDF file.
Eli
The domain name is just a string describing your grid domain. It ends up as an attribute in the NetCDF file.
Eli
Re: matlab error in tidal forcing
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
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