326
327
328
329
330
331
332
336 implicit none
337 type(GT_HISTORY), intent(in):: history
338 character(len = *), intent(in):: varname
339 character(len = STRING) :: cause_c
340 integer, intent(out), optional:: ord
341 integer:: ordwork
342 integer:: i, stat
343 character(len = *), parameter:: subname = 'lookup_variable'
344 continue
345 call beginsub(subname,
'%c', c1=trim(varname))
347 cause_c = ''
348 if (present(ord)) ord = 0
349 ordwork = 0
350 i = lookup_variable_ord(history, varname)
351 if (i > 0) then
352 result = history % vars(i)
353 if (present(ord)) ord = i
354 goto 999
355 endif
356 if (present(ord)) then
357 ord = 0
358 else
359 stat = nf90_enotvar
360 cause_c = varname
361 i = 0
362 endif
363999 continue
364 call storeerror(stat, subname, cause_c=cause_c)
365 if (present(ord)) ordwork = ord
366 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
エラー等を保持
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)
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ