5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
|
7 |
C !ROUTINE MATRIX_WRITE_TENDENCY.F |
C !ROUTINE MATRIX_WRITE_TENDENCY.F |
8 |
C This routine writes both the explicit and implicit matrices |
C This routine writes both the explicit and implicit matrices |
9 |
C to file. |
C to file. |
10 |
|
|
11 |
SUBROUTINE MATRIX_WRITE_TENDENCY( myTime, myIter, myThid ) |
SUBROUTINE MATRIX_WRITE_TENDENCY( myTime, myIter, myThid ) |
12 |
|
|
13 |
IMPLICIT NONE |
IMPLICIT NONE |
14 |
#include "SIZE.h" |
#include "SIZE.h" |
15 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
|
#include "PTRACERS_SIZE.h" |
|
|
#include "PTRACERS.h" |
|
|
#include "MATRIX.h" |
|
16 |
#include "PARAMS.h" |
#include "PARAMS.h" |
17 |
|
#include "PTRACERS_SIZE.h" |
18 |
|
#include "PTRACERS_PARAMS.h" |
19 |
|
c#include "PTRACERS_FIELDS.h" |
20 |
|
#include "MATRIX.h" |
21 |
|
|
22 |
_RL myTime |
_RL myTime |
23 |
INTEGER myIter |
INTEGER myIter |
24 |
INTEGER myThid |
INTEGER myThid |
34 |
|
|
35 |
IF ( (mod(myTime-startTime,expMatrixWriteTime) |
IF ( (mod(myTime-startTime,expMatrixWriteTime) |
36 |
& .EQ. (0.0 _d 0))) THEN |
& .EQ. (0.0 _d 0))) THEN |
37 |
recipExpDeltaTtracer = |
recipExpDeltaTtracer = |
38 |
& (1. _d 0)/(expMatrixCounter*dTtracerLev(1)) |
& (1. _d 0)/(expMatrixCounter*dTtracerLev(1)) |
39 |
IF (expMatrixWriteCount.EQ.0) expMatrixWriteCount=1 |
IF (expMatrixWriteCount.EQ.0) expMatrixWriteCount=1 |
40 |
iRec=expMatrixWriteCount |
iRec=expMatrixWriteCount |
41 |
DO iTracer=1,PTRACERS_numInUse |
DO iTracer=1,PTRACERS_numInUse |
42 |
DO bj=myByLo(myThid), myByHi (myThid) |
DO bj=myByLo(myThid), myByHi (myThid) |
43 |
DO bi=myBxLo (myThid), myBxHi (myThid) |
DO bi=myBxLo (myThid), myBxHi (myThid) |
44 |
DO k=1,Nr |
DO k=1,Nr |
45 |
DO j=1-Oly, sNy+Oly |
DO j=1-Oly, sNy+Oly |
46 |
DO i=1-Olx, sNx+Olx |
DO i=1-Olx, sNx+Olx |
53 |
ENDDO |
ENDDO |
54 |
ENDDO |
ENDDO |
55 |
WRITE(suff,'(A9,I2.2)') 'MATRIXEXP',iTracer |
WRITE(suff,'(A9,I2.2)') 'MATRIXEXP',iTracer |
56 |
write(*,*)'Writing explicit matrix :',iTracer, |
write(*,*)'Writing explicit matrix :',iTracer, |
57 |
& expMatrixWriteCount, expMatrixCounter |
& expMatrixWriteCount, expMatrixCounter |
58 |
CALL WRITE_REC_XYZ_RL(suff, |
CALL WRITE_REC_XYZ_RL(suff, |
59 |
& MATRIX(1-Olx,1-Oly,1,1,1,iTracer,1),iRec,myIter,myThid) |
& MATRIX(1-Olx,1-Oly,1,1,1,iTracer,1),iRec,myIter,myThid) |
63 |
C Reset explicit matrix |
C Reset explicit matrix |
64 |
DO iTracer=1,PTRACERS_numInUse |
DO iTracer=1,PTRACERS_numInUse |
65 |
DO bj=myByLo(myThid), myByHi (myThid) |
DO bj=myByLo(myThid), myByHi (myThid) |
66 |
DO bi=myBxLo (myThid), myBxHi (myThid) |
DO bi=myBxLo (myThid), myBxHi (myThid) |
67 |
DO k=1,Nr |
DO k=1,Nr |
68 |
DO j=1-Oly, sNy+Oly |
DO j=1-Oly, sNy+Oly |
69 |
DO i=1-Olx, sNx+Olx |
DO i=1-Olx, sNx+Olx |
71 |
ENDDO |
ENDDO |
72 |
ENDDO |
ENDDO |
73 |
ENDDO |
ENDDO |
74 |
ENDDO |
ENDDO |
75 |
ENDDO |
ENDDO |
76 |
ENDDO |
ENDDO |
77 |
ENDIF |
ENDIF |
78 |
|
|
79 |
IF ( (mod(myTime-startTime,impMatrixWriteTime) |
IF ( (mod(myTime-startTime,impMatrixWriteTime) |
80 |
& .EQ.(0.0 _d 0)) ) THEN |
& .EQ.(0.0 _d 0)) ) THEN |
81 |
recipImpMatrixCounter = (1. _d 0)/dble(impMatrixCounter) |
recipImpMatrixCounter = (1. _d 0)/dble(impMatrixCounter) |
83 |
iRec=impMatrixWriteCount |
iRec=impMatrixWriteCount |
84 |
DO iTracer=1,PTRACERS_numInUse |
DO iTracer=1,PTRACERS_numInUse |
85 |
DO bj=myByLo(myThid), myByHi (myThid) |
DO bj=myByLo(myThid), myByHi (myThid) |
86 |
DO bi=myBxLo (myThid), myBxHi (myThid) |
DO bi=myBxLo (myThid), myBxHi (myThid) |
87 |
DO k=1,Nr |
DO k=1,Nr |
88 |
DO j=1-Oly, sNy+Oly |
DO j=1-Oly, sNy+Oly |
89 |
DO i=1-Olx, sNx+Olx |
DO i=1-Olx, sNx+Olx |
96 |
ENDDO |
ENDDO |
97 |
ENDDO |
ENDDO |
98 |
WRITE(suff,'(A9,I2.2)') 'MATRIXIMP',iTracer |
WRITE(suff,'(A9,I2.2)') 'MATRIXIMP',iTracer |
99 |
write(*,*)'Writing implicit matrix :',iTracer, |
write(*,*)'Writing implicit matrix :',iTracer, |
100 |
& impMatrixWriteCount, impMatrixCounter |
& impMatrixWriteCount, impMatrixCounter |
101 |
CALL WRITE_REC_XYZ_RL(suff, |
CALL WRITE_REC_XYZ_RL(suff, |
102 |
& MATRIX(1-Olx,1-Oly,1,1,1,iTracer,2),iRec,myIter,myThid) |
& MATRIX(1-Olx,1-Oly,1,1,1,iTracer,2),iRec,myIter,myThid) |
103 |
ENDDO |
ENDDO |
104 |
impMatrixCounter=0 |
impMatrixCounter=0 |
105 |
impMatrixWriteCount=impMatrixWriteCount+1 |
impMatrixWriteCount=impMatrixWriteCount+1 |
106 |
C Reset implicit matrix |
C Reset implicit matrix |
107 |
DO iTracer=1,PTRACERS_numInUse |
DO iTracer=1,PTRACERS_numInUse |
108 |
DO bj=myByLo(myThid), myByHi (myThid) |
DO bj=myByLo(myThid), myByHi (myThid) |
109 |
DO bi=myBxLo (myThid), myBxHi (myThid) |
DO bi=myBxLo (myThid), myBxHi (myThid) |
110 |
DO k=1,Nr |
DO k=1,Nr |
111 |
DO j=1-Oly, sNy+Oly |
DO j=1-Oly, sNy+Oly |
112 |
DO i=1-Olx, sNx+Olx |
DO i=1-Olx, sNx+Olx |
114 |
ENDDO |
ENDDO |
115 |
ENDDO |
ENDDO |
116 |
ENDDO |
ENDDO |
117 |
ENDDO |
ENDDO |
118 |
ENDDO |
ENDDO |
119 |
ENDDO |
ENDDO |
120 |
ENDIF |
ENDIF |
121 |
|
|
122 |
#endif /* ALLOW_MATRIX */ |
#endif /* ALLOW_MATRIX */ |
123 |
RETURN |
RETURN |
124 |
END |
END |
|
|
|