Rotation matrix for frequencies -> results in surface shifting
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=I4), | intent(in) | :: | long |
2D array length |
||
| integer(kind=I4), | intent(in) | :: | larg |
2D array width |
||
| real(kind=R8), | intent(in), | optional, | dimension(2) | :: | shift |
surface shift fraction along x and y |
| complex(kind=R8), | intent(out), | dimension(1:long, 1:larg) | :: | shift_tab |
2D array out |
subroutine shifting(long, larg, shift, shift_tab) !================================================================================================ !! Rotation matrix for frequencies -> results in surface shifting !------------------------------------------------------------------------------------------------ implicit none integer(kind=I4), intent(in ) :: long !! *2D array length* integer(kind=I4), intent(in ) :: larg !! *2D array width* real (kind=R8), intent(in ), dimension(2), optional :: shift !! *surface shift fraction along x and y* complex(kind=R8), intent(out), dimension(1:long, 1:larg) :: shift_tab !! *2D array out* integer(kind=I4) :: i, j real (kind=R8) :: x, y complex(kind=R8) :: eixi, tmp x = - shift(1) * ( 2 * pi_r8 / (long - 1) ) y = - shift(2) * ( 2 * pi_r8 / (larg - 1) ) do i = 1, long eixi = cmplx( cos((i - 1) * x), sin((i - 1) * x), kind=r8 ) do j = 1, larg shift_tab(i, j) = eixi * cmplx( cos((j - 1) * y), sin((j - 1) * y), kind=r8 ) enddo enddo return endsubroutine shifting