[MITgcm-support] topography
Martin Losch
Martin.Losch at awi.de
Mon Sep 3 04:57:04 EDT 2012
Mohammad,
the MITgcm is written in Fortran and the fastest index is the i-index, that is normally associated with the x-direction (or longitude) in regular grids, j-index corresponds to y-direction, etc.
in Matlab, the first (i-)index in an array is the row index, and the j-index is the column index, as you would expect from the matrix-chapter of your favorite linear algebra textbook, and by default Matlab plots and operates under these assumptions. To do it "right", do this in Matlab:
assign topo(i,j) = some topo (assuming i,j are x,y directions)
to plot you need to transpose, e.g.:
contour(topo')
If it looks right after this, you can save it like this
fopen(fid,'myfile','b'); fwrite(fid,topo,'real*4'); fclose(fid);
(or real*8, whatever you need), and it should work.
Martin
On Aug 23, 2012, at 9:00 AM, mohammad akbarinasab wrote:
> Hi Pro Martin and all user
> When I plotted test case DOME of topography by MATTLAB, It turn
> sideway, but at file of data.obcs , the northern boundary is open.
> You ask from me in prior email, why did I turn sideway .
> Therefor how does the topography must be defined in the MITGCM. Please
> obsereved file of topogrphy by matalb and please modify if necessary.
> Thank you
> <untitled.jpg><top.mat>_______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list