calc_res_acf Subroutine

private subroutine calc_res_acf(acf_surf, imp_acf, crit_acf, acf__z, w, h)

Note

Function that returns crit_acf the mean absolute difference between theoretical and calculated acfs

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:w, 1:h) :: acf_surf

calculated surface acf

real(kind=R8), intent(in), dimension(1:w, 1:h) :: imp_acf

required surface acf

real(kind=R8), intent(out) :: crit_acf

mean absolute difference between theoretical and calculated acfs

real(kind=R8), intent(in) :: acf__z

plane elevation z where correlation lengths are calculated

integer(kind=I4), intent(in) :: w

surface acf width (points)

integer(kind=I4), intent(in) :: h

surface acf height (points)


Called by

proc~~calc_res_acf~~CalledByGraph proc~calc_res_acf calc_res_acf proc~sub_surf sub_surf proc~sub_surf->proc~calc_res_acf proc~read_job read_job proc~read_job->proc~sub_surf proc~prg_surf prg_surf proc~prg_surf->proc~read_job program~main main program~main->proc~prg_surf

Source Code

   subroutine calc_res_acf(acf_surf, imp_acf, crit_acf, acf__z, w, h)
   !================================================================================================
   !<@note Function that returns *crit_acf* the mean absolute difference between theoretical
   !< and calculated acfs
   !<
   !<@endnote
   !------------------------------------------------------------------------------------------------
   implicit none
   integer(kind=I4), intent(in ) :: w                                !! *surface acf width (points)*
   integer(kind=I4), intent(in ) :: h                                !! *surface acf height (points)*
   real(kind=R8),    intent(in ) :: acf__z                           !! *plane elevation z where correlation lengths are calculated*
   real(kind=R8),    intent(out) :: crit_acf                         !! *mean absolute difference between theoretical and calculated acfs*
   real(kind=R8),    intent(in ), dimension(1:w, 1:h) :: acf_surf    !! *calculated surface acf*
   real(kind=R8),    intent(in ), dimension(1:w, 1:h) :: imp_acf     !! *required surface acf*

      real(kind=R8), allocatable, dimension(:,:) :: tab_tmp

      allocate( tab_tmp(1:w, 1:h) )

      tab_tmp(1:w, 1:h) = 0

      where( imp_acf > acf__z ) tab_tmp = abs( acf_surf - imp_acf )

      crit_acf = 100 * sum( tab_tmp(1:w, 1:h) ) / count( tab_tmp(1:w, 1:h) > 0 )

      deallocate( tab_tmp )

   return
   endsubroutine calc_res_acf