[MITgcm-support] OBCS prescribed temperature

Dimitris Menemenlis dmenemenlis at gmail.com
Wed May 21 20:17:06 EDT 2014


Yup.  Much better explanation of what I was trying to say!
And yes image or quikpcolor are the "lazier" option, except that:
(i) they are "much" faster if they suffice
(ii) and quikpcolor does attempt to compensate for geometry
    (in a simple approximate way) if spacing is not perfectly regular.

On May 21, 2014, at 5:08 PM, Ryan Abernathey <ryan.abernathey at gmail.com> wrote:

> In python, the proper way to use the command pcolormesh(x, y, c) is to have x and y specify the coordinates of the cell BOUNDARIES, not centers. This means that x and y have a different shape from c. In MITgcm speak, x and y would correspond to Xg and Yg, while c would be defined at Xc and Yc. If reading from mds grid files, you just have to add on the missing final Xg and Yg points in order to make it work properly. This is a feature, not a bug, and in fact it makes a lot of sense, especially for irregular grid geometries! :)
> http://matplotlib.org/1.3.1/api/pyplot_api.html#matplotlib.pyplot.pcolor
> 
> The lazier option is to use imshow, which works the same as MATLAB's image. But this won't get the geometry correct unless your grid spacing is perfectly regular.
> 
> -Ryan
> 
> On Wed, May 21, 2014 at 7:36 PM, Dimitris Menemenlis <dmenemenlis at gmail.com> wrote:
> I was going to ask how you plotted.
> Similar problem happens if you use pcolor in matlab.
> That is, it does not plot grid cell-center values but rather interpolates
> between the grid cell centers, that is, the plot has one less column and row than does the matrix.
> 
> For MITgcm users that use matlab, if you want to plot grid cell center values,
> you should use image instead of pcolor.  It's also a lot faster.
> There is a matlab script checked in:
> MITgcm/utils/matlab/cs_grid/latloncap/quikpcolor.m
> that has same syntax as pcolor and does this automatically.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20140521/06122452/attachment.htm>


More information about the MITgcm-support mailing list