Skip to content

Commit bafe8d4

Browse files
committed
renames real*8 to double precision
1 parent bc125b7 commit bafe8d4

File tree

22 files changed

+99
-100
lines changed

22 files changed

+99
-100
lines changed

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_constants.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module cmt3d_constants
77
implicit none
88

99
! mathematical constantS
10-
real*8, parameter :: PI = 3.141592653589793d0
10+
double precision, parameter :: PI = 3.141592653589793d0
1111

1212
! scale of cmt pars (latitude,longitude,depth and moment
1313
! centroid time and half duration)
14-
real*8, parameter :: SCALE_DELTA = 0.001 ! degree
15-
real*8, parameter :: SCALE_DEPTH = 1.0 ! km
16-
real*8, parameter :: SCALE_MOMENT = 1.0e+22 ! dyns*cm
17-
real*8, parameter :: SCALE_CTIME = 1.0 ! seconds
18-
real*8, parameter :: SCALE_HDUR = 1.0 ! seconds
14+
double precision, parameter :: SCALE_DELTA = 0.001 ! degree
15+
double precision, parameter :: SCALE_DEPTH = 1.0 ! km
16+
double precision, parameter :: SCALE_MOMENT = 1.0e+22 ! dyns*cm
17+
double precision, parameter :: SCALE_CTIME = 1.0 ! seconds
18+
double precision, parameter :: SCALE_HDUR = 1.0 ! seconds
1919

2020
! maximum number of parameters
2121
integer, parameter :: NPARMAX = 11
@@ -36,8 +36,8 @@ module cmt3d_constants
3636
integer, parameter :: NML = 9
3737

3838
! small numbers
39-
real*8, parameter :: EPS2 = 1.0d-2
40-
real*8, parameter :: EPS5 = 1.0d-5
39+
double precision, parameter :: EPS2 = 1.0d-2
40+
double precision, parameter :: EPS5 = 1.0d-5
4141
real, parameter :: SMALL = -huge(1.0)
4242

4343
! io unit for parameter files

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_flexwin.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ program cmt3d_flexwin
99

1010
character(len=150) :: par_file
1111
integer :: ier, i
12-
real*8, dimension(:,:), allocatable :: A
13-
real*8, dimension(:), allocatable :: b,dm
12+
double precision, dimension(:,:), allocatable :: A
13+
double precision, dimension(:), allocatable :: b,dm
1414

1515
integer :: yr,mo,jda,ho,mi
16-
real*8:: sec, t_cmt, hdur, elat, elon, depth, moment_tensor(NM)
16+
double precision :: sec, t_cmt, hdur, elat, elon, depth, moment_tensor(NM)
1717

1818

1919
! read and print parameters

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_sub.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ end subroutine setup_data_weights
207207
subroutine setup_matrix(A,b,npar)
208208

209209
integer, intent(in) :: npar
210-
real*8, intent(out) :: A(npar,npar), b(npar)
210+
double precision, intent(out) :: A(npar,npar), b(npar)
211211

212212
integer :: ios,nf,nw,nwint,i,j
213213
real :: tstart, tend
214-
real*8 :: A1(npar,npar), b1(npar)
214+
double precision :: A1(npar,npar), b1(npar)
215215

216216
open(IOWIN,file=trim(flexwin_out_file),iostat=ios)
217217
if (ios /= 0) stop 'Flexwin output file can not be found'
@@ -254,15 +254,15 @@ end subroutine setup_matrix
254254
subroutine invert_cmt(A,b,dm,npar)
255255

256256
integer, intent(in) :: npar
257-
real*8 , intent(inout) :: A(npar,npar), b(npar)
258-
real*8 , intent(out) :: dm(npar)
257+
double precision, intent(inout) :: A(npar,npar), b(npar)
258+
double precision, intent(out) :: dm(npar)
259259

260-
real*8 :: old_par(npar),new_par(npar)
261-
real*8 :: trace, max_row
260+
double precision :: old_par(npar),new_par(npar)
261+
double precision :: trace, max_row
262262
logical :: linear_inversion,singular
263263
integer :: na, niter, i
264-
real*8 :: xout(NPARMAX+2), AA(NPARMAX+2,NPARMAX+2), bb(NPARMAX+2)
265-
real*8 :: m1(npar),lam(2), mstart(npar)
264+
double precision :: xout(NPARMAX+2), AA(NPARMAX+2,NPARMAX+2), bb(NPARMAX+2)
265+
double precision :: m1(npar),lam(2), mstart(npar)
266266
integer, parameter :: NMAX_NL_ITER = 10
267267

268268
! do we really need the extra scaling??
@@ -364,7 +364,7 @@ end subroutine invert_cmt
364364
subroutine variance_reduction(dm,npar)
365365

366366
integer,intent(in) :: npar
367-
real*8,intent(in) :: dm(npar)
367+
double precision,intent(in) :: dm(npar)
368368

369369
integer :: ios, nf, nwint, nw, is, ie, i, j, npts, ishift, ishift_new
370370
real :: b, dt, tstart, tend

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_sub2.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ subroutine compute_A_b(syn_file,data_file,data_weight,tstart,tend,A1,b1,npar)
148148

149149
character(len=*),intent(in) :: syn_file, data_file
150150
real,intent(in) :: data_weight, tstart, tend
151-
real*8, intent(out),dimension(:,:) :: A1
152-
real*8, intent(out),dimension(:) :: b1
151+
double precision, intent(out),dimension(:,:) :: A1
152+
double precision, intent(out),dimension(:) :: b1
153153
integer, intent(in) :: npar
154154

155155
real :: t0, dt, t0_1, dt1
@@ -245,13 +245,13 @@ end subroutine compute_A_b
245245
subroutine get_f_df(npar,A,b,m,lam,mstart,fij,f0)
246246

247247
integer,intent(in) :: npar
248-
real*8,intent(in) :: A(:,:),b(:)
249-
real*8,intent(in) :: m(:),mstart(:)
250-
real*8,intent(in) :: lam(:)
248+
double precision,intent(in) :: A(:,:),b(:)
249+
double precision,intent(in) :: m(:),mstart(:)
250+
double precision,intent(in) :: lam(:)
251251

252-
real*8,intent(out) :: fij(:,:),f0(:)
252+
double precision,intent(out) :: fij(:,:),f0(:)
253253

254-
real*8 :: dc1_dm(NM),dc2_dm(NM),dc2_dmi_dmj(NM,NM)
254+
double precision :: dc1_dm(NM),dc2_dm(NM),dc2_dmi_dmj(NM,NM)
255255
integer :: i,j
256256

257257
! U_j's
@@ -303,7 +303,7 @@ subroutine compute_new_syn(data_file,syn_file,npts,b,dt,dm)
303303
character(len=*),intent(in):: data_file, syn_file
304304
integer,intent(out) :: npts
305305
real, intent(out) :: b, dt
306-
real*8, intent(in) :: dm(:)
306+
double precision, intent(in) :: dm(:)
307307

308308
real,dimension(NDATAMAX,NPARMAX) :: dsyn_sngl
309309
real, dimension(NDATAMAX) :: time

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_sub3.f90

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ module cmt3d_sub3
1212
subroutine write_new_cmtsolution(cmt_file,new_cmt_file,new_par_all)
1313

1414
character(len=*),intent(in) :: cmt_file,new_cmt_file
15-
real*8,intent(inout) :: new_par_all(NPARMAX)
15+
double precision,intent(inout) :: new_par_all(NPARMAX)
1616

1717
integer, parameter :: NSIG_DIGIT = 6
1818
character(len=150) :: pde_time,event_name,out_cmt
19-
real*8 :: exponent
19+
double precision :: exponent
2020
integer :: i, nn, exp_largest, iflag
21-
real*8 :: epsilon, s1, d1, r1, s2, d2, r2, mw, m0, m00
21+
double precision :: epsilon, s1, d1, r1, s2, d2, r2, mw, m0, m00
2222

2323
open(21,file = cmt_file, status = 'old')
2424
read(21,'(a)') pde_time
@@ -94,14 +94,13 @@ subroutine Gaussian_elimination(A,n,b,x,singular)
9494
implicit none
9595

9696
integer,intent(in) :: n
97-
real*8,intent(inout) :: A(:,:),b(:)
98-
real*8,intent(out) :: x(:)
97+
double precision,intent(inout) :: A(:,:),b(:)
98+
double precision,intent(out) :: x(:)
9999
logical,intent(out) :: singular
100100

101101
integer :: i,j,k,pivot_row
102-
real*8 :: pivot,temp(n),temp1,l(n)
103-
real*8 ,parameter :: EPS = 1.0e-12
104-
102+
double precision :: pivot,temp(n),temp1,l(n)
103+
double precision ,parameter :: EPS = 1.0d-12
105104

106105
! perform Gaussian ellimination
107106

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_sub4.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ subroutine rotate_cmt(cmt_par,npar,elat0,elon0,DIRECTION)
1212
! DIRECTION = 1/-1: entering/leaving with cmt par read from /write to cmtsolution file
1313
! in terms of Mij, dep, lon and lat
1414

15-
real*8, intent(inout) :: cmt_par(NPARMAX)
16-
real*8, intent(in) :: elat0, elon0
15+
double precision, intent(inout) :: cmt_par(NPARMAX)
16+
double precision, intent(in) :: elat0, elon0
1717
integer,intent(in) :: npar,DIRECTION
1818

19-
real*8 :: th, phi, loc(3), gl(3), moment(3,3), elon,elat,edep
20-
real*8 :: rmat(3,3)
19+
double precision :: th, phi, loc(3), gl(3), moment(3,3), elon,elat,edep
20+
double precision :: rmat(3,3)
2121

2222
! check input arguments
2323
if (DIRECTION /= 1 .and. DIRECTION /= -1) stop 'Error DIRECTION (1 or -1)'
@@ -83,11 +83,11 @@ end subroutine rotate_cmt
8383

8484
subroutine calc_rot_matrix(elon,elat,rmat)
8585

86-
real*8,intent(in) :: elon, elat
87-
real*8,intent(out) :: rmat(3,3)
88-
real*8 :: th,phi
86+
double precision,intent(in) :: elon, elat
87+
double precision,intent(out) :: rmat(3,3)
88+
double precision :: th,phi
8989

90-
th=(90-elat)*PI/180
90+
th = (90-elat)*PI/180
9191
phi = elon*PI/180
9292

9393
rmat(1,1)=dsin(th)*dcos(phi)

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_utils.f

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
c double couple, and their moment.
44

55
subroutine mij(m,epsilon,s1,d1,r1,s2,d2,r2,m0,m00,iflag)
6-
implicit REAL*8(A-H,O-Z)
6+
implicit double precision(A-H,O-Z)
77

88
dimension a(3,3),d(3),v(3,3),ae(3),an(3)
99
dimension ae1(3),an1(3),an2(3),ae2(3)
10-
real*8 m(6), m0, m00
10+
double precision m(6), m0, m00
1111
common/mpa/ft,fd,fl,ft1,fd1,fl1,azt,aiht,azp,aihp,az0,aih0,
1212
*d,clvd
1313

@@ -173,7 +173,7 @@ subroutine mij(m,epsilon,s1,d1,r1,s2,d2,r2,m0,m00,iflag)
173173
end
174174

175175
subroutine jacobi(a,n,np,d,v,nrot)
176-
implicit REAL*8(A-H,O-Z)
176+
implicit double precision(A-H,O-Z)
177177
parameter (nmax=100)
178178
dimension a(np,np),d(np),v(np,np),b(nmax),z(nmax)
179179
do 12 ip=1,n
@@ -264,7 +264,7 @@ subroutine jacobi(a,n,np,d,v,nrot)
264264
end
265265

266266
subroutine tdl(an,bn,ft,fd,fl)
267-
implicit REAL*8(A-H,O-Z)
267+
implicit double precision(A-H,O-Z)
268268
dimension an(3),bn(3)
269269
xn=an(1)
270270
yn=an(2)
@@ -343,7 +343,7 @@ subroutine tdl(an,bn,ft,fd,fl)
343343
end
344344

345345
subroutine azih(aa,az,aih)
346-
implicit REAL*8(A-H,O-Z)
346+
implicit double precision(A-H,O-Z)
347347
dimension aa(3)
348348
con=57.2957795
349349
gx=aa(1)
@@ -379,9 +379,9 @@ subroutine sdr2moment(sphif,sdlt,slmda,moment,mrr,mtt,mpp,mrt,mrp,mtp)
379379
c this subroutine converts eqk fault parameters to moment tensors
380380
c for definitions see hiroo''s class notes
381381
c
382-
real*8 sphif,sdlt,slmda,moment
383-
real*8 mrr,mtt,mpp,mrt,mrp,mtp
384-
real*8 pi,phif,dlt,lmda
382+
double precision sphif,sdlt,slmda,moment
383+
double precision mrr,mtt,mpp,mrt,mrp,mtp
384+
double precision pi,phif,dlt,lmda
385385
c
386386
pi=3.1415926
387387
phif=sphif*pi/180

src/inverse_problem_for_source/CMT3D/cmt3d/cmt3d_variables.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ module cmt3d_variables
2323
! inversion schemes
2424
logical :: station_correction
2525
logical :: zero_trace_inversion, double_couple_inversion
26-
real*8 :: lambda
26+
double precision :: lambda
2727
! misc
2828
logical :: write_new_syn
2929

3030

3131
! other parameters used globally
3232
! collect all pars in an array
33-
real*8,dimension(NPARMAX) :: cmt_par,dcmt_par,new_cmt_par
33+
double precision,dimension(NPARMAX) :: cmt_par,dcmt_par,new_cmt_par
3434

3535
! number of files and windows
3636
integer :: nfiles,nwins(NRECMAX),nwin_total
@@ -41,7 +41,7 @@ module cmt3d_variables
4141
character(len=150) :: data_file, syn_file
4242

4343
! scales of cmt pars
44-
real*8 :: SCALE_PAR(NPARMAX)
44+
double precision :: SCALE_PAR(NPARMAX)
4545

4646
end module cmt3d_variables
4747

src/inverse_problem_for_source/CMT3D/cmt3d/get_cmt.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ subroutine get_cmt(cmt_file,yr,mo,jda,ho,mi,sec, &
55

66
implicit none
77

8-
character(len=*) :: cmt_file
8+
character(len=*), intent(in) :: cmt_file
99
integer :: yr,jda,ho,mi
10-
real*8 :: sec,t_cmt,hdur,elat,elon,depth
11-
real*8 :: moment_tensor(6)
10+
double precision :: sec,t_cmt,hdur,elat,elon,depth
11+
double precision :: moment_tensor(6)
1212

1313
integer :: i,ios,lstr,mo,da
14-
real*8 :: mb,ms
14+
double precision :: mb,ms
1515
character(len=24) :: reg
1616
character(len=5) :: datasource
1717
character(len=150) :: string

src/inverse_problem_for_source/CMT3D/grid3d/get_cmt.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ subroutine get_cmt(cmt_file,yr,mo,jda,ho,mi,sec, &
55

66
implicit none
77

8-
character(len=*) :: cmt_file
8+
character(len=*), intent(in) :: cmt_file
99
integer :: yr,jda,ho,mi
10-
real*8 :: sec,t_cmt,hdur,elat,elon,depth
11-
real*8 :: moment_tensor(6)
10+
double precision :: sec,t_cmt,hdur,elat,elon,depth
11+
double precision :: moment_tensor(6)
1212

1313
integer :: i,ios,lstr,mo,da
14-
real*8 :: mb,ms
14+
double precision :: mb,ms
1515
character(len=24) :: reg
1616
character(len=5) :: datasource
1717
character(len=150) :: string

0 commit comments

Comments
 (0)