[cig-commits] commit: add an output list of the observation points for display

Mercurial hg at geodynamics.org
Tue Sep 20 12:13:20 PDT 2011


changeset:   21:5373d1ee8274
user:        Sylvain Barbot <sylbar.vainbot at gmail.com>
date:        Wed Aug 10 12:02:27 2011 -0700
files:       export.f90 input.f90 relax.f90
description:
add an output list of the observation points for display


diff -r 4b0d45863b7f -r 5373d1ee8274 export.f90
--- a/export.f90	Tue Aug 09 19:19:51 2011 -0700
+++ b/export.f90	Wed Aug 10 12:02:27 2011 -0700
@@ -541,6 +541,40 @@ CONTAINS
 
   END SUBROUTINE exportpoints
 
+  !---------------------------------------------------------------------
+  !> subroutine exportoptsdat
+  !! export the coordinates and name of the observation points (often
+  !! coordinates of GPS instruments or such) for display with GMT in the
+  !! ASCII format. The file contains a list of x1,x2,x3 coordinates and
+  !! a 4-character name string.
+  !!
+  !! input variables
+  !! @param n          - number of observation points
+  !! @param opts       - coordinates of observation points
+  !! @param ptsname    - name of obs. points
+  !! @param filename   - output file (example: wdir/opts.xy)
+  !!
+  !! \author sylvain barbot (08/10/11) - original form
+  !---------------------------------------------------------------------
+  SUBROUTINE exportoptsdat(n,opts,ptsname,filename)
+    INTEGER, INTENT(IN) :: n
+    TYPE(VECTOR_STRUCT), DIMENSION(n) :: opts
+    CHARACTER(LEN=4), DIMENSION(n) :: ptsname
+    CHARACTER(80) :: filename
+
+    INTEGER :: k,iostatus
+
+    IF (n.LE.0) RETURN
+
+    OPEN (UNIT=15,FILE=filename,IOSTAT=iostatus,FORM="FORMATTED")
+    IF (iostatus>0) STOP "could not open .xy file to export observation points"
+    DO k=1,n
+       WRITE (15,'(3ES11.4E1,X,a)') opts(k)%v1,opts(k)%v2,opts(k)%v3,ptsname(k)
+    END DO
+    CLOSE(15)
+    
+  END SUBROUTINE exportoptsdat
+    
   !---------------------------------------------------------------------
   !> subroutine exportEigenstrain
   !! samples the value of an input scalar field at the location of 
diff -r 4b0d45863b7f -r 5373d1ee8274 input.f90
--- a/input.f90	Tue Aug 09 19:19:51 2011 -0700
+++ b/input.f90	Wed Aug 10 12:02:27 2011 -0700
@@ -350,6 +350,10 @@ CONTAINS
              STOP 1
           END IF
        END DO
+
+       ! export the lits of observation points for display
+       filename=trim(in%wdir)//"/opts.dat"
+       CALL exportoptsdat(in%npts,in%opts,in%ptsname,filename)
 
     END IF
 
diff -r 4b0d45863b7f -r 5373d1ee8274 relax.f90
--- a/relax.f90	Tue Aug 09 19:19:51 2011 -0700
+++ b/relax.f90	Wed Aug 10 12:02:27 2011 -0700
@@ -182,7 +182,6 @@
   !!   - evaluate Green function, stress and body forces in GPU
   !!   - create a ./configure ./install framework
   !!   - input a list of planes to compute Coulomb stress
-  !!   - export a .xy list of observation points with names 
   !!   - fix output index
   !------------------------------------------------------------------------
 PROGRAM relax



More information about the CIG-COMMITS mailing list