    !**************************************************************************
    ! subroutine readfile
    ! read molecular parameters (line strength, halfwidth, etc) from file
    !**************************************************************************
    ! linen           : number of line
    ! wnlc0(linen)    : wave number at line center (m^-1)
    ! stren0(linen)   : line strength (m^-1 / (molecule m^-2))
    ! abwid0(linen)   : air-broadened half width (m^-1 @ 296K)
    ! sbwid0(linen)   : self-broadened half width (m^-1 @ 296K)
    ! lowene(linen)   : lower level energy of the transition (m^-1)
    ! tdep_abw(linen) : coefficient of temperature dependence of
    !                 : air-broadened halfwidth
    ! tdep_sbw(linen) : coefficient of temperature dependence of
    !                 : self-broadened halfwidth
    ! fn              : input filename
    !**************************************************************************
    ! CAUTION: these variables (wnlc0,lstren,ahawid,etc) are returned
    ! in MKS units (these are in CGS unit in the input file)
    !**************************************************************************

    subroutine readfile( fn, linen, iiso, wnlc0, stren0, &
         abwid0, sbwid0, lowene, tdep_abw, tdep_sbw )

      use vtype_module
      use fi_module

      implicit none

      character(len=*), intent(in ) :: fn
      integer(i4b)    , intent(in ) :: linen
      integer(i4b)    , intent(out) :: iiso( linen )
      real(dp)        , intent(out) :: &
           wnlc0   ( linen ), stren0  ( linen ), &
           abwid0  ( linen ), sbwid0  ( linen ), lowene( linen ), &
           tdep_abw( linen ), tdep_sbw( linen )


      !
      ! local variables
      !
      integer(i4b)     :: mol
      real(dp)         :: trprob
      real(dp)         :: shift
      integer(i4b)     :: gqiup, gqilo
      character(len=9) :: lqup, lqlo
      integer(i4b)     :: ier
      integer(i4b)     :: iref

      integer(i4b)     :: fu
      integer(i4b)     :: l


      !
      ! input from file
      !
      call fi_open( fn, "read", fu )

      do l = 1, linen
         read( fu, 1000 ) mol, iiso( l ), wnlc0( l ), stren0( l ), trprob, &
              abwid0( l ), sbwid0( l ), lowene( l ), tdep_abw( l ), &
              shift, gqiup, gqilo, lqup, lqlo, ier, iref

         if( sbwid0( l ) .eq. 0.0 ) then
            write( *, * ) l,"th line's self-broadened half width is zero"
            if( abwid0( l ) .eq. 0.0 ) then
               write( *, * ) l,"th line's air-broadened  half width is also zero"
            end if
            sbwid0( l ) = abwid0( l )
!!$            ! from reference in Hourdin, 1992
!!$            lowid( l ) = ahawid * 1.8d0
!!$         else
!!$            lowid( l ) = shawid
         end if

         tdep_sbw( l ) = tdep_abw( l )

         ! transform units of return values from CGS to MKS
         wnlc0 ( l ) = wnlc0 ( l ) * 1.0d2
         stren0( l ) = stren0( l ) * 1.0d-2
         abwid0( l ) = abwid0( l ) * 1.0d2
         sbwid0( l ) = sbwid0( l ) * 1.0d2
         lowene( l ) = lowene( l ) * 1.0d2
      end do
      close( fu )

1000  format( i2, i1, f12.6, 2e10.3, 2f5.3, f10.4, f4.2, f8.5, 2i3, 2a9, i3, i6 )

    end subroutine readfile

    !**************************************************************************

    !**************************************************************************
    ! subroutine readfile
    ! read molecular parameters (line strength, halfwidth, etc) from file
    !**************************************************************************
    ! linen           : number of line
    ! wnlc0(linen)    : wave number at line center (m^-1)
    ! stren0(linen)   : line strength (m^-1 / (molecule m^-2))
    ! abwid0(linen)   : air-broadened half width (m^-1 @ 296K)
    ! sbwid0(linen)   : self-broadened half width (m^-1 @ 296K)
    ! lowene(linen)   : lower level energy of the transition (m^-1)
    ! tdep_abw(linen) : coefficient of temperature dependence of
    !                 : air-broadened halfwidth
    ! tdep_sbw(linen) : coefficient of temperature dependence of
    !                 : self-broadened halfwidth
    ! fn              : input filename
    !**************************************************************************
    ! CAUTION: these variables (wnlc0,lstren,ahawid,etc) are returned
    ! in MKS units (these are in CGS unit in the input file)
    !**************************************************************************

    subroutine readfile_hitran04( linen, iiso, wnlc0, stren0, &
         abwid0, sbwid0, lowene, tdep_abw, tdep_sbw, apshift, fn )

      use vtype_module
      use fi_module

      implicit none

      integer(i4b)    , intent(in ) :: linen
      integer(i4b)    , intent(out) :: iiso( linen )
      real(dp)        , intent(out) :: &
           wnlc0   ( linen ), stren0( linen ), &
           abwid0  ( linen ), sbwid0  ( linen ), lowene ( linen ), &
           tdep_abw( linen ), tdep_sbw( linen ), apshift( linen )
      character(len=*), intent(in ) :: fn


      !
      ! local variables
      !
      integer(i4b)      :: mol
      real(dp)          :: eacoef
      character(len=15) :: gqup, gqlo, lqup, lqlo
      integer(i4b)      :: ier( 6 ), iref( 6 )
      character(len=1)  :: flag
      real(dp)          :: swup, swlo

      integer(i4b)      :: fu
      integer(i4b)      :: l


      !
      ! declaration of function
      !
      real(dp)          :: uncertainty


      !
      ! input from file
      !
      call fi_open( fn, "read", fu )
      do l = 1, linen
         read( fu, 1000 ) mol, iiso( l ), wnlc0( l ), stren0( l ), eacoef, &
              abwid0( l ), sbwid0( l ), lowene( l ), tdep_abw( l ), &
              apshift( l ), &
              gqup, gqlo, lqup, lqlo, &
              ier (1), ier (2), ier (3), ier (4), ier (5), ier (6), &
              iref(1), iref(2), iref(3), iref(4), iref(5), iref(6), &
              flag, swup, swlo

         if( sbwid0( l ) .eq. 0.0 ) then
            write( *, * ) "For ", l, "th line's self-broadened half width is zero"
!!$            write( *, * ) l,"th line's self-broadened half width is zero"
!!$            ! from reference in Hourdin, 1992
!!$            lowid( l ) = ahawid * 1.8d0
!!$         else
!!$            lowid( l ) = shawid
         end if

         tdep_sbw( l ) = tdep_abw( l )

         ! transform units of return values from CGS to MKS
         wnlc0 ( l ) = wnlc0 ( l ) * 1.0d2
         stren0( l ) = stren0( l ) * 1.0d-2
!!$         stren0( l ) = stren0( l ) * 1.0d-2 * uncertainty( ier( 2 ) )
         abwid0( l ) = abwid0( l ) * 1.0d2
         sbwid0( l ) = sbwid0( l ) * 1.0d2
         lowene( l ) = lowene( l ) * 1.0d2
      end do
      close( fu )

1000  format( I2, I1, F12.6, E10.3, E10.3, F5.4, F5.4, F10.4, F4.2, F8.6, A15, A15, A15, A15, 6I1, 6I2, A1, F7.1, F7.1 )

    end subroutine readfile_hitran04

!******************************************************************************

    function uncertainty( ierr ) result( derr )

      use vtype_module

      implicit none

      integer(i4b), intent(in) :: ierr

      real(dp)                 :: derr


      derr = 0.0d0

      select case( ierr )
      case( 0 )
         derr = 0.0d0
      case( 1 )
         derr = 0.0d0
      case( 2 )
         derr = 0.0d0
      case( 3 )
         derr = 0.20d0
      case( 4 )
         derr = 0.10d0
      case( 5 )
         derr = 0.05d0
      case( 6 )
         derr = 0.02d0
      case( 7 )
         derr = 0.01d0
      case( 8 )
         derr = 0.0d0
      case default
         write( 6, * ) 'Unexpected uncertainty code : ', ierr
         stop
      end select

      derr = 1.0d0 + derr


    end function uncertainty



