Ignore:
Timestamp:
Mar 12, 2015, 2:15:18 PM (10 years ago)
Author:
lguez
Message:

Correcting a problem from revision 2218. The type double precision
with option "-fdefault-real-8" of gfortran is promoted to 16-byte
precision and there is no specific procedure in arth with this
precision. Could not add a specific procedure in arth with double
precision because, with ifort, the option "-real-size 64" does not
promote the double precision, so that would make two identical
specific procedures in arth.

In module nrtype, replaced double precision by a parameterized real
kind so that the effective precision does not depend on a compiler
option.

In coefpoly, fxhyp, fyhyp and invert_zoom_x, use the parameterized
real kind defined in nrtype, instead of double precision.

Also, in module nrtype, removed unused derived types sprs2_sp and
sprs2_dp.

Location:
LMDZ5/trunk/libf/bibio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/bibio/arth.F90

    r1907 r2228  
    77  INTERFACE arth
    88     ! Returns an arithmetic progression, given a first term "first", an
    9      ! increment and a number of terms "n".
     9     ! increment and a number of terms "n" (including "first").
    1010
    1111     MODULE PROCEDURE arth_r, arth_i
    12      ! The difference between the procedures is the type of
    13      ! arguments "first" and "increment" and of function result.
     12     ! The difference between the procedures is the kind and type of
     13     ! arguments first and increment and of function result.
    1414  END INTERFACE
    1515
     
    2222    REAL, INTENT(IN) :: first,increment
    2323    INTEGER, INTENT(IN) :: n
    24     REAL, DIMENSION(n) :: arth_r
     24    REAL arth_r(n)
    2525
    26     ! Variables local to the procedure:
    27 
     26    ! Local:
    2827    INTEGER :: k,k2
    2928    REAL :: temp
     
    5049       end do
    5150    end if
     51
    5252  END FUNCTION arth_r
    5353
     
    5757
    5858    INTEGER, INTENT(IN) :: first,increment,n
    59     INTEGER, DIMENSION(n) :: arth_i
     59    INTEGER arth_i(n)
     60
     61    ! Local:
    6062    INTEGER :: k,k2,temp
     63
     64    !---------------------------------------
     65
    6166    if (n > 0) arth_i(1)=first
    6267    if (n <= NPAR_ARTH) then
     
    7883       end do
    7984    end if
     85
    8086  END FUNCTION arth_i
    8187
  • LMDZ5/trunk/libf/bibio/nrtype.F90

    r2218 r2228  
    33  implicit none
    44
    5   integer, parameter:: wp = kind(0.) ! working precision for real type
     5  integer, parameter:: k8 = selected_real_kind(13)
    66
    77  ! Frequently used mathematical constants (with precision to spare):
     
    1313  REAL, PARAMETER :: EULER=0.5772156649015328606065120900824024310422
    1414
    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
     15  REAL(K8), PARAMETER:: &
     16       PI_D = 3.141592653589793238462643383279502884197_k8
     17  REAL(K8), PARAMETER:: &
     18       PIO2_D=1.57079632679489661923132169163975144209858_k8
     19  REAL(K8), PARAMETER:: &
     20       TWOPI_D=6.283185307179586476925286766559005768394_k8
    3821
    3922END MODULE nrtype
Note: See TracChangeset for help on using the changeset viewer.