# pressure bounds derivations

1. pressure ranges from midpoints

   symbol | description | unit | variable name
   --- | --- | --- | ---
   \(p(i)\) | pressure | \(Pa\) | pressure {:,vertical}
   \(p^{B}(i,l)\) | pressure boundaries (\(l \in \{1,2\}\)) | \(Pa\) | pressure_bounds {:,vertical,2}

   The pattern : for the dimensions can represent {time}, or no dimension at all.

   \begin{eqnarray} p^{B}(1,1) & = & e^{\frac{3\ln(p(1)) - \ln(p(2))}{2}} \\ p^{B}(i,1) & = & e^{\frac{\ln(p(i-1)) + \ln(p(i))}{2}}, 1 < i \leq N \\ p^{B}(i,2) & = & p^{B}(i+1,1), 1 \leq i < N \\ p^{B}(N,2) & = & e^{\frac{3\ln(p(N)) - \ln(p(N-1))}{2}} \end{eqnarray}

   This formula applies if the harp option `regrid_out_of_bounds` is set to `nan` or to `extrapolate`. If the option is set to `edge` then the first and last boundary value are set to the midpoints (\(p^{B}(1,1) = p(1)\), \(p^{B}(N,2) = p(N)\)).