! Programm reads the firts line of files:
! observ_surf_t.dat observ_soil_t_<n>p<nn>.dat, observ_soil_q_<n>p<nn>.dat
! (created by baltex_lindenberg_param_data_compilation procedure),
! compilates read data to define initial condition about the profiles of
! soil temperature and soil water content 

implicit none

integer, parameter :: nlevel_soil_inp_t=13, nlevel_soil_inp_q=6

real, dimension(nlevel_soil_inp_t) :: ts_inp, &
 level_soil_inp_t=(/0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.45, 0.50, 0.60, 0.90, 1.00, 1.20, 1.50/)
character(len=22), dimension(nlevel_soil_inp_t) :: file_input_ts= &
 (/"observ_surf_t.dat     ", "observ_soil_t_0p05.dat", "observ_soil_t_0p10.dat", &
 "observ_soil_t_0p15.dat", "observ_soil_t_0p20.dat", "observ_soil_t_0p30.dat", &
 "observ_soil_t_0p45.dat", "observ_soil_t_0p50.dat", "observ_soil_t_0p60.dat", &
 "observ_soil_t_0p90.dat", "observ_soil_t_1p00.dat", "observ_soil_t_1p20.dat", &
 "observ_soil_t_1p50.dat"/)

real, dimension(nlevel_soil_inp_q) :: qs_inp, &
 level_soil_inp_q=(/0.08, 0.15, 0.30, 0.45, 0.60, 0.90/)
character(len=22), dimension(nlevel_soil_inp_q) :: file_input_qs= &
 (/"observ_soil_q_0p08.dat", "observ_soil_q_0p15.dat", "observ_soil_q_0p30.dat", &
 "observ_soil_q_0p45.dat", "observ_soil_q_0p60.dat", "observ_soil_q_0p90.dat"/)

integer :: k
real :: zzz

 do k=1,nlevel_soil_inp_t
   open (11, file=trim(file_input_ts(k)), status="old")
   read (11,*) zzz, ts_inp(k)
   close (11)
 enddo

 do k=1,nlevel_soil_inp_q
   open (11, file=trim(file_input_qs(k)), status="old")
   read (11,*) zzz, qs_inp(k)
   close (11)
 enddo

 print *
 write (*,'(20(1x,f6.2))') ts_inp(1:nlevel_soil_inp_t)
 print *
 write (*,'(20(1x,f6.2))') qs_inp(1:nlevel_soil_inp_q)

stop
end
