# Difference between revisions of "Upwelling Diffusion Entrainment Implementation"

## Implementation of upwelling-diffusion-entrainment equations

This section details how the equations governing the upwelling-diffusion-entrainment (UDE) ocean (Eqs. A62, A63) are implemented and modified by entrainment terms and depth-dependent ocean area (see Fig. A2). These equations represent the core of the UDE model and build on the initial work by (Hoffert et al. (1980).

The entrainment is here modeled so that the upwelling velocity in the main column is the same in each layer. Thus, the three area correction factors, <m>\theta_z^{\rm top}</m>, <m>\theta_z^{b}</m> and <m>\theta_z^{\rm dif}</m>, applied below are:

<m>\theta_z^{\rm top} = \frac{A_z}{(A_{z+1}+A_z)/2}</m>

<m>\theta_z^{b} = \frac{A_{z+1}}{(A_{z+1}+A_z)/2} </m>

<m>\theta_z^{\rm dif} = \frac{A_{z+1}-A_{z}}{(A_{z+1}+A_z)/2}\label{eq_areacorrection_thetatop}</m>
(A67)

where <m>A_z</m> is the area at the top of layer z or bottom of layer z-1 and the denominator is thus an approximation for the mean area of each ocean layer.

For the mixed layer, all terms in Eq. (A62) involving <m>\Delta T^{t+1}_{\rm NO,1}</m> are collected on the left hand side in variable <m>A(1)</m>. All terms involving <m>\Delta T^{t+1}_{\rm NO,2}</m> are collected in variable <m>B(1)</m> on the left hand side. All other terms are held in variable <m>D(1)</m> on the right hand side, so that the equation reads:

 \Delta T_{\rm NO,1}^{t+1} = -\frac{B(1)}{A(1)}\Delta T_{\rm NO,2}^{t+1} + \frac{D(1)}{A(1)} \label{eq_udebm_coding_ALL1} (A68) with A(1) = 1.0+\theta_1^{\rm top}\Delta t\frac{ \lambda_O\alpha}{\zeta_o} :feedback over ocean (A69) +\theta_1^{b}\Delta t\frac{ K_z}{0.5h_m h_d} :diffusion to layer 2 +\theta_1^{b}\Delta t\frac{ w^t \beta}{h_m} :downwelling +\theta_1^{\rm top}\Delta t\frac{ k_{\rm LO}\lambda_L\mu\alpha }{\zeta_o f_{\rm NO} (\frac{k_{\rm LO}}{f_{\rm NL}} + \lambda_L)} :feedback over land B(1) = -\theta_1^{b}\Delta t\frac{ K_z}{0.5h_m h_d} :diffusion from layer 2 (A70) -\theta_1^{b}\Delta t\frac{ w^t}{h_m} :upwelling from layer 2 D(1) = \Delta T_{\rm NO,1}^{t} :previous temp (A71) + \theta_1^{\rm top}\Delta t\frac{1}{\zeta_o}DeltaQ_{NO} : forcing ocean + \theta_1^{\rm top}\Delta t\frac{\alpha k_{NS}}{\zeta_o f_{NO}}(\Delta T^t_{\rm SO,1}-\Delta T^t_{NO,1}) :inter-hemis. exch. + \theta_1^{\rm top}\Delta t\frac{ k_{LO}\Delta Q_{NL}}{\zeta_o f_{NO} (\frac{k_{LO}}{f_{NL}} + \lambda_L)} : land forcing + \theta_1^{b}\Delta t\frac{\Delta w^t}{h_m}(T^0_{\rm NO,2}-T^0_{NO,sink}) : variable upwelling

For the interior layers (2<m>{\leq}</m>z<m>{\leq}</m><m>n</m>), i.e., all layers except the top mixed layer and the bottom layer, the terms are re-ordered, so that <m>A(z)</m> comprises the terms for <m>\Delta T^{t+1}_{\rm NO,z-1}</m>, <m>B(z)</m> the terms for <m>\Delta T^{t+1}_{\rm NO,z}</m>, <m>C(z)</m> the terms for <m>\Delta T^{t+1}_{\rm NO,z+1}</m> and <m>D(z)</m> the remaining terms, according to:

 \Delta T_{\rm NO,z-1}^{t+1} = -\frac{B(z)}{A(z)}\Delta T_{\rm NO,z}^{t+1} - \frac{C(z)}{A(z)}\Delta T_{\rm NO,z+1}^{t+1} + \frac{D(z)}{A(z)} (A72) with A(z) = - \theta_z^{top}\Delta t\frac{K_z}{0.5(h_d+h_d')h_d} : diffusion from layer above (A73) B(z) = 1.0 + \theta_z^{b}\Delta t\frac{K_z}{h_d^2} :diffusion to layer below +\theta_z^{top}\Delta t\frac{K_z}{0.5(h_d+h_d')h_d} :diffusion to layer above +\theta_z^{top}\Delta t\frac{ w^t}{h_d} :upwelling to layer above (A74) C(z) = - \theta_z^{b}\Delta t\frac{K_z}{h_d^2} :diffusion from layer below -\theta_z^{b}\Delta t\frac{ w^t}{h_d} :upwelling from layer below (A75) D(z) = \Delta T_{\rm NO,z}^{t} :previous temp +\Delta t\frac{\Delta w^t}{h_d} (\theta_z^{b}T^{0}_{\rm NO,z+1}-\theta_z^{top}T^{0}_{\rm NO,z}) :variable upwelling +\theta_z^{\rm dif}\Delta t\frac{ w^t}{h_d}\beta\Delta T_{\rm NO,1}^{t-1} :entrainment +\theta_z^{\rm dif}\Delta t\frac{\Delta w^t}{h_d} T^{0}_{\rm NO,sink} :variable entrainment (A76)

where <m>h_d'</m> is zero for the layer below the mixed layer and <m>h_d</m> otherwise. For the bottom layer, the respective sum factor <m>A(n)</m> for <m>\Delta T^{t+1}_{\rm NO,n-1}</m>, <m>B(n)</m> for <m>\Delta T^{t+1}_{\rm NO,n}</m> and <m>D(n)</m> for the remaining terms is:

 \Delta T_{{\rm NO},n-1}^{t+1} = -\frac{B(n)}{A(n)}\Delta T_{{\rm NO},n}^{t+1} + \frac{D(n)}{A(n)} (A77) with A(n) = - \theta_{n}^{\rm top}\Delta t\frac{K_z}{h_d^2} :diffusion from layer n-1 (A78) B(n) = 1.0 + \theta_{n}^{\rm top}\Delta t\frac{K_z}{h_d^2} :diffusion to layer n-1 (A79) +\theta_{n}^{\rm top}\Delta t\frac{ w^t}{h_d} :upwelling to layer n-1 D(n) = \Delta T_{{\rm NO},n}^{t} :previous temp (A80) +\theta_{n}^{\rm top}\Delta t\frac{w^t}{h_d} \beta\Delta T^{t-1}_{\rm NO,1} :downwelling from top layer -\theta_{n}^{\rm top}\Delta t\frac{\Delta w^t}{h_d} T^{0}_{{\rm NO},n} :variable upwelling +\theta_{n}^{\rm top}\Delta t\frac{\Delta w^t}{h_d} T^{0}_{\rm NO,sink} :variable downweilling

With these Eqs. (A68-A80), the ocean temperatures can be solved consecutively from the bottom to the top layer at each time step.