gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
gtool_history_internal::lookup_dimension Interface Reference

Public Member Functions

type(gt_variable) function lookup_dimension (history, dimname, ord)

Detailed Description

Definition at line 88 of file gtool_history_internal.f90.

Constructor & Destructor Documentation

◆ lookup_dimension()

type(gt_variable) function gtool_history_internal::lookup_dimension::lookup_dimension ( type(gt_history), intent(in) history,
character(len = *), intent(in) dimname,
integer, intent(out), optional ord )

Definition at line 368 of file gtool_history_internal.f90.

369 !
370 ! history 内の dimname という変数名を持つ次元の GT_VARIABLE
371 ! 変数を返す. dimname 末尾の空白は無視される.
372 !
373 use gtdata_generic, only: inquire
374 use dc_types, only: string
377 implicit none
378 type(GT_HISTORY), intent(in):: history
379 character(len = *), intent(in):: dimname
380 integer, intent(out), optional:: ord
381 integer:: ordwork
382 character(len = STRING):: name, cause_c
383 integer:: i, stat
384 character(len = *), parameter:: subname = 'lookup_dimension'
385 continue
386 call beginsub(subname, 'dimname=%c', c1=trim(dimname))
387 stat = dc_noerr
388 if (present(ord)) ord = 0
389 ordwork = 0
390 if (associated(history % dimvars)) then
391 do, i = 1, size(history % dimvars)
392 call inquire(history % dimvars(i), name=name)
393 if (name == trim(dimname)) then
394 result = history % dimvars(i)
395 if (present(ord)) ord = i
396 stat = dc_noerr
397 cause_c = ""
398 goto 999
399 endif
400 enddo
401 endif
402 if (present(ord)) then
403 ord = 0
404 else
405 stat = gt_ebaddimname
406 cause_c = dimname
407 endif
408999 continue
409 call storeerror(stat, subname, cause_c=cause_c)
410 if (present(ord)) ordwork = ord
411 call endsub(subname, 'ord=%d (0:not found)', i=(/ordwork/))
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public gt_ebaddimname
Definition dc_error.f90:511
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:680
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public string
Character length for string
Definition dc_types.f90:137

References dc_trace::beginsub(), dc_trace::dbgmessage(), dc_error::dc_noerr, dc_trace::endsub(), dc_error::gt_ebaddimname, dc_error::storeerror(), and dc_types::string.

Here is the call graph for this function:

The documentation for this interface was generated from the following file: