[mpas-developers] Restructuring high-level MPAS driver

Michael Duda duda at ucar.edu
Fri Oct 29 12:08:07 MDT 2010


Hi, Phil.

These are excellent comments -- thanks!

Along with eventually having arguments for input state, output
state, and timers, I think we should consider that it should be
possible to invoke the run() routine multiple times during the
course of a simulation; that is, it should be possible for the
driver to call

   init(...)
   run(..., alarm)
   run(..., alarm)
   run(..., alarm)
   run(..., alarm)
   finalize(...)

once we have a proper time-keeping module with alarms.

On the issue of naming conflicts, I can certainly see the
advantage of longer routine names. Another way we might consider
to address this issue, too, would be to make use of the 'only'
clause in Fortran use statements to limit the symbols imported by
a module to just what is needed; in cases of unavoidable conflict,
there is always the option to do something like

   use subdriver, only : mpas_model_init => init, mpas_model_run => run

Another language feature that I've not used much to date, but that
I've noticed others have begun using, is the 'private' clause;
this seems like good practice to me, too.

Cheers,
Michael

   
On Fri, Oct 29, 2010 at 11:40:55AM -0600, Jones, Philip W wrote:
> 
> Folks,
> 
> A couple of quick comments.
> 
> The structure:
>    call init()
>     call run()
>     call finalize()
> 
> Is certainly consistent with all other component and coupling frameworks, so should ease compatibility.  At some point, you'll probably need to specify arguments for input state, output state, some sort of time interval (for the run method) and returned error codes.
> 
> Another comment, that I think I've brought up previously, is that the generic names init, run, finalize (and probably others throughout mpas) are at risk for creating namespace conflicts in other components.  It'll be safer in the long run if mpas modules, public variables and public routine names add an mpas_ prefix or other string to reduce the possibility of conflict.  Similarly, there will be cases even within the framework where we will need to distinguish between component models, like MPAS_OcnInit  and MPAS_AtmInit, or something similar.
> 
> Finally, now that I've recommended making all the names longer with prefixes, I have run into compilers already (Absoft) that are having trouble with some of the long routine names (esp. Xylar's ;^) ).  We will probably need to deal with this at some point for portability.
> 
> Phil, engaging in drive-by software engineering...
> 
> 
> ---
> Correspondence/TSPA/DUSA EARTH
> ------------------------------------------------------------
> Philip Jones                                pwjones at lanl.gov
> Climate, Ocean and Sea Ice Modeling
> Los Alamos National Laboratory
> T-3 MS B216                                 Ph: 505-500-2699
> PO Box 1663                                Fax: 505-665-5926
> Los Alamos, NM 87545-1663
> 
> 
> 
> _______________________________________________
> 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