From 0c3098aed95e9e568f02887c9ae6145422e8d857 Mon Sep 17 00:00:00 2001 From: cwaterkeyn Date: Thu, 18 Feb 2010 16:57:57 +0000 Subject: [PATCH] ChW 02/2010 for type definitions and dcmplx replacements in accordance to ANSI git-svn-id: https://lxsd.femto-st.fr/svn/fvn@69 b657c933-2333-4658-acf2-d3c7c2708721 --- fvn_fnlib/z0lgmc.f | 6 +++--- fvn_fnlib/z8lgmc.f | 11 +++++++---- fvn_fnlib/z9lgmc.f | 6 +++--- fvn_fnlib/z9ln2r.f | 12 +++++++----- fvn_fnlib/zacos.f | 6 +++--- fvn_fnlib/zacosh.f | 4 ++-- fvn_fnlib/zarg.f | 4 ++-- fvn_fnlib/zasin.f | 6 +++--- fvn_fnlib/zasinh.f | 2 +- fvn_fnlib/zatan.f | 20 +++++++++++--------- fvn_fnlib/zatan2.f | 8 ++++---- fvn_fnlib/zatanh.f | 4 ++-- fvn_fnlib/zbeta.f | 6 +++--- fvn_fnlib/zcbrt.f | 8 ++++---- fvn_fnlib/zcosh.f | 4 ++-- fvn_fnlib/zcot.f | 16 ++++++++-------- fvn_fnlib/zexprl.f | 6 +++--- fvn_fnlib/zgamma.f | 4 ++-- fvn_fnlib/zgamr.f | 6 +++--- fvn_fnlib/zlbeta.f | 4 ++-- fvn_fnlib/zlngam.f | 20 ++++++++++---------- fvn_fnlib/zlnrel.f | 8 ++++---- fvn_fnlib/zlog10.f | 6 +++--- fvn_fnlib/zpsi.f | 8 ++++---- fvn_fnlib/zsinh.f | 4 ++-- fvn_fnlib/ztan.f | 14 +++++++------- fvn_fnlib/ztanh.f | 4 ++-- 27 files changed, 107 insertions(+), 100 deletions(-) diff --git a/fvn_fnlib/z0lgmc.f b/fvn_fnlib/z0lgmc.f index 4f0a394..a67e108 100644 --- a/fvn_fnlib/z0lgmc.f +++ b/fvn_fnlib/z0lgmc.f @@ -1,4 +1,4 @@ - complex(8) function z0lgmc (z) + complex(kind(1.d0)) function z0lgmc (z) implicit none c august 1980 edition. w. fullerton c3, los alamos scientific lab. c @@ -8,8 +8,8 @@ c (z+0.5)*clog(1+1/z) - 1 = (z+0.5)*(clog(1+q) - q + q*q/2) - q*q/4 c = (z+0.5)*q**3*c9ln2r(q) - q**2/4, c where c9ln2r is (clog(1+q) - q + 0.5*q**2) / q**3. c - complex(8) z, q, z9ln2r - real(8) zabsz + complex(kind(1.d0)) z, q, z9ln2r + real(kind(1.d0)) zabsz external z9ln2r c diff --git a/fvn_fnlib/z8lgmc.f b/fvn_fnlib/z8lgmc.f index f8dbdfd..d429145 100644 --- a/fvn_fnlib/z8lgmc.f +++ b/fvn_fnlib/z8lgmc.f @@ -1,4 +1,4 @@ - complex(8) function z8lgmc (zin) + complex(kind(1.d0)) function z8lgmc (zin) implicit none c may 1978 edition. w. fullerton, c3, los alamos scientific lab. c @@ -9,9 +9,10 @@ c is small. c when real(z) is negative, c8lgmc merely returns a correction which c may be wrong by a multiple of 2*pi*i. c - complex(8) zin, z, corr, z9lgmc, z0lgmc, zexp, zlnrel - real(8) d1mach,pi,bound,sqeps,eps,x,y,absz,test + complex(kind(1.d0)) zin, z, corr, z9lgmc, z0lgmc, zexp, zlnrel + real(kind(1.d0)) d1mach,pi,bound,sqeps,eps,x,y,absz,test integer nterm,n,i,irold,ir +c complex(kind(1.d0)) tmp_arg external z0lgmc, z9lgmc, zlnrel, 1 d1mach data pi / 3.1415926535 8979324d0 / @@ -55,7 +56,9 @@ c c z = zin if (y.lt.0.0) z = conjg(z) - corr = -dcmplx(0.0,pi) + zlnrel(-exp(dcmplx(0.,2.*pi)*z)) +c tmp_arg = -exp(cmplx(0.,2.*pi,kind(1.d0))*z) + corr = -cmplx(0.0,pi,kind(1.d0)) + + 1 zlnrel(-exp(cmplx(0.,2.*pi,kind(1.d0))*z)) if (y.lt.0.0) corr = conjg(corr) c z8lgmc = corr - z8lgmc diff --git a/fvn_fnlib/z9lgmc.f b/fvn_fnlib/z9lgmc.f index 2a6ac58..608a76f 100644 --- a/fvn_fnlib/z9lgmc.f +++ b/fvn_fnlib/z9lgmc.f @@ -1,4 +1,4 @@ - complex(8) function z9lgmc (zin) + complex(kind(1.d0)) function z9lgmc (zin) implicit none c april 1978 edition. w. fullerton c3, los alamos scientific lab. c @@ -7,8 +7,8 @@ c .ge. 0.0 and for large abs(aimag(y)) when real(z) .lt. 0.0. we find c c9lgmc so that c clog(cgamma(z)) = 0.5*alog(2.*pi) + (z-0.5)*clog(z) - z + c9lgmc(z). c - complex(8) zin, z, z2inv - real(8) d1mach,bern,xbig,xmax,bound,cabsz,x,y + complex(kind(1.d0)) zin, z, z2inv + real(kind(1.d0)) d1mach,bern,xbig,xmax,bound,cabsz,x,y integer nterm,i,ndx external d1mach c diff --git a/fvn_fnlib/z9ln2r.f b/fvn_fnlib/z9ln2r.f index 9521022..ed94a00 100644 --- a/fvn_fnlib/z9ln2r.f +++ b/fvn_fnlib/z9ln2r.f @@ -1,4 +1,4 @@ - complex(8) function z9ln2r (z) + complex(kind(1.d0)) function z9ln2r (z) implicit none c april 1978 edition. w. fullerton c3, los alamos scientific lab. c @@ -27,8 +27,9 @@ c c9ln2r(z) = (xz-i*yz)**3 * (-xz - cabs(z)/4 c + 0.5*(2*xz+cabs(z))**3 * r9ln2r(2*x+cabs(z)**2) c + i*yz/(1+x) * (xz**2 + (yz/(1+x))**2*r9atn1(y/(1+x)) )) c - complex(8) z - real(8) x,y,xz,yz,cabsz,d9ln2r,d9atn1,arg,rpart,aipart,y1x + complex(kind(1.d0)) z + real(kind(1.d0)) x,y,xz,yz,cabsz,d9ln2r,d9atn1,arg,rpart,aipart, + 1 y1x external d9atn1, d9ln2r c @@ -38,7 +39,7 @@ c cabsz = abs(z) if (cabsz.gt.0.8125) go to 20 c - z9ln2r = dcmplx (1.0/3.0, 0.0) + z9ln2r = cmplx (1.0/3.0, 0.0, kind(1.d0)) if (cabsz.eq.0.0) return c xz = x/cabsz @@ -49,7 +50,8 @@ c y1x = yz/(1.0+x) aipart = y1x * (xz**2 + y1x**2*d9atn1(cabsz*y1x) ) c - z9ln2r = dcmplx(xz,-yz)**3 * dcmplx(rpart,aipart) + z9ln2r = cmplx(xz,-yz,kind(1.d0))**3 * + 1 cmplx(rpart,aipart,kind(1.d0)) return c 20 z9ln2r = (log(1.0+z) - z*(1.0-0.5*z)) / z**3 diff --git a/fvn_fnlib/zacos.f b/fvn_fnlib/zacos.f index 074f181..be9250f 100644 --- a/fvn_fnlib/zacos.f +++ b/fvn_fnlib/zacos.f @@ -1,8 +1,8 @@ - complex(8) function zacos (z) + complex(kind(1.d0)) function zacos (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z, zasin - real(8) pi2 + complex(kind(1.d0)) z, zasin + real(kind(1.d0)) pi2 external zasin data pi2 /1.5707963267 9489661923d0/ c diff --git a/fvn_fnlib/zacosh.f b/fvn_fnlib/zacosh.f index 89a0626..62c27ec 100644 --- a/fvn_fnlib/zacosh.f +++ b/fvn_fnlib/zacosh.f @@ -1,7 +1,7 @@ - complex(8) function zacosh (z) + complex(kind(1.d0)) function zacosh (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z, ci, zacos + complex(kind(1.d0)) z, ci, zacos external zacos data ci /(0.d0,1.d0)/ c diff --git a/fvn_fnlib/zarg.f b/fvn_fnlib/zarg.f index 7c3c4ac..8097a5a 100644 --- a/fvn_fnlib/zarg.f +++ b/fvn_fnlib/zarg.f @@ -1,7 +1,7 @@ - real(8) function zarg (z) + real(kind(1.d0)) function zarg (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z + complex(kind(1.d0)) z c zarg = 0.0 diff --git a/fvn_fnlib/zasin.f b/fvn_fnlib/zasin.f index e26e20e..f900a57 100644 --- a/fvn_fnlib/zasin.f +++ b/fvn_fnlib/zasin.f @@ -1,12 +1,12 @@ - complex(8) function zasin (zinp) + complex(kind(1.d0)) function zasin (zinp) implicit none c august 1980 edition. w. fullerton, c3, los alamos scientific lab. c c ref -- l. l. pennisi, elements of complex variables, holt, rinehart c and winston, 1963. page 126. c - complex(8) zinp, z, z2, sqzp1, ci - real(8) d1mach,pi2,pi,rmin,r + complex(kind(1.d0)) zinp, z, z2, sqzp1, ci + real(kind(1.d0)) d1mach,pi2,pi,rmin,r integer nterms,i,twoi external d1mach diff --git a/fvn_fnlib/zasinh.f b/fvn_fnlib/zasinh.f index 92fee17..9cf7660 100644 --- a/fvn_fnlib/zasinh.f +++ b/fvn_fnlib/zasinh.f @@ -1,4 +1,4 @@ - complex(8) function zasinh (z) + complex(kind(1.d0)) function zasinh (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. complex z, ci, zasin diff --git a/fvn_fnlib/zatan.f b/fvn_fnlib/zatan.f index 8d60b0a..b3c1f10 100644 --- a/fvn_fnlib/zatan.f +++ b/fvn_fnlib/zatan.f @@ -1,13 +1,15 @@ - complex(8) function zatan (z) + complex(kind(1.d0)) function zatan (z) implicit none c jan 1984 edition. w. fullerton, los alamos scientific lab. c - complex(8) z, z2 - real(8) pi2,sqeps,rmin,rmax,r2sml,r,d1mach,x,y,r2,xans,yans - external d1mach + complex(kind(1.d0)) z, z2 + real(kind(1.d0)) pi2,sqeps,rmin,rmax,r2sml,r,x,y,r2,xans,yans + real(kind(1.d0)) d1mach integer nterms,i,twoi data pi2 /1.5707963267 9489661923d0 / - data nterms, sqeps, rmin, rmax, r2sml / 0, 4*0.0 / + data nterms, sqeps, rmin, rmax, r2sml / 0, 4*0.0d0 / + external d1mach + c if (nterms.ne.0) go to 10 c nterms = alog(eps)/alog(rbnd) where rbnd = 0.1 @@ -42,16 +44,16 @@ c 1 seteru ( 2 55hzatan no precision because z is too close to +i or -i, 3 55, 2, 2) - if (abs(dcmplx(1.0,0.0)+z*z).lt.sqeps) call seteru ( + if (abs(cmplx(1.0d0,0.0d0,kind(1.d0))+z*z).lt.sqeps) call seteru ( 1 50hzatan answer lt half precision, z**2 close to -1, 50, 1, 1) c 40 xans = 0.5*atan2 (2.0*x, 1.0-r2) yans = 0.25*log((r2+2.0*y+1.0)/(r2-2.0*y+1.0)) - zatan = dcmplx (xans, yans) + zatan = cmplx (xans, yans, kind(1.d0)) return c - 50 zatan = dcmplx (pi2, 0.0) - if (real(z).lt.0.0) zatan = dcmplx (-pi2, 0.0) + 50 zatan = cmplx (pi2, 0.0d0, kind(1.d0)) + if (real(z).lt.0.0) zatan = cmplx (-pi2, 0.0d0, kind(1.d0)) return c end diff --git a/fvn_fnlib/zatan2.f b/fvn_fnlib/zatan2.f index 34e78ec..2661a98 100644 --- a/fvn_fnlib/zatan2.f +++ b/fvn_fnlib/zatan2.f @@ -1,8 +1,8 @@ - complex(8) function zatan2 (csn, ccs) + complex(kind(1.d0)) function zatan2 (csn, ccs) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) csn, ccs, zatan - real(8) pi + complex(kind(1.d0)) csn, ccs, zatan + real(kind(1.d0)) pi external zatan data pi / 3.1415926535 8979323846d0 / c @@ -16,7 +16,7 @@ c 10 if (abs(csn).eq.0.) call seteru ( 1 34hzatan2 called with both args zero, 34, 1, 2) c - zatan2 = dcmplx (sign(0.5*pi,real(csn)), 0.0) + zatan2 = cmplx (sign(0.5*pi,real(csn)), 0.0, kind(1.d0)) c return end diff --git a/fvn_fnlib/zatanh.f b/fvn_fnlib/zatanh.f index cd97c62..0e61676 100644 --- a/fvn_fnlib/zatanh.f +++ b/fvn_fnlib/zatanh.f @@ -1,7 +1,7 @@ - complex(8) function zatanh (z) + complex(kind(1.d0)) function zatanh (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z, ci, zatan + complex(kind(1.d0)) z, ci, zatan external zatan data ci /(0.,1.)/ c diff --git a/fvn_fnlib/zbeta.f b/fvn_fnlib/zbeta.f index f824624..fc5d8e6 100644 --- a/fvn_fnlib/zbeta.f +++ b/fvn_fnlib/zbeta.f @@ -1,8 +1,8 @@ - complex(8) function zbeta (a, b) + complex(kind(1.d0)) function zbeta (a, b) implicit none c july 1977 edition. w. fullerton, c3, los alamos scientific lab. - complex(8) a, b, zgamma, zlbeta - real(8) xmax,xmin + complex(kind(1.d0)) a, b, zgamma, zlbeta + real(kind(1.d0)) xmax,xmin external zgamma, zlbeta data xmax / 0.0 / c diff --git a/fvn_fnlib/zcbrt.f b/fvn_fnlib/zcbrt.f index 9e27f4e..24c13d2 100644 --- a/fvn_fnlib/zcbrt.f +++ b/fvn_fnlib/zcbrt.f @@ -1,14 +1,14 @@ - complex(8) function zcbrt (z) + complex(kind(1.d0)) function zcbrt (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z - real(8) theta,zarg,r,dcbrt + complex(kind(1.d0)) z + real(kind(1.d0)) theta,zarg,r,dcbrt external zarg, dcbrt c theta = zarg(z) / 3.0 r = dcbrt (abs(z)) c - zcbrt = dcmplx (r*cos(theta), r*sin(theta)) + zcbrt = cmplx (r*cos(theta), r*sin(theta), kind(1.d0)) c return end diff --git a/fvn_fnlib/zcosh.f b/fvn_fnlib/zcosh.f index 6fbf1ee..5c7e7d7 100644 --- a/fvn_fnlib/zcosh.f +++ b/fvn_fnlib/zcosh.f @@ -1,7 +1,7 @@ - complex(8) function zcosh (z) + complex(kind(1.d0)) function zcosh (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z, ci + complex(kind(1.d0)) z, ci data ci /(0.,1.)/ c zcosh = cos (ci*z) diff --git a/fvn_fnlib/zcot.f b/fvn_fnlib/zcot.f index eae9c8b..fe3ee50 100644 --- a/fvn_fnlib/zcot.f +++ b/fvn_fnlib/zcot.f @@ -1,10 +1,10 @@ - complex(8) function zcot (z) + complex(kind(1.d0)) function zcot (z) implicit none c march 1979 edition. w. fullerton, c3, los alamos scientific lab. - complex(8) z - real(8) d1mach - real(8) eps, xmax, ylarge, ybig, rmin, ymin - real(8) x,y,x2,y2,sn2x,den + complex(kind(1.d0)) z + real(kind(1.d0)) d1mach + real(kind(1.d0)) eps, xmax, ylarge, ybig, rmin, ymin + real(kind(1.d0)) x,y,x2,y2,sn2x,den integer irold,irold2 external d1mach data eps, xmax, ylarge, ybig, rmin, ymin / 5*0.0, 1.5 / @@ -38,7 +38,7 @@ c if (den.lt.x*x2*eps .and. abs(x).gt.0.5) call seteru (65hzcot a 1nswer is lt half precision, x is near pi and y is near 0, 65, 1,1) c - zcot = dcmplx (sn2x/den, -sinh(y2)/den) + zcot = cmplx (sn2x/den, -sinh(y2)/den, kind(1.d0)) return c 20 if (abs(y).lt.ymin) call seteru (75hzcot answer would have no p @@ -46,10 +46,10 @@ c if (abs(y).lt.ybig) call seteru (69hzcot answer lt half precisi 1on, abs(x) is very big and abs(y) small, 69, 2, 1) c - zcot = dcmplx (0.0, 1.0/tanh(y2)) + zcot = cmplx (0.0, 1.0/tanh(y2), kind(1.d0)) return c - 30 zcot = dcmplx (0.0, sign (1.0d0, y)) + 30 zcot = cmplx (0.0, sign (1.0d0, y), kind(1.d0)) return c end diff --git a/fvn_fnlib/zexprl.f b/fvn_fnlib/zexprl.f index afe5b2a..dd69c4c 100644 --- a/fvn_fnlib/zexprl.f +++ b/fvn_fnlib/zexprl.f @@ -1,4 +1,4 @@ - complex(8) function zexprl (z) + complex(kind(1.d0)) function zexprl (z) implicit none c august 1980 edition. w. fullerton, c3, los alamos scientific lab. c @@ -8,8 +8,8 @@ c cexprl(z) = (exp(x)*exp(i*y)-1)/z c = (x*exprel(x) * (1 - 2*sin(y/2)**2) - 2*sin(y/2)**2 c + i*sin(y)*(1+x*exprel(x))) / z c - complex(8) z - real(8) sqeps,r,xn,xln,rbnd,d1mach,alneps + complex(kind(1.d0)) z + real(kind(1.d0)) sqeps,r,xn,xln,rbnd,d1mach,alneps external d1mach integer nterms,irold,irold2,i data nterms, rbnd, sqeps / 0, 2*0.0 / diff --git a/fvn_fnlib/zgamma.f b/fvn_fnlib/zgamma.f index 7c69153..df137e8 100644 --- a/fvn_fnlib/zgamma.f +++ b/fvn_fnlib/zgamma.f @@ -1,8 +1,8 @@ - complex(8) function zgamma (z) + complex(kind(1.d0)) function zgamma (z) implicit none c july 1977 edition. w. fullerton, c3, los alamos scientific lab. c a preliminary version that is portable, but not accurate enough. - complex(8) z, zlngam + complex(kind(1.d0)) z, zlngam external zlngam c zgamma = exp (zlngam(z)) diff --git a/fvn_fnlib/zgamr.f b/fvn_fnlib/zgamr.f index b314d6c..26cb677 100644 --- a/fvn_fnlib/zgamr.f +++ b/fvn_fnlib/zgamr.f @@ -1,11 +1,11 @@ - complex(8) function zgamr (z) + complex(kind(1.d0)) function zgamr (z) implicit none c july 1977 edition. w. fullerton, c3, los alamos scientific lab. c this version is an inaccurate preliminary one. eventually this c routine should be a fundamental routine with no dependence on cgamma. c - complex(8) z, zlngam - real(8) x + complex(kind(1.d0)) z, zlngam + real(kind(1.d0)) x integer irold,ir external zlngam c diff --git a/fvn_fnlib/zlbeta.f b/fvn_fnlib/zlbeta.f index 94418e1..0d43762 100644 --- a/fvn_fnlib/zlbeta.f +++ b/fvn_fnlib/zlbeta.f @@ -1,8 +1,8 @@ - complex(8) function zlbeta (a, b) + complex(kind(1.d0)) function zlbeta (a, b) implicit none c july 1977 edition. w. fullerton, c3, los alamos scientific lab. c a preliminary version that is portable, but not accurate enough. - complex(8) a, b, zlngam + complex(kind(1.d0)) a, b, zlngam external zlngam c if (real(a).le.0.0 .or. real(b).le.0.0) call seteru ( diff --git a/fvn_fnlib/zlngam.f b/fvn_fnlib/zlngam.f index 08c8e1c..deff484 100644 --- a/fvn_fnlib/zlngam.f +++ b/fvn_fnlib/zlngam.f @@ -1,15 +1,15 @@ - complex(8) function zlngam (zin) + complex(kind(1.d0)) function zlngam (zin) implicit none c august 1980 edition. w. fullerton c3, los alamos scientific lab. c eventually clngam should make use of c8lgmc for all z except for c z in the vicinity of 1 and 2. - complex(8) zin, z, corr, zlnrel, z9lgmc - real(8) d1mach,pi,sq2pil,bound,dxrel,rmax,cabsz - real(8) x,y,argsum,zarg + complex(kind(1.d0)) zin, z, corr, zlnrel, z9lgmc + real(kind(1.d0)) d1mach,pi,sq2pil,bound,dxrel,rmax,cabsz + real(kind(1.d0)) x,y,argsum,zarg integer irold,ir,i,n external z9lgmc, zarg, zlnrel,d1mach - data pi / 3.1415926535 8979324e0 / - data sq2pil / 0.9189385332 0467274e0 / + data pi / 3.1415926535 8979324d0 / + data sq2pil / 0.9189385332 0467274d0 / c data bound, dxrel, rmax / 3*0.0 / c @@ -38,12 +38,12 @@ c abs(aimag(y)) small. c call entsrc (irold, 1) if (y.gt.0.0) z = conjg (z) - corr = exp (-dcmplx(0.0,2.0*pi)*z) + corr = exp (-cmplx(0.0,2.0*pi,kind(1.d0))*z) if (real(corr).eq.1.0 .and. aimag(corr).eq.0.0) call seteru ( 1 31hzlngam z is a negative integer, 31, 3, 2) c - zlngam = sq2pil + 1.0 - dcmplx(0.0,pi)*(z-0.5) - zlnrel(-corr) - 1 + (z-0.5)*log(1.0-z) - z - z9lgmc(1.0-z) + zlngam = sq2pil + 1.0 - cmplx(0.0,pi,kind(1.d0))*(z-0.5) - + 1 zlnrel(-corr) + (z-0.5)*log(1.0-z) - z - z9lgmc(1.0-z) if (y.gt.0.0) zlngam = conjg (zlngam) c call erroff @@ -72,7 +72,7 @@ c c if (real(corr).eq.0.0 .and. aimag(corr).eq.0.0) call seteru ( 1 31hzlngam z is a negative integer, 31, 3, 2) - corr = -dcmplx (log(abs(corr)), argsum) + corr = -cmplx (log(abs(corr)), argsum, kind(1.d0)) c c use stirling-s approximation for large z. c diff --git a/fvn_fnlib/zlnrel.f b/fvn_fnlib/zlnrel.f index b31178f..a838537 100644 --- a/fvn_fnlib/zlnrel.f +++ b/fvn_fnlib/zlnrel.f @@ -1,4 +1,4 @@ - complex(8) function zlnrel (z) + complex(kind(1.d0)) function zlnrel (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. c @@ -10,8 +10,8 @@ c clog(1+z) = cmplx (alog(r), carg(1+z)) c = cmplx (0.5*alog(r**2), carg(1+z)) c = cmplx (0.5*alnrel(2*x+rho**2), carg(1+z)) c - complex(8) z - real(8) dlnrel,d1mach,zarg,sqeps,x,rho + complex(kind(1.d0)) z + real(kind(1.d0)) dlnrel,d1mach,zarg,sqeps,x,rho external dlnrel, zarg, d1mach data sqeps /0.0/ c @@ -26,7 +26,7 @@ c if (rho.gt.0.375) return c x = real(z) - zlnrel = dcmplx (0.5*dlnrel(2.*x+rho**2), zarg(1.0+z)) + zlnrel = cmplx (0.5*dlnrel(2.*x+rho**2), zarg(1.0+z), kind(1.d0)) c return end diff --git a/fvn_fnlib/zlog10.f b/fvn_fnlib/zlog10.f index f9dea09..ffafef0 100644 --- a/fvn_fnlib/zlog10.f +++ b/fvn_fnlib/zlog10.f @@ -1,8 +1,8 @@ - complex(8) function zlog10 (z) + complex(kind(1.d0)) function zlog10 (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z - real(8) aloge + complex(kind(1.d0)) z + real(kind(1.d0)) aloge data aloge / 0.4342944819 0325182765d0 / c zlog10 = aloge * log(z) diff --git a/fvn_fnlib/zpsi.f b/fvn_fnlib/zpsi.f index d51e0f3..fcb3cd6 100644 --- a/fvn_fnlib/zpsi.f +++ b/fvn_fnlib/zpsi.f @@ -1,10 +1,10 @@ - complex(8) function zpsi (zin) + complex(kind(1.d0)) function zpsi (zin) implicit none c may 1978 edition. w. fullerton, c3, los alamos scientific lab. - complex(8) zin, z, z2inv, corr, zcot + complex(kind(1.d0)) zin, z, z2inv, corr, zcot dimension bern(13) - real(8) bern,d1mach,pi,bound, dxrel, rmin, rbig - real(8) x,y,cabsz + real(kind(1.d0)) bern,d1mach,pi,bound, dxrel, rmin, rbig + real(kind(1.d0)) x,y,cabsz integer nterm,ndx,n,i external zcot, d1mach c diff --git a/fvn_fnlib/zsinh.f b/fvn_fnlib/zsinh.f index 6ae8f0f..20833a7 100644 --- a/fvn_fnlib/zsinh.f +++ b/fvn_fnlib/zsinh.f @@ -1,7 +1,7 @@ - complex(8) function zsinh (z) + complex(kind(1.d0)) function zsinh (z) implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z, ci + complex(kind(1.d0)) z, ci data ci /(0.,1.)/ c zsinh = -ci*sin(ci*z) diff --git a/fvn_fnlib/ztan.f b/fvn_fnlib/ztan.f index 6da169c..7fb5d02 100644 --- a/fvn_fnlib/ztan.f +++ b/fvn_fnlib/ztan.f @@ -1,9 +1,9 @@ - complex(8) function ztan (z) + complex(kind(1.d0)) function ztan (z) implicit none c march 1979 edition. w. fullerton, c3, los alamos scientific lab. - complex(8) z - real(8) d1mach,eps, xmax, ylarge, ybig, ymin,sn2x,den - real(8) x,y,x2,y2 + complex(kind(1.d0)) z + real(kind(1.d0)) d1mach,eps, xmax, ylarge, ybig, ymin,sn2x,den + real(kind(1.d0)) x,y,x2,y2 integer irold,irold2 external d1mach data eps, xmax, ylarge, ybig, ymin / 4*0.0, 1.50 / @@ -34,7 +34,7 @@ c if (den.lt.x*x2*eps) call seteru (74hztan answer lt half precis 1ion, x is near pi/2 or 3*pi/2 and y is near 0, 74, 1, 1) c - ztan = dcmplx (sn2x/den, sinh(y2)/den) + ztan = cmplx (sn2x/den, sinh(y2)/den, kind(1.d0)) return c 20 if (abs(y).lt.ymin) call seteru (75hztan answer would have no p @@ -42,10 +42,10 @@ c if (abs(y).lt.ybig) call seteru (69hztan answer lt half precisi 1on, abs(x) is very big and abs(y) small, 69, 2, 1) c - ztan = dcmplx (0.0, tanh(y2)) + ztan = cmplx (0.0, tanh(y2), kind(1.d0)) return c - 30 ztan = dcmplx (0.0, -sign(1.0d0, y)) + 30 ztan = cmplx (0.0, -sign(1.0d0, y), kind(1.d0)) return c end diff --git a/fvn_fnlib/ztanh.f b/fvn_fnlib/ztanh.f index 943da05..6cba088 100644 --- a/fvn_fnlib/ztanh.f +++ b/fvn_fnlib/ztanh.f @@ -1,6 +1,6 @@ - complex(8) function ztanh (z) + complex(kind(1.d0)) function ztanh (z) c april 1977 version. w. fullerton, c3, los alamos scientific lab. - complex(8) z, ci, ztan + complex(kind(1.d0)) z, ci, ztan external ztan data ci /(0.,1.)/ c -- 2.16.4