calc_z_f Subroutine

private 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

Arguments

Type IntentOptional Attributes Name
logical(kind=I4), intent(in) :: to_be_made

whether to determine the heights, or reuse them


Calls

proc~~calc_z_f~~CallsGraph proc~calc_z_f calc_z_f calc_moments calc_moments proc~calc_z_f->calc_moments proc~build_heights build_heights proc~calc_z_f->proc~build_heights 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_f~~CalledByGraph proc~calc_z_f calc_z_f proc~read_job read_job proc~read_job->proc~calc_z_f proc~prg_surf prg_surf proc~prg_surf->proc~read_job program~main main program~main->proc~prg_surf

Source Code

   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