/[MITgcm]/MITgcm/model/src/the_correction_step.F
ViewVC logotype

Annotation of /MITgcm/model/src/the_correction_step.F

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


Revision 1.30 - (hide annotations) (download)
Tue Jan 9 20:08:03 2007 UTC (17 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.29: +1 -1 lines
FILE REMOVED
usePickupBeforeC35 no longer supported ; remove this option.

1 jmc 1.30 C $Header: /u/gcmpack/MITgcm/model/src/the_correction_step.F,v 1.29 2005/04/15 14:06:14 jmc Exp $
2 edhill 1.24 C $Name: $
3 adcroft 1.2
4 edhill 1.24 #include "PACKAGES_CONFIG.h"
5 adcroft 1.2 #include "CPP_OPTIONS.h"
6    
7 cnh 1.14 CBOP
8     C !ROUTINE: THE_CORRECTION_STEP
9     C !INTERFACE:
10 adcroft 1.2 SUBROUTINE THE_CORRECTION_STEP(myTime, myIter, myThid)
11 cnh 1.14 C !DESCRIPTION: \bv
12     C *==========================================================*
13     C | SUBROUTINE THE_CORRECTION_STEP
14     C *==========================================================*
15     C |1rst Part : Update U,V,T,S.
16     C |
17     C | The arrays used for time stepping are cycled.
18     C | Tracers:
19 jmc 1.21 C | T(n) = Gt(n)
20 cnh 1.14 C | Momentum:
21 jmc 1.21 C | V(n) = Gv(n) - dt * grad Eta
22 cnh 1.14 C |
23     C |part1: update U,V,T,S
24 jmc 1.21 C | U*,V* (contained in gU,gV) have the surface
25 cnh 1.14 C | pressure gradient term added and the result stored
26     C | in U,V (contained in uVel, vVel)
27 jmc 1.19 C | T* (contained in gT) is copied to T (theta)
28     C | S* (contained in gS) is copied to S (salt)
29 cnh 1.14 C |
30 jmc 1.19 C |part2: Adjustments & Diagnostics
31 cnh 1.14 C | o Convective Adjustment
32     C *==========================================================*
33     C \ev
34    
35     C !USES:
36 adcroft 1.2 IMPLICIT NONE
37     C == Global variables ===
38     #include "SIZE.h"
39     #include "EEPARAMS.h"
40     #include "PARAMS.h"
41     #include "DYNVARS.h"
42 jmc 1.16
43 cnh 1.14 C !INPUT/OUTPUT PARAMETERS:
44 adcroft 1.2 C == Routine arguments ==
45     C myTime - Current time in simulation
46     C myIter - Current iteration number in simulation
47     C myThid - Thread number for this instance of the routine.
48     _RL myTime
49     INTEGER myIter
50     INTEGER myThid
51    
52 cnh 1.14 C !LOCAL VARIABLES:
53 adcroft 1.2 C == Local variables
54 jmc 1.6 _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55     _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
56 adcroft 1.2 INTEGER iMin,iMax
57     INTEGER jMin,jMax
58     INTEGER bi,bj
59     INTEGER k,i,j
60    
61 cnh 1.14 CEOP
62 adcroft 1.9
63 adcroft 1.2 DO bj=myByLo(myThid),myByHi(myThid)
64     DO bi=myBxLo(myThid),myBxHi(myThid)
65 heimbach 1.7
66 adcroft 1.2 C-- Set up work arrays that need valid initial values
67     DO j=1-OLy,sNy+OLy
68     DO i=1-OLx,sNx+OLx
69 jmc 1.6 phiSurfX(i,j)=0.
70     phiSurfY(i,j)=0.
71 adcroft 1.2 ENDDO
72     ENDDO
73    
74     C Loop range: Gradients of Eta are evaluated so valid
75     C range is all but first row and column in overlaps.
76     iMin = 1-OLx+1
77     iMax = sNx+OLx
78     jMin = 1-OLy+1
79     jMax = sNy+OLy
80    
81 jmc 1.6 C- Calculate gradient of surface Potentiel
82     CALL CALC_GRAD_PHI_SURF(
83 adcroft 1.2 I bi,bj,iMin,iMax,jMin,jMax,
84 jmc 1.5 I etaN,
85 jmc 1.6 O phiSurfX,phiSurfY,
86 adcroft 1.2 I myThid )
87    
88     C-- Loop over all layers, top to bottom
89     DO K=1,Nr
90    
91     C- Update velocity fields: V(n) = V** - dt * grad Eta
92 adcroft 1.3 IF (momStepping)
93     & CALL CORRECTION_STEP(
94 adcroft 1.2 I bi,bj,iMin,iMax,jMin,jMax,K,
95 jmc 1.6 I phiSurfX,phiSurfY,myTime,myThid )
96 adcroft 1.2
97 jmc 1.29 C- Update tracer fields: T(n) = T**
98 adcroft 1.2 IF (tempStepping)
99     & CALL CYCLE_TRACER(
100 jmc 1.29 I bi,bj,K,
101     U theta,gT,
102     I myTime,myIter,myThid )
103 adcroft 1.2 IF (saltStepping)
104     & CALL CYCLE_TRACER(
105 jmc 1.29 I bi,bj,K,
106     U salt,gS,
107     I myTime,myIter,myThid )
108 adcroft 1.2
109     #ifdef ALLOW_OBCS
110     IF (useOBCS) THEN
111     CALL OBCS_APPLY_UV(bi,bj,K,uVel,vVel,myThid)
112     ENDIF
113     #endif /* ALLOW_OBCS */
114    
115     C-- End DO K=1,Nr
116     ENDDO
117    
118 adcroft 1.9 C--- 2nd Part : Adjustment.
119     C
120     C Static stability is calculated and the tracers are
121     C convective adjusted where statically unstable.
122    
123 adcroft 1.2 C-- Convectively adjust new fields to be statically stable
124 mlosch 1.20 iMin = 1
125     iMax = sNx
126     jMin = 1
127     jMax = sNy
128 mlosch 1.25 CALL CONVECTIVE_ADJUSTMENT(
129     I bi, bj, iMin, iMax, jMin, jMax,
130     I myTime, myIter, myThid )
131 adcroft 1.2
132 jmc 1.28 C-- End of 1rst bi,bj loop
133 adcroft 1.2 ENDDO
134     ENDDO
135    
136     RETURN
137     END

  ViewVC Help
Powered by ViewVC 1.1.22