Ignore:
Timestamp:
Mar 26, 2014 5:04:47 PM (7 years ago)
Author:
kanani
Message:

REAL constants defined as wp-kind

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/random_gauss.f90

    r1321 r1342  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! REAL constants defined as wp-kind
    2323!
    2424! Former revisions:
     
    7878
    7979       IF ( iset == 0 )  THEN
    80           rsq = 0.0
    81           DO  WHILE ( rsq >= 1.0  .OR.  rsq == 0.0 )
    82              v1  = 2.0 * random_function( idum ) - 1.0
    83              v2  = 2.0 * random_function( idum ) - 1.0
     80          rsq = 0.0_wp
     81          DO  WHILE ( rsq >= 1.0_wp  .OR.  rsq == 0.0_wp )
     82             v1  = 2.0_wp * random_function( idum ) - 1.0_wp
     83             v2  = 2.0_wp * random_function( idum ) - 1.0_wp
    8484             rsq = v1**2 + v2**2
    8585          ENDDO
    86           fac          = SQRT( -2.0 * LOG( rsq ) / rsq )
     86          fac          = SQRT( -2.0_wp * LOG( rsq ) / rsq )
    8787          gset         = v1 * fac
    88           random_gauss = v2 * fac + 1.0
     88          random_gauss = v2 * fac + 1.0_wp
    8989          iset         = 1
    9090       ELSE
    91           random_gauss = gset + 1.0
     91          random_gauss = gset + 1.0_wp
    9292          iset         = 0
    9393       ENDIF
    9494
    95        IF ( ABS( random_gauss - 1.0 ) <= upper_limit )  EXIT
     95       IF ( ABS( random_gauss - 1.0_wp ) <= upper_limit )  EXIT
    9696
    9797    ENDDO
Note: See TracChangeset for help on using the changeset viewer.