1 |
C $Header: /u/gcmpack/MITgcm/model/src/calc_buoyancy.F,v 1.7 2001/02/04 14:38:45 cnh Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
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 |
buoy(i,j)=(theta(i,j,k,bi,bj)-tRef(K))/tRef(K) |
42 |
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 |
ELSEIF ( buoyancyRelation .eq. 'OCEANICP' ) THEN |
54 |
|
55 |
DO j=jMin,jMax |
56 |
DO i=iMin,iMax |
57 |
if ( rholoc(i,j) .ne. 0. ) then |
58 |
rholoc(i,j) = 1./rholoc(i,j) |
59 |
buoy(i,j)=rholoc(i,j) |
60 |
endif |
61 |
ENDDO |
62 |
ENDDO |
63 |
|
64 |
ELSE |
65 |
|
66 |
STOP |
67 |
&'CALC_BUOANCY: variable "buoyancyRelation" has an illegal value' |
68 |
|
69 |
ENDIF |
70 |
|
71 |
|
72 |
RETURN |
73 |
END |