Note
Function that returns PARAM%surf, the surface made of heights with the required statistical moments, in the right order.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical(kind=I4), | intent(in) | :: | to_be_made |
whether to determine the heights, or reuse them |
subroutine calc_z_f(to_be_made) !================================================================================================ !<@note Function that returns PARAM%surf, the surface made of heights with the required statistical !< moments, in the right order. !< !< - The heights come from the vector PARAM%vect_h !< - the heights order is stored in the vector PARAM%order !< !<@endnote !------------------------------------------------------------------------------------------------ implicit none logical(kind=I4), intent(in) :: to_be_made !! *whether to determine the heights, or reuse them* integer(kind=I4) :: i 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 ! final set of heights are generated to meet the desired statistical moments ! It is done once. if ( to_be_made ) then write(SPY,*) 'calc_z_f -> final set of heights are generated to meet the desired statistical moments' call build_heights( vec_out = PARAM%vect_h(1:l), & ! OUT use_fct_expo = ( PARAM%m_end%ku < 1.10 * PARAM%m_end%sk**2 + 1. ), & ! IN stats_in = PARAM%m_end, & ! IN lg = l ) ! IN endif ! The heights stored in PARAM%vect_h(1:lg) are reinjected in PARAM%surf, with respect to the order PARAM%order write(SPY,*) 'calc_z_f -> substitution of PARAM%surf with PARAM%vect_h with respect to PARAM%order' allocate( tab_tmp(1:l) ) do i = 1, l tab_tmp( PARAM%order(i) ) = PARAM%vect_h(i) enddo PARAM%surf(1:w, 1:h) = reshape( tab_tmp(1:l), [w, h] ) call calc_moments( tab = tab_tmp(1:l), & ! IN mx = m_res, & ! OUT nb_mom = 2 ) ! IN PARAM%surf(1:w, 1:h) = ( PARAM%surf(1:w, 1:h) - m_res%mu ) / m_res%si deallocate( tab_tmp ) return endsubroutine calc_z_f