mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-28 11:30:19 +00:00
36 lines
797 B
Fortran
36 lines
797 B
Fortran
! { dg-do compile }
|
|
! { dg-options "-Ofast" }
|
|
module m
|
|
implicit none
|
|
private
|
|
save
|
|
|
|
integer, parameter, public :: &
|
|
ii4 = selected_int_kind(6), &
|
|
rr8 = selected_real_kind(13)
|
|
|
|
integer (ii4), dimension(40,40,199), public :: xyz
|
|
public :: foo
|
|
contains
|
|
subroutine foo(a)
|
|
real (rr8), dimension(40,40), intent(out) :: a
|
|
real (rr8), dimension(40,40) :: b
|
|
integer (ii4), dimension(40,40) :: c
|
|
integer i, j
|
|
|
|
do i=1,20
|
|
b(i,j) = 123 * a(i,j) + 34 * a(i,j+1) &
|
|
+ 34 * a(i,j-1) + a(i+1,j+1) &
|
|
+ a(i+1,j-1) + a(i-1,j+1) &
|
|
+ a(i-1,j-1)
|
|
c(i,j) = 123
|
|
end do
|
|
|
|
where ((xyz(:,:,2) /= 0) .and. (c /= 0))
|
|
a = b/real(c)
|
|
elsewhere
|
|
a = 456
|
|
endwhere
|
|
end subroutine foo
|
|
end module m
|