gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
Public Member Functions | List of all members
gtool_history_internal::lookup_variable Interface Reference

Public Member Functions

type(gt_variable) function lookup_variable (history, varname, ord)
 

Detailed Description

Definition at line 85 of file gtool_history_internal.f90.

Constructor & Destructor Documentation

◆ lookup_variable()

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

Definition at line 325 of file gtool_history_internal.f90.

326 !
327 ! history 内での変数 varname の ID を取得
328 ! ID を取得できた場合, 返り値 result と ord にそれぞれ
329 ! その ID が返される。
330 ! ID を取得できない場合、ord が渡されていなければその場で終了
331 ! ord が渡されている場合は ord に 0 が返される。
332 !
333 use dc_types, only: string
334 use dc_error, only: storeerror, nf90_enotvar, dc_noerr
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))
346 stat = dc_noerr
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/))
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 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::storeerror(), and dc_types::string.

Here is the call graph for this function:

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