Note
Define surface statistical moments as reference
subroutine stat_sur() !================================================================================================ !<@note Define surface statistical moments as reference !< !<@endnote !------------------------------------------------------------------------------------------------ implicit none integer(kind=I4) :: w, h, l logical(kind=I4) :: apodize read(JOB,*) apodize ; LINE_READ = LINE_READ + 1 ; write(SPY,*) "line: ", LINE_READ, 'apod? ', apodize w = PARAM%width h = PARAM%height l = PARAM%npts PARAM%surf_copy(1:w, 1:h) = PARAM%surf(1:w, 1:h) if ( apodize ) then ! apodize surface for the acf call apod_sur() call acf_wiener( tab_in = PARAM%surf(1:w, 1:h), & ! IN tab_out = PARAM%acf_surf(1:w, 1:h), & ! OUT w = w, & ! IN h = h ) ! IN ! retrieve original surface PARAM%surf(1:w, 1:h) = PARAM%surf_copy(1:w, 1:h) endif ! do not append to result file, make new one call surface_analysis( app = 0 ) ! calculate statistical moments that become prescribed call std_array(tab = PARAM%surf(1:w, 1:h), mx = PARAM%m_end) ! determine final heights PARAM%vect_h(1:l) = reshape( PARAM%surf(1:w, 1:h), [l] ) ! determine height order call sort_array2(tab_inout = PARAM%vect_h(1:l), n = l) ! prescribe moments PARAM%m_ini = PARAM%m_end ! prescribe acf PARAM%imp_acf(1:w, 1:h) = PARAM%acf_surf(1:w, 1:h) return endsubroutine stat_sur