[mpas-developers] COMMIT CHECK: Don't fail if variables and/or dimensions are not present in input file

Michael Duda duda at ucar.edu
Wed Oct 17 15:25:34 MDT 2012


Hi, Doug.

Thanks for taking a look at this. I'd like to understand the issue a bit
more, I think, before we decide on a fix. Could you or Mark give a
concrete example of the problem (e.g., by providing a set of registry
entries, mentioning which are in the input file and which aren't)?

Just speculating, would the following be an example?

   dim nUpdateTimes nUpdateTimes

   var persistent real uForcing ( nUpdateTimes nCells ) 1 ir uForcing blah - -

when uForcing is not present in the input file?

Does the proposed solution affect the results when, e.g., we have the
following variables and dimensions

   dim nVertLevels nVertLevels
   dim nCells      nCells

   var persistent real foo1 ( nVertLevels nCells ) 1 ir foo1 blah - -
   var persistent real foo2 ( nVertLevels nCells ) 1 ir foo2 blah - -


and foo1 is not present? If foo2 is present in the file, will it
nonetheless be dimensioned as (1,1)?

Another approach to this problem would be to check the return code from
the MPAS_io_inq_dim() routine at the point where it is called, and to
determine there how to deal with dimensions that are not found. If a
dimension isn't found, I'm a bit hesitant to have the MPAS_io_inq_dim()
routine return a sensible value for the dimension's length rather than a
value such as -1 that forces the caller to make a concious decision on
how to act.

Michael


On Tue, Oct 16, 2012 at 03:53:46PM -0600, Mark Petersen wrote:
> This is a great help, as we can now add variables with an 'i' input 
> setting that may not always be present, like the monthly forcing files 
> that have cause trouble lately.
> 
> Thanks Doug, it looks good to me.
> 
> Mark
> 
> On 10/16/12 15:19, Doug Jacobsen wrote:
> >Hello All,
> >
> >I would like to propose another trunk commit. This commit modifies 
> >mpas_io.F.
> >
> >Currently, if a dimension or is not present in an input/restart file 
> >and a variable is dimensioned using this dimension mpas will fail upon 
> >doing a halo update on the field. This happens because the missing 
> >dimension is -1 and MPI doesn't appreciate this.
> >
> >In this fix, I set the default dimension to 1, but print a warning to 
> >log.*.err that says the dimension was missing and to ensure that it 
> >was present in the input file if it should not be 1.
> >
> >Please let me know if anyone has an issue with this, if not I'll 
> >probably commit it tomorrow since it's only 2 lines of code that change.
> >
> >Thanks,
> >Doug
> >
> >
> >_______________________________________________
> >mpas-developers mailing list
> >mpas-developers at mailman.ucar.edu
> >http://mailman.ucar.edu/mailman/listinfo/mpas-developers

> _______________________________________________
> mpas-developers mailing list
> mpas-developers at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/mpas-developers



More information about the mpas-developers mailing list