Question of ETOPO2

Facts, news, and guidance about ROMS software

Moderators: arango, robertson

Post Reply
Message
Author
Techcoast

Question of ETOPO2

#1 Unread post by Techcoast »

Could anyone let me know how to generate the grid from the bathymetric data of ETOPO2?
or if do not use ETOPO2 , is there any other way?

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

#2 Unread post by kate »

Is this a grid generation question or a bathymetry question? We have the software to put ETOPO2 onto an existing grid if that is your goal. However, if you are working in shallow coastal waters, you may well be disappointed with ETOPO2. It has some strange deep pits in coastal waters which I simply don't believe. What is your domain of interest?

raz
Posts: 3
Joined: Wed Dec 08, 2004 3:01 am
Location: Scripps Institution of Oceanography

#3 Unread post by raz »

Kate -- what/where is the software for applying new bathymetry to an existing grid? I have new ~400m resolution NGDC coastal bathymetry that I would like to use, replacing topex, but it will have to be re-gridded for my 600m grid. It will also need to be smoothed a bit -- is there any standard method you would recommend for doing that?


thanks
Raz

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

#4 Unread post by kate »

There is some rather dusty Fortran code that does this at:
gridpak.tar.gz

The grid file is a netcdf file - you can use any language with a good netcdf interface - I'm sure many use Matlab for this sort of problem.

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

#5 Unread post by arango »

In realistic applications, all the grid information is read from ROMS grid NetCDF. See information for how to build such file. We have a matlab GUI to build such file, SeaGrid.

After this grid NetCDF file is generated, you can use any tool to over-write the bathymetry with the desired one. This is the strategy that almost everybody follows. You can interpolated better bathymetry to the model grid and replace the one in the NetCDF file. This is very trivial. Recall, we still need to smooth the bathymetry before we run ROMS to minimize the errors in the pressure gradient arising from steep and tall features.

rouf

Re: Question of ETOPO2

#6 Unread post by rouf »

I became familier running seagrid with ETOPO5 database. I want to use my own bathymetry data instead of ETOPO5 due to shallow coastal domain. Probably following is the right hints from Arango

Code: Select all

After this grid NetCDF file is generated, you can use any tool to over-write the bathymetry with the desired one. This is the strategy that almost everybody follows. You can interpolated better bathymetry to the model grid and replace the one in the NetCDF file.


But being a new user, can anyone help me with more detail guideline.

Is it mean I should creat a .nc file as usual following seagrid and Matlab. Than over-write bathymetry.... but how should i over-write in Matlab? Anyway, I am confused. Pls help anyone with detail guideline.

Rouf

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Question of ETOPO2

#7 Unread post by arango »

Yes, you can write the new bathymetry with matlab or any other software that has the NetCDF interface. Recall that NetCDF files allow a lot of manipulations once that they are created. If I am doing this in matlab I will do the following:
  • Read the longitude and latitude coordinates of the grid (lon_rho, lat_rho).

    Code: Select all

    rlon=nc_read('MyGridFile.nc','lon_rho');
    rlat=nc_read('MyGridFile.nc','lat_rho');
    
  • Load your new bathymetry (bathy) and its coordinates (lon,lat).
  • Interpolate bathymetry to model grid.

    Code: Select all

    hraw=griddata(lon,lat,bathy,rlon,rlat);
    h=hraw;
    
  • The hraw matrix is the raw bathymetry interpolated to model grid which can be also saved in the NetCDF file at the appropriate value of the unlimited dimension bath. It is always a good idea to save the raw bathymetry for reference in the future since the model bathymetry sometimes require a lot of smoothing. This of course depends on the resolution.
  • Manipulate the model bathymetry h. That is, clip the bathymetry at the coast (we cannot have h=0) to hmin value. Sometimes it is also desired to clip the bathymetry at the bottom (say we don't want depths deeper of 5000m). Then, filter and smooth the resulting matrix because terrain-following models are affected by the r-factor. If you don't know what this is, you need to investage and read the literature before you run your application.
  • Write out new bathymetry to grid NetCDF file

    Code: Select all

    status=nc_write('MyGridFile.nc','hraw',hraw,index)
    status=nc_write('MyGridFile.nc','h')
    
Notice that I use the nc_read.m and nc_write.m scripts that I distribute. There are other scripts with different name and syntax that do exactly the same. It is very trivial to figure out these scripts with the help command.

rouf

Re: Question of ETOPO2

#8 Unread post by rouf »

As Arango sir mentioned
Load your new bathymetry (bathy) and its coordinates (lon,lat).
Is it mean there should be three file, one for bathy, second for lon and third for lat data?
I am sure its simple but as a new user i need to know what should be the format of my own data and the file itself.

Anyway, I made three excell file for bathy, lon and lat. then follow your instructions with matlab and receive following error

Code: Select all

>> ncload('genga_roms_grd.nc')
>> rlon=nc_read('genga_roms_grd.nc','lon_rho');
>> rlat=nc_read('genga_roms_grd.nc','lat_rho');
>> hraw=griddata(lon,lat,bathy,rlon,rlat);
??? Maximum variable size allowed by the program is exceeded.

Error in ==> meshgrid at 44
    xx = xx(ones(ny, 1),:);

Error in ==> xyzchk at 49
      [x,y] = meshgrid(x,y);

Error in ==> griddata at 49
[msg,x,y,z,xi,yi] = xyzchk(x,y,z,xi,yi);
Please help me
Rouf

Post Reply