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

Public Member Functions

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

Detailed Description

Definition at line 84 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 318 of file gtool_history_internal.f90.

319 !
320 ! history 内での変数 varname の ID を取得
321 ! ID を取得できた場合, 返り値 result と ord にそれぞれ
322 ! その ID が返される。
323 ! ID を取得できない場合、ord が渡されていなければその場で終了
324 ! ord が渡されている場合は ord に 0 が返される。
325 !
326 use dc_types, only: string
327 use dc_error, only: storeerror, nf90_enotvar, dc_noerr
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))
339 stat = dc_noerr
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/))
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:661
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
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: