/[MITgcm]/MITgcm/model/src/calc_phi_hyd.F
ViewVC logotype

Contents of /MITgcm/model/src/calc_phi_hyd.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Fri Nov 6 22:44:44 1998 UTC (25 years, 6 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint19, checkpoint18, checkpoint20, checkpoint21, checkpoint22, checkpoint23, checkpoint24, checkpoint25, checkpoint27, checkpoint26
Changes since 1.5: +14 -7 lines
Changes to allow for atmospheric integration builds of the code

1 C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_phi_hyd.F,v 1.5 1998/09/09 15:19:07 cnh Exp $
2
3 #include "CPP_OPTIONS.h"
4
5 SUBROUTINE CALC_PHI_HYD( bi, bj, iMin, iMax, jMin, jMax, K,
6 I buoyKM1, buoyKP1, phiHyd, myThid)
7 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 _RL phiHyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
24 integer myThid
25 C == Local variables ==
26 INTEGER i,j,Km1
27 _RL halfLayer
28 _RL gamma
29
30 #ifdef INCLUDE_PHIHYD_CALCULATION_CODE
31
32 if (K.eq.1) then
33 Km1=1
34 halfLayer=0.5 _d 0
35 else
36 Km1=K-1
37 halfLayer=1.0 _d 0
38 endif
39
40 C-- Scale factor for hydrostatic relation except for ocean in
41 C-- pressure coords.
42 gamma = 1. _d 0
43 C-- Scale factor for hydrostatic relation for ocean in pressure
44 C-- coords.
45 IF ( buoyancyRelation .EQ. 'OCEANIC' .AND. usingPCoords ) THEN
46 gamma = recip_Gravity*recip_rhoConst
47 ENDIF
48
49 C-- Contribution to phiHyd(:,:,K) from buoy(:,:,K-1) + buoy(:,:,K)
50 C (This is now the actual hydrostatic pressure|height at the T/S
51 C points)
52 DO j=jMin,jMax
53 DO i=iMin,iMax
54 phiHyd(i,j,K)=phiHyd(i,j,Km1)-rhoConst*halfLayer
55 & *0.5 _d 0*( drF(Km1)+drF(K) )*gamma
56 & *0.5 _d 0*( buoyKM1(i,j)+buoyKP1(i,j) )
57 ENDDO
58 ENDDO
59
60 #endif
61
62 ! --------------------------------------------------------------------
63 return
64 end
65 ! ====================================================================

  ViewVC Help
Powered by ViewVC 1.1.22