cowind.f
118 lines · 1 definitions · on GitHub (7be4133)
Python version: cowind.py, 74 lines, on the right (switch to Python above the code).
Variables on this page (13)
c4pil, cln, clsunl, constfactor, crsun, csigl, exm, exmd, exr, exw, ishort, taucz, wmax
Purpose
This file gives the change of the surface convection zone's angular velocity over a time step due to magnetized-wind angular-momentum loss, with the older "Kawaler-type" wind law and a saturation threshold. It is used when the newer Matt et al. law (LMWIND) is off.
How it fits
- Inputs: the arguments
BL($\log L/L_\odot$),TEFFL,SMASS($M/M_\odot$),DT(the time step),HICZ(the moment of inertia of the surface convection zone),OMEGAS(the surface $\Omega$ after the previous iteration),WOLD(at the start of the step),IT(the iteration);WMAX,EXMD,EXW,EXR,EXM,CONSTFACTORinNMLPAR_MOD(set in PARMIN from the input index "ALFA," per the comment);TAUCZ(the convective overturn time) inOVRTRN_MOD; the solar constants inCONSTANTS_MOD. - Who calls it: MCOWIND, when
LMWINDis false ("run old windlaw"). - Outputs:
WIND1,WIND2, the change of $\Omega$ over the step computed with $\Omega$ at its start and at its end. The comment says they enter the diffusion equations and are averaged: SECULR, which calls MCOWIND, passes them to DCOEFT or DADCOEFT, where the surface boundary takes $-\tfrac12(\mathtt{WIND1}+\mathtt{WIND2})$ times the moment of inertia.
The method
-
Saturation. If
WMAX$> 1$, it is read as $\Omega_\mathrm{sat,\odot}\,\tau_\odot$ and $\Omega_\mathrm{sat} = \mathtt{WMAX}/\tau_\mathrm{cz}$ (MHP 3/09; the run stops if $\tau_\mathrm{cz}$ is not defined, with exit code 1 and the message also in the.shortfile); otherwise $\Omega_\mathrm{sat} = \mathtt{WMAX}$. Unlike WIND, the reinterpretation does not depend onLINSTB. -
The radius from $L$ and $T_\mathrm{eff}$: $\log R = \tfrac12(\log(L/L_\odot) + \log L_\odot - \log 4\pi - \log\sigma - 4\log T_\mathrm{eff})$, in cm.
-
The comment's law, $dJ/dt \propto K\,(\dot M/10^{-14})^{a}\,\Omega^{n}\,(M/M_\odot)^{c}(R/R_\odot)^{b}$, gives $$C = \frac{\Delta t}{I_\mathrm{CZ}}\,K\left(\frac{\dot M}{10^{-14}\,M_\odot\,\mathrm{yr}^{-1}}\right)^{a}\left(\frac{R}{R_\odot}\right)^{b}\left(\frac{M}{M_\odot}\right)^{c},$$ $$\Delta\Omega = C\,\min(\Omega, \Omega_\mathrm{sat})^{\,n-1}\,\Omega,$$ with $K$ =
CONSTFACTOR, $a$ =EXMD, $b$ =EXR, $c$ =EXM, $n$ =EXW. So $\Delta\Omega \propto \Omega^n$ below saturation and $\propto \Omega\,\Omega_\mathrm{sat}^{n-1}$ above. -
WIND1usesWOLD.WIND2usesOMEGAS; from the second iteration on, it is the mean of its previous value and the new one, which damps the iteration.
Design
The mass-loss rate is fixed: DMDOT = 2.0D-14 ($M_\odot$ yr$^{-1}$), so the factor $(\dot M/10^{-14})^a$ is the constant $2^a$.
Definitions
subroutineCOWIND
Older wind law: $\Delta\Omega = (\Delta t/I_\mathrm{CZ})\,K\,(\dot M/10^{-14})^{a}(R/R_\odot)^{b}(M/M_\odot)^{c}\,\min(\Omega,\Omega_\mathrm{sat})^{n-1}\,\Omega$, at the start (WIND1) and end (WIND2) of the step; saturation optionally scaled by the overturn time.
Uses modules CONSTANTS_MOD, IOUNITS_MOD, NMLPAR_MOD, OVRTRN_MOD
Called by MCOWIND
Change log
The changes since rp_1
Changed since rp_1. Declarations only: COMMON blocks to modules, IMPLICIT NONE; the unused /DEUTER/ is gone, and the wind parameters this file does not use (EXTAU, EXL, EXPR, EXCEN, C_2) are now namelist variables in NMLPAR_MOD, shared by all its users, which settles the former question 3 on unused inputs.
Changed since a8a5950. The error stop when $\tau_\mathrm{cz}$ is not defined now also writes its message to the .short file (ISHORT, through IOUNITS_MOD), and ends with STOP 1 instead of a bare STOP, so that a failed run no longer exits with status 0 (KNOWN_ISSUES.md, issue 38).