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