1 |
cnh |
1.5 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_phi_hyd.F,v 1.4 1998/09/09 15:04:44 cnh Exp $ |
2 |
cnh |
1.1 |
|
3 |
|
|
#include "CPP_EEOPTIONS.h" |
4 |
|
|
|
5 |
|
|
SUBROUTINE CALC_PHI_HYD( bi, bj, iMin, iMax, jMin, jMax, K, |
6 |
cnh |
1.2 |
I buoyKM1, buoyKP1, phiHyd, myThid) |
7 |
cnh |
1.1 |
C /==========================================================\ |
8 |
|
|
C | SUBROUTINE CALC_PHI_HYD | |
9 |
|
|
C | o Integrate the hydrostatic relation to find phiHyd. | |
10 |
|
|
C | | |
11 |
|
|
C \==========================================================/ |
12 |
|
|
IMPLICIT NONE |
13 |
|
|
C == Global variables == |
14 |
|
|
#include "SIZE.h" |
15 |
|
|
#include "DYNVARS.h" |
16 |
|
|
#include "GRID.h" |
17 |
|
|
#include "EEPARAMS.h" |
18 |
|
|
#include "PARAMS.h" |
19 |
|
|
C == Routine arguments == |
20 |
|
|
INTEGER bi,bj,iMin,iMax,jMin,jMax,K |
21 |
|
|
_RL buoyKM1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
22 |
|
|
_RL buoyKP1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
23 |
cnh |
1.2 |
_RL phiHyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
24 |
cnh |
1.1 |
integer myThid |
25 |
|
|
C == Local variables == |
26 |
|
|
INTEGER i,j,Km1 |
27 |
|
|
_RL halfLayer |
28 |
cnh |
1.5 |
_RL gamma |
29 |
cnh |
1.1 |
|
30 |
|
|
if (K.eq.1) then |
31 |
|
|
Km1=1 |
32 |
|
|
halfLayer=0.5 _d 0 |
33 |
|
|
else |
34 |
|
|
Km1=K-1 |
35 |
|
|
halfLayer=1.0 _d 0 |
36 |
|
|
endif |
37 |
|
|
|
38 |
cnh |
1.5 |
C-- Scale factor for hydrostatic relation except for ocean in pressure coords. |
39 |
|
|
gamma = 1. _d 0 |
40 |
|
|
C-- Scale factor for hydrostatic relation for ocean in pressure coords. |
41 |
|
|
IF ( buoyancyRelation .EQ. 'OCEANIC' .AND. usingPCoords ) THEN |
42 |
|
|
gamma = recip_Gravity*recip_rhoConst |
43 |
|
|
ENDIF |
44 |
|
|
|
45 |
cnh |
1.1 |
C-- Contribution to phiHyd(:,:,K) from buoy(:,:,K-1) + buoy(:,:,K) |
46 |
|
|
C (This is now the actual hydrostatic pressure|height at the T/S points) |
47 |
|
|
DO j=jMin,jMax |
48 |
|
|
DO i=iMin,iMax |
49 |
cnh |
1.3 |
phiHyd(i,j,K)=phiHyd(i,j,Km1)-rhoConst*halfLayer |
50 |
cnh |
1.5 |
& *0.5 _d 0*( drF(Km1)+drF(K) )*gamma |
51 |
cnh |
1.1 |
& *0.5 _d 0*( buoyKM1(i,j)+buoyKP1(i,j) ) |
52 |
|
|
ENDDO |
53 |
|
|
ENDDO |
54 |
|
|
|
55 |
|
|
! ------------------------------------------------------------------------------ |
56 |
|
|
return |
57 |
|
|
end |
58 |
|
|
! ============================================================================== |