1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/mom_vecinv/Attic/mom_vi_calc_ke.F,v 1.1.2.1 2001/03/30 21:13:33 adcroft Exp $ |
2 |
C $Name: pre38-close $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE MOM_VI_CALC_KE( |
7 |
I bi,bj,k, |
8 |
I uFld, vFld, |
9 |
O KE, |
10 |
I myThid) |
11 |
IMPLICIT NONE |
12 |
C |
13 |
C Calculate Kinetic Energy, KE, with units (m/s)^2 |
14 |
C - assumes hydrostatic formulation only |
15 |
C |
16 |
|
17 |
C == Global variables == |
18 |
#include "SIZE.h" |
19 |
#include "GRID.h" |
20 |
|
21 |
C == Routine arguments == |
22 |
INTEGER bi,bj,k |
23 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
24 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
25 |
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
26 |
INTEGER myThid |
27 |
|
28 |
C == Local variables == |
29 |
INTEGER I,J |
30 |
|
31 |
DO J=1-OLy,sNy+OLy-1 |
32 |
DO I=1-OLx,sNx+OLx-1 |
33 |
|
34 |
C This defn of KE should not ever be used. Just to let you know. |
35 |
C 2 2 |
36 |
C 1 / ___I ___J \ |
37 |
C KE = --- | U + V | |
38 |
C 2 \ / |
39 |
C |
40 |
c KE(i,j) = 0.125*( |
41 |
c & ( uFld(i,j)+uFld(i+1, j ) )**2 |
42 |
c & +( vFld(i,j)+vFld( i ,j+1) )**2 ) |
43 |
|
44 |
C This defn of KE should be used for the vector invariant equations. |
45 |
C _____I _____J |
46 |
C 1 / 2 2 \ |
47 |
C KE = --- | U + V | |
48 |
C 2 \ / |
49 |
C |
50 |
KE(i,j) = 0.25*( |
51 |
& uFld( i , j )*uFld( i , j ) |
52 |
& +uFld(i+1, j )*uFld(i+1, j ) |
53 |
& +vFld( i , j )*vFld( i , j ) |
54 |
& +vFld( i ,j+1)*vFld( i ,j+1) ) |
55 |
|
56 |
C As above but including the lopping factors and should be used |
57 |
C for the conservative form of the momentum equations. |
58 |
c KE(i,j) = 0.25*( |
59 |
c & uFld( i , j )*uFld( i , j )*hFacW(i,j,k,bi,bj) |
60 |
c & +uFld(i+1, j )*uFld(i+1, j )*hFacW(i+1,j,k,bi,bj) |
61 |
c & +vFld( i , j )*vFld( i , j )*hFacS(i,j,k,bi,bj) |
62 |
c & +vFld( i ,j+1)*vFld( i ,j+1)*hFacS(i,j+1,k,bi,bj) |
63 |
c & ) |
64 |
c & *recip_hFacC(i,j,k,bi,bj) |
65 |
|
66 |
ENDDO |
67 |
ENDDO |
68 |
|
69 |
RETURN |
70 |
END |