[Mitgcm-support] Re: KPP (c30) bug

mitgcm-support at dev.mitgcm.org mitgcm-support at dev.mitgcm.org
Wed Jul 9 15:47:52 EDT 2003


> 1) Package code is included by appending
>       #include "PKGX_OPTIONS.h"
>    at end of CPP_OPTIONS.h.  File PKGX_OPTIONS.h will usually
>    contain flag ALLOW_PKGX and may modify CPP_OPTIONS.h as
>    required.

The problem with allowing PKG1_OPTIONS.h and PKG2_OPTIONS.h to
change ALLOW_CONVECT is that the order in which you call packages
matters. Another package might turn it back on again. 'cpp'
isn't upto the task.

Remember that convection can be turned off with adjFreq=0 so you
don't have to recompile the model if you accidentally have it
compiled.

I think we are making the mistake of treatng CPP_OPTIONS.h more
like a runtime parameter file rather than compilation configuration.

> 2) Get rid of packages_check.F.  Each package is responsible
>    for taking care of its own checks during initialization,
>    including CPP flags and presence or absence of other packages.

I think there's nothing wrong with this. To avoid the same problem
as 1) above I suggest that each package have a *_check called
after initialization. Doing it during initialization would again
create a order-of-call problem.

> 3) Get rid of data.pkg and packages_init.F.  Each package is
>    responsible for setting or unsetting its own use_pkgx flag
>    if desired.  (A convenient way to do that is for packages
>    to check for presence or absence of file data.pkgx)

Absolutely no - I bet you will be the first of thousands to
forget to copy data.gmredi and burn 100 hours of CPU and
only then realise the file was missing. Having a list
in a file like data.pkg is safe and understandable.
CPP_OPTIONS.h is not meant to do this job. CPP_OPTIONS.h
is really for optimizing out unwanted code. The default
mode ought to be that everything is compiled and nothing
is selected in data.pkg. That's provides the fastest way
to set up the model simply be editing one file and not
recompiling.

"data.pkg" could go back in "data" but I thought it would be
easier to separate them until data is reduced further
as more packages are added.

A.




More information about the MITgcm-support mailing list