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
bcfd640adc Jean*0001 #include "PTRACERS_OPTIONS.h"
0002
0003
0004
0005
0006 SUBROUTINE PTRACERS_TIMEAVE(
0007 I myTime, myIter, bi, bj, myThid )
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 IMPLICIT NONE
0019
0020
0021 #include "SIZE.h"
0022 #include "EEPARAMS.h"
0023 #include "PARAMS.h"
0024 #include "GRID.h"
0025 #include "PTRACERS_SIZE.h"
0026 #include "PTRACERS_PARAMS.h"
0027 #include "PTRACERS_FIELDS.h"
0028 #include "PTRACERS_TAVE.h"
0029
0030
0031
0032
0033
0034
0035
0036 _RL myTime
0037 INTEGER myIter
0038 INTEGER bi, bj
0039 INTEGER myThid
0040
0041
0042 #ifdef ALLOW_PTRACERS
0043 #ifdef ALLOW_TIMEAVE
0044
0045
0046 LOGICAL DIFFERENT_MULTIPLE
0047 EXTERNAL DIFFERENT_MULTIPLE
0048
0049
0050 INTEGER iTr
0051 _RL DDTT
0052
0053
0054
0055
0056 IF ( myIter .EQ. nIter0 ) THEN
0057 DO iTr=1,PTRACERS_numInUse
0058 CALL TIMEAVE_RESET( ptracerFluxtave(1-Olx,1-Oly, 1,1,iTr),
0059 & 1 , bi, bj, myThid )
0060 CALL TIMEAVE_RESET( ptracertave (1-Olx,1-Oly,1,1,1,iTr),
0061 & Nr, bi, bj, myThid )
0062 ENDDO
0063 ptracer_half(bi,bj) = 0.
0064 ptracer_full(bi,bj) = 0.
0065 ENDIF
0066
73148c54cb Jean*0067 IF ( PTRACERS_taveFreq.GT.0. _d 0 ) THEN
bcfd640adc Jean*0068
73148c54cb Jean*0069 IF ( myIter .EQ. nIter0 .OR.
0070 & DIFFERENT_MULTIPLE( PTRACERS_taveFreq, myTime, deltaTClock )
0071 & ) THEN
bcfd640adc Jean*0072 DDTT = 0.5*deltaTclock
73148c54cb Jean*0073 ELSE
bcfd640adc Jean*0074 DDTT = deltaTclock
73148c54cb Jean*0075 ENDIF
bcfd640adc Jean*0076
0077
73148c54cb Jean*0078 DO iTr=1,PTRACERS_numInUse
0079 CALL TIMEAVE_CUMULATE( ptracertave(1-Olx,1-Oly,1,1,1,iTr),
0080 & pTracer(1-Olx,1-Oly,1,1,1,iTr),
0081 & Nr, DDTT, bi, bj, myThid )
0082 ENDDO
bcfd640adc Jean*0083
73148c54cb Jean*0084 ptracer_half(bi,bj) = ptracer_half(bi,bj)+DDTT
bcfd640adc Jean*0085
0086
73148c54cb Jean*0087 IF ( myIter .NE. nIter0 ) THEN
bcfd640adc Jean*0088
0089
73148c54cb Jean*0090 DO iTr=1,PTRACERS_numInUse
0091 CALL TIMEAVE_CUMULATE( ptracerFluxtave(1-Olx,1-Oly,1,1,iTr),
0092 & surfaceForcingPTr(1-Olx,1-Oly,1,1,iTr),
0093 & 1, deltaTclock, bi, bj, myThid )
0094 ENDDO
0095 ptracer_full(bi,bj) = ptracer_full(bi,bj)+deltaTclock
0096
0097 ENDIF
bcfd640adc Jean*0098
73148c54cb Jean*0099
bcfd640adc Jean*0100 ENDIF
0101
0102 #endif /* ALLOW_TIMEAVE */
0103 #endif /* ALLOW_PTRACERS */
0104
0105 RETURN
0106 END