/[MITgcm]/MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F
ViewVC logotype

Contents of /MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download)
Tue Jul 20 17:46:38 2004 UTC (19 years, 10 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint57g_pre, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint54d_post, checkpoint54e_post, checkpoint57d_post, checkpoint55, checkpoint57, checkpoint56, checkpoint54f_post, checkpoint55i_post, checkpoint55c_post, checkpoint57f_post, checkpoint57a_post, checkpoint55g_post, checkpoint57c_post, checkpoint55d_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint55h_post, checkpoint57e_post, checkpoint55b_post, checkpoint55f_post, eckpoint57e_pre, checkpoint56a_post, checkpoint57f_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint55e_post
Changes since 1.6: +2 -2 lines
Replaced CPP_OPTIONS.h with MOM_VECINV_OPTIONS
 - this was causing a call to diagnostics to not happen

1 C $Header: /u/gcmpack/MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F,v 1.6 2004/06/14 17:48:17 adcroft Exp $
2 C $Name: $
3
4 #include "MOM_VECINV_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 use_original_hFac
34 INTEGER I,J
35 _RL vBarXY,vort3u,Zp,Zm
36 _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 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 IF (upwindVorticity) THEN
50 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 vort3u=0.5*(omega3(i,j)*r_hFacZ(i,j)
57 & +omega3(i,j+1)*r_hFacZ(i,j+1))
58 ENDIF
59 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 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 IF (upwindVorticity) THEN
87 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
97 IF (useJamartMomAdv)
98 & vBarXY = vBarXY * 4. _d 0 * hFacW(i,j,k,bi,bj)
99 & * MAX( epsil, hFacS( i , j ,k,bi,bj)+hFacS(i-1, j ,k,bi,bj)
100 & +hFacS( j ,i+1,k,bi,bj)+hFacS(i-1,j+1,k,bi,bj) )
101
102 uCoriolisTerm(i,j)=
103 & +vort3u*vBarXY*recip_dxC(i,j,bi,bj)*_maskW(i,j,k,bi,bj)
104 cph *note* put these comments after end of continued line
105 cph to ensure TAMC compatibility
106 C high order vorticity advection term
107 c & ...
108 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 ENDDO
119
120 RETURN
121 END

  ViewVC Help
Powered by ViewVC 1.1.22