How to write hraw variable into grid file?

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Lee2015

How to write hraw variable into grid file?

#1 Unread post by Lee2015 »

I have generate grid file (see attached) using grid command of gridpak. But the h variable and hraw variable are empty. How to write etopo5.nc into h variable and hraw variable? Thanks.
Attachments
usw_grid_1.nc
(3.36 MiB) Downloaded 177 times

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

Re: How to write hraw variable into grid file?

#2 Unread post by kate »

Do you not have a manual for it? The site for gridpak is here with an ancient document here.Your lat,lon fields are also zero, so the first step is to do an inverse mapping to find the lat,lon values, then it will be easier to extract something like etopo5 (which is no longer the latest thing in global bathymetries).

Lee2015

Re: How to write hraw variable into grid file?

#3 Unread post by Lee2015 »

Thanks kate! For rectangular grid (Caribbean case), I successfully wrote the bathymetry into hraw variable by using bathtub.

But For curvilinear grid (USwest case), I got the following error when I used bathtub ETOPO5

~/roms/gridpak6$ export ETOPO5=/home/lee/roms/gridpak6/Data/etopo5.nc
~/roms/gridpak6$ ./bathtub ETOPO5
minimum depth (negative is land elevation)
0
maximum depth
8000
apply mask? (T/F)
T

EXTRACT - cannot find variable: topo_lon

EXTRACT - cannot find variable: topo_lat
im 6601 3601 0.0000000000000000

EXTRACT - cannot find variable: topo
Maximum depth read is 0.0000000000000000
Minimum depth read is 0.0000000000000000
latitude range of grid 28.888286590576172 48.453147888183594
latitude range of data 0.0000000000000000 0.0000000000000000
longitute range of grid 229.12171936035156 243.34384155273438
longitute range of data 0.0000000000000000 0.0000000000000000
Insufficient latitude range of data
try again ...

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

Re: How to write hraw variable into grid file?

#4 Unread post by kate »

Time to develop some debugging skills. How did it work the first time and not the second? Did you change codes? I changed my topo files to have different variable names at some point to be consistent with files from another source. You can use the NCO package to make such changes.

Lee2015

Re: How to write hraw variable into grid file?

#5 Unread post by Lee2015 »

kate wrote:Time to develop some debugging skills. How did it work the first time and not the second? Did you change codes? I changed my topo files to have different variable names at some point to be consistent with files from another source. You can use the NCO package to make such changes.
kate, thanks your reply. I didn't make any change. and I used the same bathymetry. the bathymetry has three variable: topo, topo_lat and topo_lon. I don't know why the two cases had different results?

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

Re: How to write hraw variable into grid file?

#6 Unread post by kate »

Ah, I had to remind myself what bathymetry USwest wants. None of the regular bathy files are selected because it has its own under the "else" category. Just change griddefs.h for it to use ETOPO5.

Again, these are just examples from umpteen years ago to get you looking at what choices you have, not necessarily examples of the best grid you can make today. Check out SRTM30 for higher res than ETOPO5.

Lee2015

Re: How to write hraw variable into grid file?

#7 Unread post by Lee2015 »

kate, many thanks! According to your suggestion, I change griddefs.h for it to use ETOPO5, It works now for USwest case!

Post Reply