[cig-commits] commit: write files such as GPS1.c.txt only when necessary.
Mercurial
hg at geodynamics.org
Mon Jun 25 16:31:39 PDT 2012
changeset: 130:71f748ac027e
user: Sylvain Barbot <sbarbot at caltech.edu>
date: Mon Jun 25 16:29:03 2012 -0700
files: examples/tibet/kokoxili/kokoxili_co.sh examples/tibet/kokoxili/kokoxili_vs.sh examples/tibet/kokoxili/kokoxili_vs3d.sh examples/tutorials/run2.bat src/export.f90
description:
write files such as GPS1.c.txt only when necessary.
diff -r be452d6152f3 -r 71f748ac027e examples/tibet/kokoxili/kokoxili_co.sh
--- a/examples/tibet/kokoxili/kokoxili_co.sh Mon Jun 18 11:47:07 2012 -0700
+++ b/examples/tibet/kokoxili/kokoxili_co.sh Mon Jun 25 16:29:03 2012 -0700
@@ -32,7 +32,7 @@ SX=512
SX=512
DX=2
-R=`echo $SX $DX | awk '{print $1*$2/2}'`
+R=`echo $SX $DX | awk '{print ($1-1)*$2/2}'`
OMP_NUM_THREADS=4 relax --no-proj-output $* <<EOF | tee $WDIR/in.param
# use '#' character to include comments in your input file
diff -r be452d6152f3 -r 71f748ac027e examples/tibet/kokoxili/kokoxili_vs.sh
--- a/examples/tibet/kokoxili/kokoxili_vs.sh Mon Jun 18 11:47:07 2012 -0700
+++ b/examples/tibet/kokoxili/kokoxili_vs.sh Mon Jun 25 16:29:03 2012 -0700
@@ -36,7 +36,7 @@ SX=512
SX=512
DX=2
-R=`echo $SX $DX | awk '{print $1*$2/2}'`
+R=`echo $SX $DX | awk '{print ($1-1)*$2/2}'`
OMP_NUM_THREADS=4 relax --no-proj-output --no-stress-output $* <<EOF | tee $WDIR/in.param
# use '#' character to include comments in your input file
diff -r be452d6152f3 -r 71f748ac027e examples/tibet/kokoxili/kokoxili_vs3d.sh
--- a/examples/tibet/kokoxili/kokoxili_vs3d.sh Mon Jun 18 11:47:07 2012 -0700
+++ b/examples/tibet/kokoxili/kokoxili_vs3d.sh Mon Jun 25 16:29:03 2012 -0700
@@ -36,7 +36,7 @@ SX=512
SX=512
DX=2
-R=`echo $SX $DX | awk '{print $1*$2/2}'`
+R=`echo $SX $DX | awk '{print ($1-1)*$2/2}'`
OMP_NUM_THREADS=4 relax --no-proj-output --no-stress-output $* <<EOF | tee $WDIR/in.param
# use '#' character to include comments in your input file
diff -r be452d6152f3 -r 71f748ac027e examples/tutorials/run2.bat
--- a/examples/tutorials/run2.bat Mon Jun 18 11:47:07 2012 -0700
+++ b/examples/tutorials/run2.bat Mon Jun 25 16:29:03 2012 -0700
@@ -5,4 +5,4 @@ set OMP_NUM_THREADS=4
set GMT_SHAREDIR=%CD%\..\..\share
set PROJ_LIB=%CD%\..\..\share
-..\..\relax < run2.input
+..\..\relax --no-proj-output < run2.input
diff -r be452d6152f3 -r 71f748ac027e src/export.f90
--- a/src/export.f90 Mon Jun 18 11:47:07 2012 -0700
+++ b/src/export.f90 Mon Jun 25 16:29:03 2012 -0700
@@ -472,20 +472,28 @@ CONTAINS
DO k=1,n
file1=wdir(1:i-1) // "/" // ptsname(k) // ".txt"
- file2=wdir(1:i-1) // "/" // ptsname(k) // ".c.txt"
-
IF (isnew) THEN
OPEN (UNIT=15,FILE=file1,IOSTAT=iostatus,FORM="FORMATTED")
WRITE (15,'("# t u1 u2 u3 ", &
& "s11 s12 s13 s22 s23 s33")')
- OPEN (UNIT=16,FILE=file2,IOSTAT=iostatus,FORM="FORMATTED")
ELSE
OPEN (UNIT=15,FILE=file1,POSITION="APPEND",&
IOSTAT=iostatus,FORM="FORMATTED")
- OPEN (UNIT=16,FILE=file2,POSITION="APPEND",&
- IOSTAT=iostatus,FORM="FORMATTED")
END IF
IF (iostatus>0) STOP "could not open point file for writing"
+
+ IF (0.NE.rot) THEN
+ file2=wdir(1:i-1) // "/" // ptsname(k) // ".c.txt"
+ IF (isnew) THEN
+ WRITE (15,'("# t u1 u2 u3 ", &
+ & "s11 s12 s13 s22 s23 s33")')
+ OPEN (UNIT=16,FILE=file2,IOSTAT=iostatus,FORM="FORMATTED")
+ ELSE
+ OPEN (UNIT=16,FILE=file2,POSITION="APPEND",&
+ IOSTAT=iostatus,FORM="FORMATTED")
+ END IF
+ IF (iostatus>0) STOP "could not open point file for writing"
+ END IF
x1=opts(k)%v1
x2=opts(k)%v2
@@ -514,10 +522,13 @@ CONTAINS
WRITE (15,'(13ES11.3E2)') time,v1,v2,v3, &
lsig%s11,lsig%s12,lsig%s13, &
lsig%s22,lsig%s23,lsig%s33
- WRITE (16,'(7ES11.3E2)') x1,x2,x3,time,u1,u2,u3
+ CLOSE(15)
- CLOSE(15)
- CLOSE(16)
+ IF (0.NE.rot) THEN
+ WRITE (16,'(7ES11.3E2)') x1,x2,x3,time,u1,u2,u3
+ CLOSE(16)
+ END IF
+
END DO
CONTAINS
More information about the CIG-COMMITS
mailing list