PROGRAM MAIN
  IMPLICIT NONE
  REAL*8::x0,y0,xn,yn,a,b,x00,y00
  INTEGER::Nt,i,n,j,NFINAL,idx
  REAL*8, PARAMETER:: pi=4.0*ATAN(1.0)
  INTEGER, PARAMETER:: NMAX=10000 !Number of initial conditions
  !---------------------------------------------------------
  OPEN(1,FILE='Data.dat',STATUS='UNKNOWN')
  !--------------------------------------------------------
  ! Parameters
  a=0.375
  b=0.75
  !
  NFINAL=1000000 !Final iteration time
  Nt=0
  IC: DO i=1,NMAX
     x00=i/(1.0*NMAX)
     y00=-10.0
     x0=x00;y0=y00
     idx=0
     TIME: DO n=1,NFINAL !Time evolution
        yn=y0-b*SIN(2.0*pi*x0)
        xn=MOD(x0+a*(1.0-yn**2.0),1.0)
        !
        IF(xn.LT.0.0) xn=xn+1.0
        !
        IF(yn.GT.10.0) THEN
           WRITE(1,*) x00,y00,n
           idx=1
           EXIT
        END IF
        x0=xn;y0=yn
     END DO TIME
     IF(idx.EQ.0) WRITE(1,*) x00,y00,NFINAL
  END DO IC
END PROGRAM MAIN
        
