update new files
[unres.git] / source / maxlik / src_MD_T_maxlik-NEWCORR.safe / weightgener.f
1       implicit real*8 (a-h,o-z)
2       character*16 wname(100)
3       integer ilen
4       external ilen
5       double precision weight(100),weightp(100),wspan(100),wlb(100)
6       read(*,*) iseed,nwei
7       iseed=-iabs(iseed)
8       call vrndst(iseed)
9       do i=1,100
10         read(*,*,end=10,err=10) wname(i),weight(i),wspan(i),wlb(i)
11         print *,"i",i," wname ",wname(i)," weight",weight(i)
12       enddo
13    10 n=i-1
14       do i=1,nwei
15         write (*,'("Weight set",i3,t80,"&")') i
16         il=0
17         do j=1,n
18           bound_l = weight(j)-wspan(j)
19           if (bound_l.lt.wlb(j)) bound_l=wlb(j)
20           bound_r = weight(j)+wspan(j)
21           weightp(j)=ran_number(bound_l,bound_r)
22           ill=il
23           il=il+ilen(wname(j))+9
24           if (il.gt.79) then
25             write (*,'(a,$)') (' ',k=1,79-ill)
26             write (*,'(1h&)')
27             write(*,'(a,1h=,f7.5," ",$)') wname(j)(:ilen(wname(j))),
28      &                     weightp(j)
29             il=ilen(wname(j))+9
30           else
31             write(*,'(a,1h=,f7.5," ",$)') wname(j)(:ilen(wname(j))),
32      &                     weightp(j)
33           endif
34         enddo
35         write (*,*)
36         write (*,*)
37       enddo
38       end