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_HFACZ_DISS( |
7 |
I bi,bj,k, |
8 |
O hFacZ,r_hFacZ, |
9 |
I myThid) |
10 |
IMPLICIT NONE |
11 |
C |
12 |
C Compute hFactor (and reciprol) at the corner (Z-point) |
13 |
C used for vorticity,divergence form of viscous term |
14 |
C (also in Shap_S2 formulation) |
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(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
24 |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
25 |
_RS hFacZOpen |
26 |
INTEGER myThid |
27 |
|
28 |
C == Local variables == |
29 |
INTEGER I,J |
30 |
|
31 |
C-- Calculate open water fraction at vorticity points |
32 |
|
33 |
DO i=1-Olx,sNx+Olx |
34 |
hFacZ(i,1-Oly)=0. |
35 |
r_hFacZ(i,1-Oly)=0. |
36 |
ENDDO |
37 |
|
38 |
DO j=2-Oly,sNy+Oly |
39 |
hFacZ(1-Olx,j)=0. |
40 |
r_hFacZ(1-Olx,j)=0. |
41 |
DO i=2-Olx,sNx+Olx |
42 |
hFacZOpen=MIN(_hFacW(i,j,k,bi,bj) |
43 |
& + _hFacW(i,j-1,k,bi,bj) |
44 |
& , _hFacS(i,j,k,bi,bj) |
45 |
& + _hFacS(i-1,j,k,bi,bj) |
46 |
& ) |
47 |
hFacZ(i,j)=0.5*hFacZOpen |
48 |
IF (hFacZ(i,j).EQ.0.) THEN |
49 |
r_hFacZ(i,j)=0. |
50 |
ELSE |
51 |
r_hFacZ(i,j)=1./hFacZ(i,j) |
52 |
ENDIF |
53 |
ENDDO |
54 |
ENDDO |
55 |
|
56 |
RETURN |
57 |
END |