1 
C $Header: /u/gcmpack/models/MITgcmUV/pkg/mom_vecinv/mom_calc_hfacz.F,v 1.2 2001/05/29 14:01:39 adcroft Exp $ 
2 
C $Name: $ 
3 

4 
#include "CPP_OPTIONS.h" 
5 

6 
SUBROUTINE MOM_VI_MASK_VORT3( 
7 
I bi,bj,k, 
8 
O hFacZ,r_hFacZ, 
9 
U vort3, 
10 
I myThid) 
11 
IMPLICIT NONE 
12 
C 
13 
C Compute hFactor and recip_hFactor at the corner (Zpoint) 
14 
C and set vort3 to zero where hFac = 0 (apply a mask) 
15 
C 
16 

17 
C == Global variables == 
18 
#include "SIZE.h" 
19 
#include "GRID.h" 
20 

21 
C == Routine arguments == 
22 
INTEGER bi,bj,k 
23 
_RS hFacZ(1OLx:sNx+OLx,1OLy:sNy+OLy) 
24 
_RS r_hFacZ(1OLx:sNx+OLx,1OLy:sNy+OLy) 
25 
_RL vort3(1OLx:sNx+OLx,1OLy:sNy+OLy) 
26 
_RS hFacZOpen 
27 
INTEGER myThid 
28 

29 
C == Local variables == 
30 
INTEGER I,J 
31 

32 
C Calculate open water fraction at vorticity points 
33 

34 
c DO i=1Olx,sNx+Olx 
35 
c hFacZ(i,1Oly)=0. 
36 
c r_hFacZ(i,1Oly)=0. 
37 
c ENDDO 
38 

39 
DO j=2Oly,sNy+Oly 
40 
c hFacZ(1Olx,j)=0. 
41 
c r_hFacZ(1Olx,j)=0. 
42 
DO i=2Olx,sNx+Olx 
43 
hFacZOpen=min(_hFacW(i,j,k,bi,bj), 
44 
& _hFacW(i,j1,k,bi,bj)) 
45 
hFacZOpen=min(_hFacS(i,j,k,bi,bj),hFacZOpen) 
46 
hFacZOpen=min(_hFacS(i1,j,k,bi,bj),hFacZOpen) 
47 
hFacZ(i,j)=hFacZOpen 
48 
IF (hFacZ(i,j).EQ.0.) THEN 
49 
r_hFacZ(i,j)=0. 
50 
vort3(i,j)=0. 
51 
ELSE 
52 
r_hFacZ(i,j)=1./hFacZ(i,j) 
53 
ENDIF 
54 
ENDDO 
55 
ENDDO 
56 

57 
RETURN 
58 
END 