Open mathomp4 opened 1 month ago
~ESMF logging can be controlled with the config file passed to ESMF_Init. No need for get_environment_variable
. MAPL3 is already doing it this way.~
Sorry - I think my previous answer misunderstood where the question was going.
This should be an issue for main.F90
. MAPL3 will use a command line option (but a very simple one) to determine the top config file. GCHP can readily have their own main.F90
that uses get_environment_variable
for the same purpose.
We could then consider somehow maintaining both variants inside MAPL for simplicity so that if things change we correct both. (Ideally these top files do very very little though.)
Using get_environment_variable
in the main driver fortran file works for us. And I support moving to yml too. I can make the updates in GCHP when we update to MAPL3.
In talking with @darianboggs about some ESMF stuff I was reminded of https://github.com/GEOS-ESM/MAPL/pull/2233 which fixed #2133, a request from @lizziel to allow the ability to set the ESMF logging level via a file rather than via command line option.
But, it is hardcoded that the file name is
ESMF.rc
and nothing else. Now, in MAPL3 land, this will need to be (or should be) a YAML file. So that meansESMF.yml
orESMF.yaml
.But but, @darianboggs reminded me that
get_environment_variable
does exist in Fortran.So my thinking is maybe we should do something like:
ESMF_CONTROL_FILE
or whatever (@tclune will have good opinions on this). If found, check if the file ends in.rc
,.yml
or.yaml
. If so, feed that in. (Note: I believe ESMF depends on a file ending in.yml
or.yaml
to trigger hconfig, so we would want to enforce that and then it makes our life easy if we sayESMF_Config
files end in.rc
.)ESMF.rc
,ESMF.yml
orESMF.yaml
, and use thatNow, I suppose, the command line argument should maybe "win" this battle, but I also know the arguments might be going away in favor of yamls so... 🤷🏼
I suppose the question is: would this be useful? I can sort of see maybe having a set of control files for scripting purposes with different names and then using the environment variable to select?