Manual Reference Pages  - logical (3fortran)

NAME

LOGICAL(3) - [TYPE:LOGICAL] Conversion between kinds of logical values

SYNOPSIS

result = logical(l [,kind])

         elemental logical(kind=KIND) function logical(l,KIND)

logical(kind=**),intent(in) :: l integer(kind=**),intent(in),optional :: KIND

CHARACTERISTICS

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.

DESCRIPTION

LOGICAL(3) converts one kind of logical variable to another.

OPTIONS

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.

RESULT

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.

EXAMPLES

Sample program:

    Linux
    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 :: i

! 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

Results:

     > integer,parameter :: boolean1=1
     > integer,parameter :: boolean2=2
     > integer,parameter :: boolean4=4
     > integer,parameter :: boolean8=8
     > integer,parameter :: boolean16=16

STANDARD

Fortran 95 , related ISO_FORTRAN_ENV module - fortran 2009

SEE ALSO

INT(3), REAL(3), CMPLX(3)

fortran-lang intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 logical (3fortran) April 28, 2024
Generated by manServer 1.08 from 60584712-9683-45e0-a68c-316f04b5fe01 using man macros.