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

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

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


Revision 1.5 - (show annotations) (download)
Mon May 24 15:15:15 2004 UTC (20 years ago) by adcroft
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Combined mom_vi_calc_ke.F and mom_calc_ke.F into mom_common/mom_calc_ke.F
 - they use different discretizations so a s/r argument is used to distinguish

1 C $Header: /u/gcmpack/MITgcm/pkg/mom_fluxform/mom_calc_ke.F,v 1.4 2003/10/09 04:19:20 edhill Exp $
2 C $Name: $
3
4 #include "MOM_FLUXFORM_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,
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 uFld :: zonal flow
31 C vFld :: meridional flow
32 C myThid :: thread number
33 INTEGER bi,bj,k
34 _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
35 _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
36 INTEGER myThid
37
38 C !OUTPUT PARAMETERS: ==================================================
39 C KE :: Kinetic energy
40 _RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41
42 C !LOCAL VARIABLES: ====================================================
43 C i,j :: loop indices
44 INTEGER I,J
45 CEOP
46
47 DO J=1-OLy,sNy+OLy-1
48 DO I=1-OLx,sNx+OLx-1
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 c KE(i,j) = 0.125*(
57 c & ( uFld(i,j)+uFld(i+1, j ) )**2
58 c & +( vFld(i,j)+vFld( i ,j+1) )**2 )
59
60 C This defn of KE should be used for the vector invariant equations.
61 C _____I _____J
62 C 1 / 2 2 \
63 C KE = --- | U + V |
64 C 2 \ /
65 C
66 c KE(i,j) = 0.25*(
67 c & uFld( i , j )*uFld( i , j )
68 c & +uFld(i+1, j )*uFld(i+1, j )
69 c & +vFld( i , j )*vFld( i , j )
70 c & +vFld( i ,j+1)*vFld( i ,j+1) )
71
72 C As above but including the lopping factors and should be used
73 C for the conservative form of the momentum equations.
74 KE(i,j) = 0.25*(
75 & uFld( i , j )*uFld( i , j )*hFacW(i,j,k,bi,bj)
76 & +uFld(i+1, j )*uFld(i+1, j )*hFacW(i+1,j,k,bi,bj)
77 & +vFld( i , j )*vFld( i , j )*hFacS(i,j,k,bi,bj)
78 & +vFld( i ,j+1)*vFld( i ,j+1)*hFacS(i,j+1,k,bi,bj)
79 & )
80 & *recip_hFacC(i,j,k,bi,bj)
81
82 ENDDO
83 ENDDO
84
85 RETURN
86 END

  ViewVC Help
Powered by ViewVC 1.1.22