[MITgcm-support] Re: OB*file interpolation

Martin Losch Martin.Losch at awi.de
Mon Mar 19 06:51:44 EDT 2007


Hi Riema
On 16 Mar 2007, at 15:33, Riema Rachmayani wrote:

> I may have been a little sloppy in describing exp4: The open boundary
> files actually contain two time slabs (for testing), but because in
> data periodicExternalForcing is not set to true, time independent
> forcing (and open boundaries) are assumed by default and only the
> first time slab is used.
> ==> i understand...
>
> OK, but in your case you want to prescribe hourly values for 19 days,
> that is 24*19=456 time slabs, so you field must have the size (Nx,Nr,
> 456) for a southern or northern boundary and (Ny,Nr,456) for an
> eastern or western boundary (Nr=Nz=number of vertical points).
> ==> (Nx, Nr, 456) for example Nx=111, Nr=8 means i write in a  
> file : 111 different values to the right side, 8 different values  
> downward (8 layers) for each different slab, so there will contains  
> 111*8*456 =404928 values of data??
Correct.
>  (Ny, Nr, 456) ,Ny=255,Nr=8,means i write in a file : 255 different  
> values to the right side, 8 different values downward (8 layers)  
> for each different slab, so there will contains 111*8*456 =404928  
> values of data??
255*8*456 = 930240

>
> and automatically read by MITgcm??
yes, that's the idea.
>
> If you want to specify a "barotropic" open boundary in/outflow, then
> for each time slab you have to have a fields like this, eg. for a
> soutern or northern boundary:
>
> ==>"barotropic" open boundary in/outflow means constant value of T  
> and S?? what the different with "baroclinic" open boundary in/ 
> outflow means dont held constant value of T and S?? this is what i  
> want to ask too, about difference of baroclinic and barotopic  
> treatment in MITgcm...(i sent in my previous message, subject :  
> baroclinic, barotropic and bathyfile)
I am not sure how to answer that. there is not barotropic/baroclinic  
velocity splitting the MITgcm, so you specify the full velocity and  
the full t/s fiels. What these fields look like is completely YOUR  
responsibility.
> for t=1:456
> for z=1:nr
> for x=1:nx
> uob(x,z,t) = U(t)
> end;end;end
> if U(t) is your time series.
This was meant to be matlab code for inclusion into something like a  
"gendata.m"
> ==>in what routine i wrote that code configuration???
> U(t) is just like my  U_AOK.IN?? means in every nx, in every nr has  
> 1 value for each different slabs, so that file contains 1*1*456=456  
> value of data??is that what you mean about barotopic open boundary  
> in/outflow??
No you alway need the full (2d + time) fields as above
>
> your File U_AOK.IN contains 1140 real*4 values with the following
> range/mean:
> Min 4.2563e-31 Max 0.00017648 Mean 7.6306e-06 SD 3.1229e-05
> (At least that's what I read in with matlab:
> > fid=fopen('U_AOK.IN','r','b');
> > v=fread(fid,inf,'real*4');
> ==>uups sorry, i sent the wrong file...thats why the
> distribution looks strange....really sorry...i send it again for  
> you...(U_A.OK), my U_A.OK only contains 456 values, min -4.1189,  
> max 3.6017 ,
> in matlab :
> fid2  = fopen('U_A.OK','r','b');
> W= fread(fid2,inf,'real*4');
>
> ) so that is 2.5 times the 456 number of times that you need (and the
> distribution looks strange). If you use this as U(t) then the model
> will only read the first 456 time slabs and disregard the rest, so no
> problem specifying it, but they will not affect your simulation.
>
> ==>so there is no 2.5 times of numbers, it contains 456 time slabs  
> for 1 point (tip point at west) for northern open boundary at the  
> surface...
OK.
> The
> 456 time slabs will be interpolate (linearly) in time between the
> hourly values to your 1.5sec time steps, but only specified at the
> open boundary. (not in the interior unless you use a sponge layer)
> ==>so to interpolate my file to my 1.5sec time steps just write in  
> data file :
>
> # Time stepping parameters
> &PARM03
> niter0=0,
> nTimeSteps=1641600,
> deltaT=1.5,
> abEps=0.1,
> pChkptFreq=0.0,
> chkptFreq=0.0,
> dumpFreq=11160.,
> monitorFreq=2500.,
> # for time dependent open boundary conditions comment
> # in the following three lines
> periodicExternalForcing=.TRUE.,
> externForcingPeriod=3600.,
> externForcingCycle=1641600.,
> &
>
> in data.obcs :
> # Open-boundaries
> &OBCS_PARM01
> OB_Jnorth=-1,
> OB_Jsouth=1,
> OB_Ieast=-1,
> OB_Iwest=1,
> # useOrlanskiEast=.TRUE.,
> # useOrlanskiWest=.TRUE.,
> # useOrlanskiNorth=.TRUE.,
> # useOrlanskiSouth=.TRUE.,
> # useOBCSsponge=.TRUE,
> useOBCSprescribe = .TRUE.,
> OBNuFile = U_A.OK',
> # OBSuFile = 'OBmeridU.bin',
> # OBWuFile = 'OBzonalU.bin',
> # OBEuFile = 'OBzonalU.bin',
> # OBWsFile = 'OBzonalS.bin',
> &
>
> and then automatically will be interpolate lineraly by MITgcm??
> my U_A.OK in that configuration it doesnt contains (Nx,Nr,Nt) like  
> you told me, just contains for 1 point for 456 time slabs,is that  
> ok??will affect my simulation?? like i told you before in my  
> previous message that i want to interpolate in spatial (inner of  
> point A and point B for example) and in time (linear interpolation)...
NO, you need to do this (matlab code):
fid2  = fopen('U_A.OK','r','b');
U= fread(fid2,inf,'real*4');
fclose(fid2);
for t=1:456
for z=1:nr
for x=1:nx
uob(x,z,t) = U(t)
end;end;end
fid3=fopen('U_A2D.obn','w','b');
fwrite(fid3,uob,'real*4');
fclose(fid3);
and then in data.obcs
  OBNuFile = U_A2D.obn',
and the same for your other open boundaries (and boundary values).

Martin



More information about the MITgcm-support mailing list