Skip to content

Commit 394063d

Browse files
committed
explicitly specifies size(**,kind=4) in function arguments (to avoid compiler problems where size() returns either integer(kind=4) or integer(kind=8) depending on flags like -mcmedium)
1 parent 4982310 commit 394063d

14 files changed

+281
-275
lines changed

src/generate_databases/model_external_values.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ subroutine model_external_broadcast()
9494
if (myrank == 0) call read_external_model()
9595

9696
! broadcast the information read on the main to the nodes
97-
call bcast_all_dp(MEXT_V%dvs, size(MEXT_V%dvs))
97+
call bcast_all_dp(MEXT_V%dvs, size(MEXT_V%dvs,kind=4))
9898

9999
end subroutine model_external_broadcast
100100

src/generate_databases/model_salton_trough.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ subroutine model_salton_trough_broadcast()
7171
if (myrank == 0) call read_salton_sea_model()
7272

7373
! broadcast the information read on the main to the nodes
74-
call bcast_all_r(vp_array, size(vp_array))
74+
call bcast_all_r(vp_array, size(vp_array,kind=4))
7575

7676
end subroutine model_salton_trough_broadcast
7777

src/generate_databases/model_tomography.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ subroutine model_tomography_broadcast(myrank)
121121
! allocate( vp_tomography(1:nrecord) ,stat=ier)
122122
! if (ier /= 0) stop 'error allocating array vp_tomography'
123123
!endif
124-
!call bcast_all_cr(vp_tomography,size(vp_tomography))
124+
!call bcast_all_cr(vp_tomography,size(vp_tomography,kind=4))
125125

126126
! synchronizes processes
127127
call synchronize_all()

src/generate_databases/setup_mesh_adjacency.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ subroutine setup_mesh_adjacency()
377377
endif
378378

379379
! check if element has neighbors
380-
! note: in case of a fault in this slice (splitting nodes) and/or scotch paritioning
380+
! note: in case of a fault in this slice (splitting nodes) and/or scotch partitioning
381381
! it can happen that an element has no neighbors
382382
if (NPROC == 1 .and. (.not. ANY_FAULT_IN_THIS_PROC)) then
383383
! checks if neighbors were found

src/meshfem3D/determine_cavity.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,13 @@ subroutine cmm_determine_cavity(nglob)
366366
allocate(tmp_all(1,1),stat=ier)
367367
if (ier /= 0) call exit_MPI_without_rank('error allocating array 1330')
368368
endif
369-
call sum_all_1Darray_dp(cavity_boundary,tmp_all,size(cavity_boundary))
369+
call sum_all_1Darray_dp(cavity_boundary,tmp_all,size(cavity_boundary,kind=4))
370370
if (myrank == 0) then
371371
cavity_boundary(:,:) = tmp_all(:,:)
372372
endif
373373
deallocate(tmp_all)
374374
! broadcasts to all others
375-
call bcast_all_dp(cavity_boundary,size(cavity_boundary))
375+
call bcast_all_dp(cavity_boundary,size(cavity_boundary,kind=4))
376376

377377
!print *,'cavity boundary after:',myrank,'array:',cavity_boundary(:,:)
378378

src/specfem3D/iterate_time.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ subroutine it_transfer_from_GPU()
418418

419419
if (ATTENUATION) then
420420
call transfer_rmemory_from_device(Mesh_pointer,R_xx,R_yy,R_xy,R_xz,R_yz, &
421-
R_trace,size(R_xx))
421+
R_trace,size(R_xx,kind=4))
422422
call transfer_strain_from_device(Mesh_pointer,epsilondev_xx,epsilondev_yy,epsilondev_xy,epsilondev_xz,epsilondev_yz, &
423-
epsilondev_trace,size(epsilondev_xx))
423+
epsilondev_trace,size(epsilondev_xx,kind=4))
424424

425425
endif
426426
endif

src/specfem3D/prepare_attenuation.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ subroutine prepare_attenuation()
114114

115115
! broadcasts
116116
call bcast_all_i_for_database(ispec, 1)
117-
if (size(factor_common) > 0) &
118-
call bcast_all_cr_for_database(factor_common(1,1,1,1,1), size(factor_common))
119-
if (size(scale_factor) > 0) &
120-
call bcast_all_cr_for_database(scale_factor(1,1,1,1), size(scale_factor))
121-
call bcast_all_cr_for_database(factor_common_kappa(1,1,1,1,1), size(factor_common_kappa))
122-
call bcast_all_cr_for_database(scale_factor_kappa(1,1,1,1), size(scale_factor_kappa))
117+
if (size(factor_common,kind=4) > 0) &
118+
call bcast_all_cr_for_database(factor_common(1,1,1,1,1), size(factor_common,kind=4))
119+
if (size(scale_factor,kind=4) > 0) &
120+
call bcast_all_cr_for_database(scale_factor(1,1,1,1), size(scale_factor,kind=4))
121+
call bcast_all_cr_for_database(factor_common_kappa(1,1,1,1,1), size(factor_common_kappa,kind=4))
122+
call bcast_all_cr_for_database(scale_factor_kappa(1,1,1,1), size(scale_factor_kappa,kind=4))
123123

124124
! gets stress relaxation times tau_sigma, i.e.
125125
! precalculates tau_sigma depending on period band (constant for all Q_mu), and

src/specfem3D/prepare_gpu.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ subroutine prepare_GPU()
145145
epsilondev_xx,epsilondev_yy,epsilondev_xy, &
146146
epsilondev_xz,epsilondev_yz, &
147147
ATTENUATION, &
148-
size(R_xx), &
148+
size(R_xx,kind=4), &
149149
R_xx,R_yy,R_xy,R_xz,R_yz, &
150150
factor_common, &
151151
R_trace,epsilondev_trace, &
@@ -171,7 +171,7 @@ subroutine prepare_GPU()
171171
b_epsilondev_xx,b_epsilondev_yy,b_epsilondev_xy, &
172172
b_epsilondev_xz,b_epsilondev_yz, &
173173
b_epsilon_trace_over_3, &
174-
size(R_xx), &
174+
size(R_xx,kind=4), &
175175
b_R_xx,b_R_yy,b_R_xy,b_R_xz,b_R_yz, &
176176
b_R_trace,b_epsilondev_trace, &
177177
b_alphaval,b_betaval,b_gammaval, &

src/specfem3D/read_forward_arrays.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ subroutine read_forward_arrays()
110110
if (ATTENUATION) then
111111
call transfer_b_rmemory_to_device(Mesh_pointer, &
112112
b_R_xx,b_R_yy,b_R_xy,b_R_xz,b_R_yz, &
113-
b_R_trace,size(b_R_xx))
113+
b_R_trace,size(b_R_xx,kind=4))
114114
call transfer_b_strain_to_device(Mesh_pointer, &
115115
b_epsilondev_xx,b_epsilondev_yy,b_epsilondev_xy, &
116116
b_epsilondev_xz,b_epsilondev_yz, &
117-
b_epsilondev_trace,size(b_epsilondev_xx))
117+
b_epsilondev_trace,size(b_epsilondev_xx,kind=4))
118118
endif
119119
endif
120120

@@ -217,7 +217,7 @@ subroutine read_forward_arrays_undoatt()
217217
if (ATTENUATION) then
218218
call transfer_b_rmemory_to_device(Mesh_pointer, &
219219
b_R_xx,b_R_yy,b_R_xy,b_R_xz,b_R_yz, &
220-
b_R_trace,size(b_R_xx))
220+
b_R_trace,size(b_R_xx,kind=4))
221221
endif
222222
endif
223223

0 commit comments

Comments
 (0)