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
COAWST grid script help
-
- Posts: 17
- Joined: Mon Sep 08, 2014 4:17 pm
- Location: Hohai University
Re: COAWST grid script help
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
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
-
- Posts: 17
- Joined: Mon Sep 08, 2014 4:17 pm
- Location: Hohai University
Re: COAWST grid script help
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)
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)