PROGRAM MAIN
  IMPLICIT NONE
  REAL*8::a,b,x0,y0,xn,yn
  INTEGER::NT,j,i,n,k,NTOTAL,NFINAL
  REAL*8, PARAMETER:: pi=4.0*ATAN(1.0)
  INTEGER, PARAMETER:: NMAX=1E4
  !---------------------------------------------------------------
  OPEN(1,FILE='NoBarrier.dat', STATUS='UNKNOWN')
  OPEN(2,FILE='ParameterSpaceTransmissivity.dat', STATUS='OLD')
  !---------------------------------------------------------------
  NTOTAL=1360702 !File length
  !Final iteration time
  NFINAL=100
  !---------------------------------------------------------------  
  PARAMETERS: DO j=1,NTOTAL
     READ(2,*) a,b
     NT=0
     IC: DO i=1,NMAX !Inital Conditions
        x0=i/(1.0*NMAX)
        y0=-10.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
              NT=NT+1
              EXIT
           END IF
           x0=xn;y0=yn
        END DO TIME
     END DO IC
     WRITE(1,*) a,b,NT,NT/(1.0*NMAX)
  END DO PARAMETERS
END PROGRAM MAIN
              
