COAWST grid script help

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Honolulu_Wang
Posts: 17
Joined: Mon Sep 08, 2014 4:17 pm
Location: Hohai University

COAWST grid script help

#1 Unread post by Honolulu_Wang »

Hi,
I met a proble when hoping to reproduce a COAWST inlet case gird, by the script: COAWST-master\Tools\mfiles\mtools: create_roms_xygrid.m,
but met the error:
>> create_roms_xygrid
## Defining Global Attributes...
## Defining Dimensions...
## Defining Variables and Attributes...
## Filling Variables...
SWITCH expression must be a scalar or a character vector.

Error in m_proj (line 37)
switch proj

Error in mat2roms_mw (line 95)
m_proj(s.projection);

Error in create_roms_xygrid (line 131)
eval(['mat2roms_mw(''temp_jcw33.mat'',''',fname,''');'])

May I know how to solve that?
Thanks

jcwarner
Posts: 1172
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: COAWST grid script help

#2 Unread post by jcwarner »

in create_roms_xygrid it should have
projection='mercator';
and then it saves a file (i just called it temp_jcw33.mat)
then mat2roms_mw loads that file into a structure s. as
s = load(theMatFile);
so in the mat2roms_mw there should be a s.projection, and it should = mercator.
do you know how to check that as the m file runs?
-j

Honolulu_Wang
Posts: 17
Joined: Mon Sep 08, 2014 4:17 pm
Location: Hohai University

Re: COAWST grid script help

#3 Unread post by Honolulu_Wang »

Thanks John,
Problem solved by changing in
mat2roms_mw.m
line 93

projection = s.projection;
m_proj(s.projection);
switch lower(projection)

to
projection = s.projection;
m_proj(s.projection.name);
switch lower(projection.name)

Post Reply