1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/mom_vecinv/Attic/mom_vi_calc_hdiv.F,v 1.1.2.1 2001/03/30 21:13:33 adcroft Exp $ |
2 |
C $Name: pre38-close $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE MOM_VI_CALC_HDIV( |
7 |
I bi,bj,k, |
8 |
I uFld, vFld, |
9 |
O hDiv, |
10 |
I myThid) |
11 |
IMPLICIT NONE |
12 |
C /==========================================================\ |
13 |
C | S/R MOM_CALC_HDIV | |
14 |
C |==========================================================| |
15 |
C \==========================================================/ |
16 |
|
17 |
C == Global variables == |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PARAMS.h" |
21 |
#include "GRID.h" |
22 |
C == Routine arguments == |
23 |
C myThid - Instance number for this innvocation of CALC_MOM_RHS |
24 |
INTEGER bi,bj,k |
25 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
26 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
27 |
_RL hDiv(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
28 |
INTEGER myThid |
29 |
|
30 |
C == Local variables == |
31 |
INTEGER i,j |
32 |
|
33 |
DO J=1-Oly,sNy+Oly-1 |
34 |
DO I=1-Olx,sNx+Olx-1 |
35 |
|
36 |
C This discretization is the straight forward horizontal divergence |
37 |
C that only considers the horizontal grid variations. |
38 |
c hDiv(I,J)=( |
39 |
c & uFld(i+1, j )*dyg(i+1, j ,bi,bj) |
40 |
c & -uFld( i , j )*dyg( i , j ,bi,bj) |
41 |
c & +vFld( i ,j+1)*dxg( i ,j+1,bi,bj) |
42 |
c & -vFld( i , j )*dxg( i , j ,bi,bj) |
43 |
c & )*recip_rA(I,J,bi,bj) |
44 |
|
45 |
C This discretization takes into account the fractional areas |
46 |
C due to the lopping. Whether we should do this is not clear! |
47 |
hDiv(I,J)= |
48 |
& ( uFld(i+1, j )*dyg(i+1, j ,bi,bj)*hFacW(i+1, j ,K,bi,bj) |
49 |
& -uFld( i , j )*dyg( i , j ,bi,bj)*hFacW( i , j ,K,bi,bj) |
50 |
& +vFld( i ,j+1)*dxg( i ,j+1,bi,bj)*hFacS( i ,j+1,K,bi,bj) |
51 |
& -vFld( i , j )*dxg( i , j ,bi,bj)*hFacS( i , j ,K,bi,bj) |
52 |
& )*recip_rA(I,J,bi,bj) |
53 |
& *recip_hFacC(i,j,k,bi,bj) |
54 |
|
55 |
ENDDO |
56 |
ENDDO |
57 |
|
58 |
RETURN |
59 |
END |