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

Annotation of /MITgcm/pkg/mom_vecinv/mom_vi_v_coriolis_c4.F

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


Revision 1.4 - (hide annotations) (download)
Fri Dec 10 20:15:10 2004 UTC (19 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57g_pre, checkpoint57b_post, checkpoint57g_post, checkpoint57d_post, checkpoint57i_post, checkpoint57f_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57h_post, checkpoint57c_post, checkpoint57c_pre, checkpoint57e_post, eckpoint57e_pre, checkpoint57h_done, checkpoint57f_pre
Changes since 1.3: +14 -1 lines
This set of changes restores TAMC(!) compatibility.

1 heimbach 1.4 C $Header: /u/gcmpack/MITgcm/pkg/mom_vecinv/mom_vi_v_coriolis_c4.F,v 1.3 2004/07/20 17:46:38 adcroft 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     SUBROUTINE MOM_VI_V_CORIOLIS_C4(
7     I bi,bj,K,
8     I uFld,omega3,r_hFacZ,
9     O vCoriolisTerm,
10     I myThid)
11     IMPLICIT NONE
12     C /==========================================================\
13     C | S/R MOM_VI_V_CORIOLIS |
14     C |==========================================================|
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 uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
26     _RL omega3(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
27     _RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
28     _RL vCoriolisTerm(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
29     INTEGER myThid
30    
31     C == Local variables ==
32     INTEGER I,J
33     _RL uBarXY,vort3v,Rjp,Rjm
34     LOGICAL upwindVort3
35     LOGICAL fourthVort3
36    
37     upwindVort3=.FALSE.
38     fourthVort3=.TRUE.
39    
40     DO J=2-Oly,sNy+Oly
41     DO I=1-Olx,sNx+Olx-1
42     uBarXY=0.25*(
43     & uFld( i , j )*dyG( i , j ,bi,bj)*hFacW( i , j ,k,bi,bj)
44     & +uFld(i+1, j )*dyG(i+1, j ,bi,bj)*hFacW(i+1, j ,k,bi,bj)
45     & +uFld( i ,j-1)*dyG( i ,j-1,bi,bj)*hFacW( i ,j-1,k,bi,bj)
46     & +uFld(i+1,j-1)*dyG(i+1,j-1,bi,bj)*hFacW(i+1,j-1,k,bi,bj))
47     c uBarXY=0.25*( uFld(i, j )+uFld(i+1, j )
48     c & +uFld(i,j-1)+uFld(i+1,j-1))
49     IF (upwindVort3) THEN
50     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     ELSEIF (fourthVort3) THEN
56     Rjp=omega3(i+2,j)*r_hFacZ(i+2,j)
57     & -omega3(i+1,j)*r_hFacZ(i+1,j)
58     Rjm=omega3(i,j)*r_hFacZ(i,j)
59     & -omega3(i-1,j)*r_hFacZ(i-1,j)
60     vort3v=0.5*(omega3(i,j)*r_hFacZ(i,j)
61     & +omega3(i+1,j)*r_hFacZ(i+1,j)
62     & -1./12.*(Rjp-Rjm)
63     & )
64     ELSE
65     vort3v=0.5*(omega3(i,j)*r_hFacZ(i,j)
66     & +omega3(i+1,j)*r_hFacZ(i+1,j))
67     ENDIF
68 heimbach 1.4
69     cph(
70     cph The following block with 'interlaced' comments
71     cph is bad for TAMC and will be replaced
72     cph)
73     #undef THIS_IS_BAD_FOR_TAMC
74     #ifdef THIS_IS_BAD_FOR_TAMC
75 adcroft 1.2 vCoriolisTerm(i,j)=
76     C high order vorticity advection term
77     & -vort3v*uBarXY*recip_dyc(i,j,bi,bj)
78     C linear Coriolis term
79     c & -0.5 *(fCoriG(I,J,bi,bj)+fCoriG(I+1,J,bi,bj))*uBarXY
80     C full nonlinear Coriolis term
81     c & -0.5*(omega3(I,J)+omega3(I+1,J))*uBarXY
82     C correct energy conserving form of Coriolis term
83     c & -0.5 *( fCori(I,J ,bi,bj)*uBarX(I,J ,K,bi,bj) +
84     c & fCori(I,J-1,bi,bj)*uBarX(I,J-1,K,bi,bj) )
85     C original form of Coriolis term (copied from calc_mom_rhs)
86     c & -0.5*(fCori(i,j,bi,bj)+fCori(i,j-1,bi,bj))*uBarXY
87     & *_maskS(I,J,K,bi,bj)
88 heimbach 1.4 #else
89     vCoriolisTerm(i,j)=
90     & -vort3v*uBarXY*recip_dyc(i,j,bi,bj)
91     & *_maskS(I,J,K,bi,bj)
92     #endif
93    
94 adcroft 1.2 ENDDO
95     ENDDO
96    
97     RETURN
98     END

  ViewVC Help
Powered by ViewVC 1.1.22