-
Notifications
You must be signed in to change notification settings - Fork 374
MPAS MUSICA namelist option for MICM configuration #1376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…ed logging. Registry.xml: Added a MUSICA namelist record gated by MPAS_USE_MUSICA with the `config_micm_file` option so the MICM JSON path can be provided through the standard configuration system. mpas_atm_chemistry.F: Removed the hardcoded `chapman.json`, pull the MICM file path from the configs pool, then propagate errors from `musica_init` via `mpas_log_write` to fail when initialization breaks. mpas_musica.F: Track the species description pointer and log each MICM species name from `state%species_ordering` so users can verify the runtime mapping.
| type(error_t) :: error | ||
| type(string_t) :: micm_version | ||
|
|
||
| type(string_t) :: description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like the description variable is used anywhere in this routine.
| state => micm%get_state(number_of_grid_cells, error) | ||
| if (has_error_occurred(error, error_message, error_code)) return | ||
|
|
||
| associate(map => state%species_ordering) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it's completely standard Fortran, it might be worth avoiding an associate block here for a couple of reasons:
- With Noah-MP, we hit an internal compiler error with the GCC 13 compilers due to
associateblocks in that code; so there is evidence that some compiler releases don't handleassociatevery well. - With an
associateblock, it's not possible to tell the type ofmap, and one would have to look elsewhere to find, e.g., thatnameis a valid member of an instance of whatever typemaphas.
So it might prevent compilation issues and lead to clearer code if we provide an explicit declaration of map as a local variable in the musica_init routine.
| #endif | ||
| use mpas_log, only : mpas_log_write | ||
| use mpas_derived_types, only: mpas_pool_type | ||
| use mpas_derived_types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a specific reason for eliminating the only clause for this use statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now that this was probably to get access to MPAS_LOG_CRIT. In that case, perhaps it would be better to add MPAS_LOG_CRIT to the use, only statement?
MICM configuration is now driven by a MUSICA namelist option with added logging.
Registry.xml: Added a MUSICA namelist record gated by MPAS_USE_MUSICA with the
config_micm_fileoption so the MICM JSON path can be provided through the standard configuration system.mpas_atm_chemistry.F: Removed the hardcoded
chapman.json, pull the MICM file path from the configs pool, then propagate errors frommusica_initviampas_log_writeto fail when initialization breaks. mpas_musica.F: Track the species description pointer and log each MICM species name fromstate%species_orderingso users can verify the runtime mapping.