[cig-commits] r18361 - seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH

percygalvez at geodynamics.org percygalvez at geodynamics.org
Fri May 13 15:17:08 PDT 2011


Author: percygalvez
Date: 2011-05-13 15:17:08 -0700 (Fri, 13 May 2011)
New Revision: 18361

Modified:
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90
   seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90
Log:
updated

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90	2011-05-13 14:49:04 UTC (rev 18360)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/decompose_mesh_SCOTCH.f90	2011-05-13 22:17:08 UTC (rev 18361)
@@ -389,9 +389,14 @@
     if( nspec2D_moho > 0 ) print*, '  nspec2D_moho = ', nspec2D_moho
 
     call read_fault_files(localpath_name)
-!jpa: keep the fault open, we'll close it in fault_object.f90
-!    call close_faults(nodes_coords,elmnts,nspec,nnodes,esize)    
+ 
+    if (allocated(faults)) then 
 
+    call save_nodes_coords(nodes_coords,nnodes)
+    call close_faults(nodes_coords,elmnts,nspec,nnodes,esize)    
+
+    end if 
+
   end subroutine read_mesh_files
   
   !----------------------------------------------------------------------------------------------
@@ -593,8 +598,6 @@
                                   glob2loc_nodes_nparts, glob2loc_nodes_parts, &
                                   glob2loc_nodes, nnodes, 1) 
 
-! Sticking in space not a both sides Fault nodes. 
-
        ! gets number of spectral elements                           
        call write_partition_database(15, ipart, nspec_loc, nspec, elmnts, &
                                   glob2loc_elmnts, glob2loc_nodes_nparts, &
@@ -648,22 +651,41 @@
                                   nspec2D_moho,ibelm_moho,nodes_ibelm_moho)
         
        close(15)
-    
-       ! write fault database
-       write(prname, "(i6.6,'_Database_fault')") ipart
-       open(unit=16,file=outputpath_name(1:len_trim(outputpath_name))//'/proc'//prname,&
-            status='unknown', action='write', form='formatted', iostat = ierr)
-       if( ierr /= 0 ) then
-         print*,'error file open:',outputpath_name(1:len_trim(outputpath_name))//'/proc'//prname
-         print*
-         print*,'check if path exists:',outputpath_name(1:len_trim(outputpath_name))
-         stop 
-       endif
-       call write_fault_database(16, ipart, nspec, &
-                                 glob2loc_elmnts, glob2loc_nodes_nparts, glob2loc_nodes_parts, &
-                                 glob2loc_nodes, part)
-       close(16)
       
+       if (.not. allocated(faults)) cycle 
+          ! write fault database
+          write(prname, "(i6.6,'_Database_fault')") ipart
+          open(unit=16,file=outputpath_name(1:len_trim(outputpath_name))//'/proc'//prname,&
+               status='unknown', action='write', form='formatted', iostat = ierr)
+          if( ierr /= 0 ) then
+            print*,'error file open:',outputpath_name(1:len_trim(outputpath_name))//'/proc'//prname
+            print*
+            print*,'check if path exists:',outputpath_name(1:len_trim(outputpath_name))
+            stop 
+          endif
+          call write_fault_database(16, ipart, nspec, &
+                                    glob2loc_elmnts, glob2loc_nodes_nparts, glob2loc_nodes_parts, &
+                                    glob2loc_nodes, part)
+!          close(16)
+         
+         ! write nodes coordinates with fault open crack  
+!          write(prname, "(i6.6,'_Database_fault_nodes')") ipart
+!          open(unit=16,file=outputpath_name(1:len_trim(outputpath_name))//'/proc'//prname,&
+!               status='unknown', action='write', form='formatted', iostat = ierr)
+!          if( ierr /= 0 ) then
+!            print*,'error file open:',outputpath_name(1:len_trim(outputpath_name))//'/proc'//prname
+!            print*
+!            print*,'check if path exists:',outputpath_name(1:len_trim(outputpath_name))
+!            stop 
+!          endif
+   
+          write(16,*) nnodes_loc
+          call write_glob2loc_nodes_database(16, ipart, nnodes_loc, nodes_coords_virtual,&
+                                  glob2loc_nodes_nparts, glob2loc_nodes_parts, &
+                                  glob2loc_nodes, nnodes, 2)
+
+          close(16)
+
     end do
     print*, 'partitions: '
     print*, '  num = ',nparts

Modified: seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90
===================================================================
--- seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90	2011-05-13 14:49:04 UTC (rev 18360)
+++ seismo/3D/FAULT_SOURCE/branches/new_fault_db/decompose_mesh_SCOTCH/fault_scotch.f90	2011-05-13 22:17:08 UTC (rev 18361)
@@ -10,13 +10,17 @@
     integer, dimension(:,:), pointer  :: inodes1, inodes2 
   end type fault_type
 
-  type(fault_type), allocatable, save :: faults(:)  
+  type(fault_type), allocatable, save :: faults(:) 
+  double precision, dimension(:,:), allocatable, save :: nodes_coords_virtual
+ 
+ 
   integer, parameter :: long = SELECTED_INT_KIND(18)
 
   double precision, parameter :: FAULT_GAP_TOLERANCE = 1.0d0 ! JPA: are you sure 1 meter is small enough?
                                                              ! PGB: for a simple test is fine .For SCEC lower values.
 
-  public :: read_fault_files, fault_collect_elements, close_faults, write_fault_database
+  public :: read_fault_files, fault_collect_elements, close_faults, write_fault_database, &
+            save_nodes_coords, nodes_coords_virtual, faults
 
 CONTAINS 
 !==========================================================================================
@@ -104,7 +108,19 @@
 
 
 ! ---------------------------------------------------------------------------------------------------
+! Saving nodes_coords to be used in SESAME for ibool_fault_side1 and side2
+   subroutine save_nodes_coords(nodes_coords,nnodes)
+   
+   integer, intent(in) :: nnodes
+   double precision, dimension(3,nnodes), intent(in) :: nodes_coords
+  
+   allocate(nodes_coords_virtual(3,nnodes)) 
+   nodes_coords_virtual = nodes_coords 
+ 
+   end subroutine save_nodes_coords   
 
+! ---------------------------------------------------------------------------------------------------
+
   subroutine close_faults(nodes_coords,elmnts,nelmnts,nnodes,esize)
     
   integer ,intent(in) :: nnodes, esize
@@ -402,6 +418,7 @@
 
   end subroutine write_fault_database
 
+
 ! ---------------------------------------------------------------------------------------------------
 ! Creating dual graph (adjacency is defined by 'ncommonnodes' between two elements).
 ! Taken from part_decomposition_SCOTCH.f90 routine.



More information about the CIG-COMMITS mailing list