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

Public Member Functions

logical function present_and_eq_integer (arg, val)
logical function present_and_eq_real (arg, val)
logical function present_and_eq_double (arg, val)

Detailed Description

Definition at line 70 of file dc_present.f90.

Member Function/Subroutine Documentation

◆ present_and_eq_double()

logical function dc_present::present_and_eq::present_and_eq_double ( real(dp), intent(in), optional arg,
real(dp), intent(in) val )

Check if arg is present and equals val (double precision version)

Parameters
[in]argOptional double precision real argument
[in]valValue to compare
Returns
.true. if arg is present and equals val within DP_EPS, .false. otherwise

Definition at line 262 of file dc_present.f90.

263 logical :: result
264 real(DP), intent(in), optional :: arg
265 real(DP), intent(in) :: val
266 continue
267 if(present(arg)) then
268 if ( abs(arg - val) .le. dp_eps ) then
269 result=.true.
270 else
271 result=.false.
272 endif
273 else
274 result=.false.
275 end if

References dc_types::dp_eps.

◆ present_and_eq_integer()

logical function dc_present::present_and_eq::present_and_eq_integer ( integer, intent(in), optional arg,
integer, intent(in) val )

Check if arg is present and equals val (integer version)

Parameters
[in]argOptional integer argument
[in]valValue to compare
Returns
.true. if arg is present and equals val, .false. otherwise

Definition at line 204 of file dc_present.f90.

205 logical :: result
206 integer, intent(in), optional :: arg
207 integer, intent(in) :: val
208 continue
209 result = .false.
210 if(present(arg)) then
211 if(arg==val) then
212 result=.true.
213 else
214 result=.false.
215 endif
216 else
217 result=.false.
218 endif

◆ present_and_eq_real()

logical function dc_present::present_and_eq::present_and_eq_real ( real(sp), intent(in), optional arg,
real(sp), intent(in) val )

Check if arg is present and equals val (single precision version)

Parameters
[in]argOptional single precision real argument
[in]valValue to compare
Returns
.true. if arg is present and equals val within SP_EPS, .false. otherwise

Definition at line 233 of file dc_present.f90.

234 logical :: result
235 real(SP), intent(in), optional :: arg
236 real(SP), intent(in) :: val
237 continue
238 result = .false.
239 if(present(arg)) then
240 if( abs(arg - val) .le. sp_eps ) then
241 result=.true.
242 else
243 result=.false.
244 endif
245 else
246 result=.false.
247 endif

References dc_types::sp_eps.


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