Experimental/type for run configuration
David Dickinson
Branch: experimental/type_for_run_configuration
Branch: next
Merged
Merged pull request
Merged in experimental/type_for_run_configuration (pull request #152)
Merged in experimental/type_for_run_configuration (pull request #152)
Overhaul the input/config setup. Introduces derived types to deal with the configuration of components of the code (one type per namelist). The primary motivation for this is to make it easier to override the configuration of the code in a programmatic way. This is of key importance for our unit testing, but also enables interesting uses of the code.
The use of a consistent type to define the inputs enables us to construct automatically generated documentation relating to the inputs and the default values etc. See https://gyrokinetics.gitlab.io/gs2/page/namelists/index.html for what this looks like (another PR is required to port existing documentation from the wiki into the source code so that this generated documentation is complete).
Note: Currently this PR also contains all the changes in 8.0.2-RC that are not yet in next. This will become cleaner once v8.0.2 is released and merged into next.
Add an abstract type to represent config options
Add an example config type for the run_parameters module
Make use of config instance in run_parameters
Make
config_internal
module level rather than routine level.If this is then exposed it offers a way to set the default configuration state to be used when the appropriate init routine doesn't pass in a configuration object.
Rename run_parameters_config to run_parameters_config_type
Switch to specifying defaults at initialisation time
Make reset force state to "clean"/empty object
Remove stray character
Move run_parameters_config_type to run_parameters
Remove empty config_types module
Remove initialised requirement from write_run_parameters_config
Move the init code into the abstract type as it is generic
Add a comment
Add config type for theta_grid_gridgen_knobs
Correct format for run_parameters
Initially adding salpha namelist
Make some allocations in theta_grid safer
Add helper script for working with config types
Allows auto generation of the standard routines associated with the config types by detecting the relevant information from the config type declarations in the source file.
Can also be used to produce new config types etc. if desired.
Ensure failing tests are reported on gitlab
Fix intent
Add config type for theta_grid_knobs
Add config type for theta_grid_file_knobs
Add config type for theta_grid_parameters
Add config type for theta_grid_eik_knobs
Note this shows one way to set "smart" defaults
Make sure config types are reset when module is reset
Make sure rpexist populated on all processors
Ensure only proc0 calls eikcoefs for now
Make sure we also setup theta_grid_gridgen
Bugfix: Ensure all procs participate in read_parameters type setup
Add extra output to placeholder text
Fix bug to identify defaults with no space
Add config type for kt_grids_single
Add config type for kt_grids_range_parameters.
Add config type for kt_grids_specified and kt_grids_specified_element
Make sure we cleanup kt_grids_specified module
Remove unused namelist
Add config type for kt_grids_box
Add config type for kt_grids
Add a consistency check for config elements
Fix routine names
Make sure to close indexed namelists
Also provide workaround for
get_indexed_namelist
not trimming the input namelist string. Should change this routine to use trim but for now just ensure trimmed string is passed.Add config types for species namelists
Update config placeholder generator for index fixes
Add config type for le_grids
Add config types for the dist_fn namelists
Add config type for fields knobs
Add config type for reinit knobs
Add config type for layouts_knobs
Add config type for collisions_knobs
Add config type for hyper_knobs
Add config type for nonlinear_terms_knobs
Add complex to list of valid types
Expand write_key_val type handling
Add config type for init_g_knobs
Add config type for antenna driver/stir namelists
Add config type for parameter_scan_knobs
Make sure parameter scan config is reset
Fix init_g smart default
Add config type for ballstab_knobs
Add config type for eigval_knobs
Add config type for gs2_diagnostics
Improve handling of smart defaults
Only set now if the config object hasn't been initialised
Remove unused namelist
Add config type for ingen
Add config type for normalisations
Make sure config is reset in ingen
Add config type for optimisation_config
This allows us to replace the ruby based generation with just the fortran source file.
Add config type for gs2_init
Add config type for new diagnostics config
Add routine to write markdown table from config instance
Add namelist documentation
Enable cleaner reuse of namelist documentation
Remove mistaken lines
Update documentation slightly
TO REVERT: Allow manual to build on experimental branch for testing
Join long comments with space rather than newline
Add custom css for namelist tables
Some hacking to finally get namelist tables rendering correctly
Fix formatting of individual namelist pages
Try to ensure namelist page always has namelists in the same order
Make table highlighting use blues from theme
Add table of contents for namelist page
Split python code for generating placeholder text and namelist documentation
Expand gitignore to ignore placeholders files
Add helper python tool for finding files matching a pattern in paths recursively
Can act as a simplified and perhaps more portable version of find.
Make doc rule automatically update the namelist documentation
Split run_parameters config type to more closely match namelists
Helps improve consistency with other config types.
Removing auto-generated namelist documentation
Expose config_type definitions
Add meta data to config types for requires_index status
Currently just in generator/parser script
Add indexed meta data to all config types
Add constructor to config templates
Add constructors for all types
Add write_default_input_file program
Writes an input file containing every option set to the default value
Change logic about namelist header formatting
Allow arbitrary index to be indexed
Bugfix for get_all_matching_files
Tweak auto generated documentation setup to allow to be ignored and removed automatically
Avoid generating dependency file for a few more make targets
Make config generation treat indexed types better
Start to change the naming convention of the config types
Adopt improved config type naming convention
Try to provide mechanism to pass in config types in all appropriate module init routines
Bugfix: Ensure theta_grid_params is reset correctly
Prevent shadowing in gridgen config setup
Fix previous commit -- remove different set of shadowing
Add setters for config types
Report which file is being processed in the config generator code
Remove non-ascii character
Remove two more non-ascii characters