Line data Source code
1 : ! Include shortname defintions, so that the F77 code does not have to be modified to
2 : ! reference the CARMA structure.
3 : #include "carma_globaer.h"
4 :
5 : !! This routine calculates particle source terms <evappe> due to total
6 : !! evaporation from bin <ibin> group <ig> into a monodisperse
7 : !! distribution.
8 : !!
9 : !! Distinct evaporation of cores has not been treated.
10 : !!
11 : !! @author Andy Ackerman
12 : !! @version Aug-2001
13 0 : subroutine evap_mono(carma,cstate,iz,ibin,ig,iavg,ieto,igto,rc)
14 :
15 : ! types
16 : use carma_precision_mod
17 : use carma_enums_mod
18 : use carma_constants_mod
19 : use carma_types_mod
20 : use carmastate_mod
21 : use carma_mod
22 :
23 : implicit none
24 :
25 : type(carma_type), intent(in) :: carma !! the carma object
26 : type(carmastate_type), intent(inout) :: cstate !! the carma state object
27 : integer, intent(in) :: iz !! z index
28 : integer, intent(in) :: ibin !! bin index
29 : integer, intent(in) :: ig !! group index
30 : integer, intent(in) :: iavg
31 : integer, intent(in) :: ieto
32 : integer, intent(in) :: igto
33 : integer, intent(inout) :: rc !! return code, negative indicates failure
34 :
35 : ! Local declarations
36 : integer :: ic
37 : integer :: iecore
38 : integer :: ie2cn
39 : integer :: jbin
40 : logical :: conserve_mass
41 : real(kind=f) :: factor
42 : real(kind=f) :: fracmass
43 :
44 :
45 : ! Define option to conserve mass or number when a choice must be made
46 : ! during monodisperse total evaporation beyond CN grid -- should be done in setupaer()
47 0 : conserve_mass = .true.
48 :
49 : ! Set automatic flag for total evaporation used in gasexchange()
50 0 : totevap(ibin,ig) = .true.
51 :
52 : ! Possibly put all of core mass into largest, smallest, or
53 : ! smallest nucelated CN bin
54 0 : if( too_big .or. too_small .or. nuc_small )then
55 :
56 0 : if( too_big )then
57 0 : jbin = NBIN
58 : elseif( too_small )then
59 : jbin = 1
60 : else
61 : jbin = 1
62 : endif
63 :
64 : if( conserve_mass )then
65 0 : factor = coreavg/rmass(jbin,igto)
66 : else
67 : factor = ONE
68 : endif
69 :
70 : ! First the CN number concentration element
71 0 : evappe(jbin,ieto) = evappe(jbin,ieto) + factor*evdrop
72 :
73 : ! Now the CN cores
74 0 : do ic = 2, ncore(ig)
75 0 : iecore = icorelem(ic,ig)
76 0 : ie2cn = ievp2elem(iecore)
77 :
78 : ! It is possible to have coremasses in the particle
79 : ! that don't participate in nucleation. If there is no
80 : ! evp2elem defined, then skip this part.
81 : !
82 : ! NOTE: This cam up in a sensitivity test where there were
83 : ! two nucleation cores (dust and sulfates) and there was
84 : ! a desire to turn off one of the nucleation mechanisms for
85 : ! sensitivity testing.
86 0 : if (ie2cn .gt. 0) then
87 0 : evappe(jbin,ie2cn) = evappe(jbin,ie2cn) + &
88 0 : factor*evcore(ic)*rmass(jbin,igto)
89 : end if
90 : enddo
91 : else
92 :
93 : ! Partition core mass between two CN bins, conserving total core mass
94 : ! and number. The number will be subdivided into bins <iavg> and <iavg>-1.
95 0 : if( iavg .le. 1 .or. iavg .gt. NBIN )then
96 0 : if (do_print) write(LUNOPRT, *) "evap_mono: bad iavg = , ", iavg
97 0 : rc = RC_ERROR
98 0 : return
99 : endif
100 :
101 0 : fracmass = ( rmass(iavg,igto) - coreavg ) / diffmass(iavg,igto,iavg-1,igto)
102 : ! fracmass = max( 0._f, min( ONE, fracmass ) )
103 :
104 : ! First the CN number concentration element
105 0 : evappe(iavg-1,ieto) = evappe(iavg-1,ieto) + evdrop*fracmass
106 0 : evappe(iavg,ieto) = evappe(iavg,ieto) + evdrop*( ONE - fracmass )
107 :
108 : ! Now the cores
109 0 : do ic = 2, ncore(ig)
110 0 : iecore = icorelem(ic,ig)
111 0 : ie2cn = ievp2elem(iecore)
112 :
113 : ! It is possible to have coremasses in the particle
114 : ! that don't participate in nucleation. If there is no
115 : ! evp2elem defined, then skip this part.
116 0 : if (ie2cn .gt. 0) then
117 0 : evappe(iavg-1,ie2cn) = evappe(iavg-1,ie2cn) + &
118 0 : rmass(iavg-1,igto)*evcore(ic)*fracmass
119 0 : evappe(iavg,ie2cn) = evappe(iavg,ie2cn) + &
120 0 : rmass(iavg,igto)*evcore(ic)*( ONE - fracmass )
121 : end if
122 : enddo
123 : endif
124 :
125 : return
126 0 : end
|