Skip to content

Conversation

@dwfncar
Copy link

@dwfncar dwfncar commented Nov 10, 2025

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_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.

…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.
@mgduda mgduda added Atmosphere Chemistry Changes specific to chemistry in MPAS labels Nov 10, 2025
@mgduda mgduda self-requested a review November 10, 2025 20:31
type(error_t) :: error
type(string_t) :: micm_version

type(string_t) :: description
Copy link
Contributor

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)
Copy link
Contributor

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:

  1. With Noah-MP, we hit an internal compiler error with the GCC 13 compilers due to associate blocks in that code; so there is evidence that some compiler releases don't handle associate very well.
  2. With an associate block, it's not possible to tell the type of map, and one would have to look elsewhere to find, e.g., that name is a valid member of an instance of whatever type map has.

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
Copy link
Contributor

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?

Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Atmosphere Chemistry Changes specific to chemistry in MPAS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants