anchor.diff: -! Copyright (C) 2015-2017, Simone Marsili 
  +! Copyright (C) 2015-2017, Simone Marsili
   ! All rights reserved.
   ! License: BSD 3 clause
   
  
positive.code:      ! read nvars
       call parse_next_line(unt, line, parsed_line, nfields, err)
       if (err < 0) then
          write(0,*) "input file can be converted to a valid checkpoint file"
          stop
       end if
       read(parsed_line, *, iostat=err) nvars
       if (err < 0) then
          write(0,*) "check n. of features"
          stop
       end if
  
       ! read nclasses
       call parse_next_line(unt, line, parsed_line, nfields, err)
       if (err < 0) then
          write(0,*) "input file can be converted to a valid checkpoint file"
          stop
       end if
       read(parsed_line, *, iostat=err) nclasses
       if (err < 0) then
          write(0,*) "check n. of classes"
          stop
       end if
  
       ! read data type
       call parse_next_line(unt, line, parsed_line, nfields, err)
       if (err < 0) then
          write(0,*) "input file can be converted to a valid checkpoint file"
          stop
       end if
       read(parsed_line, *, iostat=err) data_type
       if (err < 0) then
          write(0,*) "check output data type format"
          stop
       end if
  
       ! read ndata
       call parse_next_line(unt, line, parsed_line, nfields, err)
       if (err < 0) then
          write(0,*) "input file can be converted to a valid checkpoint file"
          stop
       end if
       read(parsed_line, *, iostat=err) ndata
       if (err < 0) then
          write(0,*) "check n. of samples in .chk file"
          stop
       end if
       
       ! if the first lines are ok, allocate
       allocate(prm(nvars*nclasses + nvars*(nvars - 1)*nclasses**2/2),stat=err)
       prm = 0.0_kflt
  
negative.code:   use arguments, only: read_opt, read_opt_arg
    use parser, only: parser_nfields,remove_comments, parse_next_line
    implicit none
  
    character(len=string_size) :: data_type
    integer                    :: nvars=0, nclasses=0
    integer,       allocatable :: seqs(:,:)
  