1 |
jmc |
1.4 |
C $Header: /u/gcmpack/MITgcm/model/src/pressure_for_eos.F,v 1.3 2008/08/12 22:26:39 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
#include "CPP_OPTIONS.h" |
4 |
|
|
|
5 |
|
|
CBOP |
6 |
|
|
C !ROUTINE: PRESSURE_FOR_EOS |
7 |
|
|
C !INTERFACE: |
8 |
jmc |
1.4 |
SUBROUTINE PRESSURE_FOR_EOS( |
9 |
jmc |
1.1 |
I bi, bj, iMin, iMax, jMin, jMax, k, |
10 |
|
|
O locPres, |
11 |
|
|
I myThid ) |
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
jmc |
1.4 |
C | SUBROUTINE PRESSURE_FOR_EOS |
15 |
|
|
C | o Provide a local copy of the total pressure |
16 |
jmc |
1.1 |
C | at cell center (level k) for use in EOS funct. of P |
17 |
|
|
C *==========================================================* |
18 |
|
|
C \ev |
19 |
|
|
|
20 |
|
|
C !USES: |
21 |
|
|
|
22 |
|
|
IMPLICIT NONE |
23 |
|
|
C == Global variables == |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "EEPARAMS.h" |
26 |
|
|
#include "PARAMS.h" |
27 |
|
|
#include "GRID.h" |
28 |
|
|
#include "DYNVARS.h" |
29 |
|
|
|
30 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
31 |
|
|
C == Routine arguments == |
32 |
|
|
C bi,bj, k :: tile and level indices |
33 |
|
|
C iMin,iMax,jMin,jMax :: computational domain |
34 |
|
|
C myThid - Thread number for this instance of the routine. |
35 |
|
|
INTEGER bi, bj, k |
36 |
|
|
INTEGER iMin,iMax,jMin,jMax |
37 |
|
|
_RL locPres(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
38 |
|
|
INTEGER myThid |
39 |
|
|
|
40 |
|
|
C !LOCAL VARIABLES: |
41 |
|
|
C == Local variables == |
42 |
|
|
C i,j :: loop index |
43 |
|
|
INTEGER i,j |
44 |
|
|
CEOP |
45 |
|
|
|
46 |
|
|
C |
47 |
|
|
C provide the pressure for use in the equation of state |
48 |
|
|
C |
49 |
jmc |
1.2 |
IF ( usingZCoords ) THEN |
50 |
jmc |
1.1 |
C in Z coordinates the pressure is rho0 * (hydrostatic) Potential |
51 |
jmc |
1.4 |
IF ( useDynP_inEos_Zc ) THEN |
52 |
jmc |
1.1 |
C---------- |
53 |
|
|
C NOTE: For now, totPhiHyd only contains the Potential anomaly |
54 |
jmc |
1.4 |
C since PhiRef is not available for Atmos and has not (yet) |
55 |
|
|
C been added in S/R DIAGS_PHI_HYD |
56 |
jmc |
1.1 |
C---------- |
57 |
|
|
DO j=1-Oly,sNy+Oly |
58 |
|
|
DO i=1-Olx,sNx+Olx |
59 |
|
|
locPres(i,j) = rhoConst*( |
60 |
|
|
& totPhiHyd(i,j,k,bi,bj) |
61 |
jmc |
1.4 |
& -rC(k)*gravity ) |
62 |
|
|
c & *maskC(i,j,k,bi,bj) |
63 |
jmc |
1.1 |
ENDDO |
64 |
|
|
ENDDO |
65 |
|
|
ELSE |
66 |
|
|
DO j=1-Oly,sNy+Oly |
67 |
|
|
DO i=1-Olx,sNx+Olx |
68 |
jmc |
1.4 |
locPres(i,j) = -rhoConst*rC(k)*gravity |
69 |
|
|
c & *maskC(i,j,k,bi,bj) |
70 |
jmc |
1.1 |
ENDDO |
71 |
|
|
ENDDO |
72 |
|
|
ENDIF |
73 |
jmc |
1.2 |
ELSEIF ( usingPCoords ) THEN |
74 |
jmc |
1.1 |
C in P coordinates the pressure is just the coordinate of |
75 |
|
|
C the tracer point |
76 |
|
|
DO j=1-Oly,sNy+Oly |
77 |
|
|
DO i=1-Olx,sNx+Olx |
78 |
|
|
locPres(i,j) = rC(k) |
79 |
jmc |
1.4 |
c & * maskC(i,j,k,bi,bj) |
80 |
jmc |
1.1 |
ENDDO |
81 |
|
|
ENDDO |
82 |
|
|
ENDIF |
83 |
|
|
|
84 |
jmc |
1.4 |
RETURN |
85 |
jmc |
1.1 |
END |