Note
Function that returns crit_acf the mean absolute difference between theoretical and calculated acfs
Type | Intent | Optional | 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) |
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