[MITgcm-support] Offline tracer advection

Neill Mackay neill_mackay at hotmail.com
Mon Jul 4 11:02:50 EDT 2011


Hi Oliver,

Thanks a lot for the explanation - I've been away on holiday for 2 weeks so I'm just getting back to this. First off you are correct in assuming that my data.off parameters are as follows:

  deltaToffline=43200.,
  offlineForcingPeriod=2592000.,
  offlineForcingCycle=31104000.,

Trying with offlineOffsetIter=-30 as you suggested, the model then looks for files with indexes e.g.

030
090
120
...
690

Looking at the output file (attached), it still seems to use files with indexes 690 and 030 to interpolate between for the first 30 iterations, i.e. up to the middle of January. I'm interpreting the following lines in the output.txt file as indicating that the model is using a particular interpolation for a particular iteration:

 EXTERNAL_FIELDS_LOAD,         0 : iP,iLd,i0,i1=   12    0   12    1 ; Wght=  0.5000000000  0.5000000000
 EXTERNAL_FIELDS_LOAD, it=         0 : Reading new data, i0,i1=   12    1 (prev=   12    0 )
 OFFLINE_FIELDS_LOAD,         0 : iP,iLd,i0,i1=   12    0   12    1 ; Wght=  0.5000000000  0.5000000000
 OFFLINE_FIELDS_LOAD, it=         0 : Reading new data, i0,i1=   12    1 (prev=   12    0 )
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/uVeltave.0000000690.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/uVeltave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/vVeltave.0000000690.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/vVeltave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/wVeltave.0000000690.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/wVeltave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/Convtave.0000000690.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/Convtave.0000000030.001.001.data

Where I'm taking 'EXTERNAL_FIELDS_LOAD,      0' to mean we are dealing with the first iteration, and

 EXTERNAL_FIELDS_LOAD,        30 : iP,iLd,i0,i1=   12    1    1    2 ; Wght=  1.0000000000  0.0000000000
 EXTERNAL_FIELDS_LOAD, it=        30 : Reading new data, i0,i1=    1    2 (prev=   12    1 )
 OFFLINE_FIELDS_LOAD,        30 : iP,iLd,i0,i1=   12    1    1    2 ; Wght=  1.0000000000  0.0000000000
 OFFLINE_FIELDS_LOAD, it=        30 : Reading new data, i0,i1=    1    2 (prev=   12    1 )
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/uVeltave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/uVeltave.0000000090.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/vVeltave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/vVeltave.0000000090.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/wVeltave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/wVeltave.0000000090.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/Convtave.0000000030.001.001.data
(PID.TID 0000.0001)  MDS_READ_FIELD: opening file: input_off/Convtave.0000000090.001.001.data

Which appears to be 30 iterations later, and begins to use the next 2 files. Have I interpreted the output correctly in that the number next to 'EXTERNAL_FIELDS_LOAD' represents the iteration the model is on, and therefore for the first 30 iterations (i.e. up to the middle of January) it is using a velocity field interpolated between files 690 and 030?

It seems that if this is the case, then the model is still not treating my velocity fields as if they corresponded to the beginning of the month, regardless of the index numbers I give the file names.

Regarding the precision and endianness of the data, I'm not sure how to check if these are right. The precision seems to be defined as 32-bit, and the endianness as byte-swapped by the Matlab code I am using (inherited from elsewhere) to convert the velocity arrays into data files for the model to read:

fnameU=sprintf('%s.%010d.001.001.data','uVeltave',filenum);
fid=fopen(fnameU,'w','ieee-be');
U(isnan(U))=0.;
fwrite(fid,Uin,'float32');
fclose(fid);

Are these attributes specific to the architecture of the machine I am using to run the model? I've run a test using the same lines of script to create the velocity field files, but with the velocities set to be the same at all points in space and at all timesteps, and the output looks much more normal (no negative concentrations). Does this perhaps suggest that it is the values of the velocities in the original Matlab arrays that are suspect? I have taken these from a model called 'SatGEM' which is based on an extrapolation from sea-surface-height, and am not yet certain of their suitability for this task. One final thing is that I'm currently using the velocity data from only once a month, when the data is in fact available at weekly intervals. I wonder if this is likely to be the underlying problem? I'm in the process of downloading the rest of the data to fill in the gaps, but it'll take a while.

Thanks very much again for any advice you have - sorry for the long-winded e-mail (hope it makes some sense)!

Cheers,

Neill.

> Date: Mon, 20 Jun 2011 15:53:55 -0400
> From: jahn at MIT.EDU
> To: mitgcm-support at mitgcm.org
> CC: neill_mackay at hotmail.com
> Subject: Re: [MITgcm-support] Offline tracer advection
> 
> Hi Neill,
> 
> the fields are actually assumed to correspond to the middle of the 
> forcing period (which makes sense if they are time averages).  It will 
> then interpolate between the December and January fields to get a value 
> for January 1st.
> 
> If the fields you provide actually are at times 0, 1 month, etc., you 
> can set
> 
>   offlineOffsetIter=-30
> 
> to tell the model to look for the January 1st field in a file with 
> 0000000060 in the name, etc.
> 
> I am assuming that your time step is 43200 seconds (from what you 
> describe) and
> 
>   offlineForcingPeriod=2592000.
> 
> However, I do not see why what you did should lead to large negative 
> tracer values if the December files contain valid velocity fields.  Are 
> you sure the files have the correct precision/endianness?
> 
> Cheers,
> Oliver
> 
> 
> On 06/20/2011 05:04 AM, Martin Losch wrote:
> > Neill,
> >
> > I don't know too much about this package, but there was a thread on a similar subject just a few days/weeks ago, maybe looking at the support archives will help. I assume that you can set a phase difference by using parameters like "offlineIter0" (have a look at offline_readparams.F)
> >
> > Martin
> >
> > On Jun 16, 2011, at 8:02 PM, Neill Mackay wrote:
> >
> >> Hi all,
> >>
> >> I'm attempting to modify the tutorial_offline experiment to advect a tracer using a velocity field I am defining. I've been able to get the model to accept the time-varying velocity field I've provided by setting the 'useOFFLINE=.TRUE.,' flag in the data.pkg file (as prompted by an e-mail on this list yesterday from someone grappling with the same problem), but I'm having difficulty with the filename format. On my first attempt, I used the following format, as recommended in the manual section 3.20.3.2:
> >>
> >> uVeltave.0000000001.data
> >>
> >> With 12 files each for u,v and w, and with sequence identifiers 1-12 (one for each month of the year-long model run). However, when running the model (compilation works ok), the output ended with the following lines:
> >>
> >> (PID.TID 0000.0001)  MDS_READ_FIELD: filename: input_off/uVeltave.0000000720 , input_off/uVeltave.0000000720.001.001.data
> >> (PID.TID 0000.0001)  MDS_READ_FIELD: Files DO not exist
> >>
> >>
> >> So I modified the input files to have indexes starting at 060 for the first file, and ending at 720 for the last, and this allowed the model to pick up and use the velocity fields. However what it appears to do, looking at the output, is to take the '720' files first, and interpolate between that and the '060' file, and then move forward from there. This is not what I want, since actually the '060' file (originally named '001' in my first attempt) has data from the start of January, with the next file the start of Feb and so on, with '720' being the start of December. Using the velocity fields the way they are currently being treated gives some funny results (large negative values of tracer concentration after the first timestep).
> >>
> >> Since the model seems to expect the files to correspond to the end of each period and not the start, is there a way I can get around this? The main problem seems to be that the model is using the last file to wrap-around for the beginning, so is there a way I can tell it to use a different file to start?
> >>
> >> Thanks,
> >>
> >> Neill.
> >>
> >>
> >>
> >> _______________________________________________
> >> MITgcm-support mailing list
> >> MITgcm-support at mitgcm.org
> >> http://mitgcm.org/mailman/listinfo/mitgcm-support
> >
> >
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-support
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20110704/e47c1475/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: output.txt
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20110704/e47c1475/attachment-0001.txt>


More information about the MITgcm-support mailing list