penf.F90 Source File

Portability Environment for Fortran poor people.


This file depends on

sourcefile~~penf.f90~~EfferentGraph sourcefile~penf.f90 penf.F90 sourcefile~penf_global_parameters_variables.f90 penf_global_parameters_variables.F90 sourcefile~penf.f90->sourcefile~penf_global_parameters_variables.f90 sourcefile~penf_b_size.f90 penf_b_size.F90 sourcefile~penf.f90->sourcefile~penf_b_size.f90 sourcefile~penf_stringify.f90 penf_stringify.F90 sourcefile~penf.f90->sourcefile~penf_stringify.f90 sourcefile~penf_b_size.f90->sourcefile~penf_global_parameters_variables.f90 sourcefile~penf_stringify.f90->sourcefile~penf_global_parameters_variables.f90 sourcefile~penf_stringify.f90->sourcefile~penf_b_size.f90

Files dependent on this one

sourcefile~~penf.f90~~AfferentGraph sourcefile~penf.f90 penf.F90 sourcefile~penf_stringify-doctest-86.f90 penf_stringify-doctest-86.f90 sourcefile~penf_stringify-doctest-86.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-63.f90 penf_stringify-doctest-63.f90 sourcefile~penf_stringify-doctest-63.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-9.f90 penf_b_size-doctest-9.f90 sourcefile~penf_b_size-doctest-9.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-40.f90 penf_stringify-doctest-40.f90 sourcefile~penf_stringify-doctest-40.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-87.f90 penf_stringify-doctest-87.f90 sourcefile~penf_stringify-doctest-87.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-19.f90 penf_stringify-doctest-19.f90 sourcefile~penf_stringify-doctest-19.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-29.f90 penf_stringify-doctest-29.f90 sourcefile~penf_stringify-doctest-29.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-16.f90 penf_stringify-doctest-16.f90 sourcefile~penf_stringify-doctest-16.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-6.f90 penf_b_size-doctest-6.f90 sourcefile~penf_b_size-doctest-6.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-78.f90 penf_stringify-doctest-78.f90 sourcefile~penf_stringify-doctest-78.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-48.f90 penf_stringify-doctest-48.f90 sourcefile~penf_stringify-doctest-48.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-67.f90 penf_stringify-doctest-67.f90 sourcefile~penf_stringify-doctest-67.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-23.f90 penf_stringify-doctest-23.f90 sourcefile~penf_stringify-doctest-23.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-91.f90 penf_stringify-doctest-91.f90 sourcefile~penf_stringify-doctest-91.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-7.f90 penf_stringify-doctest-7.f90 sourcefile~penf_stringify-doctest-7.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-42.f90 penf_stringify-doctest-42.f90 sourcefile~penf_stringify-doctest-42.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-50.f90 penf_stringify-doctest-50.f90 sourcefile~penf_stringify-doctest-50.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-11.f90 penf_b_size-doctest-11.f90 sourcefile~penf_b_size-doctest-11.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-89.f90 penf_stringify-doctest-89.f90 sourcefile~penf_stringify-doctest-89.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-10.f90 penf_stringify-doctest-10.f90 sourcefile~penf_stringify-doctest-10.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-52.f90 penf_stringify-doctest-52.f90 sourcefile~penf_stringify-doctest-52.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-80.f90 penf_stringify-doctest-80.f90 sourcefile~penf_stringify-doctest-80.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-24.f90 penf_stringify-doctest-24.f90 sourcefile~penf_stringify-doctest-24.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-1.f90 penf_stringify-doctest-1.f90 sourcefile~penf_stringify-doctest-1.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-56.f90 penf_stringify-doctest-56.f90 sourcefile~penf_stringify-doctest-56.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-53.f90 penf_stringify-doctest-53.f90 sourcefile~penf_stringify-doctest-53.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-31.f90 penf_stringify-doctest-31.f90 sourcefile~penf_stringify-doctest-31.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-3.f90 penf_stringify-doctest-3.f90 sourcefile~penf_stringify-doctest-3.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-4.f90 penf_b_size-doctest-4.f90 sourcefile~penf_b_size-doctest-4.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-82.f90 penf_stringify-doctest-82.f90 sourcefile~penf_stringify-doctest-82.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-75.f90 penf_stringify-doctest-75.f90 sourcefile~penf_stringify-doctest-75.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-44.f90 penf_stringify-doctest-44.f90 sourcefile~penf_stringify-doctest-44.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-4.f90 penf_stringify-doctest-4.f90 sourcefile~penf_stringify-doctest-4.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-35.f90 penf_stringify-doctest-35.f90 sourcefile~penf_stringify-doctest-35.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-84.f90 penf_stringify-doctest-84.f90 sourcefile~penf_stringify-doctest-84.f90->sourcefile~penf.f90 sourcefile~penf-doctest-2.f90 penf-doctest-2.f90 sourcefile~penf-doctest-2.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-34.f90 penf_stringify-doctest-34.f90 sourcefile~penf_stringify-doctest-34.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-77.f90 penf_stringify-doctest-77.f90 sourcefile~penf_stringify-doctest-77.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-11.f90 penf_stringify-doctest-11.f90 sourcefile~penf_stringify-doctest-11.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-2.f90 penf_b_size-doctest-2.f90 sourcefile~penf_b_size-doctest-2.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-60.f90 penf_stringify-doctest-60.f90 sourcefile~penf_stringify-doctest-60.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-64.f90 penf_stringify-doctest-64.f90 sourcefile~penf_stringify-doctest-64.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-88.f90 penf_stringify-doctest-88.f90 sourcefile~penf_stringify-doctest-88.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-14.f90 penf_stringify-doctest-14.f90 sourcefile~penf_stringify-doctest-14.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-26.f90 penf_stringify-doctest-26.f90 sourcefile~penf_stringify-doctest-26.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-54.f90 penf_stringify-doctest-54.f90 sourcefile~penf_stringify-doctest-54.f90->sourcefile~penf.f90 sourcefile~penf-doctest-6.f90 penf-doctest-6.f90 sourcefile~penf-doctest-6.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-45.f90 penf_stringify-doctest-45.f90 sourcefile~penf_stringify-doctest-45.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-13.f90 penf_stringify-doctest-13.f90 sourcefile~penf_stringify-doctest-13.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-68.f90 penf_stringify-doctest-68.f90 sourcefile~penf_stringify-doctest-68.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-7.f90 penf_b_size-doctest-7.f90 sourcefile~penf_b_size-doctest-7.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-39.f90 penf_stringify-doctest-39.f90 sourcefile~penf_stringify-doctest-39.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-8.f90 penf_stringify-doctest-8.f90 sourcefile~penf_stringify-doctest-8.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-72.f90 penf_stringify-doctest-72.f90 sourcefile~penf_stringify-doctest-72.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-22.f90 penf_stringify-doctest-22.f90 sourcefile~penf_stringify-doctest-22.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-83.f90 penf_stringify-doctest-83.f90 sourcefile~penf_stringify-doctest-83.f90->sourcefile~penf.f90 sourcefile~penf-doctest-5.f90 penf-doctest-5.f90 sourcefile~penf-doctest-5.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-76.f90 penf_stringify-doctest-76.f90 sourcefile~penf_stringify-doctest-76.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-47.f90 penf_stringify-doctest-47.f90 sourcefile~penf_stringify-doctest-47.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-25.f90 penf_stringify-doctest-25.f90 sourcefile~penf_stringify-doctest-25.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-10.f90 penf_b_size-doctest-10.f90 sourcefile~penf_b_size-doctest-10.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-65.f90 penf_stringify-doctest-65.f90 sourcefile~penf_stringify-doctest-65.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-27.f90 penf_stringify-doctest-27.f90 sourcefile~penf_stringify-doctest-27.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-2.f90 penf_stringify-doctest-2.f90 sourcefile~penf_stringify-doctest-2.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-36.f90 penf_stringify-doctest-36.f90 sourcefile~penf_stringify-doctest-36.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-38.f90 penf_stringify-doctest-38.f90 sourcefile~penf_stringify-doctest-38.f90->sourcefile~penf.f90 sourcefile~penf-doctest-1.f90 penf-doctest-1.f90 sourcefile~penf-doctest-1.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-46.f90 penf_stringify-doctest-46.f90 sourcefile~penf_stringify-doctest-46.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-57.f90 penf_stringify-doctest-57.f90 sourcefile~penf_stringify-doctest-57.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-30.f90 penf_stringify-doctest-30.f90 sourcefile~penf_stringify-doctest-30.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-8.f90 penf_b_size-doctest-8.f90 sourcefile~penf_b_size-doctest-8.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-17.f90 penf_stringify-doctest-17.f90 sourcefile~penf_stringify-doctest-17.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-21.f90 penf_stringify-doctest-21.f90 sourcefile~penf_stringify-doctest-21.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-6.f90 penf_stringify-doctest-6.f90 sourcefile~penf_stringify-doctest-6.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-37.f90 penf_stringify-doctest-37.f90 sourcefile~penf_stringify-doctest-37.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-41.f90 penf_stringify-doctest-41.f90 sourcefile~penf_stringify-doctest-41.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-9.f90 penf_stringify-doctest-9.f90 sourcefile~penf_stringify-doctest-9.f90->sourcefile~penf.f90 sourcefile~penf-doctest-3.f90 penf-doctest-3.f90 sourcefile~penf-doctest-3.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-28.f90 penf_stringify-doctest-28.f90 sourcefile~penf_stringify-doctest-28.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-43.f90 penf_stringify-doctest-43.f90 sourcefile~penf_stringify-doctest-43.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-59.f90 penf_stringify-doctest-59.f90 sourcefile~penf_stringify-doctest-59.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-3.f90 penf_b_size-doctest-3.f90 sourcefile~penf_b_size-doctest-3.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-61.f90 penf_stringify-doctest-61.f90 sourcefile~penf_stringify-doctest-61.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-70.f90 penf_stringify-doctest-70.f90 sourcefile~penf_stringify-doctest-70.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-85.f90 penf_stringify-doctest-85.f90 sourcefile~penf_stringify-doctest-85.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-32.f90 penf_stringify-doctest-32.f90 sourcefile~penf_stringify-doctest-32.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-15.f90 penf_stringify-doctest-15.f90 sourcefile~penf_stringify-doctest-15.f90->sourcefile~penf.f90 sourcefile~penf-doctest-4.f90 penf-doctest-4.f90 sourcefile~penf-doctest-4.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-66.f90 penf_stringify-doctest-66.f90 sourcefile~penf_stringify-doctest-66.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-58.f90 penf_stringify-doctest-58.f90 sourcefile~penf_stringify-doctest-58.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-18.f90 penf_stringify-doctest-18.f90 sourcefile~penf_stringify-doctest-18.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-5.f90 penf_b_size-doctest-5.f90 sourcefile~penf_b_size-doctest-5.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-71.f90 penf_stringify-doctest-71.f90 sourcefile~penf_stringify-doctest-71.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-90.f90 penf_stringify-doctest-90.f90 sourcefile~penf_stringify-doctest-90.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-12.f90 penf_stringify-doctest-12.f90 sourcefile~penf_stringify-doctest-12.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-49.f90 penf_stringify-doctest-49.f90 sourcefile~penf_stringify-doctest-49.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-33.f90 penf_stringify-doctest-33.f90 sourcefile~penf_stringify-doctest-33.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-74.f90 penf_stringify-doctest-74.f90 sourcefile~penf_stringify-doctest-74.f90->sourcefile~penf.f90 sourcefile~penf-doctest-7.f90 penf-doctest-7.f90 sourcefile~penf-doctest-7.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-5.f90 penf_stringify-doctest-5.f90 sourcefile~penf_stringify-doctest-5.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-20.f90 penf_stringify-doctest-20.f90 sourcefile~penf_stringify-doctest-20.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-81.f90 penf_stringify-doctest-81.f90 sourcefile~penf_stringify-doctest-81.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-1.f90 penf_b_size-doctest-1.f90 sourcefile~penf_b_size-doctest-1.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-79.f90 penf_stringify-doctest-79.f90 sourcefile~penf_stringify-doctest-79.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-51.f90 penf_stringify-doctest-51.f90 sourcefile~penf_stringify-doctest-51.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-69.f90 penf_stringify-doctest-69.f90 sourcefile~penf_stringify-doctest-69.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-62.f90 penf_stringify-doctest-62.f90 sourcefile~penf_stringify-doctest-62.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-55.f90 penf_stringify-doctest-55.f90 sourcefile~penf_stringify-doctest-55.f90->sourcefile~penf.f90 sourcefile~penf_stringify-doctest-73.f90 penf_stringify-doctest-73.f90 sourcefile~penf_stringify-doctest-73.f90->sourcefile~penf.f90 sourcefile~penf_b_size-doctest-12.f90 penf_b_size-doctest-12.f90 sourcefile~penf_b_size-doctest-12.f90->sourcefile~penf.f90

Contents

Source Code


Source Code

!< Portability Environment for Fortran poor people.

module penf
!< Portability Environment for Fortran poor people.
use penf_global_parameters_variables
#ifdef __INTEL_COMPILER
use penf_b_size
#else
use penf_b_size, only : bit_size, byte_size
#endif
use penf_stringify, only : str_ascii, str_ucs4, str, strz, cton, bstr, bcton

implicit none
private
save
! global parameters and variables
public :: endianL, endianB, endian, is_initialized
public :: ASCII, UCS4, CK
public :: R16P, FR16P, DR16P, MinR16P, MaxR16P, BIR16P, BYR16P, smallR16P, ZeroR16P
public :: R8P,  FR8P,  DR8P,  MinR8P,  MaxR8P,  BIR8P,  BYR8P,  smallR8P,  ZeroR8P
public :: R4P,  FR4P,  DR4P,  MinR4P,  MaxR4P,  BIR4P,  BYR4P,  smallR4P,  ZeroR4P
public :: R_P,  FR_P,  DR_P,  MinR_P,  MaxR_P,  BIR_P,  BYR_P,  smallR_P,  ZeroR_P
public :: I8P,  FI8P,  DI8P,  MinI8P,  MaxI8P,  BII8P,  BYI8P
public :: I4P,  FI4P,  DI4P,  MinI4P,  MaxI4P,  BII4P,  BYI4P
public :: I2P,  FI2P,  DI2P,  MinI2P,  MaxI2P,  BII2P,  BYI2P
public :: I1P,  FI1P,  DI1P,  MinI1P,  MaxI1P,  BII1P,  BYI1P
public :: I_P,  FI_P,  DI_P,  MinI_P,  MaxI_P,  BII_P,  BYI_P
public :: CHARACTER_KINDS_LIST, REAL_KINDS_LIST, REAL_FORMATS_LIST
public :: INTEGER_KINDS_LIST, INTEGER_FORMATS_LIST
! bit/byte size functions
public :: bit_size, byte_size
! stringify facility
public :: str_ascii, str_ucs4
public :: str, strz, cton
public :: bstr, bcton
! miscellanea facility
public :: check_endian
public :: digit
public :: penf_Init
public :: penf_print

integer, protected :: endian         = endianL !< Bit ordering: Little endian (endianL), or Big endian (endianB).
logical, protected :: is_initialized = .false. !< Check the initialization of some variables that must be initialized.

#ifdef __GFORTRAN__
! work-around for strange gfortran bug...
interface bit_size
  !< Overloading of the intrinsic *bit_size* function for computing the number of bits of (also) real and character variables.
endinterface
#endif

interface digit
  !< Compute the number of digits in decimal base of the input integer.
  module procedure digit_I8, digit_I4, digit_I2, digit_I1
endinterface

contains
   ! public procedures
   subroutine check_endian()
   !< Check the type of bit ordering (big or little endian) of the running architecture.
   !<
   !> @note The result is stored into the *endian* global variable.
   !<
   !<```fortran
   !< use penf
   !< call check_endian
   !< print *, endian
   !<```
   !=> 1 <<<
   if (is_little_endian()) then
      endian = endianL
   else
      endian = endianB
   endif
   contains
      pure function is_little_endian() result(is_little)
      !< Check if the type of the bit ordering of the running architecture is little endian.
      logical      :: is_little !< Logical output: true is the running architecture uses little endian ordering, false otherwise.
      integer(I1P) :: int1(1:4) !< One byte integer array for casting 4 bytes integer.

      int1 = transfer(1_I4P, int1)
      is_little = (int1(1)==1_I1P)
      endfunction is_little_endian
   endsubroutine check_endian

   subroutine penf_init()
   !< Initialize PENF's variables that are not initialized into the definition specification.
   !<
   !<```fortran
   !< use penf
   !< call penf_init
   !< print FI1P, BYR4P
   !<```
   !=> 4 <<<

   call check_endian
   is_initialized = .true.
   endsubroutine penf_init

   subroutine penf_print(unit, pref, iostat, iomsg)
   !< Print to the specified unit the PENF's environment data.
   !<
   !<```fortran
   !< use penf
   !< integer :: u
   !< open(newunit=u, status='scratch')
   !< call penf_print(u)
   !< close(u)
   !< print "(A)", 'done'
   !<```
   !=> done <<<
   integer(I4P), intent(in)            :: unit    !< Logic unit.
   character(*), intent(in),  optional :: pref    !< Prefixing string.
   integer(I4P), intent(out), optional :: iostat  !< IO error.
   character(*), intent(out), optional :: iomsg   !< IO error message.
   character(len=:), allocatable       :: prefd   !< Prefixing string.
   integer(I4P)                        :: iostatd !< IO error.
   character(500)                      :: iomsgd  !< Temporary variable for IO error message.

   if (.not.is_initialized) call penf_init
   prefd = '' ; if (present(pref)) prefd = pref
   if (endian==endianL) then
     write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)prefd//'This architecture has LITTLE Endian bit ordering'
   else
     write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)prefd//'This architecture has BIG Endian bit ordering'
   endif
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Character kind:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  ASCII: '//str(n=ASCII)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  UCS4:  '//str(n=UCS4)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  CK:    '//str(n=CK)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Reals kind, format and characters number:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R16P: '//str(n=R16P)//','//FR16P//','//str(n=DR16P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R8P:  '//str(n=R8P )//','//FR8P //','//str(n=DR8P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R4P:  '//str(n=R4P )//','//FR4P //','//str(n=DR4P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R_P:  '//str(n=R_P )//','//FR_P //','//str(n=DR_P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Integers kind, format and characters number:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I8P:  '//str(n=I8P)//','//FI8P //','//str(n=DI8P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I4P:  '//str(n=I4P)//','//FI4P //','//str(n=DI4P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I2P:  '//str(n=I2P)//','//FI2P //','//str(n=DI2P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I1P:  '//str(n=I1P)//','//FI1P //','//str(n=DI1P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Reals minimum and maximum values:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R16P: '//str(n=MinR16P)//','//str(n=MaxR16P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R8P:  '//str(n=MinR8P )//','//str(n=MaxR8P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R4P:  '//str(n=MinR4P )//','//str(n=MaxR4P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R_P:  '//str(n=MinR_P )//','//str(n=MaxR_P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Integergs minimum and maximum values:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I8P:  '//str(n=MinI8P )//','//str(n=MaxI8P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I4P:  '//str(n=MinI4P )//','//str(n=MaxI4P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I2P:  '//str(n=MinI2P )//','//str(n=MaxI2P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I1P:  '//str(n=MinI1P )//','//str(n=MaxI1P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Reals bits/bytes sizes:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R16P: '//str(n=BIR16P)//'/'//str(n=BYR16P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R8P:  '//str(n=BIR8P )//'/'//str(n=BYR8P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R4P:  '//str(n=BIR4P )//'/'//str(n=BYR4P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  R_P:  '//str(n=BIR_P )//'/'//str(n=BYR_P )
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Integers bits/bytes sizes:'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I8P:  '//str(n=BII8P)//'/'//str(n=BYI8P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I4P:  '//str(n=BII4P)//'/'//str(n=BYI4P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I2P:  '//str(n=BII2P)//'/'//str(n=BYI2P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  I1P:  '//str(n=BII1P)//'/'//str(n=BYI1P)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Smallest reals'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  smallR16P: '//str(smallR16P, .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  smallR8P:  '//str(smallR8P,  .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  smallR4P:  '//str(smallR4P,  .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  smallR_P:  '//str(smallR_P,  .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'Machine zero'
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  ZeroR16P: '//str(ZeroR16P, .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  ZeroR8P:  '//str(ZeroR8P,  .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  ZeroR4P:  '//str(ZeroR4P,  .true.)
   write(unit=unit,fmt='(A)',iostat=iostatd,iomsg=iomsgd)  prefd//'  ZeroR_P:  '//str(ZeroR_P,  .true.)
   if (present(iostat)) iostat = iostatd
   if (present(iomsg))  iomsg  = iomsgd
   endsubroutine penf_print

   ! private procedures
   elemental function digit_I8(n) result(digit)
   !< Compute the number of digits in decimal base of the input integer.
   !<
   !<```fortran
   !< use penf
   !< print FI4P, digit(100_I8P)
   !<```
   !=> 3 <<<
   integer(I8P), intent(in) :: n     !< Input integer.
   character(DI8P)          :: str   !< Returned string containing input number plus padding zeros.
   integer(I4P)             :: digit !< Number of digits.

   write(str, FI8P) abs(n)        ! Casting of n to string.
   digit = len_trim(adjustl(str)) ! Calculating the digits number of n.
   endfunction digit_I8

   elemental function digit_I4(n) result(digit)
   !< Compute the number of digits in decimal base of the input integer.
   !<
   !<```fortran
   !< use penf
   !< print FI4P, digit(100_I4P)
   !<```
   !=> 3 <<<
   integer(I4P), intent(in) :: n     !< Input integer.
   character(DI4P)          :: str   !< Returned string containing input number plus padding zeros.
   integer(I4P)             :: digit !< Number of digits.

   write(str, FI4P) abs(n)        ! Casting of n to string.
   digit = len_trim(adjustl(str)) ! Calculating the digits number of n.
   endfunction digit_I4

   elemental function digit_I2(n) result(digit)
   !< Compute the number of digits in decimal base of the input integer.
   !<
   !<```fortran
   !< use penf
   !< print FI4P, digit(100_I2P)
   !<```
   !=> 3 <<<
   integer(I2P), intent(in) :: n     !< Input integer.
   character(DI2P)          :: str   !< Returned string containing input number plus padding zeros.
   integer(I4P)             :: digit !< Number of digits.

   write(str, FI2P) abs(n)        ! Casting of n to string.
   digit = len_trim(adjustl(str)) ! Calculating the digits number of n.
   endfunction digit_I2

   elemental function digit_I1(n) result(digit)
   !< Compute the number of digits in decimal base of the input integer.
   !<
   !<```fortran
   !< use penf
   !< print FI4P, digit(100_I1P)
   !<```
   !=> 3 <<<
   integer(I1P), intent(in) :: n     !< Input integer.
   character(DI1P)          :: str   !< Returned string containing input number plus padding zeros.
   integer(I4P)             :: digit !< Number of digits.

   write(str, FI1P) abs(n)        ! Casting of n to string.
   digit = len_trim(adjustl(str)) ! Calculating the digits number of n.
   endfunction digit_I1
endmodule penf