m_physpar.F90 2.47 KB
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! module routine which reads the parameters needed from the file "infile"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module m_physpar
contains
subroutine physpar(tfin,dt,totdepth,dz,iniref,iniens,vars,mode,meas_action,nrsamp)
   use mod_dimensions
   use mod_variances
   implicit none

   real,            intent(out) :: tfin      ! Final time
   real,            intent(out) :: totdepth  ! Total depth
   real,            intent(out) :: dt        ! time step in inverse grid
   real,            intent(out) :: dz        ! space step in inverse grid
   logical,         intent(out) :: iniref    ! genereate new ref sol or not
   logical,         intent(out) :: iniens    ! genereate initial ensemble
   type(variances), intent(out) :: vars
   type(lstates),   intent(out) :: meas_action
   integer,         intent(out) :: mode
   integer,         intent(out) :: nrsamp

   open(10,file='inpar.in')
      read(10,*)tfin           ! Final time 
      read(10,*)totdepth       ! Total depth
      read(10,'(l1)')iniref    ! generate new ref sol
      read(10,'(l1)')iniens    ! generate new initial ensemble
      read(10,*)mode           ! 0 - ensemble int,  1 - EnKF, 2 - EnKS
      read(10,'(i3)') nrsamp   ! ensemble size
      read(10,'(3l1)')meas_action    ! N P H true for variables to measure
   close(10)
   dt=(tfin-0.0)/float(ndim-1)
   dz=(totdepth-0.0)/float(kdim-1)

   open(10,file='invar.in')
      read(10,*)vars%dyn    ! vars%dyn(1:antvar)  Dynamical average error covariance
      read(10,*)vars%ini    ! vars%ini(1:antvar)  Initial error covariance
      read(10,*)vars%b0     ! vars%b0(1:antvar)   bottom boundary cov.
      read(10,*)vars%bh     ! vars%bh(1:antvar)   bottom boundary cov.
      read(10,*)vars%mes    ! vars%mes(1:antvar)  Measurement error covariance
   close(10)

   print '(a,f10.2)', 'Final time..=',tfin
   print '(a,f10.2)', 'Total depth.=',totdepth
   print '(a,i5)', 'Ensemble size.=',nrsamp
   print '(a,tr4,l1)', 'Iniref......=',iniref
   print '(a,tr4,l1)','Iniens......=',iniens
   print '(a,tr4,3l1)','Meas_action.=',meas_action

   print '(a,f10.6)', 'dt_out......=',dt
   print '(a,f10.6)', 'dz..........=',dz
   print '(a,4e11.4)','vars%dyn....=',vars%dyn
   print '(a,4e11.4)','vars%ini....=',vars%ini
   print '(a,4e11.4)','vars%b0.....=',vars%b0
   print '(a,4e11.4)','vars%bh.....=',vars%bh
   print '(a,4e11.4)','vars%mes....=',vars%mes


end subroutine physpar
end module m_physpar