[cig-commits] r19866 - seismo/3D/ADJOINT_TOMO/iterate_adj/cluster/sum_kernel/src

danielpeter at geodynamics.org danielpeter at geodynamics.org
Sun Mar 25 23:05:51 PDT 2012


Author: danielpeter
Date: 2012-03-25 23:05:51 -0700 (Sun, 25 Mar 2012)
New Revision: 19866

Modified:
   seismo/3D/ADJOINT_TOMO/iterate_adj/cluster/sum_kernel/src/sum_preconditioned_kernels_globe.f90
Log:
updates preconditioning sum_preconditioned_kernels_globe.f90 in case no hess_kernel.bin files are available

Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/cluster/sum_kernel/src/sum_preconditioned_kernels_globe.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/cluster/sum_kernel/src/sum_preconditioned_kernels_globe.f90	2012-03-26 02:42:36 UTC (rev 19865)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/cluster/sum_kernel/src/sum_preconditioned_kernels_globe.f90	2012-03-26 06:05:51 UTC (rev 19866)
@@ -225,10 +225,10 @@
     open(12,file=trim(k_file),status='old',form='unformatted',action='read',iostat=ios)
     if( ios /= 0 ) then
       write(*,*) '  hess not found:',trim(k_file)
-      cycle
+    else
+      read(12) hess_crust_mantle
+      close(12)
     endif
-    read(12) hess_crust_mantle
-    close(12)
 
     ! outputs norm of preconditioner
     norm = sum( hess_crust_mantle * hess_crust_mantle )
@@ -339,10 +339,6 @@
 
   ! determines maximum from all slices on master
   call mpi_allreduce(maxh,maxh_all,1,CUSTOM_MPI_TYPE,MPI_MAX,MPI_COMM_WORLD,ier)
-  if( maxh_all < 1.e-18 ) then
-    ! threshold limit of hessian
-    call exit_mpi(myrank,'error hessian too small')
-  endif
   
   ! user output
   if( myrank == 0 ) then
@@ -352,8 +348,15 @@
   endif
   
   ! normalizes hessian 
-  ! since hessian has absolute values, this scales between [0,1]
-  hess_matrix = hess_matrix / maxh_all
+  if( maxh_all < 1.e-18 ) then
+    ! hessian is zero, re-initializes 
+    hess_matrix = 1.0_CUSTOM_REAL
+    !call exit_mpi(myrank,'error hessian too small')
+  else
+    ! since hessian has absolute values, this scales between [0,1]
+    hess_matrix = hess_matrix / maxh_all  
+  endif
+  
 
   ! inverts hessian values
   where( abs(hess_matrix(:,:,:,:)) > THRESHOLD_HESS )



More information about the CIG-COMMITS mailing list