[cig-commits] [commit] devel: Fix some of the simpler warnings. (92088a5)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu May 1 00:50:15 PDT 2014


Repository : ssh://geoshell/specfem3d

On branch  : devel
Link       : https://github.com/geodynamics/specfem3d/compare/cb32c88d6155d7974561a6f72fc17aea596e2c4d...50aa953c1db3f565d76415f5305410a529996b75

>---------------------------------------------------------------

commit 92088a51a813f6ebbdedd0b7e955694a1d74309a
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Sun Jan 12 01:00:30 2014 -0500

    Fix some of the simpler warnings.


>---------------------------------------------------------------

92088a51a813f6ebbdedd0b7e955694a1d74309a
 setup/constants.h.in                               | 14 +++++-----
 src/generate_databases/create_mass_matrices.f90    | 16 +++++------
 .../fault_generate_databases.f90                   |  6 ++--
 src/generate_databases/model_1d_socal.f90          | 32 +++++++++++-----------
 src/generate_databases/model_external_values.f90   | 28 +++++++++----------
 src/generate_databases/model_salton_trough.f90     |  6 ++--
 src/generate_databases/model_tomography.f90        |  2 +-
 src/meshfem3D/create_regions_mesh.f90              |  6 ++--
 src/shared/get_attenuation_model.f90               |  2 +-
 .../compute_forces_poroelastic_calling_routine.f90 |  2 +-
 src/specfem3D/create_color_image.f90               |  8 +++---
 src/specfem3D/pml_compute_accel_contribution.f90   |  2 +-
 src/specfem3D/write_output_SU.f90                  |  8 +++---
 13 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/setup/constants.h.in b/setup/constants.h.in
index 5dc62cc..09c9756 100644
--- a/setup/constants.h.in
+++ b/setup/constants.h.in
@@ -162,14 +162,14 @@
 !! C-PML absorbing boundary conditions
 !!
 !!-----------------------------------------------------------
-  real(kind=CUSTOM_REAL), parameter :: NPOWER = 1.d0
+  real(kind=CUSTOM_REAL), parameter :: NPOWER = 1._CUSTOM_REAL
 
 ! C-PML theoretical reflection coefficient
 ! (INRIA research report section 6.1:  http://hal.inria.fr/docs/00/07/32/19/PDF/RR-3471.pdf)
-  real(kind=CUSTOM_REAL), parameter :: CPML_Rcoef = 0.001d0
+  real(kind=CUSTOM_REAL), parameter :: CPML_Rcoef = 0.001_CUSTOM_REAL
 
 ! empirical damping modified factor
-  real(kind=CUSTOM_REAL), parameter :: damping_factor = 1.2d0
+  real(kind=CUSTOM_REAL), parameter :: damping_factor = 1.2_CUSTOM_REAL
 
 ! flags for the seven CPML regions
   integer, parameter :: CPML_X_ONLY = 1
@@ -247,9 +247,9 @@
 ! (EXPERIMENTAL feature)
 ! (requires MOVIE_SURFACE set to .true. in Par_file)
   logical, parameter :: PLOT_CROSS_SECTIONS = .false.
-  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_X = 67000.0
-  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_Y = 65500.0
-  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_Z = -30000.0
+  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_X = 67000.0_CUSTOM_REAL
+  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_Y = 65500.0_CUSTOM_REAL
+  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_Z = -30000.0_CUSTOM_REAL
 
 ! plots PNM cross-section image
 ! (EXPERIMENTAL feature)
@@ -405,7 +405,7 @@
 ! to avoid taking into account spurious oscillations in topography model
   double precision, parameter :: MINIMUM_THICKNESS_3D_OCEANS = 10.d0
 ! density of sea water
-  real(kind=CUSTOM_REAL), parameter :: RHO_APPROXIMATE_OCEAN_LOAD = 1020.0
+  real(kind=CUSTOM_REAL), parameter :: RHO_APPROXIMATE_OCEAN_LOAD = 1020.0_CUSTOM_REAL
 
 !!-----------------------------------------------------------
 !!
diff --git a/src/generate_databases/create_mass_matrices.f90 b/src/generate_databases/create_mass_matrices.f90
index 91c0756..766cdd1 100644
--- a/src/generate_databases/create_mass_matrices.f90
+++ b/src/generate_databases/create_mass_matrices.f90
@@ -717,7 +717,7 @@
              do j=1,NGLLY
                 do i=1,NGLLX
                    ! defines the material coefficient associated to the domain
-                   mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                   mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                    iglob = ibool(i,j,k,ispec)
                    weight = wxgll(i)*wygll(j)*wzgll(k)
                    jacobianl = jacobianstore(i,j,k,ispec)
@@ -746,7 +746,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
@@ -770,7 +770,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
@@ -794,7 +794,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
@@ -818,7 +818,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
@@ -846,7 +846,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
@@ -874,7 +874,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
@@ -902,7 +902,7 @@
                 do j=1,NGLLY
                    do i=1,NGLLX
                       ! defines the material coefficient associated to the domain
-                      mat_coef = 1.d0 / kappastore(i,j,k,ispec)
+                      mat_coef = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
                       iglob = ibool(i,j,k,ispec)
                       weight = wxgll(i)*wygll(j)*wzgll(k)
                       jacobianl = jacobianstore(i,j,k,ispec)
diff --git a/src/generate_databases/fault_generate_databases.f90 b/src/generate_databases/fault_generate_databases.f90
index 5337bc0..b2b9757 100644
--- a/src/generate_databases/fault_generate_databases.f90
+++ b/src/generate_databases/fault_generate_databases.f90
@@ -410,11 +410,11 @@ subroutine close_fault(fdb)
   do i=1,fdb%nglob
     K1 = fdb%ibulk1(i)
     K2 = fdb%ibulk2(i)
-    xstore_dummy(K1) = 0.5d0*( xstore_dummy(K1) + xstore_dummy(K2) )
+    xstore_dummy(K1) = 0.5_CUSTOM_REAL*( xstore_dummy(K1) + xstore_dummy(K2) )
     xstore_dummy(K2) = xstore_dummy(K1)
-    ystore_dummy(K1) = 0.5d0*( ystore_dummy(K1) + ystore_dummy(K2) )
+    ystore_dummy(K1) = 0.5_CUSTOM_REAL*( ystore_dummy(K1) + ystore_dummy(K2) )
     ystore_dummy(K2) = ystore_dummy(K1)
-    zstore_dummy(K1) = 0.5d0*( zstore_dummy(K1) + zstore_dummy(K2) )
+    zstore_dummy(K1) = 0.5_CUSTOM_REAL*( zstore_dummy(K1) + zstore_dummy(K2) )
     zstore_dummy(K2) = zstore_dummy(K1)
   enddo
 
diff --git a/src/generate_databases/model_1d_socal.f90 b/src/generate_databases/model_1d_socal.f90
index 5d13919..b916c7e 100644
--- a/src/generate_databases/model_1d_socal.f90
+++ b/src/generate_databases/model_1d_socal.f90
@@ -61,32 +61,32 @@
   ! assigns model parameters
   if( depth >= 32000.0 ) then
     ! moho
-    vp=7.8d0
-    vs=4.5d0
-    rho=3.0d0
+    vp=7.8_CUSTOM_REAL
+    vs=4.5_CUSTOM_REAL
+    rho=3.0_CUSTOM_REAL
   else if( depth > 16000.0 ) then
     ! moho - 16km
-    vp=6.7d0
-    vs=3.87d0
-    rho=2.8d0
+    vp=6.7_CUSTOM_REAL
+    vs=3.87_CUSTOM_REAL
+    rho=2.8_CUSTOM_REAL
   else if( depth > 5500.0 ) then
     ! basement
-    vp=6.3d0
-    vs=3.64d0
-    rho=2.67d0
+    vp=6.3_CUSTOM_REAL
+    vs=3.64_CUSTOM_REAL
+    rho=2.67_CUSTOM_REAL
   else
     ! up to topo surface
-    vp=5.5d0
-    vs=3.18d0
-    rho=2.4d0
+    vp=5.5_CUSTOM_REAL
+    vs=3.18_CUSTOM_REAL
+    rho=2.4_CUSTOM_REAL
   endif
 
   ! scale to standard units
-  vp = vp * 1000.d0
-  vs = vs * 1000.d0
-  rho = rho * 1000.d0
+  vp = vp * 1000._CUSTOM_REAL
+  vs = vs * 1000._CUSTOM_REAL
+  rho = rho * 1000._CUSTOM_REAL
 
   ! no attenuation information
-  qmu_atten = 0.d0
+  qmu_atten = 0._CUSTOM_REAL
 
   end subroutine model_1D_socal
diff --git a/src/generate_databases/model_external_values.f90 b/src/generate_databases/model_external_values.f90
index f4acaaa..4c9f253 100644
--- a/src/generate_databases/model_external_values.f90
+++ b/src/generate_databases/model_external_values.f90
@@ -164,12 +164,12 @@
   !          convention is z-axis points up
 
   ! model dimensions
-  xmin = 0. ! minval(xstore_dummy)
-  xmax = 134000. ! maxval(xstore_dummy)
-  ymin = 0.  !minval(ystore_dummy)
-  ymax = 134000. ! maxval(ystore_dummy)
-  zmin = 0. ! minval(zstore_dummy)
-  zmax = 60000. ! maxval(zstore_dummy)
+  xmin = 0._CUSTOM_REAL ! minval(xstore_dummy)
+  xmax = 134000._CUSTOM_REAL ! maxval(xstore_dummy)
+  ymin = 0._CUSTOM_REAL  !minval(ystore_dummy)
+  ymax = 134000._CUSTOM_REAL ! maxval(ystore_dummy)
+  zmin = 0._CUSTOM_REAL ! minval(zstore_dummy)
+  zmax = 60000._CUSTOM_REAL ! maxval(zstore_dummy)
 
   ! get approximate topography elevation at target coordinates from free surface
   call get_topo_elevation_free_closest(x,y,elevation,distmin, &
@@ -188,24 +188,24 @@
   if( abs( zmax - zmin ) > TINYVAL ) depth = depth / (zmax - zmin)
 
   ! initial values (in m/s and kg/m^3)
-  rho = 2691.0d0
-  vp = 4187.5d0
-  vs = 2151.9d0
+  rho = 2691.0_CUSTOM_REAL
+  vp = 4187.5_CUSTOM_REAL
+  vs = 2151.9_CUSTOM_REAL
 
   ! adds a velocity depth gradient
   ! (e.g. from PREM mantle gradients:
   !     vp : 3.9382*6371/5.5
   !     vs : 2.3481*6371/5.5
   !     rho : 0.6924*6371/5.5 )
-  rho = rho + 802.d0 * depth
-  vp = vp + 4562.d0 * depth
-  vs = vs + 2720.d0 * depth
+  rho = rho + 802._CUSTOM_REAL * depth
+  vp = vp + 4562._CUSTOM_REAL * depth
+  vs = vs + 2720._CUSTOM_REAL * depth
 
   ! attenuation: PREM crust value
-  qmu_atten=600.
+  qmu_atten=600._CUSTOM_REAL
 
   ! no Q_kappa in this model
-  qkappa_atten = 9999.
+  qkappa_atten = 9999._CUSTOM_REAL
 
   ! no anisotropy
   iflag_aniso = 0
diff --git a/src/generate_databases/model_salton_trough.f90 b/src/generate_databases/model_salton_trough.f90
index 66eadfe..1474f63 100644
--- a/src/generate_databases/model_salton_trough.f90
+++ b/src/generate_databases/model_salton_trough.f90
@@ -195,9 +195,9 @@
   real,parameter :: eps = 1.0e-3
 
 
-  i = uc + 1
-  j = vc + 1
-  k = wc + 1
+  i = int(uc) + 1
+  j = int(vc) + 1
+  k = int(wc) + 1
 
   xi = uc + 1 - i
   eta = vc + 1- j
diff --git a/src/generate_databases/model_tomography.f90 b/src/generate_databases/model_tomography.f90
index 2603228..f7c422f 100644
--- a/src/generate_databases/model_tomography.f90
+++ b/src/generate_databases/model_tomography.f90
@@ -121,7 +121,7 @@
         read(string_read,*) temp_x,temp_y,temp_z
 
         ! determines total maximum number of element records
-        nrec = temp_x*temp_y*temp_z
+        nrec = int(temp_x*temp_y*temp_z)
         nrecord_max = max(nrecord_max,nrec)
 
         call tomo_read_next_line(27,string_read)
diff --git a/src/meshfem3D/create_regions_mesh.f90 b/src/meshfem3D/create_regions_mesh.f90
index 540285c..641cf61 100644
--- a/src/meshfem3D/create_regions_mesh.f90
+++ b/src/meshfem3D/create_regions_mesh.f90
@@ -320,9 +320,9 @@ contains
                 ! loop on all the corner nodes of this element
                 do ia = 1,NGNOD_EIGHT_CORNERS
                   ! define topological coordinates of this mesh point
-                  ioffset_x = ix + iax*x_superbrick(ibool_superbrick(ia,ispec_superbrick))
-                  ioffset_y = iy + iay*y_superbrick(ibool_superbrick(ia,ispec_superbrick))
-                  ioffset_z = ir + iar*z_superbrick(ibool_superbrick(ia,ispec_superbrick))
+                  ioffset_x = int(ix + iax*x_superbrick(ibool_superbrick(ia,ispec_superbrick)))
+                  ioffset_y = int(iy + iay*y_superbrick(ibool_superbrick(ia,ispec_superbrick)))
+                  ioffset_z = int(ir + iar*z_superbrick(ibool_superbrick(ia,ispec_superbrick)))
 
                   xelm(ia) = xgrid(ioffset_z,ioffset_x,ioffset_y)
                   yelm(ia) = ygrid(ioffset_z,ioffset_x,ioffset_y)
diff --git a/src/shared/get_attenuation_model.f90 b/src/shared/get_attenuation_model.f90
index cec5e80..a35a87a 100644
--- a/src/shared/get_attenuation_model.f90
+++ b/src/shared/get_attenuation_model.f90
@@ -855,7 +855,7 @@
   ! by default: resolution is Q_resolution = 10
   ! converts Qmu to an array integer index:
   ! e.g. Qmu = 150.31 -> Qtmp = 150.31 * 10 = int( 1503.10 ) = 1503
-  Qtmp    = Qmu * dble(AM_S%Q_resolution)
+  Qtmp    = int(Qmu * dble(AM_S%Q_resolution))
 
   ! rounds to corresponding double value:
   ! e.g. Qmu_new = dble( 1503 ) / dble(10) = 150.30
diff --git a/src/specfem3D/compute_forces_poroelastic_calling_routine.f90 b/src/specfem3D/compute_forces_poroelastic_calling_routine.f90
index 4cc0682..d86cb76 100644
--- a/src/specfem3D/compute_forces_poroelastic_calling_routine.f90
+++ b/src/specfem3D/compute_forces_poroelastic_calling_routine.f90
@@ -381,7 +381,7 @@ subroutine compute_continuity_disp_po_el(NSPEC_AB,NGLOB_AB,ibool,&
   integer, dimension(NGLOB_AB) :: icount
   integer :: ispec,i,j,k,l,iglob,igll,iface
 
-     icount(:)=ZERO
+  icount(:)=0
 
 ! loops on all coupling faces
   do iface = 1,num_coupling_el_po_faces
diff --git a/src/specfem3D/create_color_image.f90 b/src/specfem3D/create_color_image.f90
index 61fde96..1f0a164 100644
--- a/src/specfem3D/create_color_image.f90
+++ b/src/specfem3D/create_color_image.f90
@@ -725,18 +725,18 @@
           if((vpmax-vpmin)/vpmin > 0.02d0) then
             x1 = (image_color_vp_display(ix,iy)-vpmin)/(vpmax-vpmin)
           else
-            x1 = 0.5d0
+            x1 = 0.5_CUSTOM_REAL
           endif
 
           ! rescale to avoid very dark gray levels
           x1 = x1*0.7 + 0.2
-          if(x1 > 1.d0) x1=1.d0
+          if(x1 > 1.d0) x1=1._CUSTOM_REAL
 
           ! invert scale: white = vpmin, dark gray = vpmax
-          x1 = 1.d0 - x1
+          x1 = 1._CUSTOM_REAL - x1
 
           ! map to [0,255]
-          x1 = x1 * 255.d0
+          x1 = x1 * 255._CUSTOM_REAL
 
           R = nint(x1)
           if(R < 0) R = 0
diff --git a/src/specfem3D/pml_compute_accel_contribution.f90 b/src/specfem3D/pml_compute_accel_contribution.f90
index cf60b10..77ffb58 100644
--- a/src/specfem3D/pml_compute_accel_contribution.f90
+++ b/src/specfem3D/pml_compute_accel_contribution.f90
@@ -224,7 +224,7 @@ subroutine pml_compute_accel_contribution_acoustic(ispec,ispec_CPML,potential_ac
   do k=1,NGLLZ
      do j=1,NGLLY
         do i=1,NGLLX
-           kappal_inv = 1.d0 / kappastore(i,j,k,ispec)
+           kappal_inv = 1._CUSTOM_REAL / kappastore(i,j,k,ispec)
            jacobianl = jacobian(i,j,k,ispec)
            iglob = ibool(i,j,k,ispec)
            wgllcube = wgll_cube(i,j,k)
diff --git a/src/specfem3D/write_output_SU.f90 b/src/specfem3D/write_output_SU.f90
index 3d4ae84..404cf0f 100644
--- a/src/specfem3D/write_output_SU.f90
+++ b/src/specfem3D/write_output_SU.f90
@@ -190,16 +190,16 @@
 
   ! time steps
   header2(1)=0  ! dummy
-  header2(2)=NSTEP
+  header2(2)=int(NSTEP, kind=2)
   write(IOUT_SU,rec=(irec_local-1)*60+(irec_local-1)*NSTEP+29) header2
 
   ! time increment
   if( NINT(DT*1.0d6) < 65536 ) then
-    header2(1)=NINT(DT*1.0d6)  ! deltat (unit: 10^{-6} second)
+    header2(1)=NINT(DT*1.0d6, kind=2)  ! deltat (unit: 10^{-6} second)
   else if( NINT(DT*1.0d3) < 65536 ) then
-    header2(1)=NINT(DT*1.0d3)  ! deltat (unit: 10^{-3} second)
+    header2(1)=NINT(DT*1.0d3, kind=2)  ! deltat (unit: 10^{-3} second)
   else
-    header2(1)=NINT(DT)  ! deltat (unit: 10^{0} second)
+    header2(1)=NINT(DT, kind=2)  ! deltat (unit: 10^{0} second)
   endif
   header2(2)=0  ! dummy
   write(IOUT_SU,rec=(irec_local-1)*60+(irec_local-1)*NSTEP+30) header2



More information about the CIG-COMMITS mailing list