[1765] | 1 | MODULE nrtype |
---|
| 2 | |
---|
| 3 | implicit none |
---|
| 4 | |
---|
| 5 | integer, parameter:: wp = kind(0.) ! working precision for real type |
---|
| 6 | |
---|
| 7 | ! Frequently used mathematical constants (with precision to spare): |
---|
| 8 | |
---|
| 9 | REAL, PARAMETER :: PI=3.141592653589793238462643383279502884197 |
---|
| 10 | REAL, PARAMETER :: PIO2=1.57079632679489661923132169163975144209858 |
---|
| 11 | REAL, PARAMETER :: TWOPI=6.283185307179586476925286766559005768394 |
---|
| 12 | REAL, PARAMETER :: SQRT2=1.41421356237309504880168872420969807856967 |
---|
| 13 | REAL, PARAMETER :: EULER=0.5772156649015328606065120900824024310422 |
---|
| 14 | |
---|
| 15 | DOUBLE PRECISION, PARAMETER:: & |
---|
| 16 | PI_D = 3.141592653589793238462643383279502884197d0 |
---|
| 17 | DOUBLE PRECISION, PARAMETER:: & |
---|
| 18 | PIO2_D=1.57079632679489661923132169163975144209858d0 |
---|
| 19 | DOUBLE PRECISION, PARAMETER:: & |
---|
| 20 | TWOPI_D=6.283185307179586476925286766559005768394d0 |
---|
| 21 | |
---|
| 22 | ! Derived data types for sparse matrices, single and double |
---|
| 23 | ! precision (see use in Chapter B2): |
---|
| 24 | |
---|
| 25 | TYPE sprs2_sp |
---|
| 26 | INTEGER :: n,len |
---|
| 27 | REAL, DIMENSION(:), POINTER :: val |
---|
| 28 | INTEGER, DIMENSION(:), POINTER :: irow |
---|
| 29 | INTEGER, DIMENSION(:), POINTER :: jcol |
---|
| 30 | END TYPE sprs2_sp |
---|
| 31 | |
---|
| 32 | TYPE sprs2_dp |
---|
| 33 | INTEGER :: n,len |
---|
| 34 | DOUBLE PRECISION, DIMENSION(:), POINTER :: val |
---|
| 35 | INTEGER, DIMENSION(:), POINTER :: irow |
---|
| 36 | INTEGER, DIMENSION(:), POINTER :: jcol |
---|
| 37 | END TYPE sprs2_dp |
---|
| 38 | |
---|
| 39 | END MODULE nrtype |
---|