Initial condition. Here we used a limited linear profile.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | x |
spatial variable |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | public, | parameter | :: | xa | = | -4._rk | |
real(kind=rk), | public, | parameter | :: | xb | = | 2._rk | |
real(kind=rk), | public, | parameter | :: | va | = | 1._rk | |
real(kind=rk), | public, | parameter | :: | vb | = | -0.5_rk |
elemental real(rk) function ic(x) !! Initial condition. Here we used a limited linear profile. real(rk), intent(in) :: x !! spatial variable real(rk), parameter :: xa = -4._rk, xb = 2._rk, va = 1._rk, vb = -0.5_rk ic = va + (vb - va)/(xb - xa)*(x - xa) ic = max(min(ic, va), vb) end function ic