37 | | We can relate each level of the column to an position in an array which contains height (h), density(ρ) and pressure(P). |
| 39 | We can relate each level of the column to an position in an array which contains height (h), density(ρ) and pressure(P), that is: |
| 40 | |
| 41 | {{{ |
| 42 | REAL(KIND=qPREC), DIMENSION(100,3) :: column !where the first indexing is the level |
| 43 | !2nd indexing determines the attribute (1 height, 2 rho, 3 pressure) |
| 44 | }}} |
| 45 | |
| 46 | In this specific implementation, a density profile needs to be specified by the user, the module will be able to calculate the ideal pressure in order to create an HSE solution. |
| 47 | |
| 48 | In order to calculate the ideal pressure, we need to interpret: |
| 49 | |
| 50 | {{{ |
| 51 | #!latex |
| 52 | \frac{dP}{dh} = - \rho \cdot g\\ |
| 53 | }}} |
| 54 | |
| 55 | in a discrete way, this gives: |
| 56 | |
| 57 | {{{ |
| 58 | #!latex |
| 59 | P(h) = P(h+\Delta h) + g(h)\cdot\rho(h)\cdot\Delta h |
| 60 | }}} |
| 61 | |
| 62 | let's translate this condition under the form of the array specified above: |
| 63 | |
| 64 | {{{ |
| 65 | #!latex |
| 66 | |
| 67 | P(h) \rightarrow col(i,3)\\ |
| 68 | P(h+Δh) \rightarrow col(i+1,3)\\ |
| 69 | g(h) \rightarrow GravityForce \\ |
| 70 | \rho(h) \rightarrow half*(col(i,2)+col(i+1,2))\\ |
| 71 | Δh \rightarrow col(i+1,1)-col(i,1)\\ |
| 72 | }}} |