MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
235 stars 312 forks source link

Add new mpas_stream_inquiry infrastructure module for querying contents of streams files #1132

Closed mgduda closed 7 months ago

mgduda commented 8 months ago

This PR adds a new infrastructure module, mpas_stream_inquiry, for querying the contents of streams XML files. The new module operates on instances of a new derived type, MPAS_streamInfo_type, to determine whether a streams XML file contains a definition of a given stream, whether a stream provides a specification for a given attribute, and the values for any attributes present in the XML file.

The mpas_stream_inquiry module can only return information that was explicitly provided in a streams XML file, but it cannot, for example, return the Registry-specified default value for an attribute unless that default value was expressed in the XML file. However, being only dependent on the contents of a streams XML file, the mpas_stream_inquiry module can be employed even before the MPAS stream manager has been initialized.

The domain type now includes a pointer to an MPAS_streamInfo_type type, which is allocated and initialized with a core's streams file from within the mpas_init routine, after mpas_framework_init_phase2 but before defining packages. This will allow cores to make queries concerning the stream definitions provided by a user during the MPAS start-up process.

Also included in this PR are unit tests for the stream inquiry functionality.