[MITgcm-support] Bug in rdmds.m when loading multiple record files

Yuan Lian lian at ashimaresearch.com
Thu May 16 14:13:55 EDT 2013


Hi Jean-Michel,

Thanks. I will let you know if I notice something else.

Best,
Yuan


On 5/16/13 6:14 AM, Jean-Michel Campin wrote:
> Hi Yuan,
>
> I have checked-in your suggested modification in rdmds.m.
> Let me know if something does not work.
>
> Thanks,
> Jean-Michel
>
> On Tue, May 14, 2013 at 11:07:02AM -0700, Yuan Lian wrote:
>> Hi Jean-Michel,
>>
>> The default MITgcm outputs work fine with the current rdmds, with or
>> without multiple records. The problem will occur only when I define
>> some variables that may confuse rdmds, e.g., the example I provided.
>>
>> The reason why I suggest to make change to the current rdmds is that
>> sometimes people may opt to use multiple record files to reduce the
>> number of outputs. For instance, there is a hard limit of number of
>> files on NASA Pleiades. To avoid constantly reaching the limit I had
>> to use multiple-record format for all outputs, including the
>> time-averaged quantities such as Ttave, though I need to hack the
>> code in timeave to do so.
>>
>> Best,
>> Yuan
>>
>>
>> Sent with AquaMail for Android
>> http://www.aqua-mail.com
>>
>>
>> On May 14, 2013 9:55:01 AM Jean-Michel Campin <jmc at ocean.mit.edu> wrote:
>>> Hi Yuan,
>>>
>>> Thanks for the report. Will take a look at this.
>>>
>>> I also think that as soon as a user specify one or a list of (or all, if NaN)
>>> iteration number to read-in, then this problem does now show up
>>> (since it become T.[10-digits-iteration-number]*.meta ),
>>> so that it makes it less likely to happen. We have few output file with
>>> multiple records corresponding to different fields (e.g., "thSIce_tave"),
>>> but they still have iteration number in their file-name; or may-be
>>> I missed something. Did you turn-on special option to generate
>>> these files ?
>>>
>>> Cheers,
>>> Jean-Michel
>>>
>>> On Mon, May 13, 2013 at 04:03:41PM -0700, Yuan Lian wrote:
>>>> Hi all,
>>>> I noticed a bug in rdmds.m under MITgcm/utils/matlab, which only
>>>> affects the multiple-record files.
>>>> The problem comes from line 149:
>>>> allfiles=dir( sprintf('%s*.meta',fname) );
>>>> For example, when one wants to load A=rdmds('T', 'rec', 1), it
>>>> actually will look up all variables starting with
>>>> 'T', including 'Ttave' etc. This is particularly problematic if
>>>> there are user defined output variables, e.g.,
>>>> if one wants to use variable name 'TSK' (surface temperature in this
>>>> example). Because the function
>>>> "localrdmds" in rdmds is called within the j=1, size(allfiles,1)
>>>> loop (line 157), the desired variable "T"
>>>> will be partially or entirely overwritten by "TSK" depending on the
>>>> size of TSK.
>>>> Moving "*" right before "meta" can easily address the issue without
>>>> affecting other functionality:
>>>> allfiles=dir( sprintf('%s.*meta',fname) );
>>>> Hope this helps.
>>>> Best,
>>>> Yuan
>>>>
>>>> _______________________________________________
>>>> 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
>>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list