LOGICAL(3) - [TYPE:LOGICAL] Conversion between kinds of logical values
result = logical(l [,kind])
elemental logical(kind=KIND) function logical(l,KIND)logical(kind=**),intent(in) :: l integer(kind=**),intent(in),optional :: KIND
o a kind designated as ** may be any supported kind for the type o L is of type logical o KIND shall be a scalar integer constant expression. If KIND is present, the kind type parameter of the result is that specified by the value of KIND; otherwise, the kind type parameter is that of default logical.
LOGICAL(3) converts one kind of logical variable to another.
o L : The logical value to produce a copy of with kind KIND o KIND : indicates the kind parameter of the result. If not present, the default kind is returned.
The return value is a logical value equal to L, with a kind corresponding to KIND, or of the default logical kind if KIND is not given.
Sample program:
program demo_logical ! Access array containing the kind type parameter values supported by this ! compiler for entities of logical type use iso_fortran_env, only : logical_kinds implicit none integer :: iResults:! list kind values supported on this platform, which generally vary ! in storage size as alias declarations do i =1, size(logical_kinds) write(*,(*(g0)))integer,parameter :: boolean, & & logical_kinds(i),=, logical_kinds(i) enddo
end program demo_logical
> integer,parameter :: boolean1=1 > integer,parameter :: boolean2=2 > integer,parameter :: boolean4=4 > integer,parameter :: boolean8=8 > integer,parameter :: boolean16=16
Fortran 95 , related ISO_FORTRAN_ENV module - fortran 2009
INT(3), REAL(3), CMPLX(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
Nemo Release 3.1 | logical (3fortran) | November 02, 2024 |