1 |
cnh |
1.2 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_div_ghat.F,v 1.1 1998/08/20 20:21:23 cnh Exp $ |
2 |
cnh |
1.1 |
|
3 |
|
|
#include "CPP_EEOPTIONS.h" |
4 |
|
|
|
5 |
|
|
C /==========================================================\ |
6 |
|
|
C | S/R CALC_DIV_GHAT | |
7 |
|
|
C | o Form the right hand-side of the surface pressure eqn. | |
8 |
|
|
C \==========================================================/ |
9 |
|
|
SUBROUTINE CALC_DIV_GHAT( |
10 |
|
|
I bi,bj,iMin,iMax,jMin,jMax, |
11 |
|
|
I K, |
12 |
|
|
I xA,yA, |
13 |
|
|
I myThid) |
14 |
|
|
|
15 |
|
|
IMPLICIT NONE |
16 |
|
|
|
17 |
|
|
C == Global variables == |
18 |
|
|
#include "SIZE.h" |
19 |
|
|
#include "DYNVARS.h" |
20 |
|
|
#include "FFIELDS.h" |
21 |
|
|
#include "EEPARAMS.h" |
22 |
|
|
#include "PARAMS.h" |
23 |
|
|
#include "GRID.h" |
24 |
|
|
#include "CG2D.h" |
25 |
|
|
|
26 |
|
|
C == Routine arguments == |
27 |
|
|
C pH - Hydrostatic pressure |
28 |
|
|
C bi, bj, iMin, iMax, jMin, jMax - Range of points for which calculation |
29 |
|
|
C results will be set. |
30 |
|
|
C kUp, kDown, kM1 - Index for upper and lower layers. |
31 |
|
|
C myThid - Instance number for this innvocation of CALC_MOM_RHS |
32 |
|
|
INTEGER bi,bj,iMin,iMax,jMin,jMax |
33 |
|
|
INTEGER K |
34 |
|
|
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
35 |
|
|
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
36 |
|
|
INTEGER myThid |
37 |
|
|
|
38 |
|
|
C == Local variables == |
39 |
|
|
INTEGER i,j |
40 |
|
|
_RL pf (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
41 |
|
|
|
42 |
|
|
C-- Pressure equation source term |
43 |
|
|
C Term is the vertical integral of the divergence of the |
44 |
|
|
C time tendency terms along with a relaxation term that |
45 |
|
|
C pulls div(U) + dh/dt back toward zero. |
46 |
|
|
|
47 |
cnh |
1.2 |
IF ( k .EQ. Nr ) THEN |
48 |
cnh |
1.1 |
C Initialise source term on first pass |
49 |
|
|
DO j=jMin,jMax |
50 |
|
|
DO i=iMin,iMax |
51 |
|
|
C cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) |
52 |
|
|
C & -freeSurfFac*_rA(i,j,bi,bj)* |
53 |
|
|
C & cg2d_x(I ,J ,bi,bj)/deltaTMom/deltaTMom |
54 |
|
|
cg2d_b(i,j,bi,bj) = |
55 |
|
|
& -freeSurfFac*_rA(i,j,bi,bj)* |
56 |
|
|
& cg2d_x(I ,J ,bi,bj)/deltaTMom/deltaTMom |
57 |
|
|
ENDDO |
58 |
|
|
ENDDO |
59 |
|
|
ENDIF |
60 |
|
|
|
61 |
|
|
DO j=jMin,jMax |
62 |
|
|
DO i=iMin,iMax |
63 |
|
|
pf(i,j) = xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom |
64 |
|
|
ENDDO |
65 |
|
|
ENDDO |
66 |
|
|
DO j=1,sNy |
67 |
|
|
DO i=1,sNx |
68 |
|
|
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) + |
69 |
|
|
& pf(i+1,j)-pf(i,j) |
70 |
|
|
ENDDO |
71 |
|
|
ENDDO |
72 |
|
|
|
73 |
|
|
DO j=jMin,jMax |
74 |
|
|
DO i=iMin,iMax |
75 |
|
|
pf(i,j) = yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom |
76 |
|
|
ENDDO |
77 |
|
|
ENDDO |
78 |
|
|
|
79 |
|
|
DO j=1,sNy |
80 |
|
|
DO i=1,sNx |
81 |
|
|
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) + |
82 |
|
|
& pf(i,j+1)-pf(i,j) |
83 |
|
|
ENDDO |
84 |
|
|
ENDDO |
85 |
|
|
|
86 |
|
|
RETURN |
87 |
|
|
END |