35 use mom_io, only : open_namelist_file, check_nml_error
37 implicit none ;
private 44 character(len=240) :: &
45 restart_input_dir =
' ',&
46 restart_output_dir =
' ',&
47 output_directory =
' ', &
57 logical,
optional,
intent(in) :: check_params
63 integer,
parameter :: npf = 5
64 character(len=240) :: &
65 parameter_filename(npf) =
' ', &
66 output_directory =
' ', &
67 restart_input_dir =
' ', &
68 restart_output_dir =
' ', &
71 character(len=240) :: output_dir
72 integer :: unit, io, ierr, valid_param_files
74 namelist /mom_input_nml/ output_directory, input_filename, parameter_filename, &
75 restart_input_dir, restart_output_dir
78 unit = open_namelist_file(file=
'input.nml')
80 call mom_error(fatal,
'Required namelist file input.nml does not exist.')
83 ierr=1 ;
do while (ierr /= 0)
84 read(unit, nml=mom_input_nml, iostat=io, end=10)
85 ierr = check_nml_error(io,
'MOM_input_nml')
87 10
call close_file(unit)
89 if (
present(dirs))
then 90 dirs%output_directory = slasher(ensembler(output_directory))
91 dirs%restart_output_dir = slasher(ensembler(restart_output_dir))
92 dirs%restart_input_dir = slasher(ensembler(restart_input_dir))
93 dirs%input_filename = ensembler(input_filename)
96 if (
present(param_file))
then 97 output_dir = slasher(ensembler(output_directory))
100 if (len_trim(trim(parameter_filename(io))) > 0)
then 102 check_params, doc_file_dir=output_dir)
103 valid_param_files = valid_param_files + 1
106 if (valid_param_files == 0)
call mom_error(fatal,
"There must be at "//&
107 "least 1 valid entry in input_filename in MOM_input_nml in input.nml.")
character(len=len(name)) function, public ensembler(name, ens_no_in)
Returns a name with "%#E" or "%E" replaced with the ensemble member number.
subroutine, public open_param_file(filename, CS, checkable, component, doc_file_dir)
This module contains I/O framework code.
logical function, public is_root_pe()
subroutine, public mom_mesg(message, verb, all_print)
subroutine, public mom_error(level, message, all_print)