[MITgcm-support] [EXTERNAL] changing one entry in pickup files

Paola Cessi pcessi at ucsd.edu
Tue May 12 19:33:14 EDT 2020


Hi Gael,

thanks for the pointers. I will try it out and report on the results.

Cheers,

Paola

----------------------------------------------
Paola Cessi   
Scripps Institution of Oceanography  
9500 Gilman Drive #0213               
La Jolla, CA 92093-0213
USA               
Tel: +1 858 534 0622   Fax: +1 858 534 8045
e-mail: pcessi at ucsd.edu     Web:  http://www-pord.ucsd.edu/~pcessi

Delivery address (Fed-Ex, DHL, UPS, etc.):
Paola Cessi
University of California San Diego
Keck Center - Room 366
8851 Shellback Way
La Jolla, CA 92093-0213
USA




> On May 11, 2020, at 6:44 PM, Gael Forget <gforget at mit.edu> wrote:
> 
> Hi Paola
> 
> The meta file created by this package indeed does not seem to include the list of variables. However, I think it should be the same list of 9 variables described in https://mitgcm.readthedocs.io/en/latest/outp_pkgs/outp_pkgs.html#input-files <https://mitgcm.readthedocs.io/en/latest/outp_pkgs/outp_pkgs.html#input-files> . Below is an exert from flt_init_varia.F which is consistent with the documented list. 
> 
> Its important to note that the first record (i.e. 9 element vector) is special. This is stated in the doc but not excessively clear and kind of tricky imho.
> 
> In any event, you should be able to read these files in Matlab using rdmds.m as usual (a copy is in https://github.com/MITgcm/gcmfaces <https://github.com/MITgcm/gcmfaces>). Doing it this way may read all tile pickups in one multidimensional array.  
> 
> Alternatively if you want more granular control on read and write, you can use read2memory and write2file (also in gcmfaces <https://github.com/MITgcm/gcmfaces>; try e.g. `help read2memory`). 
> 
> In an example where nrecords is 74 (from the meta file), this should be something like this :
> 
> >> tmp2=read2memory('pickup_flt.ckptA.001.001.data',[9 74],64)
> 
> I copy below the first and 2nd records for reference. All of the others look like #2. 
> 
> And then writing the modified pickup to a new file would look like this :
> 
> >> write2file(‘modified/pickup_flt.ckptA.001.001.data',tmp2,64)
> 
> Hope this helps. Sorry this stuff is still not documented well enough. Good luck with your experiment.
> 
> Best,
> Gael
> 
> 
> >> tmp2(:,1)
>           73
>        18001
>     10800600
>            0
>            0
>          300
>            9
>            0
>            0
> 
> >> tmp2(:,2)
>    12.0000
>   600.0000
>    13.2794
>    13.2823
>     3.0000
>          0
>          0
>          0
>    -1.0000
> 
> From flt_init_varia.F :
> 
> 152               npart( npart_tile(bi,bj),bi,bj) = tmp(1)
> 153               tstart(npart_tile(bi,bj),bi,bj) = tmp(2)
> 154               ipart( npart_tile(bi,bj),bi,bj) = ix
> 155               jpart( npart_tile(bi,bj),bi,bj) = jy
> 156               kpart( npart_tile(bi,bj),bi,bj) = kz
> 157               kfloat(npart_tile(bi,bj),bi,bj) = tmp(6)
> 158               iup(   npart_tile(bi,bj),bi,bj) = tmp(7)
> 159               itop(  npart_tile(bi,bj),bi,bj) = tmp(8)
> 160               tend(  npart_tile(bi,bj),bi,bj) = tmp(9)
> 
> 
> 
> 
>> On May 11, 2020, at 8:18 PM, Paola Cessi <pcessi at ucsd.edu <mailto:pcessi at ucsd.edu>> wrote:
>> 
>> Hi Dimitri,
>> 
>> I am using matlab. These are pickups files from the flt package, so I am not sure they are the same as the regular MITgcm pickups. They are written and read with the mdsio package.
>> 
>> I _think_ that what I need to change is the 9th entry of the “arr" array, i.e. arr(9) written/read by the routines mdsio_wr_rec_rl.F/mdsio_rd_rec_rl.F. That said, I don’t understand how to locate this variable given the .meta file (attached).
>> 
>> Many thanks,
>> 
>> <pickup_flt.ckptA.001.001.meta>
>> 
>> 
>> Paola
>> 
>> ----------------------------------------------
>> Paola Cessi   
>> Scripps Institution of Oceanography  
>> 9500 Gilman Drive #0213               
>> La Jolla, CA 92093-0213
>> USA               
>> Tel: +1 858 534 0622   Fax: +1 858 534 8045
>> e-mail: pcessi at ucsd.edu <mailto:pcessi at ucsd.edu>     Web:  http://www-pord.ucsd.edu/~pcessi <http://www-pord.ucsd.edu/~pcessi>
>> 
>> Delivery address (Fed-Ex, DHL, UPS, etc.):
>> Paola Cessi
>> University of California San Diego
>> Keck Center - Room 366
>> 8851 Shellback Way
>> La Jolla, CA 92093-0213
>> USA
>> 
>> 
>> 
>> 
>>> On May 11, 2020, at 4:41 PM, Dimitris Menemenlis <dmenemenlis at gmail.com <mailto:dmenemenlis at gmail.com>> wrote:
>>> 
>>> Hi Paola, do you use matlab or python?
>>> 
>>> If matlab and if noone answers with a generic answer, please send your pickup*.meta file and let me know which variable you want to replace and I will send you two lines of matlab code (and two small scripts) that will read and write the desired variable from and to the pickup file.
>>> 
>>> Cheers, Dimitris
>>> 
>>>> On May 11, 2020, at 3:39 PM, Paola Cessi <pcessi at ucsd.edu <mailto:pcessi at ucsd.edu>> wrote:
>>>> 
>>>> I need to change one entry in the pick-up files. Is there a simple sample program to read a pickup file change, one entry and write it again with the entry changed?
>>>> 
>>>> Thanks,
>>>> 
>>>> Paola
>>>> 
>>>> ----------------------------------------------
>>>> Paola Cessi   
>>>> Scripps Institution of Oceanography  
>>>> 9500 Gilman Drive #0213               
>>>> La Jolla, CA 92093-0213
>>>> USA               
>>>> Tel: +1 858 534 0622   Fax: +1 858 534 8045
>>>> e-mail: pcessi at ucsd.edu <mailto:pcessi at ucsd.edu>     Web:  http://www-pord.ucsd.edu/~pcessi <http://www-pord.ucsd.edu/~pcessi>
>>>> 
>>>> Delivery address (Fed-Ex, DHL, UPS, etc.):
>>>> Paola Cessi
>>>> University of California San Diego
>>>> Keck Center - Room 366
>>>> 8851 Shellback Way
>>>> La Jolla, CA 92093-0213
>>>> USA
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> MITgcm-support mailing list
>>>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>>>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support <https://urldefense.com/v3/__http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support__;!!Mih3wA!QoirxRdRyr4vnrPbSnaKY7tFkekGeHWD65KRYp5_8wt09DuCmWRzUfDbDwwgxw$>
>>> 
>>> _______________________________________________
>>> MITgcm-support mailing list
>>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>>> https://urldefense.com/v3/__http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support__;!!Mih3wA!QoirxRdRyr4vnrPbSnaKY7tFkekGeHWD65KRYp5_8wt09DuCmWRzUfDbDwwgxw$ <https://urldefense.com/v3/__http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support__;!!Mih3wA!QoirxRdRyr4vnrPbSnaKY7tFkekGeHWD65KRYp5_8wt09DuCmWRzUfDbDwwgxw$> 
>> 
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support <http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20200512/802a9642/attachment-0001.html>


More information about the MITgcm-support mailing list