Note
Function that generates the heights when the function limits have been determined.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(out), | dimension(1:lg) | :: | tab |
height vector |
|
integer(kind=I4), | intent(in) | :: | lg |
height vector size |
||
real(kind=R8), | intent(in), | dimension( : ) | :: | x |
unknowns: height function limits |
|
type(moment_stat), | intent(out) | :: | mx |
resulting statistical moments |
subroutine profil_theo_trie_1D(tab, lg, x, mx) !================================================================================================ !<@note Function that generates the heights when the function limits have been determined. !< !<@endnote !------------------------------------------------------------------------------------------------ implicit none integer (kind=I4), intent(in ) :: lg !! *height vector size* real (kind=R8), intent(out), dimension(1:lg) :: tab !! *height vector* real (kind=R8), intent(in ), dimension( : ) :: x !! *unknowns: height function limits* type(MOMENT_STAT), intent(out) :: mx !! *resulting statistical moments* real (kind=R8) :: b1, b2, alp, bet, tmp, pente integer(kind=I4) :: i select case(PARAM%func_gen) case(FCT_TANG) b1 = -PI_R8/2 *(UN-x(1)) b2 = +PI_R8/2 *(UN-x(2)) alp = -(b2-lg*b1)/(b2-b1) bet = (lg- 1)/(b2-b1) do i = 1, lg tab(i) = tan( (i*UN+alp)/bet ) enddo case(FCT_EXPO) pente = UN b1 = -(UN-x(1))/x(1) b2 = +(UN-x(2))/x(2) alp = -(b2-lg*b1)/(b2-b1) bet = (lg- 1)/(b2-b1) do i = 1, lg tmp = (i*UN+alp)/bet tmp = max(-0.9*HIG_E8, tmp) tmp = min(+0.9*HIG_E8, tmp) tab(i) = sign(UN, tmp)*(UN -exp(-pente*abs(tmp))) enddo endselect call calc_moments(tab = tab(1:lg), mx = mx, nb_mom = 4) tab(1:lg) = (tab(1:lg) -mx%mu) / mx%si ! normalization mx%mu = 0._R8 mx%si = 1._R8 return endsubroutine profil_theo_trie_1D