1 | subroutine calc_condlh(ngrid,nlayer,pt,Lcx) |
---|
2 | |
---|
3 | use tracer_h |
---|
4 | |
---|
5 | implicit none |
---|
6 | |
---|
7 | !==================================================================== |
---|
8 | ! |
---|
9 | ! Purpose |
---|
10 | ! ------- |
---|
11 | ! Computes latent heat of condensation [J.kg-1] for ice tracers |
---|
12 | ! |
---|
13 | ! INPUT |
---|
14 | ! ----- |
---|
15 | ! ngrid = Number of grid points in the chunk [-] |
---|
16 | ! nlayer = Number of vertical layers [-] |
---|
17 | ! pt = Temperature [K] |
---|
18 | ! |
---|
19 | ! OUTPUT |
---|
20 | ! ------ |
---|
21 | ! Lcx = Condensation latente heat [J.kg-1] |
---|
22 | ! |
---|
23 | ! Author |
---|
24 | ! ------ |
---|
25 | ! B. de Batz de Trenquelléon (07/2023) |
---|
26 | ! |
---|
27 | ! !!! WARNING !!! |
---|
28 | ! --------------- |
---|
29 | ! We suppose a given order of tracers ! |
---|
30 | ! Tracers come from microphysics (ices_indx) : |
---|
31 | ! CH4 --> 1 |
---|
32 | ! C2H2 --> 2 |
---|
33 | ! C2H6 --> 3 |
---|
34 | ! HCN --> 4 |
---|
35 | ! AC6H6--> 5 |
---|
36 | !==================================================================== |
---|
37 | |
---|
38 | |
---|
39 | !------------------------------------ |
---|
40 | ! 0. DECLARATIONS |
---|
41 | !------------------------------------ |
---|
42 | |
---|
43 | ! Inputs : |
---|
44 | !--------- |
---|
45 | integer, intent(in) :: ngrid |
---|
46 | integer, intent(in) :: nlayer |
---|
47 | real, intent(in) :: pt(ngrid,nlayer) |
---|
48 | |
---|
49 | ! Outputs : |
---|
50 | !---------- |
---|
51 | real, intent(out) :: Lcx(ngrid,nlayer,size(ices_indx)) |
---|
52 | |
---|
53 | ! Parameters : |
---|
54 | !------------- |
---|
55 | real, parameter :: mmolCH4 = 16.e-3 ! Molar mass of CH4 [kg.mol-1] |
---|
56 | real, parameter :: mmolC2H2 = 26.e-3 ! Molar mass of C2H2 [kg.mol-1] |
---|
57 | real, parameter :: mmolC2H6 = 30.e-3 ! Molar mass of C2H6 [kg.mol-1] |
---|
58 | real, parameter :: mmolHCN = 27.e-3 ! Molar mass of HCN [kg.mol-1] |
---|
59 | real, parameter :: mmolAC6H6 = 78.e-3 ! Molar mass of AC6H6 [kg.mol-1] |
---|
60 | |
---|
61 | real, parameter :: TcCH4 = 190.56 ! Critical point of CH4 [K] |
---|
62 | real, parameter :: TcC2H2 = 308.35 ! Critical point of C2H2 [K] |
---|
63 | real, parameter :: TcC2H6 = 305.35 ! Critical point of C2H6 [K] |
---|
64 | real, parameter :: TcHCN = 456.70 ! Critical point of HCN [K] |
---|
65 | real, parameter :: TcAC6H6 = 562.10 ! Critical point of AC6H6 [K] |
---|
66 | |
---|
67 | ! Local variables : |
---|
68 | !------------------ |
---|
69 | integer :: iq, ig, l |
---|
70 | real*8 :: ftx ! Variables for latente heat [-] |
---|
71 | |
---|
72 | |
---|
73 | !------------------------------------ |
---|
74 | ! 1. INITIALISATION |
---|
75 | !------------------------------------ |
---|
76 | |
---|
77 | do iq = 1, size(ices_indx) ! For each species |
---|
78 | |
---|
79 | ! CH4 : |
---|
80 | !------ |
---|
81 | if(trim(nameOfTracer(gazs_indx(iq))) .eq. "CH4") then |
---|
82 | |
---|
83 | do ig = 1, ngrid ! Main loop on the horizontal grid |
---|
84 | do l = 1, nlayer ! Loop on vertical layers |
---|
85 | ftx = (1. - pt(ig,l)) / TcCH4 |
---|
86 | if (ftx .le. 1.e-3) ftx = 1.e-3 |
---|
87 | Lcx(ig,l,iq) = 8.314 * TcCH4 * (7.08 * ftx**0.354 + 10.95 * 1.1e-2 * ftx**0.456) / mmolCH4 |
---|
88 | enddo ! End of loop on vertical layers |
---|
89 | enddo ! End of main loop on the horizontal grid |
---|
90 | |
---|
91 | |
---|
92 | ! C2H2 : |
---|
93 | !------- |
---|
94 | else if(trim(nameOfTracer(gazs_indx(iq))) .eq. "C2H2") then |
---|
95 | |
---|
96 | do ig = 1, ngrid ! Main loop on the horizontal grid |
---|
97 | do l = 1, nlayer ! Loop on vertical layers |
---|
98 | ftx = (1. - pt(ig,l)) / TcC2H2 |
---|
99 | if (ftx .le. 1.e-3) ftx = 1.e-3 |
---|
100 | Lcx(ig,l,iq) = 8.314 * TcC2H2 * (7.08 * ftx**0.354 + 10.95 * 1.9e-1 * ftx**0.456) / mmolC2H2 |
---|
101 | enddo ! End of loop on vertical layers |
---|
102 | enddo ! End of main loop on the horizontal grid |
---|
103 | |
---|
104 | |
---|
105 | ! C2H6 : |
---|
106 | !------- |
---|
107 | else if(trim(nameOfTracer(gazs_indx(iq))) .eq. "C2H6") then |
---|
108 | |
---|
109 | do ig = 1, ngrid ! Main loop on the horizontal grid |
---|
110 | do l = 1, nlayer ! Loop on vertical layers |
---|
111 | ftx = (1. - pt(ig,l)) / TcC2H6 |
---|
112 | if (ftx .le. 1.e-3) ftx = 1.e-3 |
---|
113 | Lcx(ig,l,iq) = 8.314 * TcC2H6 * (7.08 * ftx**0.354 + 10.95 * 9.9e-2 * ftx**0.456) / mmolC2H6 |
---|
114 | enddo ! End of loop on vertical layers |
---|
115 | enddo ! End of main loop on the horizontal grid |
---|
116 | |
---|
117 | ! AC6H6 : |
---|
118 | !-------- |
---|
119 | else if(trim(nameOfTracer(gazs_indx(iq))) .eq. "AC6H6") then |
---|
120 | |
---|
121 | do ig = 1, ngrid ! Main loop on the horizontal grid |
---|
122 | do l = 1, nlayer ! Loop on vertical layers |
---|
123 | ftx = (1. - pt(ig,l)) / TcAC6H6 |
---|
124 | if (ftx .le. 1.e-3) ftx = 1.e-3 |
---|
125 | Lcx(ig,l,iq) = 8.314 * TcAC6H6 * (7.08 * ftx**0.354 + 10.95 * 9.9e-2 * ftx**0.456) / mmolAC6H6 |
---|
126 | enddo ! End of loop on vertical layers |
---|
127 | enddo ! End of main loop on the horizontal grid |
---|
128 | |
---|
129 | ! HCN : |
---|
130 | !------ |
---|
131 | else if(trim(nameOfTracer(gazs_indx(iq))) .eq. "HCN") then |
---|
132 | |
---|
133 | do ig = 1, ngrid ! Main loop on the horizontal grid |
---|
134 | do l = 1, nlayer ! Loop on vertical layers |
---|
135 | ftx = (1. - pt(ig,l)) / TcHCN |
---|
136 | if (ftx .le. 1.e-3) ftx = 1.e-3 |
---|
137 | Lcx(ig,l,iq) = 8.314 * TcHCN * (7.08 * ftx**0.354 + 10.95 * 3.88e-1 * ftx**0.456) / mmolHCN |
---|
138 | enddo ! End of loop on vertical layers |
---|
139 | enddo ! End of main loop on the horizontal grid |
---|
140 | |
---|
141 | |
---|
142 | else |
---|
143 | write(*,*) 'Species ',trim(nameOfTracer(gazs_indx(iq))),' not considered in calc_condlh.F90... Check traceur.def' |
---|
144 | Lcx(ig,l,iq) = 0.0D0 |
---|
145 | endif |
---|
146 | |
---|
147 | enddo ! End of species |
---|
148 | |
---|
149 | return |
---|
150 | |
---|
151 | end subroutine calc_condlh |
---|