diff options
author | tradke <tradke@89daf98e-ef62-4674-b946-b8ff9de2216c> | 2002-06-18 13:00:08 +0000 |
---|---|---|
committer | tradke <tradke@89daf98e-ef62-4674-b946-b8ff9de2216c> | 2002-06-18 13:00:08 +0000 |
commit | 751bd44faded4ac77cb9029cdacd832b0cb8bec8 (patch) | |
tree | e5928adc750a6d2743db33e31f4135ec6359204a | |
parent | c0a5e1b582bcf8b481c08c6f1f04f40fac278a3b (diff) |
Use the generic routines sqrt(), abs(), log(), etc. instead of double-precision
ones dsqrt(), dabs(), dlog(), detc.
This makes the code compile in single precision.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinder/trunk@312 89daf98e-ef62-4674-b946-b8ff9de2216c
-rw-r--r-- | src/AHFinder.F | 14 | ||||
-rw-r--r-- | src/AHFinder_dis.F | 6 | ||||
-rw-r--r-- | src/AHFinder_exp.F | 4 | ||||
-rw-r--r-- | src/AHFinder_flow.F | 8 | ||||
-rw-r--r-- | src/AHFinder_fun.F | 10 | ||||
-rw-r--r-- | src/AHFinder_gau.F | 16 | ||||
-rw-r--r-- | src/AHFinder_leg.F | 4 | ||||
-rw-r--r-- | src/AHFinder_mask.F | 16 | ||||
-rw-r--r-- | src/AHFinder_output.F | 12 | ||||
-rw-r--r-- | src/AHFinder_pow.F | 18 |
10 files changed, 54 insertions, 54 deletions
diff --git a/src/AHFinder.F b/src/AHFinder.F index 364e301..8bd32ff 100644 --- a/src/AHFinder.F +++ b/src/AHFinder.F @@ -969,8 +969,8 @@ aux = intexp2_h/intarea_h - (intexp_h/intarea_h)**2 if (aux.ge.zero) then - aux = dsqrt(aux) - if (dabs(intexp_h/intarea_h)-aux.gt.zero) horizon = .false. + aux = sqrt(aux) + if (abs(intexp_h/intarea_h)-aux.gt.zero) horizon = .false. else horizon = .false. end if @@ -1070,18 +1070,18 @@ ! ! M = sqrt( A / (16 pi) ) = 0.141047396 sqrt(A) - ahfmass(mfind) = 0.141047396D0*dsqrt(intarea_h) + ahfmass(mfind) = 0.141047396D0*sqrt(intarea_h) write(*,*) write(*,*) 'Surface found, details below.' write(*,*) write(*,"(A21,ES14.6)") ' Surface area =',intarea_h write(*,"(A21,ES14.6)") ' Surface mass =', - . 0.141047396D0*dsqrt(intarea_h) + . 0.141047396D0*sqrt(intarea_h) write(*,"(A21,ES14.6)") ' Mean value of H =',aux*intexp_h write(*,"(A21,ES14.6)") ' Mean value of H^2 =',aux*intexp2_h write(*,"(A21,ES14.6)") ' Standard deviation =', - . dsqrt(dabs(aux*intexp2_h - (aux*intexp_h)**2)) + . sqrt(abs(aux*intexp2_h - (aux*intexp_h)**2)) write(*,*) if (ahf_gaussout.ne.0) then write(*,"(A11,ES14.6)") ' circ_eq =',circ_eq @@ -1096,11 +1096,11 @@ write(1,*) write(1,"(A21,ES14.6)") ' Surface area =',intarea_h write(1,"(A21,ES14.6)") ' Surface mass =', - . 0.141047396D0*dsqrt(intarea_h) + . 0.141047396D0*sqrt(intarea_h) write(1,"(A21,ES14.6)") ' Mean value of H =',aux*intexp_h write(1,"(A21,ES14.6)") ' Mean value of H^2 =',aux*intexp2_h write(1,"(A21,ES14.6)") ' Standard deviation =', - . dsqrt(dabs(aux*intexp2_h - (aux*intexp_h)**2)) + . sqrt(abs(aux*intexp2_h - (aux*intexp_h)**2)) write(1,*) if (ahf_gaussout.ne.0) then write(1,"(A11,ES14.6)") ' circ_eq =',circ_eq diff --git a/src/AHFinder_dis.F b/src/AHFinder_dis.F index c15b62b..894271c 100644 --- a/src/AHFinder_dis.F +++ b/src/AHFinder_dis.F @@ -415,7 +415,7 @@ ! *** ALLOCATE MEMORY FOR ARRAYS *** ! ************************************** - aux = dsqrt((x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2)/dx + aux = sqrt((x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2)/dx np = int(aux) @@ -545,9 +545,9 @@ do i=1,np d12 = d12 + half - . *(dsqrt(txx(i-1)*ddx**2 + tyy(i-1)*ddy**2 + tzz(i-1)*ddz**2 + . *(sqrt(txx(i-1)*ddx**2 + tyy(i-1)*ddy**2 + tzz(i-1)*ddz**2 . + two*(txy(i-1)*ddx*ddy + txz(i-1)*ddx*ddz + tyz(i-1)*ddy*ddz)) - . + dsqrt(txx(i )*ddx**2 + tyy(i )*ddy**2 + tzz(i )*ddz**2 + . + sqrt(txx(i )*ddx**2 + tyy(i )*ddy**2 + tzz(i )*ddz**2 . + two*(txy(i )*ddx*ddy + txz(i )*ddx*ddz + tyz(i )*ddy*ddz))) end do diff --git a/src/AHFinder_exp.F b/src/AHFinder_exp.F index 59d4e62..254986b 100644 --- a/src/AHFinder_exp.F +++ b/src/AHFinder_exp.F @@ -214,7 +214,7 @@ aux = guxx*dfx**2 + guyy*dfy**2 + guzz*dfz**2 . + two*(guxy*dfx*dfy + guxz*dfx*dfz + guyz*dfy*dfz) - ahfgradn(i,j,k) = dsqrt(aux) + ahfgradn(i,j,k) = sqrt(aux) if (ahfgradn(i,j,k).eq.zero) ahfgradn(i,j,k) = one ! Find crossed derivatives. @@ -262,7 +262,7 @@ T0 = dfx*dfux + dfy*dfuy + dfz*dfuz if (T0.gt.zero) then - T0 = one/dsqrt(T0) + T0 = one/sqrt(T0) ! __2 ! Find: \/ f / u diff --git a/src/AHFinder_flow.F b/src/AHFinder_flow.F index 043b629..810019b 100644 --- a/src/AHFinder_flow.F +++ b/src/AHFinder_flow.F @@ -283,8 +283,8 @@ end if - ahfsum = dsqrt(ahfsum) - ahfdiff = dsqrt(ahfdiff) + ahfsum = sqrt(ahfsum) + ahfdiff = sqrt(ahfdiff) ! If this is the first of the two small steps, save ! twice the difference. Why twice? Because this would @@ -307,8 +307,8 @@ ! Here we find the relative difference between having done two ! small steps and one large step. - reldiff = dabs(ahfdiff - ahfdiff_old) - . / (dabs(ahfdiff) + dabs(ahfdiff_old)) + reldiff = abs(ahfdiff - ahfdiff_old) + . / (abs(ahfdiff) + abs(ahfdiff_old)) ! *************************** diff --git a/src/AHFinder_fun.F b/src/AHFinder_fun.F index e565782..0af446c 100644 --- a/src/AHFinder_fun.F +++ b/src/AHFinder_fun.F @@ -99,7 +99,7 @@ do l=1,lmax - dsqrt_factor2(l) = c0(l)*dsqrt(dble(2*l+1)) + dsqrt_factor2(l) = c0(l)*sqrt(dble(2*l+1)) lm_factor1(l,0) = dble(2*l-1)/dble(l) lm_factor2(l,0) = dble(l-1)/dble(l) @@ -113,11 +113,11 @@ do l=1,lmax - dsqrt_factor(l,1) = dsqrt(2.0D0*dble(2*l+1)/dble(l*(l+1))) + dsqrt_factor(l,1) = sqrt(2.0D0*dble(2*l+1)/dble(l*(l+1))) do m=2,l dsqrt_factor(l,m) = dsqrt_factor(l,m-1) - . / dsqrt(dble((l-m+1)*(l+m))) + . / sqrt(dble((l-m+1)*(l+m))) end do end do @@ -237,7 +237,7 @@ ! Find rp. - rp = dsqrt(xp**2 + yp**2 + zp**2) + rp = sqrt(xp**2 + yp**2 + zp**2) ! Monopole term. @@ -281,7 +281,7 @@ ! if (nonaxi) then - aux2 = dsqrt((one-cost)*(one+cost)) + aux2 = sqrt((one-cost)*(one+cost)) ! This general loop can only be used until l=lmax-2 since ! the recursion relations requires 2 starting values. diff --git a/src/AHFinder_gau.F b/src/AHFinder_gau.F index 0381d3a..9e8ca67 100644 --- a/src/AHFinder_gau.F +++ b/src/AHFinder_gau.F @@ -809,7 +809,7 @@ do j=1,nphi circ_eq = circ_eq + dphi - . *dsqrt(dabs(half*(g22(ntheta+1,j) + g22(ntheta+1,j+1)))) + . *sqrt(abs(half*(g22(ntheta+1,j) + g22(ntheta+1,j+1)))) end do else @@ -819,12 +819,12 @@ aux = aux - int(aux) if (cartoon) then - circ_eq = 6.283185307D0*dsqrt(g22(i,0)) + circ_eq = 6.283185307D0*sqrt(g22(i,0)) else do j=1,nphi circ_eq = circ_eq + dphi - . *((one-aux)*dsqrt(dabs(half*(g22(i,j) + g22(i,j+1)))) - . + aux*dsqrt(dabs(half*(g22(i+1,j) + g22(i+1,j+1))))) + . *((one-aux)*sqrt(abs(half*(g22(i,j) + g22(i,j+1)))) + . + aux*sqrt(abs(half*(g22(i+1,j) + g22(i+1,j+1))))) end do end if end if @@ -833,7 +833,7 @@ do i=1,ntheta meri_p1 = meri_p1 + dtheta - . *dsqrt(dabs(half*(g11(i,1) + g11(i+1,1)))) + . *sqrt(abs(half*(g11(i,1) + g11(i+1,1)))) end do if (cartoon) then @@ -841,7 +841,7 @@ else if (refx.and.refy) then do i=1,ntheta meri_p2 = meri_p2 + dtheta - . *dsqrt(dabs(half*(g11(i,nphi+1) + g11(i+1,nphi+1)))) + . *sqrt(abs(half*(g11(i,nphi+1) + g11(i+1,nphi+1)))) end do else aux = half*pi/dphi @@ -849,8 +849,8 @@ aux = aux - int(aux) do i=1,ntheta meri_p2 = meri_p2 + dtheta - . *((one-aux)*dsqrt(dabs(half*(g11(i,j) + g11(i,j)))) - . + aux*dsqrt(dabs(half*(g11(i,j+1) + g11(i,j+1))))) + . *((one-aux)*sqrt(abs(half*(g11(i,j) + g11(i,j)))) + . + aux*sqrt(abs(half*(g11(i,j+1) + g11(i,j+1))))) end do end if diff --git a/src/AHFinder_leg.F b/src/AHFinder_leg.F index 2215539..654963b 100644 --- a/src/AHFinder_leg.F +++ b/src/AHFinder_leg.F @@ -191,7 +191,7 @@ if (M.gt.0) then - SOMX2 = dsqrt((one-X)*(one+X)) + SOMX2 = sqrt((one-X)*(one+X)) FACT = one do I=1,M @@ -291,7 +291,7 @@ end if - LEGEN = dsqrt(factor)*LEGEN + LEGEN = sqrt(factor)*LEGEN ! *************** diff --git a/src/AHFinder_mask.F b/src/AHFinder_mask.F index 194f13c..cef8bbb 100644 --- a/src/AHFinder_mask.F +++ b/src/AHFinder_mask.F @@ -84,7 +84,7 @@ dd = max(dx,dy,dz) aux = ahf_maskbuffer*dd - if (dabs(buffer).lt.aux) buffer = - aux + if (abs(buffer).lt.aux) buffer = - aux ! ***************************************** @@ -101,7 +101,7 @@ do i=1,nx if (ahfgrid(i,j,k).ge.buffer) then - aux = dsqrt((x(i,j,k)-xc)**2 + (y(i,j,k)-yc)**2 + aux = sqrt((x(i,j,k)-xc)**2 + (y(i,j,k)-yc)**2 . + (z(i,j,k)-zc)**2) if (rhor.gt.aux) rhor = aux end if @@ -167,9 +167,9 @@ aux = 0.57D0*rhor - xa = dabs(x(i,j,k)-xc) - ya = dabs(y(i,j,k)-yc) - za = dabs(z(i,j,k)-zc) + xa = abs(x(i,j,k)-xc) + ya = abs(y(i,j,k)-yc) + za = abs(z(i,j,k)-zc) if ((xa.lt.aux).and.(ya.lt.aux).and.(za.lt.aux)) then ahmask(i,j,k) = zero @@ -202,9 +202,9 @@ aux = 0.7D0*rhor - xa = dabs(x(i,j,k)-xc) - ya = dabs(y(i,j,k)-yc) - za = dabs(z(i,j,k)-zc) + xa = abs(x(i,j,k)-xc) + ya = abs(y(i,j,k)-yc) + za = abs(z(i,j,k)-zc) if ((xa.lt.aux).and.(ya.lt.aux).and.(za.lt.aux).and. . ((xa+ya+za).lt.2.0D0*aux)) then diff --git a/src/AHFinder_output.F b/src/AHFinder_output.F index c5a492e..3f5b339 100644 --- a/src/AHFinder_output.F +++ b/src/AHFinder_output.F @@ -106,7 +106,7 @@ c some compilers cannot trim an empty string, so we add at least one char end if if (status.and.report) then - out_mass = 0.141047396D0 * dsqrt(intarea_h) + out_mass = 0.141047396D0 * sqrt(intarea_h) else out_mass = 0.0 end if @@ -218,9 +218,9 @@ c some compilers cannot trim an empty string, so we add at least one char do l=1,lmax do m=1,l if (mod(m,2).ne.0) then - out_asymx = out_asymx + dabs(cc(l,m)) + out_asymx = out_asymx + abs(cc(l,m)) else - out_asymx = out_asymx + dabs(cs(l,m)) + out_asymx = out_asymx + abs(cs(l,m)) end if end do end do @@ -244,7 +244,7 @@ c some compilers cannot trim an empty string, so we add at least one char if (status.and.report.and..not.refy) then do l=1,lmax do m=1,l - out_asymy = out_asymy + dabs(cs(l,m)) + out_asymy = out_asymy + abs(cs(l,m)) end do end do out_asymy = out_asymy / c0(0) @@ -267,10 +267,10 @@ c some compilers cannot trim an empty string, so we add at least one char out_asymz = 0.0D0 if (status.and.report.and..not.refz) then do l=1,lmax - if (mod(l,2).ne.0) out_asymz = out_asymz + dabs(c0(l)) + if (mod(l,2).ne.0) out_asymz = out_asymz + abs(c0(l)) do m=1,l if (mod(l-m,2).ne.0) then - out_asymz = out_asymz + dabs(cc(l,m)) + dabs(cs(l,m)) + out_asymz = out_asymz + abs(cc(l,m)) + abs(cs(l,m)) end if end do end do diff --git a/src/AHFinder_pow.F b/src/AHFinder_pow.F index 149a474..fe53079 100644 --- a/src/AHFinder_pow.F +++ b/src/AHFinder_pow.F @@ -137,8 +137,8 @@ ! And record it if it is the largest decrease so far. - if (dabs(FPTT-FRET).gt.DEL) then - DEL = dabs(FPTT-FRET) + if (abs(FPTT-FRET).gt.DEL) then + DEL = abs(FPTT-FRET) IBIG = I end if @@ -148,12 +148,12 @@ ! Termination criterion. - TOL1 = 0.5D0*FTOL*(dabs(FP)+dabs(FRET)) + ZEPS + TOL1 = 0.5D0*FTOL*(abs(FP)+abs(FRET)) + ZEPS - if (dabs(FP-FRET).le.TOL1) then + if (abs(FP-FRET).le.TOL1) then found = .true. return - else if (dabs(FRET).lt.ZEPS) then + else if (abs(FRET).lt.ZEPS) then found = .true. return end if @@ -423,7 +423,7 @@ S = (XB-XA)*(FB-FC) Q = (XB-XC)*(FB-FA) U = XB - ((XB-XC)*Q - (XB-XA)*S) - . / (2.0D0*SIGN(MAX(DABS(Q-S),TINY),Q-S)) + . / (2.0D0*SIGN(MAX(ABS(Q-S),TINY),Q-S)) ! We will not go further than this. @@ -584,8 +584,8 @@ ! Test for done here. - TOL1 = 0.5D0*TOL*(dabs(FP)+dabs(FX)) + ZEPS - if (dabs(FP-FX).le.TOL1) goto 3 + TOL1 = 0.5D0*TOL*(abs(FP)+abs(FX)) + ZEPS + if (abs(FP-FX).le.TOL1) goto 3 ! Construct a trial parabolic fit. @@ -612,7 +612,7 @@ ! Check if X was already the minimum. - if (dabs(U-XX).lt.ZEPS) goto 3 + if (abs(U-XX).lt.ZEPS) goto 3 ! This is the one function evaluation per iteration. |