MODULE Aero_Isrpia
   IMPLICIT NONE
   
   INTEGER,parameter :: ncomp=5
   INTEGER,parameter :: nions=7
   INTEGER,parameter :: ngasaq=3
   INTEGER,parameter :: nslds=9
   INTEGER,parameter :: npair=13
   INTEGER,parameter :: nzsr=100
   INTEGER,parameter :: nerrmx=25
   INTEGER,PARAMETER :: nso4s=14
   INTEGER,PARAMETER :: nrhs=20
   INTEGER,PARAMETER :: nasrd=nso4s*nrhs

   ! Input Variables 
   !inpt
   DOUBLE PRECISION  :: w(ncomp)
   DOUBLE PRECISION  :: waer(ncomp)
   DOUBLE PRECISION  :: temp
   DOUBLE PRECISION  :: rh
   INTEGER :: iprob
   INTEGER :: metstbl
   
   !water activities of pure salt solutions
   !zsr
   DOUBLE PRECISION, PARAMETER :: awas(nzsr)=(/  &          ! awas= ammonium sulfate
    990.0,30.00,30.00,30.00,29.54,28.25,27.06,25.94,24.89,23.90, & !1
    22.97,22.10,21.27,20.48,19.73,19.02,18.34,17.69,17.07,16.48, & !2
    15.91,15.37,14.85,14.34,13.86,13.39,12.94,12.50,12.08,11.67, & !3
    11.27,10.88,10.51,10.14, 9.79, 9.44, 9.10, 8.78, 8.45, 8.14, & !4
     7.83, 7.53, 7.23, 6.94, 6.65, 6.36, 6.08, 5.81, 5.53, 5.26, & !5
     4.99, 4.72, 4.46, 4.19, 3.92, 3.65, 3.38, 3.11, 2.83, 2.54, & !6
     2.25, 1.95, 1.63, 1.31, 0.97, 0.63, 0.30, 0.001,0.00, 0.00, & !7
     0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !8
     0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !9
     0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00  & !10
     /)
   DOUBLE PRECISION,PARAMETER :: awss(nzsr)=(/&             ! awss= sodium sulfate
    34*1.e5,23*14.30,14.21,12.53,11.47,10.66,10.01, 9.46, 8.99, 8.57, & !1
    8.19, 7.85, 7.54, 7.25, 6.98, 6.74, 6.50, 6.29, 6.08, 5.88, & !2
    5.70, 5.52, 5.36, 5.20, 5.04, 4.90, 4.75, 4.54, 4.34, 4.14, & !3
    3.93, 3.71, 3.49, 3.26, 3.02, 2.76, 2.49, 2.20, 1.89, 1.55, & !4
    1.18, 0.82, 0.49, 0.22, 0.001,0.00, 0.00, 0.00, 0.00, 0.00, & !5
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !6
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !7
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !8
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !9
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00  & !10
    /)
   DOUBLE PRECISION,PARAMETER  :: awac(nzsr)=(/ &          ! awac= ammonium chloride
    100., 100., 100., 100., 100., 100., 100., 100., 100., 100.,  &
    100., 100., 100., 100., 100., 100., 100., 100., 100.,31.45,  &
    31.30,31.14,30.98,30.82,30.65,30.48,30.30,30.11,29.92,29.71,  &
    29.50,29.29,29.06,28.82,28.57,28.30,28.03,27.78,27.78,27.77,  &
    27.77,27.43,27.07,26.67,26.21,25.73,25.18,24.56,23.84,23.01,  &
    22.05,20.97,19.85,18.77,17.78,16.89,16.10,15.39,14.74,14.14,  &
    13.59,13.06,12.56,12.09,11.65,11.22,10.81,10.42,10.03, 9.66,  &
    9.30, 8.94, 8.59, 8.25, 7.92, 7.59, 7.27, 6.95, 6.63, 6.32,  &
    6.01, 5.70, 5.39, 5.08, 4.78, 4.47, 4.17, 3.86, 3.56, 3.25,  &
    2.94, 2.62, 2.30, 1.98, 1.65, 1.32, 0.97, 0.62, 0.26, 0.13/)
   DOUBLE PRECISION,PARAMETER  :: awsc(nzsr)=(/ &           ! awsc= sodium chloride
    100., 100., 100., 100., 100., 100., 100., 100., 100., 100.,  &
    100., 100., 100., 100., 100., 100., 100., 100., 100.,16.34,  &
    16.28,16.22,16.15,16.09,16.02,15.95,15.88,15.80,15.72,15.64,  &
    15.55,15.45,15.36,15.25,15.14,15.02,14.89,14.75,14.60,14.43,  &
    14.25,14.04,13.81,13.55,13.25,12.92,12.56,12.19,11.82,11.47,  &
    11.13,10.82,10.53,10.26,10.00, 9.76, 9.53, 9.30, 9.09, 8.88,  &
    8.67, 8.48, 8.28, 8.09, 7.90, 7.72, 7.54, 7.36, 7.17, 6.99,  &
    6.81, 6.63, 6.45, 6.27, 6.09, 5.91, 5.72, 5.53, 5.34, 5.14,  &
    4.94, 4.74, 4.53, 4.31, 4.09, 3.86, 3.62, 3.37, 3.12, 2.85,  &
    2.58, 2.30, 2.01, 1.72, 1.44, 1.16, 0.89, 0.64, 0.40, 0.18/)
   DOUBLE PRECISION, PARAMETER :: awan(nzsr)=(/ &         ! awan= ammonium nitrate
    31*1.e5,97.17,92.28,87.66,83.15,78.87,74.84,70.98,67.46,64.11,  &
    60.98,58.07,55.37,52.85,50.43,48.24,46.19,44.26,42.40,40.70,  &
    39.10,37.54,36.10,34.69,33.35,32.11,30.89,29.71,28.58,27.46,  &
    26.42,25.37,24.33,23.89,22.42,21.48,20.56,19.65,18.76,17.91,  &
    17.05,16.23,15.40,14.61,13.82,13.03,12.30,11.55,10.83,10.14,  &
     9.44, 8.79, 8.13, 7.51, 6.91, 6.32, 5.75, 5.18, 4.65, 4.14,  &
     3.65, 3.16, 2.71, 2.26, 1.83, 1.42, 1.03, 0.66, 0.30, 0.001, &
     0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !8
     0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !9
     0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00  & !10
     /)
   DOUBLE PRECISION, PARAMETER :: awsn(nzsr)=(/ &         ! awsn= sodium nitrate
    9*700.0,685.59,451.00,336.46,268.48,223.41,191.28,167.20,148.46,133.44, &
     121.12,110.83,102.09, 94.57, 88.03, 82.29, 77.20, 72.65, 68.56, 64.87, &
    61.51,58.44,55.62,53.03,50.63,48.40,46.32,44.39,42.57,40.87, &
    39.27,37.76,36.33,34.98,33.70,32.48,31.32,30.21,29.16,28.14, &
    27.18,26.25,25.35,24.50,23.67,22.87,22.11,21.36,20.65,19.95, &
    19.28,18.62,17.99,17.37,16.77,16.18,15.61,15.05,14.51,13.98, &
    13.45,12.94,12.44,11.94,11.46,10.98,10.51,10.04, 9.58, 9.12, &
     8.67, 8.22, 7.77, 7.32, 6.88, 6.43, 5.98, 5.53, 5.07, 4.61, &
     4.15, 3.69, 3.22, 2.76, 2.31, 1.87, 1.47, 1.10, 0.77, 0.48, &
     0.23,0.001, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 &
     /)
   DOUBLE PRECISION, PARAMETER :: awsb(nzsr)=(/ &      ! awsb= sodium bisulfate
   173.72,156.88,142.80,130.85,120.57,  &
    111.64,103.80,96.88,90.71,85.18,  &
    80.20,75.69,71.58,67.82,64.37,61.19,58.26,55.53,53.00,50.64,  &
    48.44,46.37,44.44,42.61,40.90,39.27,37.74,36.29,34.91,33.61,  &
    32.36,31.18,30.05,28.97,27.94,26.95,26.00,25.10,24.23,23.39,  &
    22.59,21.81,21.07,20.35,19.65,18.98,18.34,17.71,17.11,16.52,  &
    15.95,15.40,14.87,14.35,13.85,13.36,12.88,12.42,11.97,11.53,  &
    11.10,10.69,10.28, 9.88, 9.49, 9.12, 8.75, 8.38, 8.03, 7.68,  &
    7.34, 7.01, 6.69, 6.37, 6.06, 5.75, 5.45, 5.15, 4.86, 4.58,  &
    4.30, 4.02, 3.76, 3.49, 3.23, 2.98, 2.73, 2.48, 2.24, 2.01,  &
    1.78, 1.56, 1.34, 1.13, 0.92, 0.73, 0.53, 0.35, 0.17, 0.001/)
   DOUBLE PRECISION, PARAMETER  :: awab(nzsr)=(/ &    ! awab= ammonium bisulfate
   356.45,296.51,253.21,220.47,194.85,  &
    174.24,157.31,143.16,131.15,120.82,  &
    111.86,103.99,97.04,90.86,85.31,80.31,75.78,71.66,67.90,64.44,  &
    61.25,58.31,55.58,53.04,50.68,48.47,46.40,44.46,42.63,40.91,  &
    39.29,37.75,36.30,34.92,33.61,32.36,31.18,30.04,28.96,27.93,  &
    26.94,25.99,25.08,24.21,23.37,22.57,21.79,21.05,20.32,19.63,  &
    18.96,18.31,17.68,17.07,16.49,15.92,15.36,14.83,14.31,13.80,  &
    13.31,12.83,12.36,11.91,11.46,11.03,10.61,10.20, 9.80, 9.41,  &
    9.02, 8.64, 8.28, 7.91, 7.56, 7.21, 6.87, 6.54, 6.21, 5.88,  &
    5.56, 5.25, 4.94, 4.63, 4.33, 4.03, 3.73, 3.44, 3.14, 2.85,  &
    2.57, 2.28, 1.99, 1.71, 1.42, 1.14, 0.86, 0.57, 0.29, 0.001/)
   DOUBLE PRECISION, PARAMETER  :: awsa(nzsr)=(/ &     ! awsa= sulfuric acid
   34.0,33.56,29.22,26.55,24.61,23.11,21.89,20.87,19.99,  &
    19.21,18.51,17.87,17.29,16.76,16.26,15.8,15.37,14.95,14.56,  &
    14.20,13.85,13.53,13.22,12.93,12.66,12.40,12.14,11.90,11.67,  &
    11.44,11.22,11.01,10.8,10.60,10.4,10.2,10.01,9.83,9.65,9.47,  &
    9.3,9.13,8.96,8.81,8.64,8.48,8.33,8.17,8.02,7.87,7.72,7.58,  &
    7.44,7.30,7.16,7.02,6.88,6.75,6.61,6.48,6.35,6.21,6.08,5.95,  &
    5.82,5.69,5.56,5.44,5.31,5.18,5.05,4.92,4.79,4.66,4.53,4.40,  &
    4.27,4.14,4.,3.87,3.73,3.6,3.46,3.31,3.17,3.02,2.87,2.72,  &
    2.56,2.4,2.23,2.05,1.87,1.68,1.48,1.27,1.05,0.807,0.552,0.281/)
   DOUBLE PRECISION, PARAMETER  :: awlc(nzsr)=(/ &    ! awlc= (NH4)3H(SO4)2
  34*1.e5,17.0,16.5 ,15.94,15.31,14.71,14.14,13.60,13.08,12.59,  &
   12.12,11.68,11.25,10.84,10.44,10.07, 9.71, 9.36, 9.02, 8.70,  &
    8.39, 8.09, 7.80, 7.52, 7.25, 6.99, 6.73, 6.49, 6.25, 6.02,  &
    5.79, 5.57, 5.36, 5.15, 4.95, 4.76, 4.56, 4.38, 4.20, 4.02,  &
    3.84, 3.67, 3.51, 3.34, 3.18, 3.02, 2.87, 2.72, 2.57, 2.42,  &
    2.28, 2.13, 1.99, 1.85, 1.71, 1.57, 1.43, 1.30, 1.16, 1.02,  &
    0.89, 0.75, 0.61, 0.46, 0.32, 0.16,0.001, 0.00, 0.00, 0.00,  &
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !8
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & !9
    0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00  & !10
    /)
   
   ! deliquescence relative humidities
   !dhr
   DOUBLE PRECISION  :: drh2so4
   DOUBLE PRECISION  :: drnh42s4
   DOUBLE PRECISION  :: drnahso4
   DOUBLE PRECISION  :: drnacl
   DOUBLE PRECISION  :: drnano3
   DOUBLE PRECISION  :: drna2so4
   DOUBLE PRECISION  :: drnh4hs4
   DOUBLE PRECISION  :: drlc
   DOUBLE PRECISION  :: drnh4no3
   DOUBLE PRECISION  :: drnh4cl
   !mdrh
   DOUBLE PRECISION  :: drmlcab
   DOUBLE PRECISION  :: drmlcas
   DOUBLE PRECISION  :: drmasan
   DOUBLE PRECISION  :: drmg1
   DOUBLE PRECISION  :: drmg2
   DOUBLE PRECISION  :: drmg3
   DOUBLE PRECISION  :: drmh1
   DOUBLE PRECISION  :: drmh2
   DOUBLE PRECISION  :: drmi1
   DOUBLE PRECISION  :: drmi2
   DOUBLE PRECISION  :: drmi3
   DOUBLE PRECISION  :: drmq1
   DOUBLE PRECISION  :: drmr1
   DOUBLE PRECISION  :: drmr2
   DOUBLE PRECISION  :: drmr3
   DOUBLE PRECISION  :: drmr4
   DOUBLE PRECISION  :: drmr5
   DOUBLE PRECISION  :: drmr6
   DOUBLE PRECISION  :: drmr7
   DOUBLE PRECISION  :: drmr8
   DOUBLE PRECISION  :: drmr9
   DOUBLE PRECISION  :: drmr10
   DOUBLE PRECISION  :: drmr11
   DOUBLE PRECISION  :: drmr12
   DOUBLE PRECISION  :: drmr13
   INTEGER  :: wftyp
   
   ! variables for liquid aerosol phase 
   !ions
   DOUBLE PRECISION :: molal(nions)
   DOUBLE PRECISION :: molalr(npair)
   DOUBLE PRECISION :: gama(npair)
   DOUBLE PRECISION, PARAMETER :: zz(npair)=(/ &
       1.,2.,1.,2.,1.,1.,2.,1.,1.,1.,1.,1.,2./)
   DOUBLE PRECISION, PARAMETER :: z(nions)=(/ &
       1.,1.,1.,1.,2.,1.,1./)
   DOUBLE PRECISION :: gamou(npair)
   DOUBLE PRECISION :: gamin(npair)
   DOUBLE PRECISION :: m0(npair)
   DOUBLE PRECISION :: gasaq(ngasaq)
   DOUBLE PRECISION :: epsact
   DOUBLE PRECISION :: coh
   DOUBLE PRECISION :: chno3
   DOUBLE PRECISION :: chcl
   DOUBLE PRECISION :: water
   INTEGER :: iacalc
   REAL :: ionic
   LOGICAL :: calaou
   LOGICAL :: calain
   LOGICAL :: frst
   LOGICAL :: dryf
   
   ! variables for solid aerosol phase
   !salt
   DOUBLE PRECISION :: ch2so4
   DOUBLE PRECISION :: cnh42s4
   DOUBLE PRECISION :: cnh4hs4
   DOUBLE PRECISION :: cnacl
   DOUBLE PRECISION :: cna2so4
   DOUBLE PRECISION :: cnano3
   DOUBLE PRECISION :: cnh4no3
   DOUBLE PRECISION :: cnh4cl
   DOUBLE PRECISION :: cnahso4
   DOUBLE PRECISION :: clc
   
   ! variables for gas phase
   !gas
   DOUBLE PRECISION :: gnh3
   DOUBLE PRECISION :: ghno3 
   DOUBLE PRECISION :: ghcl
   
   ! equilibrium constants
   !equk
   DOUBLE PRECISION :: xk1
   DOUBLE PRECISION :: xk2
   DOUBLE PRECISION :: xk3
   DOUBLE PRECISION :: xk4
   DOUBLE PRECISION :: xk5
   DOUBLE PRECISION :: xk6
   DOUBLE PRECISION :: xk7
   DOUBLE PRECISION :: xk8
   DOUBLE PRECISION :: xk9
   DOUBLE PRECISION :: xk10
   DOUBLE PRECISION :: xk11
   DOUBLE PRECISION :: xk12
   DOUBLE PRECISION :: xk13
   DOUBLE PRECISION :: xk14
   DOUBLE PRECISION :: xkw
   DOUBLE PRECISION :: xk21
   DOUBLE PRECISION :: xk22
   DOUBLE PRECISION :: xk31
   DOUBLE PRECISION :: xk32
   DOUBLE PRECISION :: xk41
   DOUBLE PRECISION :: xk42
   
   ! molecular weights
   !othr
   DOUBLE PRECISION :: r
   DOUBLE PRECISION, PARAMETER :: imw(nions)=(/ &
      1.0,23.0,18.0,35.5,96.0,97.0,63.0/)
   DOUBLE PRECISION, PARAMETER :: wmw(ncomp)=(/ &
       23.0,98.0,17.0,63.0,36.5/)
   DOUBLE PRECISION, PARAMETER :: smw(npair)=(/ &
        58.5,142.,85.0,132.,80.0,53.5,98.0,98.0,115.,63.0, 36.5,120.,247./)
   
   ! solution/info variables
   !case
   DOUBLE PRECISION :: sulratw
   DOUBLE PRECISION :: sulrat
   DOUBLE PRECISION :: sodrat
   CHARACTER (LEN=15) :: scase
   !soln
   DOUBLE PRECISION :: eps
   INTEGER :: maxit
   INTEGER :: nsweep
   INTEGER :: ndiv
   INTEGER :: iclact

   ! error system 
   !eror
   CHARACTER (LEN=40) :: errmsg(nerrmx)
   INTEGER :: errstk(nerrmx)
   INTEGER :: nofer
   LOGICAL :: stkofl
   
   ! Generic Variables
   !cgen
   DOUBLE PRECISION :: great
   DOUBLE PRECISION :: tiny
   DOUBLE PRECISION :: tiny2
   DOUBLE PRECISION :: zero
   DOUBLE PRECISION :: one
   real(8), parameter :: tinydenom = 1.0d-20   !
   CHARACTER (LEN=*), PARAMETER :: version='1.5 (10/04/01)'
   
   ! for interaction with hydrophilic organic compounds
   !org
   DOUBLE PRECISION :: organion
   DOUBLE PRECISION :: watorg

   ! data for aerosol sulfate ratio array needed in function getasr
   ! *** COPYRIGHT 1996-2000, UNIVERSITY OF MIAMI, CARNEGIE MELLON UNIVERSITY
   ! @author ATHANASIOS NENES   
   DOUBLE PRECISION, PARAMETER :: asso4(nso4s)=(/ &
      1.0E-9, 2.5E-9, 5.0E-9, 7.5E-9, 1.0E-8,  &
      2.5E-8, 5.0E-8, 7.5E-8, 1.0E-7, 2.5E-7,  &
      5.0E-7, 7.5E-7, 1.0E-6, 5.0E-6/)
   DOUBLE PRECISION, PARAMETER :: asrat(nasrd)=(/ &
      1.020464, 0.9998130, 0.9960167, 0.9984423, 1.004004,  &
       1.010885,  1.018356,  1.026726,  1.034268, 1.043846,  &
       1.052933,  1.062230,  1.062213,  1.080050, 1.088350,  &
       1.096603,  1.104289,  1.111745,  1.094662, 1.121594,  &
       1.268909,  1.242444,  1.233815,  1.232088, 1.234020,  &
       1.238068,  1.243455,  1.250636,  1.258734, 1.267543,  &
       1.276948,  1.286642,  1.293337,  1.305592, 1.314726,  &
       1.323463,  1.333258,  1.343604,  1.344793, 1.355571,  &
       1.431463,  1.405204,  1.395791,  1.393190, 1.394403,  &
       1.398107,  1.403811,  1.411744,  1.420560, 1.429990,  &
       1.439742,  1.449507,  1.458986,  1.468403, 1.477394,  &
       1.487373,  1.495385,  1.503854,  1.512281, 1.520394,  &
       1.514464,  1.489699,  1.480686,  1.478187, 1.479446,  &
       1.483310,  1.489316,  1.497517,  1.506501, 1.515816,  &
       1.524724,  1.533950,  1.542758,  1.551730, 1.559587,  &
       1.568343,  1.575610,  1.583140,  1.590440, 1.596481,  &
       1.567743,  1.544426,  1.535928,  1.533645, 1.535016,  &
       1.539003,  1.545124,  1.553283,  1.561886, 1.570530,  &
       1.579234,  1.587813,  1.595956,  1.603901, 1.611349,  &
       1.618833,  1.625819,  1.632543,  1.639032, 1.645276,  &
       1.707390,  1.689553,  1.683198,  1.681810, 1.683490,  &
       1.687477,  1.693148,  1.700084,  1.706917, 1.713507,  &
       1.719952,  1.726190,  1.731985,  1.737544, 1.742673,  &
       1.747756,  1.752431,  1.756890,  1.761141, 1.765190,  &
       1.785657,  1.771851,  1.767063,  1.766229, 1.767901,  &
       1.771455,  1.776223,  1.781769,  1.787065, 1.792081,  &
       1.796922,  1.801561,  1.805832,  1.809896, 1.813622,  &
       1.817292,  1.820651,  1.823841,  1.826871, 1.829745,  &
       1.822215,  1.810497,  1.806496,  1.805898, 1.807480,  &
       1.810684,  1.814860,  1.819613,  1.824093, 1.828306,  &
       1.832352,  1.836209,  1.839748,  1.843105, 1.846175,  &
       1.849192,  1.851948,  1.854574,  1.857038, 1.859387,  &
       1.844588,  1.834208,  1.830701,  1.830233, 1.831727,  &
       1.834665,  1.838429,  1.842658,  1.846615, 1.850321,  &
       1.853869,  1.857243,  1.860332,  1.863257, 1.865928,  &
       1.868550,  1.870942,  1.873208,  1.875355, 1.877389,  &
       1.899556,  1.892637,  1.890367,  1.890165, 1.891317,  &
       1.893436,  1.896036,  1.898872,  1.901485, 1.903908,  &
       1.906212,  1.908391,  1.910375,  1.912248, 1.913952,  &
       1.915621,  1.917140,  1.918576,  1.919934, 1.921220,  &
       1.928264,  1.923245,  1.921625,  1.921523, 1.922421,  &
       1.924016,  1.925931,  1.927991,  1.929875, 1.931614,  &
       1.933262,  1.934816,  1.936229,  1.937560, 1.938769,  &
       1.939951,  1.941026,  1.942042,  1.943003, 1.943911,  &
       1.941205,  1.937060,  1.935734,  1.935666, 1.936430,  &
       1.937769,  1.939359,  1.941061,  1.942612, 1.944041,  &
       1.945393,  1.946666,  1.947823,  1.948911, 1.949900,  &
       1.950866,  1.951744,  1.952574,  1.953358, 1.954099,  &
       1.948985,  1.945372,  1.944221,  1.944171, 1.944850,  &
       1.946027,  1.947419,  1.948902,  1.950251, 1.951494,  &
       1.952668,  1.953773,  1.954776,  1.955719, 1.956576,  &
       1.957413,  1.958174,  1.958892,  1.959571, 1.960213,  &
       1.977193,  1.975540,  1.975023,  1.975015, 1.975346,  &
       1.975903,  1.976547,  1.977225,  1.977838, 1.978401,  &
       1.978930,  1.979428,  1.979879,  1.980302, 1.980686,  &
       1.981060,  1.981401,  1.981722,  1.982025, 1.982312/)
   
   ! *** Integer part
   REAL :: aint10(20)=(/ 0.1000E-08, 0.1000E-07, 0.1000E-06, 0.1000E-05, 0.1000E-04,  &
       0.1000E-03, 0.1000E-02, 0.1000E-01, 0.1000E+00, 0.1000E+01,  &
       0.1000E+02, 0.1000E+03, 0.1000E+04, 0.1000E+05, 0.1000E+06,  &
       0.1000E+07, 0.1000E+08, 0.1000E+09, 0.1000E+10, 0.1000E+11 /)
   
   ! *** decimal part
   REAL :: adec10(200)=(/  &
       0.1023E+00, 0.1047E+00, 0.1072E+00, 0.1096E+00, 0.1122E+00,  &
       0.1148E+00, 0.1175E+00, 0.1202E+00, 0.1230E+00, 0.1259E+00,  &
       0.1288E+00, 0.1318E+00, 0.1349E+00, 0.1380E+00, 0.1413E+00,  &
       0.1445E+00, 0.1479E+00, 0.1514E+00, 0.1549E+00, 0.1585E+00,  &
       0.1622E+00, 0.1660E+00, 0.1698E+00, 0.1738E+00, 0.1778E+00,  &
       0.1820E+00, 0.1862E+00, 0.1905E+00, 0.1950E+00, 0.1995E+00,  &
       0.2042E+00, 0.2089E+00, 0.2138E+00, 0.2188E+00, 0.2239E+00,  &
       0.2291E+00, 0.2344E+00, 0.2399E+00, 0.2455E+00, 0.2512E+00,  &
       0.2570E+00, 0.2630E+00, 0.2692E+00, 0.2754E+00, 0.2818E+00,  &
       0.2884E+00, 0.2951E+00, 0.3020E+00, 0.3090E+00, 0.3162E+00,  &
       0.3236E+00, 0.3311E+00, 0.3388E+00, 0.3467E+00, 0.3548E+00,  &
       0.3631E+00, 0.3715E+00, 0.3802E+00, 0.3890E+00, 0.3981E+00,  &
       0.4074E+00, 0.4169E+00, 0.4266E+00, 0.4365E+00, 0.4467E+00,  &
       0.4571E+00, 0.4677E+00, 0.4786E+00, 0.4898E+00, 0.5012E+00,  &
       0.5129E+00, 0.5248E+00, 0.5370E+00, 0.5495E+00, 0.5623E+00,  &
       0.5754E+00, 0.5888E+00, 0.6026E+00, 0.6166E+00, 0.6310E+00,  &
       0.6457E+00, 0.6607E+00, 0.6761E+00, 0.6918E+00, 0.7079E+00,  &
       0.7244E+00, 0.7413E+00, 0.7586E+00, 0.7762E+00, 0.7943E+00,  &
       0.8128E+00, 0.8318E+00, 0.8511E+00, 0.8710E+00, 0.8913E+00,  &
       0.9120E+00, 0.9333E+00, 0.9550E+00, 0.9772E+00, 0.1000E+01,  &
       0.1023E+01, 0.1047E+01, 0.1072E+01, 0.1096E+01, 0.1122E+01,  &
       0.1148E+01, 0.1175E+01, 0.1202E+01, 0.1230E+01, 0.1259E+01,  &
       0.1288E+01, 0.1318E+01, 0.1349E+01, 0.1380E+01, 0.1413E+01,  &
       0.1445E+01, 0.1479E+01, 0.1514E+01, 0.1549E+01, 0.1585E+01,  &
       0.1622E+01, 0.1660E+01, 0.1698E+01, 0.1738E+01, 0.1778E+01,  &
       0.1820E+01, 0.1862E+01, 0.1905E+01, 0.1950E+01, 0.1995E+01,  &
       0.2042E+01, 0.2089E+01, 0.2138E+01, 0.2188E+01, 0.2239E+01,  &
       0.2291E+01, 0.2344E+01, 0.2399E+01, 0.2455E+01, 0.2512E+01,  &
       0.2570E+01, 0.2630E+01, 0.2692E+01, 0.2754E+01, 0.2818E+01,  &
       0.2884E+01, 0.2951E+01, 0.3020E+01, 0.3090E+01, 0.3162E+01,  &
       0.3236E+01, 0.3311E+01, 0.3388E+01, 0.3467E+01, 0.3548E+01,  &
       0.3631E+01, 0.3715E+01, 0.3802E+01, 0.3890E+01, 0.3981E+01,  &
       0.4074E+01, 0.4169E+01, 0.4266E+01, 0.4365E+01, 0.4467E+01,  &
       0.4571E+01, 0.4677E+01, 0.4786E+01, 0.4898E+01, 0.5012E+01,  &
       0.5129E+01, 0.5248E+01, 0.5370E+01, 0.5495E+01, 0.5623E+01,  &
       0.5754E+01, 0.5888E+01, 0.6026E+01, 0.6166E+01, 0.6310E+01,  &
       0.6457E+01, 0.6607E+01, 0.6761E+01, 0.6918E+01, 0.7079E+01,  &
       0.7244E+01, 0.7413E+01, 0.7586E+01, 0.7762E+01, 0.7943E+01,  &
       0.8128E+01, 0.8318E+01, 0.8511E+01, 0.8710E+01, 0.8913E+01,  &
       0.9120E+01, 0.9333E+01, 0.9550E+01, 0.9772E+01, 0.1000E+02 /)
   
CONTAINS 

  SUBROUTINE InitIsrpia
  
      temp=298.0
      r=82.0567D-6
      rh=0.9D0
      eps=1D-6
      maxit=100
      tiny=1D-20
      great=1D10
      zero=0.0D0
      one=1.0D0
      nsweep=4
      tiny2=1D-11
      ndiv=5
      molal=nions*0.0D0
      molalr=npair*0.0D0
      gama=npair*0.1D0
      gamou=npair*1D10
      gamin=npair*1D10
      calain=.true.
      calaou=.true.
      epsact=5D-2
      iclact=0
      iacalc=1
      wftyp=2
      errstk=nerrmx*0
      errmsg=repeat(' ',nerrmx)
      nofer=0
      stkofl=.false.
  
  END  SUBROUTINE InitIsrpia


END MODULE Aero_Isrpia
