1 |
jmc |
1.9 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_vecinv/mom_vi_v_coriolis.F,v 1.8 2005/04/28 14:57:22 jmc 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 |
jmc |
1.9 |
SUBROUTINE MOM_VI_V_CORIOLIS( |
7 |
jmc |
1.4 |
I bi,bj,k, |
8 |
|
|
I uFld,omega3,hFacZ,r_hFacZ, |
9 |
adcroft |
1.2 |
O vCoriolisTerm, |
10 |
|
|
I myThid) |
11 |
|
|
IMPLICIT NONE |
12 |
jmc |
1.4 |
C *==========================================================* |
13 |
|
|
C | S/R MOM_VI_V_CORIOLIS |
14 |
|
|
C | o Calculate zonal flux of vorticity at V 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 |
jmc |
1.4 |
INTEGER bi,bj,k |
25 |
adcroft |
1.2 |
_RL uFld(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 vCoriolisTerm(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 uBarXY,vort3v,Zp,Zm |
36 |
jmc |
1.4 |
_RS epsil |
37 |
|
|
PARAMETER ( use_original_hFac=.FALSE. ) |
38 |
|
|
|
39 |
|
|
epsil = 1. _d -9 |
40 |
|
|
|
41 |
|
|
DO J=2-Oly,sNy+Oly |
42 |
|
|
DO I=1-Olx,sNx+Olx-1 |
43 |
|
|
IF ( use_original_hFac ) THEN |
44 |
adcroft |
1.2 |
uBarXY=0.25*( |
45 |
jmc |
1.9 |
& (uFld( i , j )*dyG( i , j ,bi,bj)*hFacW( i , j ,k,bi,bj) |
46 |
|
|
& +uFld( i ,j-1)*dyG( i ,j-1,bi,bj)*hFacW( i ,j-1,k,bi,bj)) |
47 |
|
|
& +(uFld(i+1, j )*dyG(i+1, j ,bi,bj)*hFacW(i+1, j ,k,bi,bj) |
48 |
|
|
& +uFld(i+1,j-1)*dyG(i+1,j-1,bi,bj)*hFacW(i+1,j-1,k,bi,bj))) |
49 |
adcroft |
1.5 |
IF (upwindVorticity) THEN |
50 |
adcroft |
1.2 |
IF (uBarXY.GT.0.) THEN |
51 |
|
|
vort3v=omega3(i,j)*r_hFacZ(i,j) |
52 |
|
|
ELSE |
53 |
|
|
vort3v=omega3(i+1,j)*r_hFacZ(i+1,j) |
54 |
|
|
ENDIF |
55 |
|
|
ELSE |
56 |
jmc |
1.4 |
vort3v=0.5*(omega3(i,j)*r_hFacZ(i,j) |
57 |
|
|
& +omega3(i+1,j)*r_hFacZ(i+1,j)) |
58 |
adcroft |
1.2 |
ENDIF |
59 |
adcroft |
1.5 |
ELSEIF ( SadournyCoriolis ) THEN |
60 |
|
|
Zm=0.5*( |
61 |
|
|
& uFld( i , j )*dyG( i , j ,bi,bj)*hFacW( i , j ,k,bi,bj) |
62 |
|
|
& +uFld( i ,j-1)*dyG( i ,j-1,bi,bj)*hFacW( i ,j-1,k,bi,bj) ) |
63 |
|
|
Zp=0.5*( |
64 |
|
|
& uFld(i+1, j )*dyG(i+1, j ,bi,bj)*hFacW(i+1, j ,k,bi,bj) |
65 |
|
|
& +uFld(i+1,j-1)*dyG(i+1,j-1,bi,bj)*hFacW(i+1,j-1,k,bi,bj) ) |
66 |
|
|
IF (upwindVorticity) THEN |
67 |
|
|
IF ( (Zm+Zp) .GT.0.) THEN |
68 |
|
|
vort3v=Zm*r_hFacZ( i ,j)*omega3( i ,j) |
69 |
|
|
ELSE |
70 |
|
|
vort3v=Zp*r_hFacZ(i+1,j)*omega3(i+1,j) |
71 |
|
|
ENDIF |
72 |
|
|
ELSE |
73 |
|
|
Zm=Zm*r_hFacZ( i ,j)*omega3( i ,j) |
74 |
|
|
Zp=Zp*r_hFacZ(i+1,j)*omega3(i+1,j) |
75 |
|
|
vort3v=0.5*( Zm + Zp ) |
76 |
|
|
ENDIF |
77 |
|
|
uBarXY=1. |
78 |
jmc |
1.4 |
ELSE |
79 |
|
|
c-- test a different formulation (relatively to hFac) |
80 |
|
|
uBarXY=0.5*( |
81 |
jmc |
1.9 |
& (uFld( i , j )*dyG( i , j ,bi,bj)*hFacZ(i,j) |
82 |
|
|
& +uFld( i ,j-1)*dyG( i ,j-1,bi,bj)*hFacZ(i,j) ) |
83 |
|
|
& +(uFld(i+1, j )*dyG(i+1, j ,bi,bj)*hFacZ(i+1,j) |
84 |
|
|
& +uFld(i+1,j-1)*dyG(i+1,j-1,bi,bj)*hFacZ(i+1,j)) |
85 |
jmc |
1.4 |
& )/MAX( epsil, hFacZ(i,j)+hFacZ(i+1,j) ) |
86 |
adcroft |
1.5 |
IF (upwindVorticity) THEN |
87 |
jmc |
1.4 |
IF (uBarXY.GT.0.) THEN |
88 |
|
|
vort3v=omega3(i,j) |
89 |
|
|
ELSE |
90 |
|
|
vort3v=omega3(i+1,j) |
91 |
|
|
ENDIF |
92 |
|
|
ELSE |
93 |
|
|
vort3v=0.5*(omega3(i,j)+omega3(i+1,j)) |
94 |
|
|
ENDIF |
95 |
|
|
ENDIF |
96 |
adcroft |
1.5 |
|
97 |
adcroft |
1.6 |
IF (useJamartMomAdv) |
98 |
adcroft |
1.5 |
& uBarXY = uBarXY * 4. _d 0 * hFacS(i,j,k,bi,bj) |
99 |
jmc |
1.9 |
& / MAX( epsil, (hFacW( i ,j,k,bi,bj)+hFacW( i ,j-1,k,bi,bj)) |
100 |
|
|
& +(hFacW(i+1,j,k,bi,bj)+hFacW(i+1,j-1,k,bi,bj)) ) |
101 |
jmc |
1.4 |
|
102 |
|
|
vCoriolisTerm(i,j)= |
103 |
|
|
& -vort3v*uBarXY*recip_dyC(i,j,bi,bj)*_maskS(i,j,k,bi,bj) |
104 |
adcroft |
1.2 |
C high order vorticity advection term |
105 |
heimbach |
1.3 |
c & ... |
106 |
adcroft |
1.2 |
C linear Coriolis term |
107 |
|
|
c & -0.5 *(fCoriG(I,J,bi,bj)+fCoriG(I+1,J,bi,bj))*uBarXY |
108 |
|
|
C full nonlinear Coriolis term |
109 |
|
|
c & -0.5*(omega3(I,J)+omega3(I+1,J))*uBarXY |
110 |
|
|
C correct energy conserving form of Coriolis term |
111 |
|
|
c & -0.5 *( fCori(I,J ,bi,bj)*uBarX(I,J ,K,bi,bj) + |
112 |
|
|
c & fCori(I,J-1,bi,bj)*uBarX(I,J-1,K,bi,bj) ) |
113 |
|
|
C original form of Coriolis term (copied from calc_mom_rhs) |
114 |
|
|
c & -0.5*(fCori(i,j,bi,bj)+fCori(i,j-1,bi,bj))*uBarXY |
115 |
|
|
ENDDO |
116 |
jmc |
1.4 |
ENDDO |
117 |
adcroft |
1.2 |
|
118 |
|
|
RETURN |
119 |
|
|
END |