/[MITgcm]/MITgcm/pkg/ptracers/ptracers_timeave.F
ViewVC logotype

Annotation of /MITgcm/pkg/ptracers/ptracers_timeave.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Sun Jan 3 03:11:21 2010 UTC (14 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
Changes since 1.1: +23 -19 lines
cumulate fields only if doing time-ave output (PTRACERS_taveFreq > 0)

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_timeave.F,v 1.1 2010/01/02 23:45:46 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "PTRACERS_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: PTRACERS_TIMEAVE
8     C !INTERFACE:
9     SUBROUTINE PTRACERS_TIMEAVE(
10     I myTime, myIter, bi, bj, myThid )
11    
12     C !DESCRIPTION: \bv
13     C *==========================================================*
14     C | S/R PTRACERS_TIMEAVE
15     C | o Time averaging routine for PTRACERS
16     C | in model main time-stepping
17     C *==========================================================*
18     C \ev
19    
20     C !USES:
21     IMPLICIT NONE
22    
23     C == Global variables ===
24     #include "SIZE.h"
25     #include "EEPARAMS.h"
26     #include "PARAMS.h"
27     #include "GRID.h"
28     #include "PTRACERS_SIZE.h"
29     #include "PTRACERS_PARAMS.h"
30     #include "PTRACERS_FIELDS.h"
31     #include "PTRACERS_TAVE.h"
32    
33     C !INPUT/OUTPUT PARAMETERS:
34     C == Routine arguments ==
35     C myTime :: Current time in simulation
36     C myIter :: Iteration number
37     C bi, bj :: Tile indices
38     C myThid :: my Thread Id number
39     _RL myTime
40     INTEGER myIter
41     INTEGER bi, bj
42     INTEGER myThid
43     CEOP
44    
45     #ifdef ALLOW_PTRACERS
46     #ifdef ALLOW_TIMEAVE
47    
48     C !FUNCTIONS:
49     LOGICAL DIFFERENT_MULTIPLE
50     EXTERNAL DIFFERENT_MULTIPLE
51    
52     C !LOCAL VARIABLES:
53     INTEGER iTr
54     _RL DDTT
55    
56     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
57    
58     C- Initialize fields for the first call ever
59     IF ( myIter .EQ. nIter0 ) THEN
60     DO iTr=1,PTRACERS_numInUse
61     CALL TIMEAVE_RESET( ptracerFluxtave(1-Olx,1-Oly, 1,1,iTr),
62     & 1 , bi, bj, myThid )
63     CALL TIMEAVE_RESET( ptracertave (1-Olx,1-Oly,1,1,1,iTr),
64     & Nr, bi, bj, myThid )
65     ENDDO
66     ptracer_half(bi,bj) = 0.
67     ptracer_full(bi,bj) = 0.
68     ENDIF
69    
70 jmc 1.2 IF ( PTRACERS_taveFreq.GT.0. _d 0 ) THEN
71 jmc 1.1 C-- Cumulate state-variables with Half or Full time step :
72 jmc 1.2 IF ( myIter .EQ. nIter0 .OR.
73     & DIFFERENT_MULTIPLE( PTRACERS_taveFreq, myTime, deltaTClock )
74     & ) THEN
75 jmc 1.1 DDTT = 0.5*deltaTclock
76 jmc 1.2 ELSE
77 jmc 1.1 DDTT = deltaTclock
78 jmc 1.2 ENDIF
79 jmc 1.1
80     C- Time Averages of state variables
81 jmc 1.2 DO iTr=1,PTRACERS_numInUse
82     CALL TIMEAVE_CUMULATE( ptracertave(1-Olx,1-Oly,1,1,1,iTr),
83     & pTracer(1-Olx,1-Oly,1,1,1,iTr),
84     & Nr, DDTT, bi, bj, myThid )
85     ENDDO
86 jmc 1.1 C- Keep record of how much time has been integrated over
87 jmc 1.2 ptracer_half(bi,bj) = ptracer_half(bi,bj)+DDTT
88 jmc 1.1
89     C- Time Averages of "intermediate" fields
90 jmc 1.2 IF ( myIter .NE. nIter0 ) THEN
91 jmc 1.1
92     C- Time Averages of surface fluxes
93 jmc 1.2 DO iTr=1,PTRACERS_numInUse
94     CALL TIMEAVE_CUMULATE( ptracerFluxtave(1-Olx,1-Oly,1,1,iTr),
95     & surfaceForcingPTr(1-Olx,1-Oly,1,1,iTr),
96     & 1, deltaTclock, bi, bj, myThid )
97     ENDDO
98     ptracer_full(bi,bj) = ptracer_full(bi,bj)+deltaTclock
99    
100     ENDIF
101 jmc 1.1
102 jmc 1.2 C- end block if PTRACERS_taveFreq > 0
103 jmc 1.1 ENDIF
104    
105     #endif /* ALLOW_TIMEAVE */
106     #endif /* ALLOW_PTRACERS */
107    
108     RETURN
109     END

  ViewVC Help
Powered by ViewVC 1.1.22