Accessing lfric_apps namelist in lfric_core #634
Replies: 4 comments 3 replies
-
|
Now I've written that, I guess the idea of "core" is that it shouldn't be dependent on any other code base, such as lfric_apps. And so perhaps the only solution is to move this subroutine where I want to add namelist variables into lfric_apps? |
Beta Was this translation helpful? Give feedback.
-
|
The normal way would be to replace the hard-wired parameters with input variables. The code that calls the routine lives in the application-specific code (in lfric_apps) and is responsible for getting the variables from its configuration namelist. The existing subroutine remains generic and can stay in lfric_core - it can be called from any app regardless of the source of the theta perturbation values. A unit test for it can be written which can call the routine with values that only need to be included in the unit test code (and not in a namelist feign routine) |
Beta Was this translation helpful? Give feedback.
-
|
Looking at what you're doing in MetOffice/lfric_core#374 the variables you're trying to move are in a kernel which means you're going to have to pull the configuration variables all the way through from any calls in lfric_apps and down through the kernel API, you can't pass the config variables in through module use statements (as I mentioned in your other post we are trying to remove all config use statements but particularly in kernels). |
Beta Was this translation helpful? Give feedback.
-
|
Apologies - I hadn't twigged it was a kernel. There is a slight extra complication in that when you pass arguments from the algorithm code they may come in as either single or double precision, so you will need a subroutine interface for both. You can see many examples of this within the same directory which should make it more straightforward to implement. e.g. In short, two things need to be done:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In MetOffice/lfric_core#374 I'm wanting to put some hardwired variables in lfric_core into a namelist. The one I've chosen lives in lfric_apps. This works fine in "normal" usage where apps and core are compiled together but, as far as I can tell, core doesn't have a dependency on lfric_apps. I've tried just adding that in to my branch's dependencies.sh but it's still failing to build because this namelist config can't be found:
dependerator.database.DatabaseException: ("Unable to find unit 'initial_temperature_config_mod'", None)
Is the lack of visibility of lfric_apps code when running core rose stem tests the correct diagnosis of my problem? Is it possible to include lfric_apps in the core dependencies.sh file, and if so, how?
Beta Was this translation helpful? Give feedback.
All reactions