/[MITgcm]/MITgcm/pkg/mom_common/mom_calc_ke.F
ViewVC logotype

Contents of /MITgcm/pkg/mom_common/mom_calc_ke.F

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


Revision 1.4 - (show annotations) (download)
Wed Jun 7 01:55:14 2006 UTC (17 years, 11 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint58r_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58i_post, checkpoint58o_post, 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, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58m_post
Changes since 1.3: +16 -11 lines
Modifications for bottom topography control
o replace hFacC by _hFacC at various places
o replace ALLOW_HFACC_CONTROL by ALLOW_DEPTH_CONTROL
o add non-self-adjoint cg2d_nsa
o update autodiff support routines
o re-initialise hfac after ctrl_depth_ini
o works for 5x5 box, doesnt work for global_ocean.90x40x15

1 C $Header: /u/gcmpack/MITgcm/pkg/mom_common/mom_calc_ke.F,v 1.3 2005/09/23 19:16:25 jmc Exp $
2 C $Name: $
3
4 #include "MOM_COMMON_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: MOM_CALC_KE
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE MOM_CALC_KE(
11 I bi,bj,k,KEscheme,
12 I uFld, vFld,
13 O KE,
14 I myThid)
15
16 C !DESCRIPTION:
17 C Calculates the Kinetic energy of horizontal flow
18 C \begin{equation*}
19 C KE = \frac{1}{2} \left( h_w \overline{u^2}^i + h_s \overline{v^2}^j \right)
20 C \end{equation*}
21
22 C !USES: ===============================================================
23 IMPLICIT NONE
24 #include "SIZE.h"
25 #include "GRID.h"
26
27 C !INPUT PARAMETERS: ===================================================
28 C bi,bj :: tile indices
29 C k :: vertical level
30 C KEscheme :: spacial discretisation scheme for KE
31 C uFld :: zonal flow
32 C vFld :: meridional flow
33 C KE :: Kinetic Energy
34 C myThid :: thread number
35 INTEGER bi,bj,k
36 _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
37 _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
38 INTEGER KEscheme
39 INTEGER myThid
40
41 C !OUTPUT PARAMETERS: ==================================================
42 C KE :: Kinetic energy
43 _RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44
45 C !LOCAL VARIABLES: ====================================================
46 C i,j :: loop indices
47 INTEGER I,J
48 CEOP
49
50 C This defn of KE should not ever be used. Just to let you know.
51 C 2 2
52 C 1 / ___I ___J \
53 C KE = --- | U + V |
54 C 2 \ /
55 C
56 IF (KEscheme.EQ.-1) THEN
57 DO J=1-OLy,sNy+OLy-1
58 DO I=1-OLx,sNx+OLx-1
59 KE(i,j) = 0.125*(
60 & ( uFld(i,j)+uFld(i+1, j ) )**2
61 & +( vFld(i,j)+vFld( i ,j+1) )**2 )
62 ENDDO
63 ENDDO
64
65 ELSEIF (KEscheme.EQ.0) THEN
66 C This defn of KE should be used for the vector invariant equations.
67 C _____I _____J
68 C 1 / 2 2 \
69 C KE = --- | U + V |
70 C 2 \ /
71 C
72 DO J=1-OLy,sNy+OLy-1
73 DO I=1-OLx,sNx+OLx-1
74 KE(i,j) = 0.25*(
75 & ( uFld( i , j )*uFld( i , j )
76 & +uFld(i+1, j )*uFld(i+1, j ) )
77 & + ( vFld( i , j )*vFld( i , j )
78 & +vFld( i ,j+1)*vFld( i ,j+1) )
79 & )
80 ENDDO
81 ENDDO
82
83 ELSEIF (KEscheme.EQ.1) THEN
84 C As above but including the area
85 DO J=1-OLy,sNy+OLy-1
86 DO I=1-OLx,sNx+OLx-1
87 KE(i,j) = 0.25*(
88 & ( uFld(i, j )*uFld(i, j )*rAw(i ,j, bi,bj)
89 & +uFld(i+1,j)*uFld(i+1,j)*rAw(i+1,j,bi,bj) )
90 & + ( vFld(i, j )*vFld(i, j )*rAs(i ,j, bi,bj)
91 & +vFld(i,j+1)*vFld(i,j+1)*rAs(i,j+1,bi,bj) )
92 & )*recip_rA(i,j,bi,bj)
93 ENDDO
94 ENDDO
95
96 ELSEIF (KEscheme.EQ.2) THEN
97 C As KEscheme=0 but including the lopping factors and should be used
98 C for the conservative form of the momentum equations.
99 DO J=1-OLy,sNy+OLy-1
100 DO I=1-OLx,sNx+OLx-1
101 KE(i,j) = 0.25*(
102 & ( uFld( i , j )*uFld( i , j )*_hFacW(i,j,k,bi,bj)
103 & +uFld(i+1, j )*uFld(i+1, j )*_hFacW(i+1,j,k,bi,bj) )
104 & + ( vFld( i , j )*vFld( i , j )*_hFacS(i,j,k,bi,bj)
105 & +vFld( i ,j+1)*vFld( i ,j+1)*_hFacS(i,j+1,k,bi,bj) )
106 & )*_recip_hFacC(i,j,k,bi,bj)
107 ENDDO
108 ENDDO
109
110 ELSEIF (KEscheme.EQ.3) THEN
111 C As above but including the area
112 DO J=1-OLy,sNy+OLy-1
113 DO I=1-OLx,sNx+OLx-1
114 KE(i,j) = 0.25*(
115 & (
116 & uFld(i, j )*uFld(i, j )
117 & *_hFacW(i ,j, k,bi,bj)*rAw(i ,j, bi,bj)
118 & +uFld(i+1,j)*uFld(i+1,j)
119 & *_hFacW(i+1,j,k,bi,bj)*rAw(i+1,j,bi,bj)
120 & )
121 & + (
122 & vFld(i, j )*vFld(i, j )
123 & *_hFacS(i, j, k,bi,bj)*rAs(i ,j, bi,bj)
124 & +vFld(i,j+1)*vFld(i,j+1)
125 & *_hFacS(i,j+1,k,bi,bj)*rAs(i,j+1,bi,bj)
126 & ) )*_recip_hFacC(i,j,k,bi,bj)
127 & * recip_rA(i,j,bi,bj)
128 ENDDO
129 ENDDO
130
131 ELSE
132 STOP 'S/R MOM_CALC_KE: We should never reach this point!'
133 ENDIF
134
135 RETURN
136 END

  ViewVC Help
Powered by ViewVC 1.1.22