[cig-commits] r4278 - mc/3D/CitcomS/trunk/lib

gurnis at geodynamics.org gurnis at geodynamics.org
Sat Aug 12 15:47:23 PDT 2006


Author: gurnis
Date: 2006-08-12 15:47:23 -0700 (Sat, 12 Aug 2006)
New Revision: 4278

Modified:
   mc/3D/CitcomS/trunk/lib/Full_boundary_conditions.c
   mc/3D/CitcomS/trunk/lib/Lith_age.c
Log:
Fix bug associated with assimilating age grids in global models. Only relevant change was made in the subroutine full_temperature_boundary_condition() in which I now make a call to lith_age_temperature_bound_adj() if lith_age_time is on.

Modified: mc/3D/CitcomS/trunk/lib/Full_boundary_conditions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_boundary_conditions.c	2006-08-12 20:45:52 UTC (rev 4277)
+++ mc/3D/CitcomS/trunk/lib/Full_boundary_conditions.c	2006-08-12 22:47:23 UTC (rev 4278)
@@ -134,6 +134,15 @@
       horizontal_bc(E,E->sphere.cap[j].TB,1,3,E->control.TBCbotval,FBZ,1,lev,j);
       }
 
+    if(E->control.lith_age_time==1)  {
+
+   /* set the regions in which to use lithosphere files to determine temperature
+   note that this is called if the lithosphere age in inputted every time step
+   OR it is only maintained in the boundary regions */
+      lith_age_temperature_bound_adj(E,lev);
+    }
+
+
     }     /* end for j */
 
   temperatures_conform_bcs(E);

Modified: mc/3D/CitcomS/trunk/lib/Lith_age.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Lith_age.c	2006-08-12 20:45:52 UTC (rev 4277)
+++ mc/3D/CitcomS/trunk/lib/Lith_age.c	2006-08-12 22:47:23 UTC (rev 4278)
@@ -263,11 +263,13 @@
   int m,j,node,nox,noz,noy,gnox,gnoy,gnoz,nodeg,i,k;
   float ttt2,ttt3,fff2,fff3;
   float r1,t1,f1,t0,temp;
+  float depth;
   float e_4;
   FILE *fp1;
   char output_file[255];
   int output;
 
+
   e_4=1.e-4;
   output = 0;
 
@@ -320,6 +322,7 @@
 	      if( ((E->sx[m][2][node]<=fff2) || (E->sx[m][2][node]>=fff3)) && (E->sx[m][3][node]>=E->sphere.ro-E->control.depth_bound_adj) ) {
 		/* if < (width) from y bounds AND (depth) from top */
 
+
 		/* keep the age the same! */
 		temp = (E->sphere.ro-r1) *0.5 /sqrt(E->age_t[nodeg]);
 		t0 = E->control.lith_age_mantle_temp * erf(temp);
@@ -353,11 +356,12 @@
 	      if(  E->sx[m][3][node]>=E->sphere.ro-E->control.lith_age_depth ) {
 		/* if closer than (lith_age_depth) from top */
 
+                depth=E->sphere.ro - E->sx[m][3][node];
+
 		/* set a new age from the file */
 		temp = (E->sphere.ro-r1) *0.5 /sqrt(E->age_t[nodeg]);
 		t0 = E->control.lith_age_mantle_temp * erf(temp);
 
-             
 		E->sphere.cap[m].TB[1][node]=t0;
 		E->sphere.cap[m].TB[2][node]=t0;
 		E->sphere.cap[m].TB[3][node]=t0;
@@ -415,11 +419,12 @@
             break;
         } /* end switch */
 
+        depth = E->sphere.ro - E->sx[j][3][node];
+
         switch (type) {
         case 0:  /* no match, next node */
             break;
         default:
-            depth = E->sphere.ro - E->sx[j][3][node];
             if(depth <= E->control.lith_age_depth) {
                 /* daf == depth_assimilation_factor */
                 daf = 0.5*depth/E->control.lith_age_depth;



More information about the cig-commits mailing list