Feature/config type collection

Merged
#248 · Created  · Last updated

Merged pull request

Merged in feature/config_type_collection (pull request #248)

4a5ae17·Author: ·Closed by: ·2021-01-29

Description

  • Add module and type representing a collection of all the configuration objects

  • Make write_default_input_file use the config_collection type rather than local instances of each config.

  • Allow multiple instances of indexed configs

  • Add method to config_collection_type to write current configuration to provided unit.

    Note we don't check the initialised state etc. of each individual config instance and as such we will write the default values in such cases. This is useful for writing the current full state, but might have a slight issue in that this would indicate the presence of a config/namelist etc. For example suppose we read an empty input file and then wrote out the configuration to a new input file. This could cause different behaviour at points where we take action based on the presence/absence of namelists in the input file.

    Similarly we allocate unallocated "indexed" config entries (and then deallocate on exit of routine).

  • Update write_default_input_file to make use of write_to_unit

  • Tweak handling of unallocated configs

  • Indentation

  • Make allocation of unallocated indexed config types the consistent size

  • Add documentation

  • Avoids including both configurations

    This is probably the most sensible option if we assume the two diagnostic modules are exclusive (which is reasonable given they share a namelist name but not the full set of inputs).

This greatly simplifies the write_default_input_file program, but the main motivation is to start to provide a way to encapsulate the configuration state of a given simulation/run.

0 attachments

0 comments

Loading commits...