<commit_before>! This program reads in a file in the format of struct_enum.out and
! makes a postscript output of the 2D structures
PROGRAM make2Dplot
use num_types
use vector_matrix_utilities
implicit none
character(80) fname, title, labeling, dummy
integer ioerr,  i,j,  is,js, iD, nD
integer k, strN, hnfN, sizeN, nAt, diag(3), a,b,c,d,e,f,  fullL(3,3), pgOps,&
     & label, L(2,2), temp(2), Nspots, rows, cols, indx
real(sp) :: p(3,3),  scale, spotsize
real(sp) :: xorig, yorig, parLat(2,2),point(2),yoff,xoff
real(dp), allocatable :: dvec(:,:)

if(iargc()/=1) stop "2Dplot.x requires as an argument &
     & the filename to read from"
call getarg(1,dummy)
read(dummy,*) fname

open(11,file=fname,status='old',iostat=ioerr)
if(ioerr/=0)then; write(*,'("Input file doesn''t exist:",a80)') trim(fname);endif
! Read in the title from the struct_enum.out file
read(11,'(a80)') title; title = trim(title)
read(11,*) dummy ! Read in surf/bulk
 
! Read in the parent lattice vectors
do i = 1,3; read(11,*) p(:,i); enddo
parLat = p(2:3,2:3)

! Read in the basis vectors for the d-set
read(11,*) nD
allocate(dvec(3,nD))
do i = 1,nD
   read(11,*) dvec(:,i)
enddo

! Read in the number of labels, i.e., binary, ternary, etc.
read(11,'(i2)') k
do i = 1,4;read(11,*);enddo ! Skip 4 lines

scale = .33
Nspots = 8
rows = 16
cols = 5
spotsize = .35
call init(scale,-10.0,-2.0)
call init_colors

xorig = 0.; yorig = 0
! Need to add a loop over each structure
outer: do js = 1,rows
   do is = 1,cols
      xoff = (is-1)*Nspots
      yoff = 28/scale - (js-1)*Nspots
      !if ((js-1)*cols+is>160) exit outer ! Ternary
      !if ((js-1)*cols+is>155) exit outer ! binary
      if (yoff < 0) exit outer
      ! Read in the info for the given structure
      read(11,*,iostat=ioerr) strN, hnfN,sizeN, nAt, pgOps, diag, a,b,c,d,e,f,&
      fullL,labeling
      if (ioerr/=0) exit
      L = reshape((/fullL(2,2),fullL(2,3),fullL(3,2),fullL(3,3)/),(/2,2/))
      do i = 1,2
         write(*,'(2i2)') L(i,:)
      enddo
      indx = diag(2)*diag(3)
      do i = 0,Nspots-2
         do j = 0,Nspots-2<commit_msg>just a small change to make2Dplot.f90.<commit_after>! This program reads in a file in the format of struct_enum.out and
! makes a postscript output of the 2D structures
PROGRAM make2Dplot
use num_types
use vector_matrix_utilities
implicit none
character(80) fname, title, labeling, dummy
integer ioerr,  i,j,  is,js, iD, nD
integer k, strN, hnfN, sizeN, nAt, diag(3), a,b,c,d,e,f,  fullL(3,3), pgOps,&
     & label, L(2,2), temp(2), Nspots, rows, cols, indx
real(sp) :: p(3,3),  scale, spotsize
real(sp) :: xorig, yorig, parLat(2,2),point(2),yoff,xoff
real(dp), allocatable :: dvec(:,:)

if(iargc()/=1) stop "2Dplot.x requires as an argument &
     & the filename to read from"
call getarg(1,dummy)
read(dummy,*) fname

open(11,file=fname,status='old',iostat=ioerr)
if(ioerr/=0)then; write(*,'("Input file doesn''t exist:",a80)') trim(fname);endif
! Read in the title from the struct_enum.out file
read(11,'(a80)') title; title = trim(title)
read(11,*) dummy ! Read in surf/bulk
 
! Read in the parent lattice vectors
do i = 1,3; read(11,*) p(:,i); enddo
parLat = p(2:3,2:3)

! Read in the basis vectors for the d-set
read(11,*) nD
allocate(dvec(3,nD))
do i = 1,nD
   read(11,*) dvec(:,i)
enddo

! Read in the number of labels, i.e., binary, ternary, etc.
read(11,'(i2)') k
do i = 1,4;read(11,*);enddo ! Skip 4 lines

scale = .19
Nspots = 10
rows = 16
cols = 10
spotsize = .35
call init(scale,-10.0,-2.0)
call init_colors

xorig = 0.; yorig = 0
! Need to add a loop over each structure
outer: do js = 1,rows
   do is = 1,cols
      xoff = (is-1)*Nspots
      yoff = 28/scale - (js-1)*Nspots
      !if ((js-1)*cols+is>160) exit outer ! Ternary
      !if ((js-1)*cols+is>155) exit outer ! binary
      if (yoff < 0) exit outer
      ! Read in the info for the given structure
      read(11,*,iostat=ioerr) strN, hnfN,sizeN, nAt, pgOps, diag, a,b,c,d,e,f,&
      fullL,labeling
      if (ioerr/=0) exit
      L = reshape((/fullL(2,2),fullL(2,3),fullL(3,2),fullL(3,3)/),(/2,2/))
      do i = 1,2
         write(*,'(2i2)') L(i,:)
      enddo
      indx = diag(2)*diag(3)
      do i = 0,Nspots-2
         do j = 0,Nspots-2
{'fraction_non_alphanumeric': 0.16884661117717004, 'fraction_numerical': 0.05065398335315101, 'mean_word_length': 3.6941964285714284, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6836274', 'n_tokens_mistral': 1847, 'n_tokens_neox': 1731, 'n_words': 494}