/[MITgcm]/MITgcm/verification/matrix_example/code/tracers_correction_step.F
ViewVC logotype

Contents of /MITgcm/verification/matrix_example/code/tracers_correction_step.F

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


Revision 1.2 - (show annotations) (download)
Wed Apr 20 18:29:57 2005 UTC (18 years, 11 months ago) by spk
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Removing files that are now incorporated in main code tree

1 C $Header: /u/gcmpack/MITgcm/verification/matrix_example/code/tracers_correction_step.F,v 1.1 2005/04/18 20:13:50 spk Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: TRACERS_CORRECTION_STEP
9 C !INTERFACE:
10 SUBROUTINE TRACERS_CORRECTION_STEP(myTime, myIter, myThid)
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE TRACERS_CORRECTION_STEP
14 C *==========================================================*
15 C |1rst Part : Update T,S.
16 C |
17 C | The arrays used for time stepping are cycled.
18 C | Tracers:
19 C | T(n) = Gt(n)
20 C |
21 C |part1: update T,S
22 C | T* (contained in gT) is copied to T (theta)
23 C | S* (contained in gS) is copied to S (salt)
24 C |
25 C |part2: Adjustments & Diagnostics
26 C | o Filter T,S (Shapiro Filter, Zonal_Filter)
27 C | o Convective Adjustment
28 C | o Diagmnostic of state variables (Time average)
29 C *==========================================================*
30 C \ev
31
32 C !USES:
33 IMPLICIT NONE
34 C == Global variables ===
35 #include "SIZE.h"
36 #include "EEPARAMS.h"
37 #include "PARAMS.h"
38 #include "DYNVARS.h"
39
40 C !INPUT/OUTPUT PARAMETERS:
41 C == Routine arguments ==
42 C myTime - Current time in simulation
43 C myIter - Current iteration number in simulation
44 C myThid - Thread number for this instance of the routine.
45 _RL myTime
46 INTEGER myIter
47 INTEGER myThid
48
49 C !LOCAL VARIABLES:
50 C == Local variables
51 INTEGER iMin,iMax
52 INTEGER jMin,jMax
53 INTEGER bi,bj
54 INTEGER k,i,j
55
56 CEOP
57
58 DO bj=myByLo(myThid),myByHi(myThid)
59 DO bi=myBxLo(myThid),myBxHi(myThid)
60
61 C-- Loop over all layers, top to bottom
62 DO K=1,Nr
63
64 C- Update tracer fields: T(n) = T**
65 #ifndef ALLOW_OFFLINE
66 IF (tempStepping)
67 & CALL CYCLE_TRACER(
68 I bi,bj,K,
69 U theta,gT,
70 I myTime,myIter,myThid )
71 IF (saltStepping)
72 & CALL CYCLE_TRACER(
73 I bi,bj,k,
74 U salt,gS,
75 I myTime,myIter,myThid )
76 #endif
77 #ifdef ALLOW_PTRACERS
78 C- Update passive tracer fields: T(n) = T**
79 IF (usePTRACERS)
80 & CALL PTRACERS_CYCLE(bi,bj,k,myIter,myTime,myThid)
81 #endif /* ALLOW_PTRACERS */
82
83 C-- End DO K=1,Nr
84 ENDDO
85
86 C-- End of 1rst bi,bj loop
87 ENDDO
88 ENDDO
89
90 C--- 2nd Part : Adjustment.
91 C
92 C Static stability is calculated and the tracers are
93 C convective adjusted where statically unstable.
94
95 C-- Filter (and exchange)
96 #ifdef ALLOW_SHAP_FILT
97 IF (useSHAP_FILT) THEN
98 CALL SHAP_FILT_APPLY_TS( theta,salt, myTime, myIter, myThid )
99 ENDIF
100 #endif
101 #ifdef ALLOW_ZONAL_FILT
102 IF (useZONAL_FILT) THEN
103 CALL ZONAL_FILT_APPLY_TS( theta, salt, myThid )
104 ENDIF
105 #endif
106
107 #ifndef ALLOW_OFFLINE
108 DO bj=myByLo(myThid),myByHi(myThid)
109 DO bi=myBxLo(myThid),myBxHi(myThid)
110
111 C-- Convectively adjust new fields to be statically stable
112 iMin = 1
113 iMax = sNx
114 jMin = 1
115 jMax = sNy
116 #ifdef ALLOW_OPPS
117 IF ( useOPPS ) THEN
118 CALL OPPS_INTERFACE(
119 I bi, bj, iMin, iMax, jMin, jMax,
120 I myTime, myIter, myThid )
121 ELSE
122 #endif /* ALLOW_OPPS */
123 CALL CONVECTIVE_ADJUSTMENT(
124 I bi, bj, iMin, iMax, jMin, jMax,
125 I myTime, myIter, myThid )
126 #ifdef ALLOW_OPPS
127 ENDIF
128 #endif /* ALLOW_OPPS */
129
130 #ifdef ALLOW_MATRIX
131 IF (useMATRIX)
132 & CALL MATRIX_STORE_TENDENCY_IMP( bi, bj, myTime, myIter, myThid )
133 #endif
134
135 C-- End of 2nd bi,bj loop
136 ENDDO
137 ENDDO
138 #endif
139
140 RETURN
141 END

  ViewVC Help
Powered by ViewVC 1.1.22