[MITgcm-support] to prepare horizGridFilefor the curvilinear coordinates

Martin Losch Martin.Losch at awi.de
Mon Oct 1 11:21:32 EDT 2018


Hi Yi-Chih,

now I am not quite sure what you are trying to do. Once you have specified the curvilinear grid in one way (grid files) or the other (OLD_GRID_IO method), you do not have to specify delX/delY in data. In fact, it does not make sense to specify spherical coordinate deltaX/Y for a curvilinear grid, does it? The best that can happen, is that these parameters are ignored, and I think that is what you are seeing. Have look here:

http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/arctic/

for examples of a curvilinear grid across the Arctic using the OLD_GRID_IO method. The grid files contain longitude and latitude and there’s no ambiguity about the grid.

Another option is to rotate a spherical grid so that the converging longitudes are moved out of your region of interest. This has been done before and there are parameters for this (from PARAMS.h: 
C     rotateGrid      :: rotate grid coordinates to geographical coordinates
C                        according to Euler angles phiEuler, thetaEuler, psiEuler
)

Only on a spherical grid (or cartesian grid), the parameters ygOrigin, delx/dely have a meaning. f0 can only be used with a cartesian grid. It does not make too much sense to have an f- or beta-plane in a non-cartesian grid (as far a I know).

Martin


> On 1. Oct 2018, at 11:46, Yi-Chih Huang <dscpln at gmail.com> wrote:
> 
> Hello MITgcm Support experts,
> 
>     I work on idealized simulation on the curvilinear coordinates in MITgcm.  I am trying to prepare the horizGridFile for the curvilinear coordinates.   By trial and error I completed a matlab script below to generate horizGridFile for the curvilinear coordinates.  Do you think this file grid.bin as the attachment satisfies the need of 10N-90N for the curvilinear coordinates in MITgcm?  
> 
>     I used grid.bin in data in execution of MITgcm and got almost the same temperature field as giving delX=320*0.25, and delY=320*0.25 in the data file.  In fact, I got almost the same temperature field with the same horizGridFile in the following two conditions of f0 and ygOrigin after 750000 sec intergration.  Although I work on idealized simulations, I can't help but ask do I need to prepare different horizGridFile for 0N-80N and 10N-90N?  How to let MITgcm know the domain is 10N-90N instead of 1N-9N?
> 
> f0=2.531787E-5,,
> ygOrigin=10.,
> 
> f0=0.,
> ygOrigin=0.
> 
>     Thanks much,
> 
>                       Yi-Chih
> 
> ####################################################
> addpath('C:\Users\huang\Documents\MITgcm\Matlab_scripts')
> cd C:\Users\huang\Documents\MITgcm\vel_out\run_n_320_253t;
> 
> xc = rdmds('XC');
> yc = rdmds('YC');
> lon = 10.25:0.25:90;
> lat = 10.25:0.25:90; 
> % 2d field fld2d on lon-lat grid:
> % fld = interp2(lon,lat,fld2d,xc(:),yc(:),method); % method = 'linear','cubic', etc see help interp2
> A=rdmds('T.0000000000.001.001');
> size(A);
> fld = interp2(lon,lat,A(:,:,1),xc(:),yc(:),'spline');
> fld = reshape(fld,size(xc));
> writebin('grid.bin', fld, 1, 'real*4');
> <grid_10N_90N.bin>_______________________________________________
> 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