[cig-commits] r17122 - seismo/3D/SPECFEM3D/trunk

pieyre at geodynamics.org pieyre at geodynamics.org
Thu Aug 26 08:31:14 PDT 2010


Author: pieyre
Date: 2010-08-26 08:31:14 -0700 (Thu, 26 Aug 2010)
New Revision: 17122

Modified:
   seismo/3D/SPECFEM3D/trunk/Makefile.in
   seismo/3D/SPECFEM3D/trunk/create_movie_shakemap_AVS_DX_GMT.f90
Log:
finished to add GMT format in create_movie_shakemap_AVS_DX_GMT


Modified: seismo/3D/SPECFEM3D/trunk/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/Makefile.in	2010-08-26 15:10:26 UTC (rev 17121)
+++ seismo/3D/SPECFEM3D/trunk/Makefile.in	2010-08-26 15:31:14 UTC (rev 17122)
@@ -240,15 +240,10 @@
 xcreate_header_file: $O/program_create_header_file.o $(LIBSPECFEM)
 	${FCCOMPILE_CHECK} -o xcreate_header_file $O/program_create_header_file.o $(LIBSPECFEM)
 
-#@COND_PYRE_FALSE at xcreate_movie_shakemap_AVS_DX_GMT: $O/create_movie_shakemap_AVS_DX_GMT.o $(LIBSPECFEM) OUTPUT_FILES/values_from_mesher.h
-#@COND_PYRE_FALSE@	${FCCOMPILE_CHECK} -o xcreate_movie_shakemap_AVS_DX_GMT $O/create_movie_shakemap_AVS_DX_GMT.o $(LIBSPECFEM)
+ at COND_PYRE_FALSE@xcreate_movie_shakemap_AVS_DX_GMT: $O/create_movie_shakemap_AVS_DX_GMT.o $(LIBSPECFEM) OUTPUT_FILES/surface_from_mesher.h
+ at COND_PYRE_FALSE@	${FCCOMPILE_CHECK} -o xcreate_movie_shakemap_AVS_DX_GMT $O/create_movie_shakemap_AVS_DX_GMT.o $(LIBSPECFEM)
 
- at COND_PYRE_FALSE@xcreate_movie_shakemap_AVS_DX_GMT: $O/create_movie_shakemap_AVS_DX_GMT.o $O/read_parameter_file.o $O/read_value_parameters.o $O/get_value_parameters.o OUTPUT_FILES/surface_from_mesher.h $O/param_reader.o
- at COND_PYRE_FALSE@	${FCCOMPILE_CHECK} -o xcreate_movie_shakemap_AVS_DX_GMT $O/create_movie_shakemap_AVS_DX_GMT.o $O/read_parameter_file.o $O/read_value_parameters.o $O/get_value_parameters.o $O/param_reader.o
 
-
-
-
 xcombine_AVS_DX: $O/combine_AVS_DX.o $(LIBSPECFEM)
 	${FCCOMPILE_CHECK} -o xcombine_AVS_DX $O/combine_AVS_DX.o $(LIBSPECFEM)
 

Modified: seismo/3D/SPECFEM3D/trunk/create_movie_shakemap_AVS_DX_GMT.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/create_movie_shakemap_AVS_DX_GMT.f90	2010-08-26 15:10:26 UTC (rev 17121)
+++ seismo/3D/SPECFEM3D/trunk/create_movie_shakemap_AVS_DX_GMT.f90	2010-08-26 15:31:14 UTC (rev 17122)
@@ -24,11 +24,12 @@
 !=====================================================================
 
 !
-!---  create a movie of vertical component of surface displacement or velocity
-!---  in AVS or OpenDX format
+!---  create a movie of the vertical component of surface displacement or velocity
+!---  or a ShakeMap(R) (i.e. map of the maximum absolute value of the two horizontal components
+!---  of the velocity vector) in AVS, OpenDX or GMT format
 !
 
-  program create_movie_AVS_DX
+  program create_movie_shakemap
 
   implicit none
 
@@ -54,7 +55,7 @@
   integer iformat,nframes,iframe,inumber,inorm,iscaling_shake
   integer ibool_number,ibool_number1,ibool_number2,ibool_number3,ibool_number4
 
-  logical USE_OPENDX,USE_AVS,plot_shaking_map
+  logical USE_OPENDX,USE_AVS,USE_GMT,plot_shaking_map
 
   real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: x,y,z,display
   real(kind=CUSTOM_REAL) xcoord,ycoord,zcoord
@@ -66,6 +67,9 @@
 
   integer ipoin
 
+  ! GMT
+  double precision lat,long
+
   ! for sorting routine
   integer npointot,ilocnum,nglob,i,j,ielm,ieoff,ispecloc
   integer, dimension(:), allocatable :: iglob,loc,ireorder
@@ -224,12 +228,15 @@
   if(iformat == 1) then
     USE_OPENDX = .true.
     USE_AVS = .false.
+    USE_GMT = .false.
   else if(iformat == 2) then
     USE_OPENDX = .false.
     USE_AVS = .true.
+    USE_GMT = .false.
   else
     USE_OPENDX = .false.
     USE_AVS = .false.
+    USE_GMT = .true.
   endif
 
   ! define the total number of elements at the surface
@@ -630,6 +637,9 @@
           write(outputname,"('/AVS_shaking_map.inp')")
           open(unit=11,file=trim(OUTPUT_FILES)//outputname,status='unknown')
           write(11,*) nglob,' ',nspectot_AVS_max,' 1 0 0'
+       else if(USE_GMT) then
+          write(outputname,"('/gmt_shaking_map.xyz')")
+          open(unit=11,file=trim(OUTPUT_FILES)//outputname,status='unknown')      
         else
           stop 'wrong output format selected'
         endif
@@ -644,6 +654,9 @@
           write(outputname,"('/AVS_movie_',i6.6,'.inp')") ivalue
           open(unit=11,file=trim(OUTPUT_FILES)//outputname,status='unknown')
           write(11,*) nglob,' ',nspectot_AVS_max,' 1 0 0'
+       else if(USE_GMT) then
+          write(outputname,"('/gmt_movie_',i6.6,'.xyz')") ivalue
+          open(unit=11,file=trim(OUTPUT_FILES)//outputname,status='unknown')
         else
           stop 'wrong output format selected'
         endif
@@ -651,8 +664,24 @@
       endif
 
 
-      if(.false.) then
-        ! GMT format not implemented yet        
+      if(USE_GMT) then
+       
+! output list of points
+         mask_point = .false.
+         do ispec=1,nspectot_AVS_max
+            ieoff = NGNOD2D_AVS_DX*(ispec-1)
+! four points for each element
+            do ilocnum = 1,NGNOD2D_AVS_DX
+               ibool_number = iglob(ilocnum+ieoff)
+               if(.not. mask_point(ibool_number)) then
+                  call utm_geo(long,lat,xp_save(ilocnum+ieoff),yp_save(ilocnum+ieoff), &
+                       UTM_PROJECTION_ZONE,IUTM2LONGLAT,SUPPRESS_UTM_PROJECTION)
+                  write(11,*) long,lat,field_display(ilocnum+ieoff)
+               endif
+               mask_point(ibool_number) = .true.
+            enddo
+         enddo
+         
       else
 
         ! output list of points
@@ -750,15 +779,15 @@
       close(11)
 
     ! end of loop and test on all the time steps for all the movie images
-    endif
-  enddo ! it
+   endif
+enddo ! it
 
   print *
   print *,'done creating movie or shaking map'
   print *
   if(USE_OPENDX) print *,'DX files are stored in ', trim(OUTPUT_FILES), '/DX_*.dx'
   if(USE_AVS) print *,'AVS files are stored in ', trim(OUTPUT_FILES), '/AVS_*.inp'
-
+  if(USE_GMT) print *,'GMT files are stored in ', trim(OUTPUT_FILES), '/gmt_*.xyz'
   print *
 
 
@@ -785,7 +814,7 @@
     deallocate(display)
   endif
 
-  end program create_movie_AVS_DX
+  end program create_movie_shakemap
 
 !
 !=====================================================================



More information about the CIG-COMMITS mailing list