calc_z_i Subroutine

private subroutine calc_z_i()

Note

Function that returns the starting surface of random heights

Arguments

None

Calls

proc~~calc_z_i~~CallsGraph proc~calc_z_i calc_z_i calc_moments calc_moments proc~calc_z_i->calc_moments proc~build_heights build_heights proc~calc_z_i->proc~build_heights scramble scramble proc~calc_z_i->scramble proc~build_heights->calc_moments proc~pikaia_skku_solver pikaia_skku_solver proc~build_heights->proc~pikaia_skku_solver proc~profil_theo_trie_1d profil_theo_trie_1D proc~build_heights->proc~profil_theo_trie_1d sort_array2 sort_array2 proc~build_heights->sort_array2 init pikaia_class%init proc~pikaia_skku_solver->init solve pikaia_class%solve proc~pikaia_skku_solver->solve proc~profil_theo_trie_1d->calc_moments

Called by

proc~~calc_z_i~~CalledByGraph proc~calc_z_i calc_z_i proc~read_job read_job proc~read_job->proc~calc_z_i proc~prg_surf prg_surf proc~prg_surf->proc~read_job program~main main program~main->proc~prg_surf

Source Code

   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