319
320
321
322
323
324
325
329 implicit none
330 type(GT_HISTORY), intent(in):: history
331 character(len = *), intent(in):: varname
332 character(len = STRING) :: cause_c
333 integer, intent(out), optional:: ord
334 integer:: ordwork
335 integer:: i, stat
336 character(len = *), parameter:: subname = 'lookup_variable'
337 continue
338 call beginsub(subname,
'%c', c1=trim(varname))
340 cause_c = ''
341 if (present(ord)) ord = 0
342 ordwork = 0
343 i = lookup_variable_ord(history, varname)
344 if (i > 0) then
345 result = history % vars(i)
346 if (present(ord)) ord = i
347 goto 999
348 endif
349 if (present(ord)) then
350 ord = 0
351 else
352 stat = nf90_enotvar
353 cause_c = varname
354 i = 0
355 endif
356999 continue
357 call storeerror(stat, subname, cause_c=cause_c)
358 if (present(ord)) ordwork = ord
359 call endsub(subname,
"ord=%d (0: not found)", i=(/ordwork/))
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
Error storage variables
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Provides kind type parameter values.
integer, parameter, public string
Character length for string