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:

    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 intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 logical (3fortran) November 02, 2024
Generated by manServer 1.08 from 5681fcc0-0a5b-4bc3-a97f-0333b1b2ed25 using man macros.