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

Martin Losch Martin.Losch at awi.de
Tue Oct 2 03:16:30 EDT 2018


Did you see the readme.txt?, e.g.:

http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/arctic/cs_36km/readme.txt

I describes in great detail, what you need for this type of configuration. In code/CPP_OPTIONS.h the line 
#define OLD_GRID_IO
makes the model expect a certain set of input files. These are not specified in the any of the namelist files.
The various input files don’t seem to be available anymore, but the readme.txt lists, what type of files you need to have the appropriate grid information, I put a similar configuration here:

https://www.dropbox.com/s/9nrmtc3gk2ltt8k/input.tgz?dl=0

and in case you want to see them the obcs-files:

https://www.dropbox.com/s/4l0mpuufg63re54/obcs.tgz?dl=0


domain 10N-90N sounds to me like “northern hemisphere to the north pole”, but how do you construct your curvilinear grid? Just setting curvilinearGrid=.TRUE. is not enough for the model to know what you want to do. For this type of grid, you need to carefully prescribe every detail of the grid yourself.

I suggest that you have a look at the manual, in particular 
Section 2.11 Spatial discretization of the dynamical equations 
and
https://mitgcm.readthedocs.io/en/latest/algorithm/horiz-grid.html
I admit that there is little information about the curvilinear grid. But the above example (readme.txt) basically describes, what you need.

Martin

> On 1. Oct 2018, at 19:03, Yi-Chih Huang <dscpln at gmail.com> wrote:
> 
> 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');  
> _______________________________________________
> 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