[MITgcm-support] to prepare horizGridFile for the curvilinear coordinates

Yi-Chih Huang dscpln at gmail.com
Mon Oct 1 13:03:20 EDT 2018


Martin,

    Thanks much for the reply.  I wish to conduct idealized simulations
with the domain 10N - 90N in the curvilinear coordinates in MITgcm.  Did
you mean the matlab script I pasted in the previous email cannot provide
the latitude information for MITgcm in the curvilinear coordinates?  Also,
there is no horizontal grid information in the data file for
the curvilinear coordinates in the three cases on
http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/arctic/ as below.
Could you indicate where is the related horizGridFile?

# Gridding parameters &PARM04 usingCartesianGrid=.FALSE.,
usingSphericalPolarGrid=.FALSE., usingCurvilinearGrid=.TRUE., delR = 10.00,
10.00, 10.00, 10.00, 10.00, 10.00, 10.00, 10.01,
10.03, 10.11, 10.32, 10.80, 11.76, 13.42, 16.04 , 19.82, 24.85, 31.10,
38.42, 46.50, 55.00, 63.50, 71.58, 78.90, 85.15, 90.18, 93.96, 96.58,
98.25, 99.25,100.01,101.33,104.56,111.33,122.83,
139.09,158.94,180.83,203.55,226.50,249.50,272.50,295.50,318.50, & Many
thanks, Yi-Chih

######################################################################################
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');
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20181001/5eb8a9f8/attachment.html>


More information about the MITgcm-support mailing list