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_model(m,Nmol,alt,pres,temp,x) implicit none include 'max.inc' include 'formats.inc' c c Purpose: to read atmospheric data contained in file "model.in" c c Output: c + m: number of atmospheric levels c + Nmol: number of molecular species c + alt: altitude at each level (m) c + pres: pressure at each level (atm) c + temp: temperature at each level (K) c + x: molar fraction (mixratio) of each molecule, at each atmospheric level c integer m,ios,Nmol,mol,i double precision alt(1:Nmax) double precision pres(1:Nmax) double precision temp(1:Nmax) double precision x(1:Nmax,1:Nmol_mx) character*(Nchar_mx) file_model,strtmp1 c label integer strlen character*(Nchar_mx) label label='subroutine read_model' file_model='./data/composition.in' open(11,file=file_model(1:strlen(file_model)), & status='old',iostat=ios) if (ios.ne.0) then ! file not found write(*,*) 'Error from routine ', & label(1:strlen(label)),' :' write(*,*) 'Data file could not be found:' write(*,*) file_model(1:strlen(file_model)) stop endif write(*,*) 'Reading atmospheric profile data from file:' write(*,*) file_model(1:strlen(file_model)) read(11,*) read(11,*) read(11,*) m read(11,*) read(11,*) Nmol read(11,*) read(11,*) do i=1,m read(11,50) alt(i),pres(i),temp(i),(x(i,mol),mol=1,Nmol) enddo close(11) return end