[cig-commits] [commit] QA: Fix some simple type-conversion warnings. (1c2db37)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Jan 20 11:49:38 PST 2014
Repository : ssh://geoshell/specfem2d
On branch : QA
Link : https://github.com/geodynamics/specfem2d/compare/28743f19b9f9fdb75d359c135053825c0ffd05b3...5e8aa55e68fd17b6f475fb65531b84195e497aa1
>---------------------------------------------------------------
commit 1c2db374621d9faef3e75a0bd1f35ac5b2e60f24
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date: Mon Jan 6 20:47:03 2014 -0500
Fix some simple type-conversion warnings.
>---------------------------------------------------------------
1c2db374621d9faef3e75a0bd1f35ac5b2e60f24
src/specfem2D/check_stability.F90 | 2 +-
src/specfem2D/noise_tomography.f90 | 4 ++--
src/specfem2D/paco_beyond_critical.f90 | 4 ++--
src/specfem2D/pml_init.F90 | 4 ++--
src/specfem2D/prepare_color_image.F90 | 8 ++++----
src/specfem2D/specfem2D.F90 | 2 +-
src/specfem2D/write_seismograms.F90 | 8 ++++----
7 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/specfem2D/check_stability.F90 b/src/specfem2D/check_stability.F90
index a6ad2a3..84f532c 100644
--- a/src/specfem2D/check_stability.F90
+++ b/src/specfem2D/check_stability.F90
@@ -273,7 +273,7 @@
if(it < NSTEP) then
! compute date and time at which the run should finish (useful for long runs)
! add remaining minutes and get date and time of that future timestamp in minutes
- timestamp = (timestamp_seconds_current + t_remain) / 60.d0
+ timestamp = nint((timestamp_seconds_current + t_remain) / 60.d0)
call invtime(timestamp,year,mon,day,hr,minutes)
! convert to Julian day to get day of the week
diff --git a/src/specfem2D/noise_tomography.f90 b/src/specfem2D/noise_tomography.f90
index 9258292..2acc47d 100644
--- a/src/specfem2D/noise_tomography.f90
+++ b/src/specfem2D/noise_tomography.f90
@@ -221,8 +221,8 @@
time_function_noise(:) = 0._CUSTOM_REAL
t0 = ((NSTEP-1)/2.)*deltat
- aval = 0.6d0
- factor_noise = 1.d3
+ aval = 0.6_CUSTOM_REAL
+ factor_noise = 1.e3_CUSTOM_REAL
if ( time_function_type == 0) then
diff --git a/src/specfem2D/paco_beyond_critical.f90 b/src/specfem2D/paco_beyond_critical.f90
index d1ee6db..527a35d 100644
--- a/src/specfem2D/paco_beyond_critical.f90
+++ b/src/specfem2D/paco_beyond_critical.f90
@@ -97,11 +97,11 @@ subroutine paco_beyond_critical(coord,nglob,deltat,NSTEP_global,anglesource,&
N=2
do while(N<2*NSTEP_global+1)
- N=2.d0*N
+ N=2*N
enddo
do while(DT<(delta_in_period/N))
- N=2.d0*N
+ N=2*N
enddo
print *,'N found to perform the frequency calculation:',N
diff --git a/src/specfem2D/pml_init.F90 b/src/specfem2D/pml_init.F90
index f1520f9..0dc8df3 100644
--- a/src/specfem2D/pml_init.F90
+++ b/src/specfem2D/pml_init.F90
@@ -83,7 +83,7 @@
! ibound is the side we are looking (bottom, right, top or left)
do ibound=1,4
- icorner_iglob = ZERO
+ icorner_iglob = 0
ncorner=0
if(anyabs) then
@@ -123,7 +123,7 @@
! list every corner of each PML element detected
ncorner=0
- icorner_iglob=ZERO
+ icorner_iglob=0
nspec_PML=0
do ispec=1,nspec
if(which_PML_elem(ibound,ispec)) then
diff --git a/src/specfem2D/prepare_color_image.F90 b/src/specfem2D/prepare_color_image.F90
index f2e090b..cd46e84 100644
--- a/src/specfem2D/prepare_color_image.F90
+++ b/src/specfem2D/prepare_color_image.F90
@@ -255,8 +255,8 @@
! find pixel position of the sources with orange crosses
do i=1,NSOURCES
- ix_image_color_source(i) = (x_source(i) - xmin_color_image) / size_pixel_horizontal + 1
- iy_image_color_source(i) = (z_source(i) - zmin_color_image) / size_pixel_vertical + 1
+ ix_image_color_source(i) = int((x_source(i) - xmin_color_image) / size_pixel_horizontal) + 1
+ iy_image_color_source(i) = int((z_source(i) - zmin_color_image) / size_pixel_vertical) + 1
! avoid edge effects
if(ix_image_color_source(i) < 1) ix_image_color_source(i) = 1
@@ -268,8 +268,8 @@
! find pixel position of the receivers with green squares
do i=1,nrec
- ix_image_color_receiver(i) = (st_xval(i) - xmin_color_image) / size_pixel_horizontal + 1
- iy_image_color_receiver(i) = (st_zval(i) - zmin_color_image) / size_pixel_vertical + 1
+ ix_image_color_receiver(i) = int((st_xval(i) - xmin_color_image) / size_pixel_horizontal) + 1
+ iy_image_color_receiver(i) = int((st_zval(i) - zmin_color_image) / size_pixel_vertical) + 1
! avoid edge effects
if(ix_image_color_receiver(i) < 1) ix_image_color_receiver(i) = 1
diff --git a/src/specfem2D/specfem2D.F90 b/src/specfem2D/specfem2D.F90
index 88d2c91..f6b388f 100644
--- a/src/specfem2D/specfem2D.F90
+++ b/src/specfem2D/specfem2D.F90
@@ -2316,7 +2316,7 @@
if (ios /= 0) call exit_MPI(' file '//trim(filename)//' read error')
read(113,rec=irec,iostat=ios) r4head, adj_src_s(:,3)
if (ios /= 0) call exit_MPI(' file '//trim(filename)//' read error')
- header2=r4head(29)
+ header2=int(r4head(29), kind=2)
if (irec==1) print*, r4head(1),r4head(19),r4head(20),r4head(21),r4head(22),header2(2)
call lagrange_any(xi_receiver(irec),NGLLX,xigll,hxir,hpxir)
call lagrange_any(gamma_receiver(irec),NGLLZ,zigll,hgammar,hpgammar)
diff --git a/src/specfem2D/write_seismograms.F90 b/src/specfem2D/write_seismograms.F90
index e12e044..8b4dafa 100644
--- a/src/specfem2D/write_seismograms.F90
+++ b/src/specfem2D/write_seismograms.F90
@@ -349,9 +349,9 @@
write(12,rec=(irec-1)*60+(irec-1)*NSTEP+22) NINT(st_zval(irec)) ! receiver location zr
if (nrec>1) write(12,rec=(irec-1)*60+(irec-1)*NSTEP+48) SNGL(st_xval(2)-st_xval(1)) ! receiver interval
header2(1)=0 ! dummy
- header2(2)=NSTEP
+ header2(2)=int(NSTEP, kind=2)
write(12,rec=(irec-1)*60+(irec-1)*NSTEP+29) header2
- header2(1)=NINT(deltat*1.0d6) ! deltat (unit: 10^{-6} second)
+ header2(1)=NINT(deltat*1.0d6, kind=2) ! deltat (unit: 10^{-6} second)
header2(2)=0 ! dummy
write(12,rec=(irec-1)*60+(irec-1)*NSTEP+30) header2
if ( seismotype /= 4 .and. seismotype /= 6 .and. p_sv) then
@@ -365,9 +365,9 @@
write(14,rec=(irec-1)*60+(irec-1)*NSTEP+22) NINT(st_zval(irec))
if(nrec>1) write(14,rec=(irec-1)*60+(irec-1)*NSTEP+48) SNGL(st_xval(2)-st_xval(1))
header2(1)=0 ! dummy
- header2(2)=NSTEP
+ header2(2)=int(NSTEP, kind=2)
write(14,rec=(irec-1)*60+(irec-1)*NSTEP+29) header2
- header2(1)=NINT(deltat*1.0d6)
+ header2(1)=NINT(deltat*1.0d6, kind=2)
header2(2)=0 ! dummy
write(14,rec=(irec-1)*60+(irec-1)*NSTEP+30) header2
endif
More information about the CIG-COMMITS
mailing list