submodule (params_template_m) io_params_template_features_s !! Handles I/O of timestep parameters of template models use parallelisation_setup_m, only : is_rank_info_writer use screen_io_m, only : get_stdout use error_handling_grillix_m, only: handle_error use status_codes_grillix_m, only : GRILLIX_ERR_NAMELIST implicit none namelist / features_template / mms_on, perptransp_on, partransp_on, pardiff_on contains module subroutine read_params_template_features(optional_filepath) !! Initializes parameters related with feature selection character(len=*), intent(in), optional :: optional_filepath !! Filename, where to read feature selection parameters from character(len=:), allocatable :: fpath integer :: io_unit, io_error character(len=256) :: io_errmsg if (present(optional_filepath)) then fpath = optional_filepath else fpath = path_features endif open(newunit=io_unit, file=fpath, status='old', action='read', iostat=io_error, iomsg=io_errmsg) if (io_error /= 0) then call handle_error(io_errmsg, GRILLIX_ERR_NAMELIST, __LINE__, __FILE__) endif read(io_unit, nml=features_template, iostat=io_error, iomsg=io_errmsg) if (io_error /= 0) then call handle_error(io_errmsg, GRILLIX_ERR_NAMELIST, __LINE__, __FILE__) endif close(io_unit) end subroutine module subroutine display_params_template_features() if (is_rank_info_writer) then write(get_stdout(), nml=features_template) endif end subroutine end submodule