c Copyright (C) 2008-2014 Vincent Eymet c c KDISTRIBUTION 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 KDISTRIBUTION 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 KDISTRIBUTION; if not, see c subroutine read_data(i_min,i_max) implicit none include 'max.inc' c c Purpose: to read data from the "data.in" file c c Outputs: c + i_min,i_max: min and max layer indexes c integer i_min,i_max,ios,i character*(Nchar_mx) dfile c label integer strlen character*(Nchar_mx) label label='subroutine read_data' dfile='./data.in' open(11,file=dfile(1:strlen(dfile)),status='old',iostat=ios) if (ios.ne.0) then ! file not found write(*,*) 'Error from routine ',label(1:strlen(label)),' :' write(*,*) 'File not found:' write(*,*) dfile(1:strlen(dfile)) stop endif do i=1,3 read(11,*) enddo read(11,*) i_min read(11,*) read(11,*) i_max close(11) return end