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

lax_wendrof2.f

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

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

Variables on this page (5)

c4pi, ecod1z_h, ez, json, ldifz

Purpose

LAX_WENDROF2 is the second (full) step of the two-step Lax–Wendroff scheme for the settling term: from the coefficients at the grid midpoints (already updated with the half-step abundances) it adds the change over a full time step to the abundances at the grid points.

How it fits

Called by GRSETT and MICRODIFF_RUN, after LAX_WENDROF1. Arguments: DT, ECOD1_H (coefficients at the midpoints), EM_H (masses at the midpoints), EX (the abundances on the equal grid, updated in place), NPT, STOT, LDOLI. Modules as in LAX_WENDROF1: CONSTANTS_MOD, NMLPAR_MOD, GRAVEZ_MOD (here ECOD1Z_H in, EZ updated), and DIMENSIONS_MOD.

The method

With $F_{i+1/2}$ = ECOD1_H(I) and $m_{i+1/2}$ = EM_H(I):

$$X_1 \mathrel{+}= \Delta t\,4\pi\,\frac{F_{1/2}}{m_{1/2}},\qquad X_i \mathrel{+}= \Delta t\,4\pi\,\frac{F_{i+1/2}-F_{i-1/2}}{m_{i+1/2}-m_{i-1/2}}\ (i = 2..N-1),\qquad X_N \mathrel{+}= -\Delta t\,4\pi\,\frac{F_{N-1/2}}{M - m_{N-1/2}} .$$

The same for the metals (EZ) when LDIFZ is true and LDOLI is false.

The end points hold the reservoirs beyond the grid: The surface update divides by $M - m_{N-1/2}$, half a cell plus all the mass above point $N$, and the central one by $m_{1/2}$, all the mass below the first midpoint; EQUAL_TO_MODEL then applies the end points' changes to every shell beyond them (settled from the code, Nov 9, 2026: lines 43–45↗, lines 54–56↗; equal_to_model.f, lines 42–44↗, equal_to_model.f, lines 113–116↗).

Definitions

subroutineLAX_WENDROF2

lines 2–74 · GitHub

Full-step update of $X$ (and $Z$) from the midpoint fluxes (above).

Uses modules CONSTANTS_MOD, DIMENSIONS_MOD, GRAVEZ_MOD, NMLPAR_MOD

Called by GRSETT, MICRODIFF_RUN

Change log

The changes since rp_1

Changed since rp_1. Declarations only: COMMON blocks to modules (/CONST1/ to CONSTANTS_MOD, LDIFZ from /GRAVS3/ to NMLPAR_MOD, /GRAVEZ/ to GRAVEZ_MOD), JSON from DIMENSIONS_MOD, IMPLICIT NONE.