~maddevelopers/mg5amcnlo/2.7.1.3

« back to all changes in this revision

Viewing changes to Template/NLO/SubProcesses/mint-integrator2.f

  • Committer: olivier Mattelaer
  • Date: 2016-05-12 11:00:18 UTC
  • mfrom: (262.1.150 2.3.4)
  • Revision ID: olivier.mattelaer@uclouvain.be-20160512110018-sevb79f0wm4g8mpp
pass to 2.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
655
655
      real * 8 xn(nintervals),r,tiny,xl,xu,nl,nu
656
656
      parameter ( tiny=1d-8 )
657
657
      integer kint,jint
658
 
      logical plot_grid
659
 
      parameter (plot_grid=.false.)
660
658
c Use the same smoothing as in VEGAS uses for the grids (i.e. use the
661
659
c average of the central and the two neighbouring grid points):
662
660
      xl=xacc(1)
691
689
      do kint=1,ninter
692
690
         xacc(kint)=xacc(kint)/xacc(ninter)
693
691
      enddo
694
 
cRF: Check that we have a reasonable result and update the accumulated
 
692
c Check that we have a reasonable result and update the accumulated
695
693
c results if need be
696
694
      do kint=1,ninter
697
695
         if (xacc(kint).lt.(xacc(kint-1)+tiny)) then
698
 
c            write (*,*) 'Accumulated results need adaptation #1:'
699
 
c            write (*,*) xacc(kint),xacc(kint-1),' become'
700
696
            xacc(kint)=xacc(kint-1)+tiny
701
 
c            write (*,*) xacc(kint),xacc(kint-1)
702
697
         endif
703
698
      enddo
704
699
c it could happen that the change above yielded xacc() values greater
705
 
c than 1; should be fixed once more.
 
700
c than 1: one more update needed
706
701
      xacc(ninter)=1d0
707
702
      do kint=1,ninter
708
703
         if (xacc(ninter-kint).gt.(xacc(ninter-kint+1)-tiny)) then
709
 
c            write (*,*) 'Accumulated results need adaptation #2:'
710
 
c            write (*,*) xacc(ninter-kint),xacc(ninter-kint+1),' become'
711
704
            xacc(ninter-kint)=1d0-dble(kint)*tiny
712
 
c            write (*,*) xacc(ninter-kint),xacc(ninter-kint+1)
713
705
         else
714
706
            exit
715
707
         endif
716
708
      enddo
717
 
cend RF
718
 
 
719
 
      if (plot_grid) then
720
 
         write(11,*) 'set limits x 0 1 y 0 1'
721
 
         write(11,*) 0, 0
722
 
         do kint=1,ninter
723
 
            write(11,*) xgrid(kint),xacc(kint)
724
 
         enddo
725
 
         write(11,*) 'join 1'
726
 
      endif
727
709
 
728
710
      do kint=1,ninter
729
711
         r=dble(kint)/dble(ninter)
730
 
 
731
 
         if (plot_grid) then
732
 
            write(11,*) 0, r
733
 
            write(11,*) 1, r
734
 
            write(11,*) ' join'
735
 
         endif
736
 
 
737
712
         do jint=1,ninter
738
713
            if(r.lt.xacc(jint)) then
739
714
               xn(kint)=xgrid(jint-1)+(r-xacc(jint-1))
750
725
      enddo
751
726
      do kint=1,ninter
752
727
         xgrid(kint)=xn(kint)
753
 
         if (plot_grid) then
754
 
            write(11,*) xgrid(kint), 0
755
 
            write(11,*) xgrid(kint), 1
756
 
            write(11,*) ' join'
757
 
         endif
758
728
      enddo
759
 
      if (plot_grid) write(11,*) ' newplot'
760
729
      end
761
730
 
762
731
      subroutine nextlexi(ndim,iii,kkk,iret)
1057
1026
      implicit none
1058
1027
      integer ncalls0,ndim,ncalls,i
1059
1028
      integer dim,ng,npg,k
1060
 
      common /even_ran/dim,ng,npg,k
 
1029
      logical firsttime
 
1030
      common /even_ran/dim,ng,npg,k,firsttime
 
1031
c Make sure that hypercubes are newly initialized
 
1032
      firsttime=.true.
1061
1033
c Number of dimension of the integral
1062
1034
      dim=ndim
1063
1035
c Number of elements in which we can split one dimension
1076
1048
      implicit none
1077
1049
      double precision ran2,dng
1078
1050
      external ran2
 
1051
      integer dim,ng,npg,k
1079
1052
      logical firsttime
1080
 
      data firsttime/.true./
1081
 
      integer dim,ng,npg,k
1082
 
      common /even_ran/dim,ng,npg,k
 
1053
      common /even_ran/dim,ng,npg,k,firsttime
1083
1054
      integer maxdim
1084
1055
      parameter (maxdim=100)
1085
1056
      integer iii(maxdim),kkk(maxdim),i,iret
1181
1152
     $     ,ndimmax)
1182
1153
      double precision ave_virt(nintervals_virt,ndimmax)
1183
1154
     $     ,ave_virt_acc(nintervals_virt,ndimmax)
1184
 
     $     ,ave_born_acc(nintervals_virt ,ndimmax)
 
1155
     $     ,ave_born_acc(nintervals_virt,ndimmax)
1185
1156
      common/c_ave_virt/ave_virt,ave_virt_acc,ave_born_acc,nvirt
1186
1157
     $     ,nvirt_acc
1187
1158
c need to solve for k_new = (virt+k_old*born)/born