[cig-commits] [commit] devel: better comments in src/meshfem3D/model_crust.f90 (b7d1c98)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Sat Apr 12 03:59:23 PDT 2014
Repository : ssh://geoshell/specfem3d_globe
On branch : devel
Link : https://github.com/geodynamics/specfem3d_globe/compare/0ea7c2c7082eee564ffec9e4bd3bd9a26368f720...fffd8ea8f6da23e60ce4f2d0cefe1c988d24165d
>---------------------------------------------------------------
commit b7d1c98b71ee6f66e0e8e162cc1dcabfd535c5cd
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date: Sat Apr 12 12:58:24 2014 +0200
better comments in src/meshfem3D/model_crust.f90
>---------------------------------------------------------------
b7d1c98b71ee6f66e0e8e162cc1dcabfd535c5cd
src/meshfem3D/model_crust.f90 | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/meshfem3D/model_crust.f90 b/src/meshfem3D/model_crust.f90
index addc293..896c4b2 100644
--- a/src/meshfem3D/model_crust.f90
+++ b/src/meshfem3D/model_crust.f90
@@ -312,15 +312,15 @@
integer :: i,icolat,ilon
character(len=2) :: crustaltype
- ! small hash map to convert crustal types to key
+ ! small hash table to convert crustal types to key
integer, dimension(128*128) :: crustalhash_to_key
integer :: ihash, crustalkey
- ! fill in the hash map
+ ! fill in the hash table
crustalhash_to_key = -1
do i=1,NKEYS_CRUST
call hash_crustal_type(code(i), ihash)
- if (crustalhash_to_key(ihash) /= -1) stop 'error in crust_CAPsmoothed: hash collision'
+ if (crustalhash_to_key(ihash) /= -1) stop 'error in crust_CAPsmoothed: hash table collision'
crustalhash_to_key(ihash) = i
enddo
@@ -407,9 +407,14 @@
! hash table to define the crustal type using an integer instead of characters
! because working with integers in the rest of the routines results in much faster code
subroutine hash_crustal_type(crustaltype, ihash)
+
+ implicit none
+
character(len=2), intent(in) :: crustaltype
integer, intent(out) :: ihash
+
ihash = iachar(crustaltype(1:1)) + 128*iachar(crustaltype(2:2)) + 1
+
end subroutine hash_crustal_type
!
@@ -420,7 +425,6 @@
implicit none
-
! argument variables
double precision :: xlat,xlon
integer :: icolat,ilon
@@ -443,8 +447,7 @@
!-------------------------------------------------------------------------------------------------
!
- subroutine get_crust_structure(ikey,vptyp,vstyp,rhtyp,thtp, &
- thlr,velocp,velocs,dens)
+ subroutine get_crust_structure(ikey,vptyp,vstyp,rhtyp,thtp,thlr,velocp,velocs,dens)
use model_crust_par,only: NLAYERS_CRUST,NKEYS_CRUST
@@ -606,3 +609,4 @@
endif
end subroutine CAP_vardegree
+
More information about the CIG-COMMITS
mailing list