[MITgcm-support] Questions Setting Up Bathymetry File
Martin Losch
Martin.Losch at awi.de
Fri Aug 10 04:31:16 EDT 2018
Hi Keerthijan,
did you get a reply?
I think the python code looks good to me, except that I would expect to have your “bandarray” with dimensions (ny,nx) following the python convention. I then usually don’t need the ravel method. In the end you’ll find out by trial and error, which ordering is correct.
- Nx = sNx*nSx*nPx, where Nx are the number of points in x-direction in your bathy file, and similar for Ny. nSx/nSy should normally be 1 unless you want a hybrid MPI/OpenMP executable.
- you can set (constant) resolution by using dxSpacing, dySpacing in “data”, the units depend on the grid you choose. For a cartesian grid it’s meters. For a spherical polar grid degrees.
- Nr is the number of vertical grid point.
Martin
> On 24. Jul 2018, at 17:31, Keerthijan Radhakrishnan <kradhakrishnan at edu.uwaterloo.ca> wrote:
>
> Hello,
>
> I am working on modelling water flow through a strait using MITgcm. I am new to this and I have some questions setting up the bathymetry file for upload to MITgcm. I would appreciate any help.
>
> To create my bathymetry file, I downloaded the bedrock in a geotiff format from NOAA. The coordinates were in latitude/longitude and I warped it to metres. Then I cropped the geotiff to remove all areas without data and obtained a rectangle. This I converted to a Numpy array on python. My array is of shape: (points in x, points in y) and the elevation at each point is the value in the matrix. I converted the array to a bin using the following code on Python:
> dt='>f8'
> fid = open("bathymetry.bin, "wb")
> bandarray.astype(dt).ravel(order='F').tofile(fid)
> fid.close()
>
> My question is, when I provide info in the SIZE.h file, are the following correct:
> • sNx*nPx should equal the number of X points on the bathymetry file.
> • sNy*nPy should equal the number of Y points on the bathymetry file.
> • The resolution should equal the spacing between each point in the X/Y and in metres?
> • Then what is Nr? We are not providing a grid for the Z coordinates only values of elevation.
> • Also, is my process above correct?
>
> Regards,
> Keerthijan
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list