gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dc_present Module Reference

省略可能な制御パラメータの判定 More...

Data Types

interface  present_and_eq
interface  present_and_ne
interface  present_select

Functions/Subroutines

logical function, public present_and_true (arg)
logical function, public present_and_false (arg)
logical function, public present_and_zero (arg)
logical function, public present_and_nonzero (arg)
logical function, public present_and_not_empty (arg)

Detailed Description

省略可能な制御パラメータの判定

Author
Youhei SASAKI, Yasuhiro MORIKAWA, Eizi TOYODA, Takeshi HORINOUCHI

Important

This file is generated from ../../../../src/dc_utils/dc_present.erb by ERB included Ruby 3.3.8. Please do not edit this file directly.

省略可能な引数のチェックに使用するユーティリティ関数を提供するモジュールです。 これらの関数は、省略可能な引数が与えられているかどうか、 また特定の条件(真、偽、ゼロ、指定値と等しいか、など)を満たすかどうかを判定します。

手続一覧

手続名 説明
present_and_true arg が省略されておらず .true. の場合に .true. を返す
present_and_false arg が省略されておらず .false. の場合に .true. を返す
present_and_zero arg が省略されておらず 0 の場合に .true. を返す
present_and_nonzero arg が省略されておらず 0 でない場合に .true. を返す
present_and_eq arg が省略されておらず val と等しい場合に .true. を返す
present_and_ne arg が省略されておらず val と等しくない場合に .true. を返す
present_and_not_empty arg が省略されておらず空文字でない場合に .true. を返す
present_select 最初の有効な省略可能引数またはデフォルト値を返す

Function/Subroutine Documentation

◆ present_and_false()

logical function, public dc_present::present_and_false ( logical, intent(in), optional arg)

arg が省略されておらず偽かどうかを判定

Parameters
[in]arg省略可能な論理型引数
Returns
arg が省略されておらず .false. の場合は .true.、それ以外は .false.

Definition at line 127 of file dc_present.f90.

128 logical :: result
129 logical, intent(in), optional :: arg
130 continue
131 if(present(arg)) then
132 if(arg) then
133 result=.false.
134 else
135 result=.true.
136 endif
137 else
138 result=.false.
139 endif

◆ present_and_nonzero()

logical function, public dc_present::present_and_nonzero ( integer, intent(in), optional arg)

arg が省略されておらず 0 でないかどうかを判定

Parameters
[in]arg省略可能な整数型引数
Returns
arg が省略されておらず 0 でない場合は .true.、それ以外は .false.

Definition at line 177 of file dc_present.f90.

178 logical :: result
179 integer, intent(in), optional :: arg
180 continue
181 if(present(arg)) then
182 if(arg==0) then
183 result=.false.
184 else
185 result=.true.
186 endif
187 else
188 result=.false.
189 endif

◆ present_and_not_empty()

logical function, public dc_present::present_and_not_empty ( character(len=*), intent(in), optional arg)

arg が省略されておらず空文字でないかどうかを判定

Parameters
[in]arg省略可能な文字型引数
Returns
arg が省略されておらず空文字でない場合は .true.、それ以外は .false.

Definition at line 375 of file dc_present.f90.

376 logical :: result
377 character(len=*), intent(in), optional :: arg
378 continue
379 result = .false.
380 if( present(arg) .AND. (arg .ne. '')) result = .true.

◆ present_and_true()

logical function, public dc_present::present_and_true ( logical, intent(in), optional arg)

arg が省略されておらず真かどうかを判定

Parameters
[in]arg省略可能な論理型引数
Returns
arg が省略されておらず .true. の場合は .true.、それ以外は .false.

Definition at line 102 of file dc_present.f90.

103 logical :: result
104 logical, intent(in), optional :: arg
105 continue
106 if(present(arg)) then
107 if(arg) then
108 result=.true.
109 else
110 result=.false.
111 endif
112 else
113 result=.false.
114 endif

◆ present_and_zero()

logical function, public dc_present::present_and_zero ( integer, intent(in), optional arg)

arg が省略されておらず 0 かどうかを判定

Parameters
[in]arg省略可能な整数型引数
Returns
arg が省略されておらず 0 の場合は .true.、それ以外は .false.

Definition at line 152 of file dc_present.f90.

153 logical :: result
154 integer, intent(in), optional :: arg
155 continue
156 if(present(arg)) then
157 if(arg==0) then
158 result=.true.
159 else
160 result=.false.
161 endif
162 else
163 result=.false.
164 endif