[mpas-developers] COMMIT CHECK: Issue with registry

Michael Duda duda at ucar.edu
Thu Apr 26 11:58:01 MDT 2012


Hi, Doug.

I think whenever possible, it's better to use (len=*) if the routine can 
be written in a general way such that a particular string length is not assumed.
So, I'd suggest to only change code that uses a specified string length.

Michael


On Thu, Apr 26, 2012 at 11:38:13AM -0600, Doug Jacobsen wrote:
> With these changes, would you like to see all len=* changed to len=StrKIND
> too? Or just len=#?
> 
> Thanks,
> Doug
> 
> On Thu, Apr 26, 2012 at 10:50 AM, Michael Duda <duda at ucar.edu> wrote:
> 
> > Hi, Doug.
> >
> > This sounds like a great idea to me.
> >
> > Michael
> >
> >
> > On Wed, Apr 25, 2012 at 03:15:05PM -0600, Doug Jacobsen wrote:
> > > Hi All,
> > >
> > > I figured I would give everyone one last call for input since I know some
> > > of you were rather busy last week.
> > >
> > > I'll work on this tomorrow if I don't hear from anyone. Thanks!
> > >
> > > Doug
> > >
> > > On Mon, Apr 16, 2012 at 3:23 PM, Doug Jacobsen
> > > <jacobsen.douglas at gmail.com>wrote:
> > >
> > > > Hi Again All,
> > > >
> > > > Actually after some discussion within the ocean group here, I think we
> > > > have come up with a better solution. Though this solution requires more
> > > > code changes than the simple one I sent out previously.
> > > >
> > > > The solution is to define a new kind type, lets call it StrKIND. Then
> > > > replace the length of all hardcoded strings with this StrKIND. This
> > would
> > > > allow us to have the length of strings controlled by the
> > mpas_kind_types
> > > > module.
> > > >
> > > > If everyone is ok with this, I can modify it throughout mpas. Just to
> > be
> > > > clear, all lines that have something like "char (len=32)" would change
> > to
> > > > "char (len=StrKIND)". This would also change in the gen_inc.c file I
> > > > attached previously in order to allow the string length to be standard
> > > > across mpas.
> > > >
> > > > If anyone have comments of questions please let me know.
> > > >
> > > > I'll probably give this until early next week before I begin working
> > on it.
> > > >
> > > > Thanks,
> > > > Doug
> > > >
> > > >
> > > > On Fri, Apr 13, 2012 at 4:29 PM, Doug Jacobsen <
> > jacobsen.douglas at gmail.com
> > > > > wrote:
> > > >
> > > >> Hi All,
> > > >>
> > > >> We recently came across an issue with registry, where namelist
> > variables
> > > >> are truncated to be 32 characters in length. This is a problem when
> > we have
> > > >> really long prefixes for files like the block/proc decomposition
> > files, or
> > > >> even grid file names. The fix is pretty simple in the
> > > >> src/registry/gen_inc.c file, but I wanted some input on the max
> > length for
> > > >> these variables.
> > > >>
> > > >> Things like the input/output filename are truncated to 1024 within the
> > > >> MPAS code (see src/framework/mpas_io_input.F) while things like the
> > > >> decomposition filename are truncated to be 256 characters (see
> > > >> src/framework/mpas_block_decomp.F).
> > > >>
> > > >> It seems like overkill to make all strings 1024 (or even 256 for that
> > > >> matter) but I was curious what everyones preference is. I have
> > attached a
> > > >> copy of gen_inc.c where I changed the truncation limit from 32 to 256
> > so
> > > >> everyone can see what has to change, but feel free to provide input
> > on the
> > > >> max length for these strings.
> > > >>
> > > >> Doug
> > > >>
> > > >
> > > >
> >
> > > _______________________________________________
> > > 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