1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_buoyancy.F,v 1.4 1998/11/03 15:28:04 cnh Exp $ |
2 |
|
3 |
#include "CPP_OPTIONS.h" |
4 |
|
5 |
SUBROUTINE CALC_BUOYANCY( |
6 |
I bi, bj, iMin, iMax, jMin, jMax, k, rhoLoc, |
7 |
O buoy, |
8 |
I myThid ) |
9 |
|
10 |
C /==========================================================\ |
11 |
C | o SUBROUTINE BUOYANCY | |
12 |
C | Calculates buoyancy for an XY slice of a tile. | |
13 |
C |==========================================================| |
14 |
C | | |
15 |
C | k - is the density level | |
16 |
C | kRef - determines pressure reference level | |
17 |
C | (not used in 'LINEAR' mode) | |
18 |
C | | |
19 |
C \==========================================================/ |
20 |
IMPLICIT NONE |
21 |
|
22 |
C-- == Global data == |
23 |
#include "SIZE.h" |
24 |
#include "DYNVARS.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
|
28 |
C-- == Routine arguments == |
29 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
30 |
INTEGER k |
31 |
INTEGER kRef |
32 |
_RL rhoLoc(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
33 |
_RL buoy (1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
34 |
INTEGER myThid |
35 |
|
36 |
C-- == Local variables == |
37 |
INTEGER i,j |
38 |
_RL refTemp,refSalt,sigRef,tP,sP,deltaSig |
39 |
|
40 |
IF ( buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN |
41 |
|
42 |
DO j=jMin,jMax |
43 |
DO i=iMin,iMax |
44 |
buoy(i,j)=(theta(i,j,k,bi,bj)-tRef(K))/tRef(K) |
45 |
ENDDO |
46 |
ENDDO |
47 |
|
48 |
ELSEIF ( buoyancyRelation .eq. 'OCEANIC' ) THEN |
49 |
|
50 |
DO j=jMin,jMax |
51 |
DO i=iMin,iMax |
52 |
buoy(i,j)=-Gravity*recip_rhoConst*rholoc(i,j) |
53 |
ENDDO |
54 |
ENDDO |
55 |
|
56 |
ELSE |
57 |
|
58 |
STOP |
59 |
&'CALC_BUOANCY: variable "buoyancyRelation" has an illegal value' |
60 |
|
61 |
ENDIF |
62 |
|
63 |
|
64 |
RETURN |
65 |
END |