!# This source file is part of code Pégase.3.0.1 (2019-02-21).
!# Copyright: Michel Fioc (Michel.Fioc@iap.fr), Sorbonne université, 
!# Institut d'astrophysique de Paris/CNRS, France.
!# 
!# Pégase.3.0.1 is governed by the CeCILL license under French law and abides 
!# by the rules of distribution of free software. You can use, modify and/or 
!# redistribute this software under the terms of the CeCILL license as circulated 
!# by CEA, CNRS and INRIA at "http://www.cecill.info". The text of this license
!# is also available in French and in English in directory "doc_dir/" of this
!# code.
!# 
!# As a counterpart to the access to the source code and to the rights to copy,
!# modify and redistribute it granted by the license, users are provided only
!# with a limited warranty, and the software's author, the holder of the
!# economic rights, and the successive licensors have only limited
!# liability. 
!# 
!# The fact that you are presently reading this means that you have had
!# knowledge of the CeCILL license and that you accept its terms.
!#====================================================================== 

module mod_read_cosmo_param

  use mod_types
  use mod_analyze_statement, only : get_val, error_message

  implicit none
  public
  real(CDR), save :: Omega_m, H_0, form_redshift
  logical, save :: CBR

contains

!#======================================================================

  subroutine reset_cosmo

    use mod_spectra_def_param
    implicit none
!#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Omega_m = Omega_m_def
    H_0 = H_0_def
    form_redshift = form_redshift_def
    CBR = CBR_def

  end subroutine reset_cosmo

!#======================================================================

  subroutine read_Omega_m(rhs)

    implicit none
    character(len=*), intent(in) :: rhs
!#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    call get_val(Omega_m, rhs)

  end subroutine read_Omega_m

!#======================================================================

  subroutine read_H_0(rhs)

    implicit none
    character(len=*), intent(in) :: rhs
!#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    call get_val(H_0, rhs)

  end subroutine read_H_0

!#======================================================================

  subroutine read_form_redshift(rhs)

    implicit none
    character(len=*), intent(in) :: rhs
!#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    call get_val(form_redshift, rhs)

  end subroutine read_form_redshift

!#======================================================================

  subroutine read_CBR(rhs)

    implicit none
    character(len=*), intent(in) :: rhs
!#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    call get_val(CBR, rhs)

  end subroutine read_CBR

end module mod_read_cosmo_param
