## Not a valid bathymetry file

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
kee
Posts: 44
Joined: Fri Mar 15, 2013 1:30 pm
Location: Nanjing Uni. of Info. Sci. & Tech. (nanjing institute of meterology)

## Not a valid bathymetry file

#1 Unread post by kee »

Hi all,
I tried to obtain the Bathymetry data through below way, but it doesnot work.
I donot know how to do.
can anyone help me?
thank you!

Code: Select all

>> y=nc_varget('etopo5.nc','topo_lat',[1020],[421]);
>> x=nc_varget('etopo5.nc','topo_lon',[1140],[481]);
>> z=nc_varget('etopo5.nc','topo',[1020 1140],[421 481]);
>> [X,Y]=meshgrid(x,y);
>> save bathy.mat X Y z
And also this way

Code: Select all

>> y=nc_varget('etopo5.nc','topo_lat',[1020],[421]);
>> x=nc_varget('etopo5.nc','topo_lon',[1140],[481]);
>> z=nc_varget('etopo5.nc','topo',[1020 1140],[421 481]);
>> [X,Y]=meshgrid(x,y);
>> X=X(:);
>> Y=Y(:);
>> Z=z(:);
>> save bathy.mat X Y Z

kee
Posts: 44
Joined: Fri Mar 15, 2013 1:30 pm
Location: Nanjing Uni. of Info. Sci. & Tech. (nanjing institute of meterology)

Re: ## Not a valid bathymetry file

#2 Unread post by kee »

Hi all,
I got the answer from https://www.myroms.org/wiki/index.php/seagrid.
The matlab scripts should be written in this way

Code: Select all

>> [xbathy,ybathy]=meshgrid(xbathy,ybathy);  
>> xbathy =  xbathy(:);
>> ybathy =  ybathy(:);
>> zbathy = -zbathy(:);
>> save bathy_seagrid.mat xbathy ybathy zbathy
the names are sensitive.
cheer up!

Post Reply