Subroutine to apply a roughness table to a surface
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(FE_FILM), | intent(inout) | :: | fe_f | |||
real(kind=R8), | intent(in), | dimension(:,:) | :: | tab_s |
subroutine apply_roughness(fe_f, tab_s)
implicit none
type(FE_FILM), intent(inout) :: fe_f
real(kind=R8), intent(in ), dimension(:,:) :: tab_s
real(kind=R8) :: xp, yp
integer(kind=I4) :: k, i, j
do k = 1, fe_f%m%n
xp = fe_f%m%x(k)
yp = fe_f%m%y(k)
i = int((fe_f%m%nx - 1) * xp / fe_f%m%lx) + 1
j = int((fe_f%m%ny - 1) * yp / fe_f%m%ly) + 1
fe_f%vn(k, H2_N) = fe_f%data_f%h_0 - tab_s(i, j)
enddo
fe_f%vn(:, H_N) = fe_f%vn(:, H2_N) - fe_f%vn(:, H1_N)
return
endsubroutine apply_roughness