program grabuge use genplotting implicit none call genp_init (0) call do_surface (51) call genp_end (0) contains ! --------------------------------------------------------- real function displacement(x, y, a) real, intent(in) :: x, y integer, intent(in) :: a displacement = cos(((5.8+x+y)*(y+x))/real(a)) end function ! --------------------------------------------------------- subroutine do_surface (amp) integer, intent(in) :: amp integer :: ix, iy, color real :: rx, ry, dy, disp logical :: startline do iy= -amp, amp ry = real(iy) startline = .true. do ix = -(amp-1), amp rx = real(ix) disp = displacement (rx, ry, amp) dy = ry + disp if (disp .lt. 0.0) then color = 6 else color = 3 endif if (startline) then call genp_move(real(-amp), dy) startline = .false. else call genp_draw(rx, dy, color) endif enddo enddo end subroutine ! --------------------------------------------------------- end program