1 |
cswdptr -- added routine --- |
2 |
#include "CPP_OPTIONS.h" |
3 |
#include "GCHEM_OPTIONS.h" |
4 |
|
5 |
SUBROUTINE PTRACERS_STATVARS( |
6 |
I myTime, myIter, bi, bj, myThid) |
7 |
C /==========================================================\ |
8 |
C | SUBROUTINE PTRACERS_STATVARS | |
9 |
C | o Time averaging routine for PTRACERS | |
10 |
C | in model main time-stepping | |
11 |
C \==========================================================/ |
12 |
IMPLICIT NONE |
13 |
|
14 |
C == Global variables === |
15 |
#include "SIZE.h" |
16 |
#include "EEPARAMS.h" |
17 |
#include "PARAMS.h" |
18 |
#include "DYNVARS.h" |
19 |
#include "GRID.h" |
20 |
#include "TIMEAVE_STATV.h" |
21 |
#ifdef ALLOW_PTRACERS |
22 |
#include "PTRACERS.h" |
23 |
#include "PTRACERS_OPTIONS.h" |
24 |
#include "PTRACERS_STATV.h" |
25 |
#endif |
26 |
|
27 |
LOGICAL DIFFERENT_MULTIPLE |
28 |
EXTERNAL DIFFERENT_MULTIPLE |
29 |
|
30 |
C == Routine arguments == |
31 |
C myThid - Thread number for this instance of the routine. |
32 |
C myIter - Iteration number |
33 |
C myTime - Current time of simulation ( s ) |
34 |
INTEGER myThid |
35 |
INTEGER myIter, bi, bj |
36 |
_RL myTime |
37 |
|
38 |
#ifdef ALLOW_PTRACERS |
39 |
#ifdef ALLOW_TIMEAVE |
40 |
|
41 |
C == Local variables == |
42 |
INTEGER iTracer, k |
43 |
_RL DDTT |
44 |
|
45 |
C- Initialize fields for the first call ever |
46 |
IF ( myIter .EQ. nIter0 ) THEN |
47 |
do iTracer=1,PTRACERS_numInUse |
48 |
CALL TIMEAVE_RESET(ptracertave(1-Olx,1-Oly,1,1,1,iTracer), |
49 |
& Nr, bi, bj, myThid) |
50 |
enddo |
51 |
DO K=1,Nr |
52 |
ptracer_half(k,bi,bj)=0. |
53 |
ENDDO |
54 |
ENDIF |
55 |
|
56 |
C-- Cumulate state-variables with Half or Full time step : |
57 |
IF ( myIter .EQ. nIter0 .OR. |
58 |
& DIFFERENT_MULTIPLE(taveFreq, myTime, myTime-deltaTClock)) THEN |
59 |
DDTT=0.5*deltaTclock |
60 |
ELSE |
61 |
DDTT=deltaTclock |
62 |
ENDIF |
63 |
|
64 |
C- Time Averages of single fields (no hFactor) |
65 |
do iTracer=1,PTRACERS_numInUse |
66 |
CALL TIMEAVE_CUMULATE(ptracertave(1-Olx,1-Oly,1,1,1,iTracer), |
67 |
& ptracer(1-Olx,1-Oly,1,1,1,iTracer), |
68 |
& Nr, DDTT, bi, bj, myThid) |
69 |
enddo |
70 |
|
71 |
C- Keep record of how much time has been integrated over |
72 |
DO K=1,Nr |
73 |
ptracer_half(k,bi,bj)=ptracer_half(k,bi,bj)+DDTT |
74 |
ENDDO |
75 |
|
76 |
|
77 |
|
78 |
|
79 |
#endif /* ALLOW_TIMEAVE */ |
80 |
#endif |
81 |
|
82 |
RETURN |
83 |
END |