1 |
adcroft |
1.6 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_buoyancy.F,v 1.5 1998/11/06 22:44:43 cnh Exp $ |
2 |
cnh |
1.1 |
|
3 |
cnh |
1.5 |
#include "CPP_OPTIONS.h" |
4 |
cnh |
1.1 |
|
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 | | |
17 |
|
|
C \==========================================================/ |
18 |
|
|
IMPLICIT NONE |
19 |
|
|
|
20 |
|
|
C-- == Global data == |
21 |
|
|
#include "SIZE.h" |
22 |
|
|
#include "DYNVARS.h" |
23 |
|
|
#include "EEPARAMS.h" |
24 |
|
|
#include "PARAMS.h" |
25 |
|
|
|
26 |
|
|
C-- == Routine arguments == |
27 |
|
|
INTEGER bi,bj,iMin,iMax,jMin,jMax |
28 |
|
|
INTEGER k |
29 |
|
|
_RL rhoLoc(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
30 |
|
|
_RL buoy (1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
31 |
|
|
INTEGER myThid |
32 |
|
|
|
33 |
|
|
C-- == Local variables == |
34 |
|
|
INTEGER i,j |
35 |
|
|
|
36 |
|
|
IF ( buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN |
37 |
|
|
|
38 |
|
|
DO j=jMin,jMax |
39 |
|
|
DO i=iMin,iMax |
40 |
cnh |
1.4 |
buoy(i,j)=(theta(i,j,k,bi,bj)-tRef(K))/tRef(K) |
41 |
cnh |
1.1 |
ENDDO |
42 |
|
|
ENDDO |
43 |
|
|
|
44 |
|
|
ELSEIF ( buoyancyRelation .eq. 'OCEANIC' ) THEN |
45 |
|
|
|
46 |
|
|
DO j=jMin,jMax |
47 |
|
|
DO i=iMin,iMax |
48 |
|
|
buoy(i,j)=-Gravity*recip_rhoConst*rholoc(i,j) |
49 |
|
|
ENDDO |
50 |
|
|
ENDDO |
51 |
|
|
|
52 |
|
|
ELSE |
53 |
|
|
|
54 |
cnh |
1.3 |
STOP |
55 |
|
|
&'CALC_BUOANCY: variable "buoyancyRelation" has an illegal value' |
56 |
cnh |
1.1 |
|
57 |
|
|
ENDIF |
58 |
cnh |
1.2 |
|
59 |
cnh |
1.1 |
|
60 |
|
|
RETURN |
61 |
|
|
END |