libsim Versione 7.2.6

◆ int_l

integer, parameter int_l = SELECTED_INT_KIND(8)

4-byte integer (long)

Definizione alla linea 250 del file kinds.F90.

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

Generated with Doxygen.