[cig-commits] r13347 - in seismo/2D/SPECFEM2D/branches/BIOT: . DATA
cmorency at geodynamics.org
cmorency at geodynamics.org
Wed Nov 19 13:01:38 PST 2008
Author: cmorency
Date: 2008-11-19 13:01:38 -0800 (Wed, 19 Nov 2008)
New Revision: 13347
Modified:
seismo/2D/SPECFEM2D/branches/BIOT/DATA/Par_file
seismo/2D/SPECFEM2D/branches/BIOT/meshfem2D.F90
seismo/2D/SPECFEM2D/branches/BIOT/part_unstruct.F90
Log:
Yang : irregular mesh files now include a special file for the receivers.
This file must be present in Par_file.
Modified: seismo/2D/SPECFEM2D/branches/BIOT/DATA/Par_file
===================================================================
--- seismo/2D/SPECFEM2D/branches/BIOT/DATA/Par_file 2008-11-19 20:50:16 UTC (rev 13346)
+++ seismo/2D/SPECFEM2D/branches/BIOT/DATA/Par_file 2008-11-19 21:01:38 UTC (rev 13347)
@@ -5,11 +5,12 @@
# data concerning mesh, when generated using third-party app (more info in README)
read_external_mesh = .false.
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
+mesh_file = ./DATA/yangluo_mesh_overthrust/mesh_file # file containing the mesh
+nodes_coords_file = ./DATA/yangluo_mesh_overthrust/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./DATA/yangluo_mesh_overthrust/materials_file # file containing the material number for each element
+free_surface_file = ./DATA/yangluo_mesh_overthrust/free_surface_file # file containing the free surface
+absorbing_surface_file = ./DATA/yangluo_mesh_overthrust/absorbing_surface_file # file containing the absorbing surface
+receivers_file = ./DATA/yangluo_mesh_overthrust/receivers_file # file containing the absorbing surface
# parameters concerning partitionning
nproc = 1 # number of processes
Modified: seismo/2D/SPECFEM2D/branches/BIOT/meshfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/branches/BIOT/meshfem2D.F90 2008-11-19 20:50:16 UTC (rev 13346)
+++ seismo/2D/SPECFEM2D/branches/BIOT/meshfem2D.F90 2008-11-19 21:01:38 UTC (rev 13347)
@@ -155,7 +155,7 @@
! parameters for external mesh
logical :: read_external_mesh
- character(len=256) :: mesh_file, nodes_coords_file, materials_file, free_surface_file, absorbing_surface_file
+ character(len=256) :: mesh_file, nodes_coords_file, materials_file, free_surface_file, absorbing_surface_file,receivers_file
! variables used for storing info about the mesh and partitions
integer, dimension(:), pointer :: elmnts
@@ -252,6 +252,7 @@
call read_value_string(IIN,IGNORE_JUNK,materials_file)
call read_value_string(IIN,IGNORE_JUNK,free_surface_file)
call read_value_string(IIN,IGNORE_JUNK,absorbing_surface_file)
+ call read_value_string(IIN,IGNORE_JUNK,receivers_file)
! read info about partitionning
call read_value_integer(IIN,IGNORE_JUNK,nproc)
@@ -1326,7 +1327,9 @@
print *
enddo
!--- compute position of the receivers and write the STATIONS file
-
+ if (read_external_mesh) then
+ call read_receivers(receivers_file,xs,zs)
+ else
if (generate_STATIONS) then
print *
print *,'writing the DATA/STATIONS file'
@@ -1380,8 +1383,8 @@
endif
print *
+ endif !(if(external_mesh...
-
end program meshfem2D
! *******************
Modified: seismo/2D/SPECFEM2D/branches/BIOT/part_unstruct.F90
===================================================================
--- seismo/2D/SPECFEM2D/branches/BIOT/part_unstruct.F90 2008-11-19 20:50:16 UTC (rev 13346)
+++ seismo/2D/SPECFEM2D/branches/BIOT/part_unstruct.F90 2008-11-19 21:01:38 UTC (rev 13347)
@@ -243,7 +243,47 @@
end subroutine read_abs_surface
+ !-----------------------------------------------
+ ! Read receivers.
+ ! 'receivers_file' contains
+ ! first line: number of receivers
+ ! following lines: xrec zrec
+ !-----------------------------------------------
+ subroutine read_receivers(filename,xs,zs)
+ character(len=256), intent(in) :: filename
+ integer :: nrec, irec_global_number
+ double precision :: xrec,zrec,xs,zs
+ integer :: i
+
+ open(unit=996,file='DATA/STATIONS',status='unknown')
+ open(unit=997,file='OUTPUT_FILES/receivers_file',status='unknown')
+ open(unit=995, file=trim(filename), form='formatted' , status='old', action='read')
+ print *, 'reading receivers_file', trim(filename)
+ read(995,*) nrec
+ print *
+ print *,'writing the DATA/STATIONS file'
+ print *
+ print *
+ print *,'There are ',nrec,' receivers'
+ print *
+ print *,'Position (x,z) of the ',nrec,' receivers'
+ print *
+
+
+ write(997,"(f20.7,1x,f20.7)") xs,zs
+ do i = 1, nrec
+ read(995,*) xrec,zrec
+ write(996,"('S',i4.4,' AA ',f20.7,1x,f20.7,' 0.0 0.0')") i,xrec,zrec
+ write(997,"(f20.7,1x,f20.7)") xrec,zrec
+ end do
+
+ close(995)
+ close(996)
+ close(997)
+
+ end subroutine read_receivers
+
!-----------------------------------------------
! Creating dual graph (adjacency is defined by 'ncommonnodes' between two elements).
!-----------------------------------------------
More information about the CIG-COMMITS
mailing list