# [MITgcm-support] PH and PHRefC

Jody Klymak jklymak at uvic.ca
Sat May 27 15:52:08 EDT 2017

Hi Ryan,

> On May 26, 2017, at  17:08 PM, Ryan Abernathey <ryan.abernathey at gmail.com> wrote:
>
> Very useful! Thanks for sharing Jody!

Yes, well it took me a couple of hours, so I thought I could share, since others have asked over the years.  Its pretty hard to parse with all the IF statements, and calls to different routines.  I guess when something is as capable as the MITgcm it gets complicated!

> Once I figured this out and wrote it down so I would remember it:
> PHRefC = gravity * rhoref * RC[k]

I don’t think it has any rhoref in it.  Its just phiRef[k] = gravity* RC[k].  From set_ref_state.F I think its just:

fortran
phiRef(1)   = top_Pres*recip_rhoConst
pRefLocF(1) = top_Pres
IF ( gravityFile.EQ.' ' ) THEN
DO k=1,Nr
phiRef(2*k)   = phiRef(1)
&                  + (rC(k) - rF(1))*gravity*gravitySign
phiRef(2*k+1) = phiRef(1)
&                  + (rF(k+1)-rF(1))*gravity*gravitySign


…but maybe I misread one of the switches.  What mystifies me is the use of this variable, and why we’d want to write it to PHRefC.data, except maybe to tell us what top_Pres is?

Cheers,   Jody

>
> On Fri, May 26, 2017 at 6:24 PM, Jody Klymak <jklymak at uvic.ca <mailto:jklymak at uvic.ca>> wrote:
>
> Hi all,
>
> OK, about once a year I get re-confused about the meaning of the data contained in PH, PHL, and PHRefC.  I use a linear equation of state in z-coordinates with an oceanic buoyancy relation, so it should be pretty simple.
>
> One would think that to get the total pressure one would just add P = PH + PHRefC, but that is indeed not the case if tRef and/or sRef vary with depth (k).  PHRefC is simply g*Z (where Z is the z at the center of the cells).  PH is the dynamic pressure: (1/rho_0) \int (rho-rho_{Ref}(z)) g dz.  Nowhere, that I can tell, is the cumulative integral of rho_{Ref} stored (nor indeed tRef or sRef).
>
> My sleuthing, mainly so I don’t do this again (ha), but perhaps is useful to others, is at
>
> https://gist.github.com/jklymak/156c30b5344a9cf63e8aebc429fee1c6 <https://gist.github.com/jklymak/156c30b5344a9cf63e8aebc429fee1c6>
>
> I do wonder why PHRefC doesn’t include the full reference pressure using tRef and sRef to calculate rhoRef: i.e. (1/rho_0) \int g rho_{Ref}(z) dz. I don’t need g*zc saved for any reason.  But maybe other co-ordinate systems or EOSs make sense of this variable?
>
> Thanks,   Jody
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
> http://mitgcm.org/mailman/listinfo/mitgcm-support <http://mitgcm.org/mailman/listinfo/mitgcm-support>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20170527/b9660e2b/attachment.htm>


More information about the MITgcm-support mailing list