diff options
author | allen <allen@5301f0c2-dbc4-4cee-b2f5-8d7afba4d129> | 2000-01-11 09:11:58 +0000 |
---|---|---|
committer | allen <allen@5301f0c2-dbc4-4cee-b2f5-8d7afba4d129> | 2000-01-11 09:11:58 +0000 |
commit | 2c5a9898aade0ef52e6208bbb3fca110e66b742d (patch) | |
tree | 773c841581385c5de9fde6ab17dad0d96dcf9846 /src/energy.f | |
parent | 9e60c939734aa6bdcdd6b9927d74043fed5b3b15 (diff) |
Fixed bug in extract on multiprocessors, and tidied up especially
reorganising the Extract.F file
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/Extract/trunk@9 5301f0c2-dbc4-4cee-b2f5-8d7afba4d129
Diffstat (limited to 'src/energy.f')
-rw-r--r-- | src/energy.f | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/energy.f b/src/energy.f index 19ef5e2..2466e83 100644 --- a/src/energy.f +++ b/src/energy.f @@ -1,3 +1,4 @@ + PROGRAM energy c ----------------------------------------------------------------- @@ -17,7 +18,7 @@ c ----------------------------------------------------------------- CHARACTER*50 filename REAL*8 t(nmax),Qplus(nmax),dEdt(nmax),E,ddQ(nmax),Qnew(nmax) REAL*8 Dtnew,fac,time,t1,t2,dQdt_l,dQdt_r,dtmin,dt - + INTEGER :: ioerror WRITE(6,*) WRITE(6,*) "Starting PROGRAM energy ..." WRITE(6,*) "---------------------------" @@ -30,7 +31,8 @@ c ----------------------------------------------------------------- OPEN(UNIT=12,FILE=filename,STATUS="old") DO i=1,nmax - READ(12,*,ERR=101) t(i),Qplus(i) + READ(12,*,ERR=101, IOSTAT=ioerror) t(i),Qplus(i) + if(ioerror /= 0) goto 101 itotal = i END DO WRITE(6,*) "Didn't read all of data file" @@ -101,12 +103,12 @@ c Calculate energy flux dEdt(Nt) = fac*((Qnew(Nt)-Qnew(Nt-1))/Dtnew)**2 c Write results to file - OPEN(UNIT=101,FILE="dEdt",STATUS="unknown") + OPEN(UNIT=21,FILE="dEdt",STATUS="unknown") DO i = 1,Nt time = t1+DBLE(i-1)*Dtnew - WRITE(101,*) time,dEdt(i) + WRITE(21,*) time,dEdt(i) END DO - CLOSE(101) + CLOSE(21) c Use Simpsons rule to calculate integral IF ( MOD(Nt,2) /= 0) THEN @@ -202,4 +204,3 @@ c Write out total energy END - |