c kspectrum (http://www.meso-star.com/en_Products.html) - This file is part of kspectrum c Copyright (C) 2008-2015 - Méso-Star - Vincent Eymet c c This file must be used under the terms of the CeCILL license. c This source file is licensed as described in the file COPYING, which c you should have received as part of this distribution. The terms c are also available at c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt 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