
       implicit integer*4(i-n)
       implicit real*8(a-h,o-z)
       parameter(nmax=1000)
       dimension x(nmax),y(nmax),v(nmax)
       dimension ax(nmax,nmax),bx(nmax,nmax),cx(nmax,nmax)
      
       write(6,'(a,$)')'nx: '
       read(5,*)nx
       write(6,'(a,$)')'ny: '
       read(5,*)ny
       write(6,'(a,$)')'xmax: '
       read(5,*)hx
       write(6,'(a,$)')'ymax: '
       read(5,*)hy
c       nx=4
c       ny=10
c       hx=15.d+00
c       hy=30.d+00
      
      do i=1,nx+1
        x(i)=dfloat(i-1)/dfloat(nx)
        x(i)=x(i)*hx
      enddo
      
      do j=1,ny+1
        y(j)=dfloat(j-1)/dfloat(ny)
        y(j)=y(j)*hy
      enddo
      
      do i=1,nx+1
        do j=1,ny+1
          ax(j,i)=x(i)
          bx(j,i)=y(j)
          cx(j,i)=cos(ax(j,i))+cos(bx(j,i))
        enddo
      enddo
      
      open(unit=10,file='datos1.txt',status='unknown')

	write(10,'(2i5)')nx,ny
	write(10,*)
      
      do j=1,ny+1
        do i=1,nx
        write(10,100)ax(j,i)
        enddo
        write(10,101)ax(j,nx+1)
      enddo
      write(10,*)
      do j=1,ny+1
        do i=1,nx
        write(10,100)bx(j,i)
        enddo
        write(10,101)bx(j,nx+1)
      enddo
      write(10,*)
      do j=1,ny+1
        do i=1,nx
        write(10,100)cx(j,i)
        enddo
        write(10,101)cx(j,nx+1)
      enddo
 100   format(e12.5,$)
 101   format(e12.5)
      close(10)
      


      end
      

       