Note
Function that returns the starting surface of random heights
subroutine calc_z_i() !================================================================================================ !<@note Function that returns the starting surface of random heights !< !<@endnote !------------------------------------------------------------------------------------------------ implicit none integer (kind=I4) :: w, h, l real(kind=R8), allocatable, dimension(:) :: tab_tmp type(MOMENT_STAT) :: m_res w = PARAM%width h = PARAM%height l = PARAM%npts allocate( tab_tmp(1:l) ) ! starting set of heights are generated to meet the statistical moments prescribed by calc_ffh write(SPY,*) 'calc_z_i -> starting set of heights are generated to meet the prescribed statistical moments by calc_ffh' call build_heights( vec_out = tab_tmp(1:l), & ! OUT use_fct_expo = ( PARAM%m_stt%ku < 1.34 * PARAM%m_stt%sk**2 + 1. ), & ! IN stats_in = PARAM%m_stt, & ! IN lg = l ) ! IN call calc_moments( tab = tab_tmp(1:l), & ! IN mx = m_res, & ! OUT nb_mom = 4 ) ! IN write(TER,*) 'starting statistical moments ', m_res%mu, m_res%va, m_res%sk, m_res%ku tab_tmp(1:l) = ( tab_tmp(1:l) - m_res%mu ) / m_res%si call scramble( tab = tab_tmp(1:l), & ! INOUT lg = l ) ! IN PARAM%surf(1:w, 1:h) = reshape( tab_tmp(1:l), [w, h] ) deallocate( tab_tmp ) return endsubroutine calc_z_i