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

Jean-Michel Campin jmc at ocean.mit.edu
Tue May 14 12:55:01 EDT 2013


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




More information about the MITgcm-support mailing list