1 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F,v 1.3 2001/09/05 17:46:03 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE MOM_VI_U_CORIOLIS( |
7 |
I bi,bj,k, |
8 |
I vFld,omega3,hFacZ,r_hFacZ, |
9 |
O uCoriolisTerm, |
10 |
I myThid) |
11 |
IMPLICIT NONE |
12 |
C *==========================================================* |
13 |
C | S/R MOM_VI_U_CORIOLIS |
14 |
C | o Calculate meridional flux of vorticity at U point |
15 |
C *==========================================================* |
16 |
|
17 |
C == Global variables == |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "GRID.h" |
21 |
#include "PARAMS.h" |
22 |
|
23 |
C == Routine arguments == |
24 |
INTEGER bi,bj,K |
25 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
26 |
_RL omega3(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
27 |
_RS hFacZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
28 |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
29 |
_RL uCoriolisTerm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
30 |
INTEGER myThid |
31 |
|
32 |
C == Local variables == |
33 |
LOGICAL upwindVort3, use_original_hFac |
34 |
INTEGER I,J |
35 |
_RL vBarXY,vort3u |
36 |
_RS epsil |
37 |
PARAMETER ( upwindVort3 =.FALSE. ) |
38 |
PARAMETER ( use_original_hFac=.FALSE. ) |
39 |
|
40 |
epsil = 1. _d -9 |
41 |
|
42 |
DO J=1-Oly,sNy+Oly-1 |
43 |
DO I=2-Olx,sNx+Olx |
44 |
IF ( use_original_hFac ) THEN |
45 |
vBarXY=0.25*( |
46 |
& vFld( i , j )*dxG( i , j ,bi,bj)*hFacS( i , j ,k,bi,bj) |
47 |
& +vFld( i ,j+1)*dxG( i ,j+1,bi,bj)*hFacS( i ,j+1,k,bi,bj) |
48 |
& +vFld(i-1, j )*dxG(i-1, j ,bi,bj)*hFacS(i-1, j ,k,bi,bj) |
49 |
& +vFld(i-1,j+1)*dxG(i-1,j+1,bi,bj)*hFacS(i-1,j+1,k,bi,bj)) |
50 |
IF (upwindVort3) THEN |
51 |
IF (vBarXY.GT.0.) THEN |
52 |
vort3u=omega3(I,J)*r_hFacZ(i,j) |
53 |
ELSE |
54 |
vort3u=omega3(I,J+1)*r_hFacZ(i,j+1) |
55 |
ENDIF |
56 |
ELSE |
57 |
vort3u=0.5*(omega3(i,j)*r_hFacZ(i,j) |
58 |
& +omega3(i,j+1)*r_hFacZ(i,j+1)) |
59 |
ENDIF |
60 |
ELSE |
61 |
c-- test a different formulation (relatively to hFac) |
62 |
vBarXY=0.5*( |
63 |
& vFld( i , j )*dxG( i , j ,bi,bj)*hFacZ(i,j) |
64 |
& +vFld(i-1, j )*dxG(i-1, j ,bi,bj)*hFacZ(i,j) |
65 |
& +vFld( i ,j+1)*dxG( i ,j+1,bi,bj)*hFacZ(i,j+1) |
66 |
& +vFld(i-1,j+1)*dxG(i-1,j+1,bi,bj)*hFacZ(i,j+1) |
67 |
& )/MAX( epsil, hFacZ(i,j)+hFacZ(i,j+1) ) |
68 |
IF (upwindVort3) THEN |
69 |
IF (vBarXY.GT.0.) THEN |
70 |
vort3u=omega3(i,j) |
71 |
ELSE |
72 |
vort3u=omega3(i,j+1) |
73 |
ENDIF |
74 |
ELSE |
75 |
vort3u=0.5*(omega3(i,j)+omega3(i,j+1)) |
76 |
ENDIF |
77 |
ENDIF |
78 |
|
79 |
uCoriolisTerm(i,j)= |
80 |
& +vort3u*vBarXY*recip_dxC(i,j,bi,bj)*_maskW(i,j,k,bi,bj) |
81 |
cph *note* put these comments after end of continued line |
82 |
cph to ensure TAMC compatibility |
83 |
C high order vorticity advection term |
84 |
c & ... |
85 |
C linear Coriolis term |
86 |
c & +0.5*(fCoriG(I,J,bi,bj)+fCoriG(I,J+1,bi,bj))*vBarXY |
87 |
C full nonlinear Coriolis term |
88 |
c & +0.5*(omega3(I,J)+omega3(I,J+1))*vBarXY |
89 |
C correct energy conserving form of Coriolis term |
90 |
c & +0.5*( fCori(I ,J,bi,bj)*vBarY(I ,J,K,bi,bj) + |
91 |
c & fCori(I-1,J,bi,bj)*vBarY(I-1,J,K,bi,bj) ) |
92 |
C original form of Coriolis term (copied from calc_mom_rhs) |
93 |
c & +0.5*(fCori(i,j,bi,bj)+fCori(i-1,j,bi,bj))*vBarXY |
94 |
ENDDO |
95 |
ENDDO |
96 |
|
97 |
RETURN |
98 |
END |