Remove nems grid comp#104
Conversation
|
Would it be possible to remove the ALLCAPS and just use lower case where possible? (eg INTEGER,INTENT(OUT) :: RC_REG) |
Do you mean in module_EARTH_GRID_COMP.F90? BTW, I think this file (module) should be renamed to ufs_nuopc_driver.F90 because that's what it is. |
| !----------------------------------------------------------------------- | ||
| ! | ||
| contains | ||
| subroutine check_esmf_pet(print_esmf) |
There was a problem hiding this comment.
model_configure is an ESMF config file. It should be opened and queried with:
ESMF_ConfigLoadFile
ESMF_ConfigGetAttribute
That being said, I do not think that NEMS should open "model_configure" at all, since that it an atmosphere configuration file. Configuration related to NEMS should go into nems.configure.
There was a problem hiding this comment.
This is related to my question about clocks. Do we need main clock to be set in the main program. If we do then we must parse all clock related parameters from "model_configure" in the main program. @theurich
This subroutine check_esmf_pet is called before ESMF is initialized to set logging option at the time we call ESMF_Initialize. I'll be happy to remove this subroutine if we can set the ESMF logging after it has been initialized. Can we?
There was a problem hiding this comment.
The decision about ESMF logging options to be used definitely does NOT belong into the ATM specific model_configure. Instead it belongs into the nems.configure.
Now how to read this, there is currently this chicken-and-egg issue going on. ESMF_Initialize() needs to be called before you can use ESMF_Config* calls to open the configuration file to read, e.g. to find out what logging option to be used. While you can change some logging details after ESMF_Initialize(), the LOGKIND (e.g. ESMF_LOGKIND_MULTI_ON_ERROR vs ESMF_LOGKIND_MULTI) has to be set during ESMF_Initialize().
CESM is dealing with I think by using a standard Fortran namelist file where they read in information before ESMF_Initialize() is called.
We have been discussing a few other options in the past, but none are implemented. One option I could see is to define a specific Config Attribute, e.g. ESMF_LogKind_Flag. Then have it where when ESMF_Initialize() is called with a specific config file (i.e. via the existing argument 'defaultConfigFileName'), and that config file contains the ESMF_LogKind_Flag attribute, its value will be used during ESMF_Initialize(). For NEMS I would assume that nems.configure was passed in for defaultConfigFileName, and then this provides the mechanism to cleanly set ESMF_LogKind_Flag for the execution.
If we go this direction, we need to prioritize the ESMF work for it.
There was a problem hiding this comment.
Not in this PR. We need to keep check_esmf_pet for now.
There was a problem hiding this comment.
@DusanJovic-NOAA - I know this PR is merged and closed. But there is a new feature in ESMF that directly relates to the discussion about the need for subroutine check_esmf_pet().
Starting with https://github.com/esmf-org/esmf/releases/tag/ESMF_8_2_0_beta_snapshot_18, the 'defaultConfigFileName' argument in ESMF_Initialize() is implemented! For the associated API doc please see: https://earthsystemmodeling.org/docs/nightly/develop/ESMF_refdoc/node4.html#SECTION04024100000000000000
Bottom line, I hope that we can migrate where
ESMF_Initialize(defaultConfigFileName="nems.configure", ...)is called inMAIN_NEMS.F90.logKindFlag:is set in filenems.configure.- The
print_esmfflag is removed frommodel_configure. subroutine check_esmf_pet()is removed fromMAIN_NEMS.F90, and the logic around callingESMF_Initialize()is simplified.
Let me know if you have questions about any of what I am proposing.
There was a problem hiding this comment.
We are in the process of updating UFS to ESMF_820bs14. I'm not sure when we are going to move to bs18 or newer, but as soon as we do, I'll make these changes and test them. I agree we need to simplify this part of the code and stop using this hand written check_esmf_pet routine.
Yes, in the earth grid, I was referring to the code itself where it is written in all caps, for example |
|
@junwang-noaa @DeniseWorthen please review and approve |
Fixes: #103