File indexing completed on 2018-03-02 18:43:03 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
5d1aafd341 Jean*0001 #include "PTRACERS_OPTIONS.h"
0002 #include "GAD_OPTIONS.h"
0003
0004
0005
0006
0007
0008
0009 SUBROUTINE PTRACERS_RESET( myTime, myIter, myThid )
0010
0011
0012
0013
0014
0015 #include "PTRACERS_MOD.h"
0016 IMPLICIT NONE
0017 #include "SIZE.h"
0018 #include "EEPARAMS.h"
0019 #include "PARAMS.h"
0020 #include "GRID.h"
0021 #include "PTRACERS_SIZE.h"
0022 #include "PTRACERS_PARAMS.h"
0023 #include "PTRACERS_FIELDS.h"
0024 #include "GAD.h"
0025
0026
0027
0028 INTEGER myIter
0029 _RL myTime
0030 INTEGER myThid
0031
0032 #ifdef ALLOW_PTRACERS
0033
0034 LOGICAL DIFFERENT_MULTIPLE
0035 EXTERNAL DIFFERENT_MULTIPLE
0036
0037
0038
0039
0040 INTEGER i,j,k,bi,bj,iTracer
0041 CHARACTER*(MAX_LEN_MBUF) msgBuf
7d62671abd Oliv*0042 CHARACTER*(MAX_LEN_FNAM) tmpInitialFile
5d1aafd341 Jean*0043
0044 #ifdef PTRACERS_ALLOW_DYN_STATE
0045 INTEGER n
0046 #endif
0047
0048
0049
0050 DO iTracer = 1, PTRACERS_num
0051
0052
0053 IF ( PTRACERS_resetFreq(iTracer).GT.0. .AND. myIter.GT.0 .AND.
0054 & DIFFERENT_MULTIPLE( PTRACERS_resetFreq(iTracer),
0055 & myTime + PTRACERS_resetPhase(iTracer), deltaTClock ) ) THEN
0056
0057
0058 _BEGIN_MASTER( myThid )
0059 WRITE(msgBuf,'(A,I2,I10)')
0060 & '// PTRACER Resetting, (iTracer,t-step) = ',
0061 & iTracer, myIter
0062 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0063 & SQUEEZE_RIGHT, myThid )
0064 _END_MASTER( myThid )
0065
0066
0067 DO bj = myByLo(myThid), myByHi(myThid)
0068 DO bi = myBxLo(myThid), myBxHi(myThid)
0069 DO k=1,Nr
0070 DO j=1-OLy,sNy+OLy
0071 DO i=1-OLx,sNx+OLx
0072 pTracer(i,j,k,bi,bj,iTracer) = PTRACERS_ref(k,iTracer)
0073 gpTrNm1(i,j,k,bi,bj,iTracer) = 0. _d 0
0074 ENDDO
0075 ENDDO
0076 ENDDO
0077 ENDDO
0078 ENDDO
0079
0080
7d62671abd Oliv*0081 tmpInitialFile = ' '
0082 tmpInitialFile = PTRACERS_initialFile(iTracer)
0083 IF ( tmpInitialFile .NE. ' ' ) THEN
0084 CALL READ_FLD_XYZ_RL(tmpInitialFile,' ',
5d1aafd341 Jean*0085 & pTracer(1-OLx,1-OLy,1,1,1,iTracer),0,myThid)
0086 _EXCH_XYZ_RL(pTracer(1-OLx,1-OLy,1,1,1,iTracer),myThid)
0087 ENDIF
0088
0089
0090 DO bj = myByLo(myThid), myByHi(myThid)
0091 DO bi = myBxLo(myThid), myBxHi(myThid)
0092 DO k=1,Nr
0093 DO j=1-OLy,sNy+OLy
0094 DO i=1-OLx,sNx+OLx
0095 IF (maskC(i,j,k,bi,bj).EQ.0.)
0096 & pTracer(i,j,k,bi,bj,iTracer)=0. _d 0
0097 ENDDO
0098 ENDDO
0099 ENDDO
0100 ENDDO
0101 ENDDO
0102
0103 #ifdef PTRACERS_ALLOW_DYN_STATE
0104
0105 IF ( PTRACERS_SOM_Advection(iTracer) ) THEN
0106 _BEGIN_MASTER( myThid )
0107 WRITE(msgBuf,'(A,I3,A)')'PTRACERS_RESET: iTracer = ',
0108 & iTracer, ' : resetting 2nd-order moments '
0109 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0110 & SQUEEZE_RIGHT, myThid )
0111 _END_MASTER( myThid )
0112 DO bj = myByLo(myThid), myByHi(myThid)
0113 DO bi = myBxLo(myThid), myBxHi(myThid)
0114 DO n = 1,nSOM
0115 DO k=1,Nr
0116 DO j=1-OLy,sNy+OLy
0117 DO i=1-OLx,sNx+OLx
0118 _Ptracers_som(i,j,k,bi,bj,n,iTracer) = 0. _d 0
0119 ENDDO
0120 ENDDO
0121 ENDDO
0122 ENDDO
0123 ENDDO
0124 ENDDO
0125
0126
0127 ENDIF
0128 #endif /* PTRACERS_ALLOW_DYN_STATE */
0129
0130 _BEGIN_MASTER( myThid )
0131 WRITE(msgBuf,'(A)') ' '
0132 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0133 & SQUEEZE_RIGHT, myThid )
0134 _END_MASTER( myThid )
0135
0136
0137 ENDIF
0138
0139 ENDDO
0140
0141 #endif /* ALLOW_PTRACERS */
0142
0143 RETURN
0144 END