|
subroutine | get_float_val (fval, filename, argname, line, echo, start, finish) |
|
subroutine | get_string_val (sval, filename, argname, line, echo, start, finish) |
|
subroutine | get_logical_val (lval, filename, argname, line, echo, start, finish) |
|
subroutine | get_integer_val (ival, filename, argname, line, echo, start, finish) |
|
Definition at line 43 of file mod_newinp.f90.
◆ get_float_val()
subroutine input_util::get_val::get_float_val |
( |
real(sp), intent(out) |
fval, |
|
|
character(len=*), intent(in) |
filename, |
|
|
character(len=*), intent(in) |
argname, |
|
|
integer, intent(out) |
line, |
|
|
logical, intent(in), optional |
echo, |
|
|
integer, intent(in), optional |
start, |
|
|
integer, intent(in), optional |
finish |
|
) |
| |
Definition at line 125 of file mod_newinp.f90.
126 real(sp),
intent(out) :: fval
127 character(len=*),
intent(in ) :: filename
128 character(len=*),
intent(in ) :: argname
129 integer,
intent(out) :: line
130 logical,
optional,
intent(in) :: echo
131 integer,
optional,
intent(in) :: start
132 integer,
optional,
intent(in) :: finish
134 character(len=80) :: argval
135 character(len=80) :: argtype
140 if(.not.check_exist(filename))
then 141 call error(
'Get_Val',
'halt',
'error reading: '//trim(argname), &
142 'file: '//trim(filename)//
' does not exist')
146 if(
present(start) .and.
present(finish))
then 147 if(finish < start)
then 148 call error(
'Get_Val',
'halt',
'finish must be greater than or equal to start')
153 call extract_val_string(filename,argname,argval,ierr,line,start,finish)
155 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
156 'does not exist in file: '//trim(filename))
160 call check_arg_type(argval,argtype)
161 if(trim(argtype) /=
'float')
then 162 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
163 'in file: '//trim(filename), &
164 'should be float but is: '//trim(argtype))
171 if(
present(echo))
then 173 write(*,
'(A20,F10.4)')trim(argname)//
': ',fval
◆ get_integer_val()
subroutine input_util::get_val::get_integer_val |
( |
integer, intent(out) |
ival, |
|
|
character(len=*), intent(in) |
filename, |
|
|
character(len=*), intent(in) |
argname, |
|
|
integer, intent(out) |
line, |
|
|
logical, intent(in), optional |
echo, |
|
|
integer, intent(in), optional |
start, |
|
|
integer, intent(in), optional |
finish |
|
) |
| |
Definition at line 67 of file mod_newinp.f90.
68 integer,
intent(out) :: ival
69 character(len=*),
intent(in ) :: filename
70 character(len=*),
intent(in ) :: argname
71 integer,
intent(out) :: line
72 logical,
optional,
intent(in) :: echo
73 integer,
optional,
intent(in) :: start
74 integer,
optional,
intent(in) :: finish
76 character(len=80) :: argval
77 character(len=80) :: argtype
81 if(.not.check_exist(filename))
then 82 call error(
'Get_Val',
'halt',
'error reading: '//trim(argname), &
83 'file: '//trim(filename)//
' does not exist')
87 if(
present(start) .and.
present(finish))
then 88 if(finish < start)
then 89 call error(
'Get_Val',
'halt',
'finish must be greater than or equal to start')
94 call extract_val_string(filename,argname,argval,ierr,line,start,finish)
96 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
97 'does not exist in file: '//trim(filename))
101 call check_arg_type(argval,argtype)
102 if(trim(argtype) /=
'integer')
then 103 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
104 'in file: '//trim(filename), &
105 'should be integer but is: '//trim(argtype))
112 if(
present(echo))
then 114 write(*,
'(A20,I10)')trim(argname)//
': ',ival
◆ get_logical_val()
subroutine input_util::get_val::get_logical_val |
( |
logical, intent(out) |
lval, |
|
|
character(len=*), intent(in) |
filename, |
|
|
character(len=*), intent(in) |
argname, |
|
|
integer, intent(out) |
line, |
|
|
logical, intent(in), optional |
echo, |
|
|
integer, intent(in), optional |
start, |
|
|
integer, intent(in), optional |
finish |
|
) |
| |
Definition at line 185 of file mod_newinp.f90.
186 logical,
intent(out) :: lval
187 character(len=*),
intent(in ) :: filename
188 character(len=*),
intent(in ) :: argname
189 integer,
intent(out) :: line
190 logical,
optional,
intent(in) :: echo
191 integer,
optional,
intent(in) :: start
192 integer,
optional,
intent(in) :: finish
194 character(len=80) :: argval
195 character(len=80) :: argtype
199 if(.not.check_exist(filename))
then 200 call error(
'Get_Val',
'halt',
'error reading: '//trim(argname), &
201 'file: '//trim(filename)//
' does not exist')
205 if(
present(start) .and.
present(finish))
then 206 if(finish < start)
then 207 call error(
'Get_Val',
'halt',
'finish must be greater than or equal to start')
212 call extract_val_string(filename,argname,argval,ierr,line,start,finish)
214 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
215 'does not exist in file: '//trim(filename))
219 call check_arg_type(argval,argtype)
220 if(trim(argtype) /=
'logical')
then 221 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
222 'in file: '//trim(filename), &
223 'should be logical but is: '//trim(argtype))
228 if(argval(1:1) ==
'T') lval = .true.
231 if(
present(echo))
then 233 write(*,
'(A20,L10)')trim(argname)//
': ',lval
◆ get_string_val()
subroutine input_util::get_val::get_string_val |
( |
character(len=*), intent(out) |
sval, |
|
|
character(len=*), intent(in) |
filename, |
|
|
character(len=*), intent(in) |
argname, |
|
|
integer, intent(out) |
line, |
|
|
logical, intent(in), optional |
echo, |
|
|
integer, intent(in), optional |
start, |
|
|
integer, intent(in), optional |
finish |
|
) |
| |
Definition at line 244 of file mod_newinp.f90.
245 character(len=*),
intent(out) :: sval
246 character(len=*),
intent(in ) :: filename
247 character(len=*),
intent(in ) :: argname
248 integer,
intent(out) :: line
249 logical,
optional,
intent(in) :: echo
250 integer,
optional,
intent(in) :: start
251 integer,
optional,
intent(in) :: finish
253 character(len=80) :: argval
254 character(len=80) :: argtype
258 if(.not.check_exist(filename))
then 259 call error(
'Get_Val',
'halt',
'error reading: '//trim(argname), &
260 'file: '//trim(filename)//
' does not exist')
264 if(
present(start) .and.
present(finish))
then 265 if(finish < start)
then 266 call error(
'Get_Val',
'halt',
'finish must be greater than or equal to start')
271 call extract_val_string(filename,argname,argval,ierr,line,start,finish)
273 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
274 'does not exist in file: '//trim(filename))
278 call check_arg_type(argval,argtype)
279 if(trim(argtype) /=
'string')
then 280 call error(
'Get_Val',
'halt',
'error reading variable: '//trim(argname), &
281 'in file: '//trim(filename), &
282 'should be string but is: '//trim(argtype))
286 sval = adjustl(trim(argval))
289 if(
present(echo))
then 291 write(*,
'(A20,A20)') trim(argname)//
': ',trim(sval)
The documentation for this interface was generated from the following file: