PyREC scaffolding (from YREC development, 7be4133)/ hsubp.fGlossary

hsubp.f

77 lines · 1 definitions · on GitHub (7be4133)

Python version: hsubp.py, 66 lines, on the right (switch to Python above the code).

Variables on this page (8)

cgl, cln, json, ldh, xxdh, yydh, zdh, zzdh

Purpose

HSUBP computes the local pressure scale height at one point, the edge of a convective region, for the overshoot calculation (comment: "PD Dec. 1984, revised for YREC/Mark6 by MHP 2/91").

How it fits

  • Who calls it: only OVERSH, with JEDGE the point at the edge of the convection zone.
  • Inputs: the model's composition HCOMP, and $\log\rho$, $\log P$, $\log r$, $\log m$, $\log T$ (HD, HP, HR, HS, HT). Output: PSCAHE, the scale height in cm.
  • Calls: EQSTAT, the equation of state.
  • Modules: the constants of CONSTANTS_MOD (for CLN and $\log G$, CGL); DEBHU_MOD, where it sets the composition used by the Debye–Hückel correction (XXDH, YYDH, ZZDH, ZDH(1..3)) before calling the EOS, shared with EQRELV, PHYSIC, COEFFT and others; and the flag LDH from NMLPAR_MOD (formerly in /DEBHU/).

When LDH is true, HSUBP overwrites XXDH, YYDH, ZZDH, ZDH(1..3) in DEBHU_MOD with the composition at JEDGE (lines 60–67↗). The interior's EOS callers set them again first, shell by shell (coefft.f, lines 207–209↗; physic.f, lines 100–102↗), as CRRECT does before SURFBC (crrect.f, lines 136–143↗), so the overwrite does not reach them.

The method

The scale height returned is the hydrostatic one,

$$H_p = \frac{P}{\rho g} = \frac{P\,r^2}{\rho\,G\,m},$$

computed in logs: PSCAHE $= 10^{\log P + 2\log r - \log\rho - \log G - \log m}$. Here $\log\rho$ is not the model's HD(JEDGE): DL is an output argument of EQSTAT, which recomputes the density from $P$, $T$, $X$, $Z$, and PSCAHE uses that value. The EOS call also returns RMU (probably $\mathcal{R}/\mu$), which goes only into a second, ideal-gas estimate PSCAP $= (\mathcal{R}/\mu)\,T r^2/(G m)$, which is never returned (unused?).

Definitions

subroutineHSUBP

lines 4–77 · GitHub

Returns $H_p = P r^2/(\rho G m)$ at point JEDGE, with $\rho$ from the EOS (above).

Uses modules CONSTANTS_MOD, DEBHU_MOD, DIMENSIONS_MOD, NMLPAR_MOD

Called by OVERSH ×4

Flowchart of its calls, in order (1)

Change log

The changes since rp_1

Changed since rp_1. Declarations only: COMMON blocks to modules, IMPLICIT NONE.