c Copyright (C) 2008-2011 Vincent Eymet c c KSPECTRUM is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3, or (at your option) c any later version. c KSPECTRUM is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c You should have received a copy of the GNU General Public License c along with KSPECTRUM; if not, see c subroutine get_nlines(kfile,stringp_file,nl) implicit none include 'max.inc' logical ex integer strlen,nl character*(Nchar_mx) kfile character*(Nchar_mx) command character*(Nchar_mx) stringp_file inquire(file=kfile(1:strlen(kfile)),exist=ex) if (.not.ex) then nl=0 goto 123 endif c Number of lines in the specified data file command="wc -l < "//kfile(1:strlen(kfile))//" > "// & stringp_file(1:strlen(stringp_file)) call exec(command) open(10,file=stringp_file(1:strlen(stringp_file))) read(10,*) nl close(10) 123 continue return end