update_surface_temperature
- cosipy.modules.surfaceTemperature.update_surface_temperature(GRID, dt, z, z0, T2, rH2, p, SWnet, u2, RAIN, SLOPE, LWin=None, N=None)[source]
Solve the surface temperature and get the surface fluxes.
Implemented minimisation methods:
Newton: Recommended, and fastest.
Secant: Potentially faster for coupled WRF simulations.
L-BFGS-B: Slower, different results since 02/2024.
SLSQP: Slower, different results since 02/2024.
- Parameters:
GRID (Grid) – Glacier data structure.
dt (float) – Integration time [s] - can vary in WRF_X_CSPY.
z (float) – Measurement height [m] - varies in WRF_X_CSPY.
z0 (float) – Roughness length [m].
T2 (float) – Air temperature [K].
rH2 (float) – Relative humidity [%].
p (float) – Air pressure [hPa].
SWnet (float) – Incoming shortwave radiation [W m -2].
u2 (float) – Wind velocity [m s -1].
RAIN (float) – Rain [mm].
SLOPE (float) – Slope of the surface [degree].
LWin (float) – Incoming longwave radiation [W m -2].
N (float) – Fractional cloud cover [-].
- Returns:
- res.fun:
Minimisation function.
- res.x:
Surface temperature [K].
- Li:
Incoming longwave radiation [W m -2].
- Lo:
Outgoing longwave radiation [W m -2].
- H:
Sensible heat flux [W m -2].
- L:
Latent heat flux [W m -2].
- B:
Ground heat flux [W m -2].
- Qrr:
Rain heat flux [W m -2].
- rho:
Air density [kg m -3].
- Lv:
Latent heat of vaporization [J \(\cdot\) kg -1].
- MOL:
Monin-Obukhov length [m].
- Cs_t:
Stanton number [-].
- Cs_q:
Dalton number [-].
- q0:
Mixing ratio at the surface [kg kg -1].
- q2:
Mixing ratio at measurement height [kg kg -1].
- Return type:
tuple
- Raises:
NotImplementedError – Invalid method for minimizing the residual.