Merge branch 'prerelease-3.2.1'
[unres.git] / source / unres / src_MD-M / readrtns_CSA.F
index 0b08ab7..bd17218 100644 (file)
@@ -1862,8 +1862,16 @@ C Get parameter filenames and open the parameter files.
       open (ibond,file=bondname,status='old',readonly,shared)
       call getenv_loc('THETPAR',thetname)
       open (ithep,file=thetname,status='old',readonly,shared)
+#ifndef CRYST_THETA
+      call getenv_loc('THETPARPDB',thetname_pdb)
+      open (ithep_pdb,file=thetname_pdb,status='old',readonly,shared)
+#endif
       call getenv_loc('ROTPAR',rotname)
       open (irotam,file=rotname,status='old',readonly,shared)
+#ifndef CRYST_SC
+      call getenv_loc('ROTPARPDB',rotname_pdb)
+      open (irotam_pdb,file=rotname_pdb,status='old',readonly,shared)
+#endif
       call getenv_loc('TORPAR',torname)
       open (itorp,file=torname,status='old',readonly,shared)
       call getenv_loc('TORDPAR',tordname)
@@ -1888,9 +1896,17 @@ c      print *,"Processor",myrank," opened file IBOND"
       call getenv_loc('THETPAR',thetname)
       open (ithep,file=thetname,status='old',action='read')
 c      print *,"Processor",myrank," opened file ITHEP" 
+#ifndef CRYST_THETA
+      call getenv_loc('THETPARPDB',thetname_pdb)
+      open (ithep_pdb,file=thetname_pdb,status='old',action='read')
+#endif
       call getenv_loc('ROTPAR',rotname)
       open (irotam,file=rotname,status='old',action='read')
 c      print *,"Processor",myrank," opened file IROTAM" 
+#ifndef CRYST_SC
+      call getenv_loc('ROTPARPDB',rotname_pdb)
+      open (irotam_pdb,file=rotname_pdb,status='old',action='read')
+#endif
       call getenv_loc('TORPAR',torname)
       open (itorp,file=torname,status='old',action='read')
 c      print *,"Processor",myrank," opened file ITORP" 
@@ -1919,8 +1935,16 @@ C Get parameter filenames and open the parameter files.
       open (ibond,file=bondname,status='old')
       call getenv_loc('THETPAR',thetname)
       open (ithep,file=thetname,status='old')
+#ifndef CRYST_THETA
+      call getenv_loc('THETPARPDB',thetname_pdb)
+      open (ithep_pdb,file=thetname_pdb,status='old')
+#endif
       call getenv_loc('ROTPAR',rotname)
       open (irotam,file=rotname,status='old')
+#ifndef CRYST_SC
+      call getenv_loc('ROTPARPDB',rotname_pdb)
+      open (irotam_pdb,file=rotname_pdb,status='old')
+#endif
       call getenv_loc('TORPAR',torname)
       open (itorp,file=torname,status='old')
       call getenv_loc('TORDPAR',tordname)
@@ -1943,8 +1967,18 @@ C Get parameter filenames and open the parameter files.
       open (ibond,file=bondname,status='old',readonly)
       call getenv_loc('THETPAR',thetname)
       open (ithep,file=thetname,status='old',readonly)
+#ifndef CRYST_THETA
+      call getenv_loc('THETPARPDB',thetname_pdb)
+      print *,"thetname_pdb ",thetname_pdb
+      open (ithep_pdb,file=thetname_pdb,status='old',action='read')
+      print *,ithep_pdb," opened"
+#endif
       call getenv_loc('ROTPAR',rotname)
       open (irotam,file=rotname,status='old',readonly)
+#ifndef CRYST_SC
+      call getenv_loc('ROTPARPDB',rotname_pdb)
+      open (irotam_pdb,file=rotname_pdb,status='old',action='read')
+#endif
       call getenv_loc('TORPAR',torname)
       open (itorp,file=torname,status='old',readonly)
       call getenv_loc('TORDPAR',tordname)
@@ -2388,6 +2422,9 @@ C Initialize random number generator
 C
       implicit real*8 (a-h,o-z)
       include 'DIMENSIONS'
+#ifdef AMD64
+      integer*8 iseedi8
+#endif
 #ifdef MPI
       include 'mpif.h'
       logical OKRandom, prng_restart
@@ -2423,9 +2460,11 @@ C
       if (fg_rank.eq.0) then
       seed=seed*(me+1)+1
 #ifdef AMD64
-      if(me.eq.king)
-     &  write (iout,*) 'MPI: node= ', me, ' iseed= ',iseed
-      OKRandom = prng_restart(me,iseed)
+      iseedi8=dint(seed)
+      if(me.eq.king .or. .not. out1file)
+     &  write (iout,*) 'MPI: node= ', me, ' iseed= ',iseedi8
+      write (*,*) 'MPI: node= ', me, ' iseed= ',iseedi8
+      OKRandom = prng_restart(me,iseedi8)
 #else
       do i=1,4
        tmp=65536.0d0**(4-i)