Note
Function that returns PARAM%surf, the surface made of heights with the required statistical moments, in the right order.
subroutine calc_z_f() !================================================================================================ !<@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 integer(kind=I4) :: i integer(kind=I4) :: w, h, l real(kind=R8), allocatable, dimension(:) :: tab_tmp read(JOB,*) PARAM%calc_zf ; LINE_READ = LINE_READ +1 ; write(SPY,*) "line: ", LINE_READ, "PARAM%calc_zf ", PARAM%calc_zf 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 ( PARAM%calc_zf ) 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.34 * PARAM%m_end%sk**2 + 1.8), & ! 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 std_array( tab = tab_tmp(1:l) ) deallocate( tab_tmp ) return endsubroutine calc_z_f