[MITgcm-support] How does MITgcm readin grid from tile001.mitgrid file

Peng Zhan peng.zhan at kaust.edu.sa
Tue Apr 26 02:39:56 EDT 2016


Hi Chen,
Make sure '#define OLD_GRID_IO' in the CPP_OPINTIONS.h if you want to use
tile files.
In my case I am using a series of .bin file for the grid info and therefore
put '#undef OLD_GRID_IO'.
Best, Peng

On Tue, Apr 26, 2016 at 4:06 AM, 陈忱 <chen636489 at gmail.com> wrote:

> Hi All:
>
> I want the model to read grid from tiles file instead of specifying delX
> delY in input/data. However I did't find where to trigger this reading
> process. Here is what I have done so far:
>
> Taking the experiment from verification/internal_wave:
>
> (1) In compile time, I didn't change anything in code directory.
>
> (2) generate tile001.mitgrid file and drop it into internal_wave/input/:
>
> xc =rdmds('XC');
> yc =rdmds('YC');
> %dxf=rdmds('DXF');
> %dyf=rdmds('DYF');
> rac=rdmds('RAC');
> xg =rdmds('XG');
> yg =rdmds('YG');
> %dxv=rdmds('DXV');
> %dyu=rdmds('DYU');
> raz=rdmds('RAZ');
> dxc=rdmds('DXC');
> dyc=rdmds('DYC');
> raw=rdmds('RAW');
> ras=rdmds('RAS');
> dxg=rdmds('DXG');
> dyg=rdmds('DYG');
> dxf=zeros(60,1);dyf=zeros(60,1);dxv=zeros(60,1);dyu=zeros(60,1);
>
> n=1;
> fid=fopen( sprintf('tile%3.3i.mitgrid',n), 'w',ieee );
> fwrite(fid,xc(:,:,n),dtype);
> fwrite(fid,yc(:,:,n),dtype);
> fwrite(fid,dxf(:,:,n),dtype);
> fwrite(fid,dyf(:,:,n),dtype);
> fwrite(fid,rac(:,:,n),dtype);
> fwrite(fid,xg(:,:,n),dtype);
> fwrite(fid,yg(:,:,n),dtype);
> fwrite(fid,dxv(:,:,n),dtype);
> fwrite(fid,dyu(:,:,n),dtype);
> fwrite(fid,raz(:,:,n),dtype);
> fwrite(fid,dxc(:,:,n),dtype);
> fwrite(fid,dyc(:,:,n),dtype);
> fwrite(fid,raw(:,:,n),dtype);
> fwrite(fid,ras(:,:,n),dtype);
> fwrite(fid,dxg(:,:,n),dtype);
> fwrite(fid,dyg(:,:,n),dtype);
> fclose(fid);
>
> Noting that, XC, YC ,RAW.etc which rdmds read, is from an initial run0. I
> did everything in README, and it will return me the grid info in
> internal_wave/run/ directory in the format of data/meta.
>
> try(3a) internal_wave/input/data:
>
> making changes in data:
>
> # Gridding parameters
>
>  &PARM04
>  usingCartesianGrid=.TRUE.,
>  horizGridFile='tile001.mitgrid',
>  delZ=20*10.,
>  &
>
> === didn't work so far======
>
> try(3b) internal_wave/input/data:
>
> making changes in data:
>
> # Gridding parameters
> #hoping that the model could detect mitgrid itself.
>
>  &PARM04
>  usingCartesianGrid=.TRUE.,
>  delZ=20*10.,
>  &
>
> === didn't work either======
>
> (4) cd verfication/aim_51_cs/input:
>
> It contains tile001~006.mitgrid files. But it's not specify in input/data
> &PARAM5.
>
> (5) vim verfication/aim_51_cs/results/output.txt:
>
> (PID.TID 0000.0001) SET_PARMS: done
> (PID.TID 0000.0001) Enter INI_VERTICAL_GRID: setInterFDr=    T ;
> setCenterDr=    F
> (PID.TID 0000.0001) tile:   1 ; Read from file tile001.mitgrid
> (PID.TID 0000.0001)   => xC yC dxF dyF rA xG yG dxV dyU rAz dxC dyC rAw
> rAs dxG dyG
> (PID.TID 0000.0001) tile:   2 ; Read from file tile002.mitgrid
> (PID.TID 0000.0001)   => xC yC dxF dyF rA xG yG dxV dyU rAz dxC dyC rAw
> rAs dxG dyG
> (PID.TID 0000.0001) tile:   3 ; Read from file tile003.mitgrid
> (PID.TID 0000.0001)   => xC yC dxF dyF rA xG yG dxV dyU rAz dxC dyC rAw
> rAs dxG dyG
> (PID.TID 0000.0001) tile:   4 ; Read from file tile004.mitgrid
> (PID.TID 0000.0001)   => xC yC dxF dyF rA xG yG dxV dyU rAz dxC dyC rAw
> rAs dxG dyG
> (PID.TID 0000.0001) tile:   5 ; Read from file tile005.mitgrid
> (PID.TID 0000.0001)   => xC yC dxF dyF rA xG yG dxV dyU rAz dxC dyC rAw
> rAs dxG dyG
> (PID.TID 0000.0001) tile:   6 ; Read from file tile006.mitgrid
> (PID.TID 0000.0001)   => xC yC dxF dyF rA xG yG dxV dyU rAz dxC dyC rAw
> rAs dxG dyG
>
> (PID.TID 0000.0001) %MON XC_max                       =
> 1.7854351589505E+02
> (PID.TID 0000.0001) %MON XC_min                       =
>  -1.7854351589505E+02
> (PID.TID 0000.0001) %MON XC_mean                      =
>  -4.6999441375798E-15
> (PID.TID 0000.0001) %MON XC_sd                        =
> 1.0355545336287E+02
>
>
>
> ===========================================================================================
> I attached the STDOUT.0000 STDERR.0000 for step(3)(4).
>
> It seems mitgcm first of all didn't notice the grid should be imported
> from tile001.mitgrid.
>
> I also have download tile001.mitgrid file online and replaced it with
> mine. The same error appear here again.
>
> I also dig into ini_cartesian_grid & load_grid_spacing, didn't find where
> to read mitgrid.
>
> In all, the main question here will be,* where and how does mitgcm read
> .mitgrid file during run time.*
>
>
> Thank you in advance for your attention!
> --
> Chen CHEN
> Graduate Student in ICES&EM
> The University of Texas at Austin
>
>
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>


-- 

Peng ZHAN

______________________________
PhD Candidate
Earth Science & Engineering (ErSE)
King Abdullah University of Science and Technology (KAUST)
Bldg 1, Lv 4, 4700 KAUST, Thuwal 23955-6900, Jeddah, Saudi Arabia
Mobile: +966 544701621
* <peng.zhan at kaust.edu.sa>*

-- 

------------------------------
This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing 
this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20160426/f973f4fb/attachment.htm>


More information about the MITgcm-support mailing list