indeControl of the precision f_precision

Work in progress: here the automodule documentation of f_precision should appear


This module enhances the portability of various kind of variables and defines other objects that might be used in the host code

Quick access

Variables:f_byte, f_long, f_short, f_integer, f_double, f_quadruple, f_simple, f_f, f_t, f_address, f_cr, f_backslash, f_0, f_1


  • type f_precisions/unknown_type
    Type fields:
    • % val [character]


  • f_precisions/f_byte [integer,public/parameter/optional/default=1]

    precision for 1-byte logical, to be declared as logical(f_byte)

  • f_precisions/f_backslash [character,public/parameter/optional/default=char(92)]
  • f_precisions/f_long [integer,public/parameter/optional/default=selected_int_kind(16)]

    kind of a pointer address, long integer on most machines. Might be detected at configure time

  • f_precisions/f_double [integer,public/parameter/optional/default=selected_real_kind(15,307)]


  • f_precisions/f_cr [character,public/parameter/optional/default=char(13)//char(10)]
  • f_precisions/f_f [logical,public/parameter/optional/default=.false._f_byte]
  • f_precisions/f_address [integer,public/parameter/optional/default=8]
  • f_precisions/f_t [logical,public/parameter/optional/default=.true._f_byte]
  • f_precisions/f_short [integer,public/parameter/optional/default=selected_int_kind(4)]
  • f_precisions/f_quadruple [integer,public/parameter/optional/default=selected_real_kind(33,4931)]
  • f_precisions/f_integer [integer,public/parameter/optional/default=selected_int_kind(8)]
  • f_precisions/f_1 [f_parameter,public/parameter/optional/default=f_parameter(c_1)]
  • f_precisions/f_simple [integer,public/parameter/optional/default=selected_real_kind(6,37)]
  • f_precisions/f_0 [f_parameter,public/parameter/optional/default=f_parameter(c_0)]

Subroutines and functions

function f_precisions/f_loc(routine)
Parameters:routine [external]
Return:f_loc [integer]
Use :f_precisions (f_address())
Called from:f_err_set_last_error_callback(), dict_destroy(), deallocate_file(), err_set_callback_advanced(), f_dump_possible_errors(), err_set_callback_simple(), f_err_severe_override()

Now I write some customized information here:

function f_precisions/f_loc(x)

Inquiry Function which identifies the address of the scalar object associated to a unknown quantity. Portable version of the loc() function of GNU fortran standard


x [in] :: Variable of any type; it may be a subroutine or a fortran intrinsic or derived type. It cannot be a nullified pointer


f_loc [integer(f_address)] :: Address of the object

Example :
program test_f_loc
   use f_precisions, only: f_address,f_loc
   implicit none
   integer(f_address) :: i
   !note that altough this variable is uninitialized it
   !already has an address in the stack
   real :: r

   i = f_loc(r)
   print *, i
end program test_f_loc


Some text 2