1 |
jmc |
1.8 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F,v 1.7 2004/07/20 17:46:38 adcroft Exp $ |
2 |
jmc |
1.4 |
C $Name: $ |
3 |
adcroft |
1.2 |
|
4 |
adcroft |
1.7 |
#include "MOM_VECINV_OPTIONS.h" |
5 |
adcroft |
1.2 |
|
6 |
|
|
SUBROUTINE MOM_VI_U_CORIOLIS( |
7 |
jmc |
1.4 |
I bi,bj,k, |
8 |
|
|
I vFld,omega3,hFacZ,r_hFacZ, |
9 |
adcroft |
1.2 |
O uCoriolisTerm, |
10 |
|
|
I myThid) |
11 |
|
|
IMPLICIT NONE |
12 |
jmc |
1.4 |
C *==========================================================* |
13 |
|
|
C | S/R MOM_VI_U_CORIOLIS |
14 |
|
|
C | o Calculate meridional flux of vorticity at U point |
15 |
|
|
C *==========================================================* |
16 |
adcroft |
1.2 |
|
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 |
jmc |
1.4 |
_RS hFacZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
28 |
adcroft |
1.2 |
_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 |
adcroft |
1.5 |
LOGICAL use_original_hFac |
34 |
adcroft |
1.2 |
INTEGER I,J |
35 |
adcroft |
1.5 |
_RL vBarXY,vort3u,Zp,Zm |
36 |
jmc |
1.4 |
_RS epsil |
37 |
|
|
PARAMETER ( use_original_hFac=.FALSE. ) |
38 |
|
|
|
39 |
|
|
epsil = 1. _d -9 |
40 |
|
|
|
41 |
|
|
DO J=1-Oly,sNy+Oly-1 |
42 |
|
|
DO I=2-Olx,sNx+Olx |
43 |
|
|
IF ( use_original_hFac ) THEN |
44 |
adcroft |
1.2 |
vBarXY=0.25*( |
45 |
|
|
& vFld( i , j )*dxG( i , j ,bi,bj)*hFacS( i , j ,k,bi,bj) |
46 |
|
|
& +vFld( i ,j+1)*dxG( i ,j+1,bi,bj)*hFacS( i ,j+1,k,bi,bj) |
47 |
|
|
& +vFld(i-1, j )*dxG(i-1, j ,bi,bj)*hFacS(i-1, j ,k,bi,bj) |
48 |
|
|
& +vFld(i-1,j+1)*dxG(i-1,j+1,bi,bj)*hFacS(i-1,j+1,k,bi,bj)) |
49 |
adcroft |
1.5 |
IF (upwindVorticity) THEN |
50 |
adcroft |
1.2 |
IF (vBarXY.GT.0.) THEN |
51 |
|
|
vort3u=omega3(I,J)*r_hFacZ(i,j) |
52 |
|
|
ELSE |
53 |
|
|
vort3u=omega3(I,J+1)*r_hFacZ(i,j+1) |
54 |
|
|
ENDIF |
55 |
|
|
ELSE |
56 |
jmc |
1.4 |
vort3u=0.5*(omega3(i,j)*r_hFacZ(i,j) |
57 |
|
|
& +omega3(i,j+1)*r_hFacZ(i,j+1)) |
58 |
adcroft |
1.2 |
ENDIF |
59 |
adcroft |
1.5 |
ELSEIF ( SadournyCoriolis ) THEN |
60 |
|
|
Zm=0.5*( |
61 |
|
|
& vFld( i , j )*dxG( i , j ,bi,bj)*hFacS( i , j ,k,bi,bj) |
62 |
|
|
& +vFld(i-1, j )*dxG(i-1, j ,bi,bj)*hFacS(i-1, j ,k,bi,bj) ) |
63 |
|
|
Zp=0.5*( |
64 |
|
|
& vFld( i ,j+1)*dxG( i ,j+1,bi,bj)*hFacS( i ,j+1,k,bi,bj) |
65 |
|
|
& +vFld(i-1,j+1)*dxG(i-1,j+1,bi,bj)*hFacS(i-1,j+1,k,bi,bj) ) |
66 |
|
|
IF (upwindVorticity) THEN |
67 |
|
|
IF ( (Zm+Zp) .GT.0.) THEN |
68 |
|
|
vort3u=Zm*r_hFacZ(i, j )*omega3(i, j ) |
69 |
|
|
ELSE |
70 |
|
|
vort3u=Zp*r_hFacZ(i,j+1)*omega3(i,j+1) |
71 |
|
|
ENDIF |
72 |
|
|
ELSE |
73 |
|
|
Zm=Zm*r_hFacZ(i, j )*omega3(i, j ) |
74 |
|
|
Zp=Zp*r_hFacZ(i,j+1)*omega3(i,j+1) |
75 |
|
|
vort3u=0.5*( Zm + Zp ) |
76 |
|
|
ENDIF |
77 |
|
|
vBarXY=1. |
78 |
jmc |
1.4 |
ELSE |
79 |
|
|
c-- test a different formulation (relatively to hFac) |
80 |
|
|
vBarXY=0.5*( |
81 |
|
|
& vFld( i , j )*dxG( i , j ,bi,bj)*hFacZ(i,j) |
82 |
|
|
& +vFld(i-1, j )*dxG(i-1, j ,bi,bj)*hFacZ(i,j) |
83 |
|
|
& +vFld( i ,j+1)*dxG( i ,j+1,bi,bj)*hFacZ(i,j+1) |
84 |
|
|
& +vFld(i-1,j+1)*dxG(i-1,j+1,bi,bj)*hFacZ(i,j+1) |
85 |
|
|
& )/MAX( epsil, hFacZ(i,j)+hFacZ(i,j+1) ) |
86 |
adcroft |
1.5 |
IF (upwindVorticity) THEN |
87 |
jmc |
1.4 |
IF (vBarXY.GT.0.) THEN |
88 |
|
|
vort3u=omega3(i,j) |
89 |
|
|
ELSE |
90 |
|
|
vort3u=omega3(i,j+1) |
91 |
|
|
ENDIF |
92 |
|
|
ELSE |
93 |
|
|
vort3u=0.5*(omega3(i,j)+omega3(i,j+1)) |
94 |
|
|
ENDIF |
95 |
|
|
ENDIF |
96 |
adcroft |
1.5 |
|
97 |
adcroft |
1.6 |
IF (useJamartMomAdv) |
98 |
adcroft |
1.5 |
& vBarXY = vBarXY * 4. _d 0 * hFacW(i,j,k,bi,bj) |
99 |
jmc |
1.8 |
& / MAX( epsil, hFacS( i , j ,k,bi,bj)+hFacS(i-1, j ,k,bi,bj) |
100 |
adcroft |
1.5 |
& +hFacS( j ,i+1,k,bi,bj)+hFacS(i-1,j+1,k,bi,bj) ) |
101 |
jmc |
1.4 |
|
102 |
|
|
uCoriolisTerm(i,j)= |
103 |
|
|
& +vort3u*vBarXY*recip_dxC(i,j,bi,bj)*_maskW(i,j,k,bi,bj) |
104 |
heimbach |
1.3 |
cph *note* put these comments after end of continued line |
105 |
|
|
cph to ensure TAMC compatibility |
106 |
adcroft |
1.2 |
C high order vorticity advection term |
107 |
heimbach |
1.3 |
c & ... |
108 |
adcroft |
1.2 |
C linear Coriolis term |
109 |
|
|
c & +0.5*(fCoriG(I,J,bi,bj)+fCoriG(I,J+1,bi,bj))*vBarXY |
110 |
|
|
C full nonlinear Coriolis term |
111 |
|
|
c & +0.5*(omega3(I,J)+omega3(I,J+1))*vBarXY |
112 |
|
|
C correct energy conserving form of Coriolis term |
113 |
|
|
c & +0.5*( fCori(I ,J,bi,bj)*vBarY(I ,J,K,bi,bj) + |
114 |
|
|
c & fCori(I-1,J,bi,bj)*vBarY(I-1,J,K,bi,bj) ) |
115 |
|
|
C original form of Coriolis term (copied from calc_mom_rhs) |
116 |
|
|
c & +0.5*(fCori(i,j,bi,bj)+fCori(i-1,j,bi,bj))*vBarXY |
117 |
|
|
ENDDO |
118 |
jmc |
1.4 |
ENDDO |
119 |
adcroft |
1.2 |
|
120 |
|
|
RETURN |
121 |
|
|
END |