362
363
364
365
370 implicit none
371 type(GT_HISTORY), intent(in):: history
372 character(len = *), intent(in):: dimname
373 integer, intent(out), optional:: ord
374 integer:: ordwork
375 character(len = STRING):: name, cause_c
376 integer:: i, stat
377 character(len = *), parameter:: subname = 'lookup_dimension'
378 continue
379 call beginsub(subname,
'dimname=%c', c1=trim(dimname))
381 if (present(ord)) ord = 0
382 ordwork = 0
383 if (associated(history % dimvars)) then
384 do, i = 1, size(history % dimvars)
385 call inquire(history % dimvars(i), name=name)
386 if (name == trim(dimname)) then
387 result = history % dimvars(i)
388 if (present(ord)) ord = i
390 cause_c = ""
391 goto 999
392 endif
393 enddo
394 endif
395 if (present(ord)) then
396 ord = 0
397 else
399 cause_c = dimname
400 endif
401999 continue
402 call storeerror(stat, subname, cause_c=cause_c)
403 if (present(ord)) ordwork = ord
404 call endsub(subname,
'ord=%d (0:not found)', i=(/ordwork/))
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public gt_ebaddimname
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