How to write hraw variable into grid file?
How to write hraw variable into grid file?
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 183 times
Re: How to write hraw variable into grid file?
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).
Re: How to write hraw variable into grid file?
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 ...
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 ...
Re: How to write hraw variable into grid file?
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.
Re: How to write hraw variable into grid file?
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?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.
Re: How to write hraw variable into grid file?
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.
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.
Re: How to write hraw variable into grid file?
kate, many thanks! According to your suggestion, I change griddefs.h for it to use ETOPO5, It works now for USwest case!