libsim Versione 7.2.6

◆ int_ll

integer, parameter int_ll = ( ( ( 1 + SIGN( 1, int_ll_t ) ) / 2 ) * int_ll_t ) + ( ( ( 1 - SIGN( 1, int_ll_t ) ) / 2 ) * int_l )

8-byte integer (long long) if supported, otherwise 4-byte integer

Definizione alla linea 254 del file kinds.F90.

254! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
255! authors:
256! Davide Cesari <dcesari@arpa.emr.it>
257! Paolo Patruno <ppatruno@arpa.emr.it>
258
259! This program is free software; you can redistribute it and/or
260! modify it under the terms of the GNU General Public License as
261! published by the Free Software Foundation; either version 2 of
262! the License, or (at your option) any later version.
263
264! This program is distributed in the hope that it will be useful,
265! but WITHOUT ANY WARRANTY; without even the implied warranty of
266! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
267! GNU General Public License for more details.
268
269! You should have received a copy of the GNU General Public License
270! along with this program. If not, see <http://www.gnu.org/licenses/>.
271#include "config.h"
272!> \defgroup base Libsim package, base library.
273!! The libsim base library defines modules and classes of general
274!! use for scientifical applications in Fortran 90. In order to
275!! compile and link programs using this library, you have to insert
276!! the required \c USE statements in the program units involved,
277!! specify the location of module files when compiling (tipically \c
278!! -I/usr/lib/gfortran/modules or \c -I/usr/lib64/gfortran/modules or
279!! \c -I/usr/include) and indicate the library name \c -lsim_base when
280!! linking, assuming that the library has been installed in a default
281!! location.
282
283!> Definition of constants to be used for declaring variables of a
284!! desired type. This module defines constants that can be portably
285!! used when declaring variables (through the \c KIND attribute) and
286!! when defining constants (through the underscore character \c _ ) in
287!! order to be sure that the desired type is used.
288!!
289!! There is a subtle difference between platform-default single and
290!! double precision real, obtained by declaring a variable of type \c
291!! REAL or \c DOUBLE \c PRECISION respectively, and single and double
292!! precision IEEE (4 and 8 bytes respectively) which are the standard
293!! IEEE data types and which are declared through \c REAL(kind=fp_s)
294!! and \c REAL(kind=fp_d) respectively: these two pairs of types
295!! usually coincide, but it may be not the case on some platforms, so
296!! you should choose one or the other approach depending on situation.
297!!
298!! Example of typical use:
299!! \code
300!! USE kinds
301!! ...
302!! INTEGER(kind=int_b) :: ab, bb
303!! REAL(kind=fp_d) :: dd
304!!
305!! ab = 13_int_b
306!! dd = REAL(ab, kind=fp_d)
307!! ...
308!! \endcode
309!! \ingroup base
310MODULE kinds
311IMPLICIT NONE
312
313INTEGER, PARAMETER :: int_b = selected_int_kind(1) !< 1-byte integer (byte)
314INTEGER, PARAMETER :: int_s = selected_int_kind(4) !< 2-byte integer (short)
315INTEGER, PARAMETER :: int_l = selected_int_kind(8) !< 4-byte integer (long)
316INTEGER, PARAMETER, PRIVATE :: &
317 int_ll_t = selected_int_kind(16)
318!> 8-byte integer (long long) if supported, otherwise 4-byte integer
319INTEGER, PARAMETER :: int_ll = &
320 ( ( ( 1 + sign( 1, int_ll_t ) ) / 2 ) * int_ll_t ) + &
321 ( ( ( 1 - sign( 1, int_ll_t ) ) / 2 ) * int_l )
322
323INTEGER, PARAMETER :: fp_s = selected_real_kind(6) !< single precision floating point (4 byte IEEE)
324INTEGER, PARAMETER :: fp_d = selected_real_kind(15) !< double precision floating point (8 byte IEEE)
325INTEGER, PARAMETER, PRIVATE :: fp_q_t = selected_real_kind(20)
326!> quad precision floating point (16 byte IEEE) if supported, otherwise double precision floating point
327INTEGER, PARAMETER :: fp_q = &
328 ( ( ( 1 + sign( 1, fp_q_t ) ) / 2 ) * fp_q_t ) + &
329 ( ( ( 1 - sign( 1, fp_q_t ) ) / 2 ) * fp_d )
330
331INTEGER, PARAMETER :: ptr_c = sizeof_ptr_c !< kind for an integer having the same size of a C pointer
332
333END MODULE kinds
Definition of constants to be used for declaring variables of a desired type.
Definition kinds.F90:245

Generated with Doxygen.