1 |
jmc |
1.5 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_vecinv/mom_vi_v_coriolis_c4.F,v 1.4 2004/12/10 20:15:10 heimbach Exp $ |
2 |
adcroft |
1.3 |
C $Name: $ |
3 |
adcroft |
1.2 |
|
4 |
adcroft |
1.3 |
#include "MOM_VECINV_OPTIONS.h" |
5 |
adcroft |
1.2 |
|
6 |
jmc |
1.5 |
CBOP |
7 |
|
|
C !ROUTINE: MOM_VI_V_CORIOLIS_C4 |
8 |
|
|
C !INTERFACE: |
9 |
|
|
SUBROUTINE MOM_VI_V_CORIOLIS_C4( |
10 |
|
|
I bi,bj,k, |
11 |
adcroft |
1.2 |
I uFld,omega3,r_hFacZ, |
12 |
|
|
O vCoriolisTerm, |
13 |
|
|
I myThid) |
14 |
jmc |
1.5 |
C !DESCRIPTION: \bv |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | S/R MOM_VI_V_CORIOLIS_C4 |
17 |
|
|
C |==========================================================* |
18 |
|
|
C | o Calculate zonal flux of vorticity at V point |
19 |
|
|
C | using 4th order interpolation |
20 |
|
|
C *==========================================================* |
21 |
|
|
C \ev |
22 |
|
|
|
23 |
|
|
C !USES: |
24 |
adcroft |
1.2 |
IMPLICIT NONE |
25 |
|
|
|
26 |
|
|
C == Global variables == |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
#include "EEPARAMS.h" |
29 |
|
|
#include "GRID.h" |
30 |
|
|
#include "PARAMS.h" |
31 |
|
|
|
32 |
jmc |
1.5 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
adcroft |
1.2 |
C == Routine arguments == |
34 |
jmc |
1.5 |
INTEGER bi,bj,k |
35 |
adcroft |
1.2 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
36 |
|
|
_RL omega3(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
37 |
|
|
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
38 |
|
|
_RL vCoriolisTerm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
39 |
|
|
INTEGER myThid |
40 |
jmc |
1.5 |
CEOP |
41 |
adcroft |
1.2 |
|
42 |
|
|
C == Local variables == |
43 |
jmc |
1.5 |
INTEGER i,j |
44 |
adcroft |
1.2 |
_RL uBarXY,vort3v,Rjp,Rjm |
45 |
jmc |
1.5 |
_RL uBarYm,uBarYp,oneSixth |
46 |
adcroft |
1.2 |
LOGICAL upwindVort3 |
47 |
|
|
LOGICAL fourthVort3 |
48 |
|
|
|
49 |
jmc |
1.5 |
PARAMETER(oneSixth=1.D0/6.D0) |
50 |
|
|
PARAMETER(upwindVort3=.FALSE.) |
51 |
|
|
PARAMETER(fourthVort3=.TRUE. ) |
52 |
|
|
|
53 |
|
|
c DO j=2-Oly,sNy+Oly |
54 |
|
|
c DO i=2-Olx,sNx+Olx-2 |
55 |
|
|
DO j=1,sNy+1 |
56 |
|
|
DO i=1,sNx |
57 |
|
|
|
58 |
|
|
IF ( SadournyCoriolis ) THEN |
59 |
|
|
C- using SadournyCoriolis discretization: |
60 |
|
|
|
61 |
|
|
uBarXY=1. |
62 |
|
|
uBarYm=0.5*( |
63 |
|
|
& uFld( i , j )*dyG( i , j ,bi,bj)*hFacW( i , j ,k,bi,bj) |
64 |
|
|
& +uFld( i ,j-1)*dyG( i ,j-1,bi,bj)*hFacW( i ,j-1,k,bi,bj) ) |
65 |
|
|
uBarYp=0.5*( |
66 |
|
|
& uFld(i+1, j )*dyG(i+1, j ,bi,bj)*hFacW(i+1, j ,k,bi,bj) |
67 |
|
|
& +uFld(i+1,j-1)*dyG(i+1,j-1,bi,bj)*hFacW(i+1,j-1,k,bi,bj) ) |
68 |
|
|
IF (upwindVorticity) THEN |
69 |
|
|
IF ( (uBarYm+uBarYp) .GT.0.) THEN |
70 |
|
|
vort3v=uBarYm*r_hFacZ( i ,j)*omega3( i ,j) |
71 |
|
|
ELSE |
72 |
|
|
vort3v=uBarYp*r_hFacZ(i+1,j)*omega3(i+1,j) |
73 |
|
|
ENDIF |
74 |
|
|
ELSEIF (fourthVort3) THEN |
75 |
|
|
Rjp = omega3(i+1,j)*r_hFacZ(i+1,j) |
76 |
|
|
& -oneSixth*( omega3(i+2,j)*r_hFacZ(i+2,j) |
77 |
|
|
& -omega3( i ,j)*r_hFacZ( i ,j) ) |
78 |
|
|
Rjm = omega3(i,j)*r_hFacZ(i,j) |
79 |
|
|
& +oneSixth*( omega3(i+1,j)*r_hFacZ(i+1,j) |
80 |
|
|
& -omega3(i-1,j)*r_hFacZ(i-1,j) ) |
81 |
|
|
vort3v=0.5*( uBarYm*Rjm + uBarYp*Rjp ) |
82 |
|
|
ELSE |
83 |
|
|
vort3v=0.5*( uBarYm*r_hFacZ( i ,j)*omega3( i ,j) |
84 |
|
|
& +uBarYp*r_hFacZ(i+1,j)*omega3(i+1,j) ) |
85 |
|
|
ENDIF |
86 |
|
|
|
87 |
|
|
ELSE |
88 |
|
|
C- not using SadournyCoriolis discretization: |
89 |
adcroft |
1.2 |
|
90 |
|
|
uBarXY=0.25*( |
91 |
|
|
& uFld( i , j )*dyG( i , j ,bi,bj)*hFacW( i , j ,k,bi,bj) |
92 |
|
|
& +uFld(i+1, j )*dyG(i+1, j ,bi,bj)*hFacW(i+1, j ,k,bi,bj) |
93 |
|
|
& +uFld( i ,j-1)*dyG( i ,j-1,bi,bj)*hFacW( i ,j-1,k,bi,bj) |
94 |
|
|
& +uFld(i+1,j-1)*dyG(i+1,j-1,bi,bj)*hFacW(i+1,j-1,k,bi,bj)) |
95 |
|
|
IF (upwindVort3) THEN |
96 |
|
|
IF (uBarXY.GT.0.) THEN |
97 |
|
|
vort3v=omega3(i,j)*r_hFacZ(i,j) |
98 |
|
|
ELSE |
99 |
|
|
vort3v=omega3(i+1,j)*r_hFacZ(i+1,j) |
100 |
|
|
ENDIF |
101 |
|
|
ELSEIF (fourthVort3) THEN |
102 |
|
|
Rjp=omega3(i+2,j)*r_hFacZ(i+2,j) |
103 |
|
|
& -omega3(i+1,j)*r_hFacZ(i+1,j) |
104 |
|
|
Rjm=omega3(i,j)*r_hFacZ(i,j) |
105 |
|
|
& -omega3(i-1,j)*r_hFacZ(i-1,j) |
106 |
|
|
vort3v=0.5*(omega3(i,j)*r_hFacZ(i,j) |
107 |
|
|
& +omega3(i+1,j)*r_hFacZ(i+1,j) |
108 |
|
|
& -1./12.*(Rjp-Rjm) |
109 |
|
|
& ) |
110 |
|
|
ELSE |
111 |
|
|
vort3v=0.5*(omega3(i,j)*r_hFacZ(i,j) |
112 |
|
|
& +omega3(i+1,j)*r_hFacZ(i+1,j)) |
113 |
|
|
ENDIF |
114 |
heimbach |
1.4 |
|
115 |
jmc |
1.5 |
C- end if / else SadournyCoriolis |
116 |
|
|
ENDIF |
117 |
|
|
|
118 |
|
|
vCoriolisTerm(i,j)= |
119 |
|
|
& -vort3v*uBarXY*recip_dyC(i,j,bi,bj) |
120 |
|
|
& * _maskS(i,j,k,bi,bj) |
121 |
heimbach |
1.4 |
|
122 |
adcroft |
1.2 |
ENDDO |
123 |
jmc |
1.5 |
ENDDO |
124 |
adcroft |
1.2 |
|
125 |
|
|
RETURN |
126 |
|
|
END |