[cig-commits] r9205 - cs/avm/trunk

tan2 at geodynamics.org tan2 at geodynamics.org
Fri Feb 1 11:28:56 PST 2008


Author: tan2
Date: 2008-02-01 11:28:55 -0800 (Fri, 01 Feb 2008)
New Revision: 9205

Modified:
   cs/avm/trunk/avm-partition.c
   cs/avm/trunk/avm.f90
Log:
Non-dimensionalization is done in avm.f90, instead of in avm-partition.c

Modified: cs/avm/trunk/avm-partition.c
===================================================================
--- cs/avm/trunk/avm-partition.c	2008-02-01 12:55:26 UTC (rev 9204)
+++ cs/avm/trunk/avm-partition.c	2008-02-01 19:28:55 UTC (rev 9205)
@@ -38,13 +38,6 @@
 /* increase it if more components are needed */
 #define MAX_NUM_COMPOSITIONS 10
 
-/* reference density (SI unit) */
-/* corresponding to const.density in CitcomS */
-#define REFERENCE_DENSITY 3340.0
-
-/* gravititional constant from 2006 CODATA (SI unit) */
-#define GRAV_CONST 6.67428e-11
-
 /* a constant for specfem mesh data */
 #define IREGION_CRUST_MANTLE 1
 
@@ -68,23 +61,6 @@
 }
 
 /*
- * Take dimensional density and elastic moduli (SI units) and return
- * non-dimensionalized results.
- * See SPECFEM3D manaul for the dimensional scheme.
- */
-void non_dimensionalize(double *rho, double *ks, double *mu)
-{
-    const double inv_ref_rho = 1.0 / REFERENCE_DENSITY;
-    const double inv_ref_moduli = 1.0;
-
-    *rho *= inv_ref_rho;
-    *ks *= inv_ref_moduli;
-    *mu *= inv_ref_moduli;
-    return;
-}
-
-
-/*
  * Scan input str to get a double vector *values. The vector length is from
  * input len. The input str contains white-space seperated numbers.
  */

Modified: cs/avm/trunk/avm.f90
===================================================================
--- cs/avm/trunk/avm.f90	2008-02-01 12:55:26 UTC (rev 9204)
+++ cs/avm/trunk/avm.f90	2008-02-01 19:28:55 UTC (rev 9205)
@@ -91,6 +91,9 @@
   integer iglob
   integer i,j,k
 
+  ! constants for non-dimensionalize variables
+  real(kind=CUSTOM_REAL) inv_ref_rho,inv_ref_time,inv_ref_pressure
+
   ! AVM files
   integer ipoint,ispec
   real(kind=CUSTOM_REAL) rho,kappa,mu
@@ -101,7 +104,11 @@
   ABSORBING_CONDITIONS = .false.
   LOCAL_PATH = 'scratch'
 
+  inv_ref_rho = 1.d0 / RHOAV
+  inv_ref_time = 1.d0 / sqrt(PI * GRAV * RHOAV)
+  inv_ref_pressure = 1.d0 / (RHOAV * R_EARTH * R_EARTH * inv_ref_time * inv_ref_time)
 
+
   do myrank=0,NPROCTOT_VAL-1
 
      ! create the name for the database of the current slide and region
@@ -147,9 +154,11 @@
         read(IIN,*) iglob, rho, kappa, mu
 
         if (iglob < 0 .or. iglob > NGLOB_CRUST_MANTLE) stop 'invalid global point number'
-        rho_avm(iglob) = rho
-        kappa_avm(iglob) = kappa
-        mu_avm(iglob) = mu
+
+        ! store the non-dimensional value
+        rho_avm(iglob) = rho * inv_ref_rho
+        kappa_avm(iglob) = kappa * inv_ref_pressure
+        mu_avm(iglob) = mu * inv_ref_pressure
         mask_ibool(iglob) = .false.
      enddo
 



More information about the cig-commits mailing list