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

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

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


Revision 1.5 - (hide annotations) (download)
Thu Oct 9 04:19:18 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint52d_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52k_post, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint52b_pre, checkpoint51l_pre, checkpoint52m_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint53c_post, checkpoint51r_post, checkpoint51i_post, checkpoint53a_post, checkpoint52d_post, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint53f_post, checkpoint52j_post, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint51o_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint53d_pre, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.4: +2 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 edhill 1.5 C $Header: /u/u3/gcmpack/MITgcm/model/src/integr_continuity.F,v 1.4.4.1 2003/10/02 18:10:45 edhill Exp $
2 jmc 1.1 C $Name: $
3    
4 edhill 1.5 #include "PACKAGES_CONFIG.h"
5 jmc 1.1 #include "CPP_OPTIONS.h"
6    
7     CBOP
8     C !ROUTINE: INTEGR_CONTINUITY
9     C !INTERFACE:
10     SUBROUTINE INTEGR_CONTINUITY(
11     I bi, bj, uFld, vFld,
12     I myTime, myIter, myThid )
13     C !DESCRIPTION: \bv
14     C *==========================================================*
15     C | SUBROUTINE INTEGR_CONTINUITY
16     C | o Integrate the continuity Eq : compute vertical velocity
17     C | and free surface "r-anomaly" (etaN) to satisfy
18     C | exactly the convervation of the Total Volume
19     C *==========================================================*
20     C \ev
21    
22     C !USES:
23     IMPLICIT NONE
24     C == Global variables
25     #include "SIZE.h"
26     #include "EEPARAMS.h"
27     #include "PARAMS.h"
28     #include "DYNVARS.h"
29     #include "GRID.h"
30     #include "SURFACE.h"
31     #include "FFIELDS.h"
32    
33     C !INPUT/OUTPUT PARAMETERS:
34     C == Routine arguments ==
35     C uFld :: Zonal velocity ( m/s )
36     C vFld :: Meridional velocity ( m/s )
37     C bi,bj :: tile index
38     C myTime :: Current time in simulation
39     C myIter :: Current iteration number in simulation
40     C myThid :: Thread number for this instance of the routine.
41     _RL myTime
42     INTEGER myIter
43     INTEGER myThid
44     INTEGER bi,bj
45     LOGICAL UpdateEtaN_EtaH
46     _RL uFld(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
47     _RL vFld(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
48    
49     C !LOCAL VARIABLES:
50     C Local variables in common block
51    
52     C Local variables
53     C i,j,k :: Loop counters
54     C uTrans :: Volume transports ( uVel.xA )
55     C vTrans :: Volume transports ( vVel.yA )
56     INTEGER i,j,k
57     _RL uTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
58     _RL vTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
59 jmc 1.3 _RL wSurf, facEmP
60 jmc 1.1 CEOP
61    
62     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
63    
64     #ifdef EXACT_CONSERV
65     IF (exactConserv) THEN
66    
67     C-- Compute the Divergence of The Barotropic Flow :
68    
69     C- Initialise
70     DO j=1-Oly,sNy+Oly
71     DO i=1-Olx,sNx+Olx
72     hDivFlow(i,j,bi,bj) = 0. _d 0
73     utrans(i,j) = 0. _d 0
74     vtrans(i,j) = 0. _d 0
75     ENDDO
76     ENDDO
77    
78     DO k=1,Nr
79    
80     C- Calculate velocity field "volume transports" through tracer cell faces
81     DO j=1,sNy+1
82     DO i=1,sNx+1
83     uTrans(i,j) = uFld(i,j,k,bi,bj)*_dyG(i,j,bi,bj)
84     & *drF(k)*_hFacW(i,j,k,bi,bj)
85     vTrans(i,j) = vFld(i,j,k,bi,bj)*_dxG(i,j,bi,bj)
86     & *drF(k)*_hFacS(i,j,k,bi,bj)
87     ENDDO
88     ENDDO
89    
90     C- Integrate vertically the Horizontal Divergence
91     DO j=1,sNy
92     DO i=1,sNx
93     hDivFlow(i,j,bi,bj) = hDivFlow(i,j,bi,bj)
94     & +maskC(i,j,k,bi,bj)*( uTrans(i+1,j)-uTrans(i,j)
95     & +vTrans(i,j+1)-vTrans(i,j) )
96     ENDDO
97     ENDDO
98    
99     C- End DO k=1,Nr
100     ENDDO
101    
102     ENDIF
103    
104     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
105    
106     IF (exactConserv .AND. myTime.NE.startTime) THEN
107     C-- Update etaN at the end of the time step :
108     C Incorporate the Implicit part of -Divergence(Barotropic_Flow)
109    
110     IF (implicDiv2Dflow.EQ. 0. _d 0) THEN
111     DO j=1-Oly,sNy+Oly
112     DO i=1-Olx,sNx+Olx
113     etaN(i,j,bi,bj) = etaH(i,j,bi,bj)
114     ENDDO
115     ENDDO
116     ELSEIF (useRealFreshWaterFlux) THEN
117     DO j=1,sNy
118     DO i=1,sNx
119     etaN(i,j,bi,bj) = etaH(i,j,bi,bj)
120     & - implicDiv2Dflow*( convertEmP2rUnit*EmPmR(i,j,bi,bj)
121     & +hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)
122     & )*deltaTfreesurf
123     ENDDO
124     ENDDO
125     ELSE
126     DO j=1,sNy
127     DO i=1,sNx
128     etaN(i,j,bi,bj) = etaH(i,j,bi,bj)
129     & - implicDiv2Dflow*hDivFlow(i,j,bi,bj)
130     & *recip_rA(i,j,bi,bj)*deltaTfreesurf
131     ENDDO
132     ENDDO
133     ENDIF
134    
135     ENDIF
136 jmc 1.3
137     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
138    
139     #ifdef NONLIN_FRSURF
140     IF (select_rStar .NE. 0) THEN
141     facEmP = 0.
142     IF (useRealFreshWaterFlux) facEmP = convertEmP2rUnit
143    
144     IF ( useRealFreshWaterFlux .AND. myTime.EQ.startTime ) THEN
145     C needs previous time-step value of E-P-R, that has not been loaded
146     C and was not in pickup-file ; try to use etaN & etaH instead.
147     DO j=1,sNy
148     DO i=1,sNx
149     rStarDhCDt(i,j,bi,bj) =
150     & ( etaN(i,j,bi,bj)-etaH(i,j,bi,bj) )
151     & /(implicDiv2Dflow*deltaTfreesurf)
152     & * recip_Rcol(i,j,bi,bj)
153     ENDDO
154     ENDDO
155     ELSE
156     DO j=1,sNy
157     DO i=1,sNx
158     rStarDhCDt(i,j,bi,bj) =
159     & (-hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)
160     & -facEmP*EmPmR(i,j,bi,bj)
161     & ) * recip_Rcol(i,j,bi,bj)
162     ENDDO
163     ENDDO
164     ENDIF
165    
166     ENDIF
167     #endif /* NONLIN_FRSURF */
168 jmc 1.4 #endif /* EXACT_CONSERV */
169 jmc 1.1
170     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
171    
172     DO k=Nr,1,-1
173     C-- Integrate continuity vertically for vertical velocity
174    
175     CALL INTEGRATE_FOR_W(
176     I bi, bj, k, uFld, vFld,
177     O wVel,
178     I myThid )
179    
180 jmc 1.4 #if ( defined EXACT_CONSERV && defined NONLIN_FRSURF )
181 jmc 1.2 IF ( k.EQ.Nr .AND. myTime.NE. 0. _d 0 .AND.
182     & useRealFreshWaterFlux .AND.
183     & buoyancyRelation .EQ. 'OCEANICP' ) THEN
184    
185     IF ( myTime.NE.startTime ) THEN
186     DO j=1,sNy
187     DO i=1,sNx
188     wVel(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)
189     & -convertEmP2rUnit*EmPmR(i,j,bi,bj)*maskC(i,j,k,bi,bj)
190     ENDDO
191     ENDDO
192     ELSEIF (nonlinFreeSurf.GE.0) THEN
193     C needs previous time-step value of E-P-R, that has not been loaded
194     C and was not in pickup-file ; try to use etaN & etaH instead.
195     DO j=1,sNy
196     DO i=1,sNx
197     wSurf = hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)
198     & + (etaN(i,j,bi,bj)-etaH(i,j,bi,bj))
199     & /(implicDiv2Dflow*deltaTfreesurf)
200     wVel(i,j,k,bi,bj) = wVel(i,j,k,bi,bj)
201     & + wSurf*maskC(i,j,k,bi,bj)
202     ENDDO
203     ENDDO
204     ENDIF
205    
206     ENDIF
207 jmc 1.4 #endif /* EXACT_CONSERV & NONLIN_FRSURF */
208 jmc 1.2
209 jmc 1.1 #ifdef ALLOW_OBCS
210     #ifdef ALLOW_NONHYDROSTATIC
211     C-- Apply OBC to W if in N-H mode
212     IF (useOBCS.AND.nonHydrostatic) THEN
213     CALL OBCS_APPLY_W( bi, bj, k, wVel, myThid )
214     ENDIF
215     #endif /* ALLOW_NONHYDROSTATIC */
216     #endif /* ALLOW_OBCS */
217    
218     C- End DO k=Nr,1,-1
219     ENDDO
220    
221     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
222    
223     RETURN
224     END

  ViewVC Help
Powered by ViewVC 1.1.22