457 |
#include "PARAMS.h" |
#include "PARAMS.h" |
458 |
#include "GRID.h" |
#include "GRID.h" |
459 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
460 |
|
#ifdef ALLOW_NONHYDROSTATIC |
461 |
|
# include "NH_VARS.h" |
462 |
|
#endif /* ALLOW_NONHYDROSTATIC */ |
463 |
|
|
464 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
465 |
C == Routine arguments == |
C == Routine arguments == |
477 |
|
|
478 |
IF ( usingZCoords ) THEN |
IF ( usingZCoords ) THEN |
479 |
C in Z coordinates the pressure is rho0 * (hydrostatic) Potential |
C in Z coordinates the pressure is rho0 * (hydrostatic) Potential |
480 |
c IF ( selectP_inEOS_Zc.GE.2 ) THEN |
#ifdef ALLOW_NONHYDROSTATIC |
481 |
IF ( storePhiHyd4Phys ) THEN |
IF ( selectP_inEOS_Zc.EQ.3 ) THEN |
482 |
|
pLoc = rhoConst*( totPhiHyd(i,j,kRef,bi,bj) |
483 |
|
& + phi_nh(i,j,kRef,bi,bj) |
484 |
|
& + phiRef(2*kRef) |
485 |
|
& )*maskC(i,j,kRef,bi,bj) |
486 |
|
ELSEIF ( selectP_inEOS_Zc.EQ.2 ) THEN |
487 |
|
#else /* ALLOW_NONHYDROSTATIC */ |
488 |
|
IF ( selectP_inEOS_Zc.EQ.2 ) THEN |
489 |
|
#endif /* ALLOW_NONHYDROSTATIC */ |
490 |
C---------- |
C---------- |
491 |
C NOTE: For now, totPhiHyd only contains the Potential anomaly |
C NOTE: For now, totPhiHyd only contains the Potential anomaly |
492 |
C since PhiRef is not available for Atmos and has not (yet) |
C since PhiRef has not (yet) been added in S/R DIAGS_PHI_HYD |
|
C been added in S/R DIAGS_PHI_HYD |
|
493 |
C---------- |
C---------- |
494 |
pLoc = rhoConst*( totPhiHyd(i,j,kRef,bi,bj) |
pLoc = rhoConst*( totPhiHyd(i,j,kRef,bi,bj) |
495 |
& -rC(kRef)*gravity |
& + phiRef(2*kRef) |
496 |
& )*maskC(i,j,kRef,bi,bj) |
& )*maskC(i,j,kRef,bi,bj) |
497 |
|
c ELSEIF ( selectP_inEOS_Zc.EQ.1 ) THEN |
498 |
|
C note: for the case selectP_inEOS_Zc=0, also use pRef4EOS (set to |
499 |
|
C rhoConst*phiRef(2*k) ) to reproduce same previous machine truncation |
500 |
|
ELSEIF ( selectP_inEOS_Zc.LE.1 ) THEN |
501 |
|
pLoc = pRef4EOS(kRef)*maskC(i,j,kRef,bi,bj) |
502 |
ELSE |
ELSE |
503 |
pLoc = -rhoConst*rC(kRef)*gravity*maskC(i,j,kRef,bi,bj) |
pLoc = rhoConst*phiRef(2*kRef)*maskC(i,j,kRef,bi,bj) |
504 |
ENDIF |
ENDIF |
505 |
ELSEIF ( usingPCoords ) THEN |
ELSEIF ( usingPCoords ) THEN |
506 |
C in P coordinates the pressure is just the coordinate of |
C in P coordinates the pressure is just the coordinate of the tracer point |
|
C the tracer point |
|
507 |
pLoc = rC(kRef)* maskC(i,j,kRef,bi,bj) |
pLoc = rC(kRef)* maskC(i,j,kRef,bi,bj) |
508 |
ENDIF |
ENDIF |
509 |
|
|