1 | ! path: $Source: /storm/rc1/cvsroot/rc/rrtmg_lw/src/rrtmg_lw_read_nc.f90,v $ |
---|
2 | ! author: $Author: mike $ |
---|
3 | ! revision: $Revision: 1.1 $ |
---|
4 | ! created: $Date: 2009/05/22 21:02:13 $ |
---|
5 | ! |
---|
6 | |
---|
7 | !=============================================================================== |
---|
8 | ! rrtmg_lw_read_nc.f90 |
---|
9 | ! |
---|
10 | ! Description: This program reads all of the RRTM longwave data from a NetCDF |
---|
11 | ! file in band by band subroutines, as a replacement for the |
---|
12 | ! rrtmg_lw_k_g.f90 data statements. |
---|
13 | ! |
---|
14 | ! Written By: Patrick Hofmann |
---|
15 | ! Last Update: 1/23/2009 |
---|
16 | !=============================================================================== |
---|
17 | |
---|
18 | !******************************************************************************* |
---|
19 | subroutine lw_kgb01 |
---|
20 | use rrlw_kg01, only : fracrefao, fracrefbo, kao, kbo, kao_mn2, kbo_mn2, & |
---|
21 | selfrefo, forrefo, no1 |
---|
22 | use rrlw_ncpar |
---|
23 | use netcdf |
---|
24 | |
---|
25 | implicit none |
---|
26 | save |
---|
27 | |
---|
28 | integer(kind=im) :: ab |
---|
29 | integer(kind=im), parameter :: bandNumber = 1, numGPoints = no1 |
---|
30 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
31 | integer(kind=im) :: ncid, varID |
---|
32 | |
---|
33 | status(:) = nf90_NoErr |
---|
34 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
35 | |
---|
36 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
37 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
38 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
39 | count = (/numGPoints,1,1,1/)) |
---|
40 | |
---|
41 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
42 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
43 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
44 | count = (/numGPoints,1,1,1/)) |
---|
45 | |
---|
46 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
47 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
48 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
49 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
50 | |
---|
51 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
52 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
53 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
54 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
55 | |
---|
56 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
57 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
58 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
59 | count = (/Tself,numGPoints,1,1/)) |
---|
60 | |
---|
61 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
62 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
63 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
64 | count = (/Tforeign,numGPoints,1,1/)) |
---|
65 | |
---|
66 | !Get absorber index for N2 |
---|
67 | call getAbsorberIndex('N2',ab) |
---|
68 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
69 | status(15) = nf90_get_var(ncid, varID, kao_mn2, & |
---|
70 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
71 | count = (/1,T,numGPoints,1,1,1/)) |
---|
72 | |
---|
73 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
74 | status(17) = nf90_get_var(ncid, varID, kbo_mn2, & |
---|
75 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
76 | count = (/1,T,numGPoints,1,1,1/)) |
---|
77 | |
---|
78 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
79 | |
---|
80 | status(1) = nf90_close(ncid) |
---|
81 | |
---|
82 | end subroutine lw_kgb01 |
---|
83 | !******************************************************************************* |
---|
84 | |
---|
85 | !******************************************************************************* |
---|
86 | subroutine lw_kgb02 |
---|
87 | use rrlw_kg02, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo, no2 |
---|
88 | use rrlw_ncpar |
---|
89 | use netcdf |
---|
90 | |
---|
91 | implicit none |
---|
92 | save |
---|
93 | |
---|
94 | integer(kind=im), parameter :: bandNumber = 2 |
---|
95 | integer(kind=im), parameter :: numGPoints = no2 |
---|
96 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
97 | integer(kind=im) :: ncid, varID |
---|
98 | |
---|
99 | status(:) = nf90_NoErr |
---|
100 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
101 | |
---|
102 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
103 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
104 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
105 | count = (/numGPoints,1,1,1/)) |
---|
106 | |
---|
107 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
108 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
109 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
110 | count = (/numGPoints,1,1,1/)) |
---|
111 | |
---|
112 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
113 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
114 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
115 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
116 | |
---|
117 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
118 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
119 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
120 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
121 | |
---|
122 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
123 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
124 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
125 | count = (/Tself,numGPoints,1,1/)) |
---|
126 | |
---|
127 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
128 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
129 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
130 | count = (/Tforeign,numGPoints,1,1/)) |
---|
131 | |
---|
132 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
133 | |
---|
134 | status(1) = nf90_close(ncid) |
---|
135 | |
---|
136 | end subroutine lw_kgb02 |
---|
137 | !******************************************************************************* |
---|
138 | |
---|
139 | !******************************************************************************* |
---|
140 | subroutine lw_kgb03 |
---|
141 | use rrlw_kg03, only : fracrefao, fracrefbo, kao, kbo, kao_mn2o, & |
---|
142 | kbo_mn2o, selfrefo, forrefo, no3 |
---|
143 | use rrlw_ncpar |
---|
144 | use netcdf |
---|
145 | |
---|
146 | implicit none |
---|
147 | save |
---|
148 | |
---|
149 | integer(kind=im) :: ab |
---|
150 | integer(kind=im), parameter :: bandNumber = 3 |
---|
151 | integer(kind=im), parameter :: numGPoints = no3 |
---|
152 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
153 | integer(kind=im) :: ncid, varID |
---|
154 | |
---|
155 | status(:) = nf90_NoErr |
---|
156 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
157 | |
---|
158 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
159 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
160 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
161 | count = (/numGPoints,keylower,1,1/)) |
---|
162 | |
---|
163 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
164 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
165 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
166 | count = (/numGPoints,keyupper,1,1/)) |
---|
167 | |
---|
168 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
169 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
170 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
171 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
172 | |
---|
173 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
174 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
175 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
176 | count = (/keyupper,Tdiff,pupper,numGPoints,1,1/)) |
---|
177 | |
---|
178 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
179 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
180 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
181 | count = (/Tself,numGPoints,1,1/)) |
---|
182 | |
---|
183 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
184 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
185 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
186 | count = (/Tforeign,numGPoints,1,1/)) |
---|
187 | |
---|
188 | !Get absorber index for N2 |
---|
189 | call getAbsorberIndex('N2O',ab) |
---|
190 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
191 | status(15) = nf90_get_var(ncid, varID, kao_mn2o, & |
---|
192 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
193 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
194 | |
---|
195 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
196 | status(17) = nf90_get_var(ncid, varID, kbo_mn2o, & |
---|
197 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
198 | count = (/keyupper,T,numGPoints,1,1,1/)) |
---|
199 | |
---|
200 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
201 | |
---|
202 | status(1) = nf90_close(ncid) |
---|
203 | |
---|
204 | end subroutine lw_kgb03 |
---|
205 | !******************************************************************************* |
---|
206 | |
---|
207 | !******************************************************************************* |
---|
208 | subroutine lw_kgb04 |
---|
209 | use rrlw_kg04, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo, no4 |
---|
210 | use rrlw_ncpar |
---|
211 | use netcdf |
---|
212 | |
---|
213 | implicit none |
---|
214 | save |
---|
215 | |
---|
216 | integer(kind=im), parameter :: bandNumber = 4 |
---|
217 | integer(kind=im), parameter :: numGPoints = no4 |
---|
218 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
219 | integer(kind=im) :: ncid, varID |
---|
220 | |
---|
221 | status(:) = nf90_NoErr |
---|
222 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
223 | |
---|
224 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
225 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
226 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
227 | count = (/numGPoints,keylower,1,1/)) |
---|
228 | |
---|
229 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
230 | status(5) = nf90_get_var(ncid, varID, fracrefbo(:,1:5), & |
---|
231 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
232 | count = (/numGPoints,keyupper,1,1/)) |
---|
233 | |
---|
234 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
235 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
236 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
237 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
238 | |
---|
239 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
240 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
241 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
242 | count = (/keyupper,Tdiff,pupper,numGPoints,1,1/)) |
---|
243 | |
---|
244 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
245 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
246 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
247 | count = (/Tself,numGPoints,1,1/)) |
---|
248 | |
---|
249 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
250 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
251 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
252 | count = (/Tforeign,numGPoints,1,1/)) |
---|
253 | |
---|
254 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
255 | |
---|
256 | status(1) = nf90_close(ncid) |
---|
257 | |
---|
258 | end subroutine lw_kgb04 |
---|
259 | !******************************************************************************* |
---|
260 | |
---|
261 | !******************************************************************************* |
---|
262 | subroutine lw_kgb05 |
---|
263 | use rrlw_kg05, only : fracrefao, fracrefbo, kao, kbo, kao_mo3, & |
---|
264 | selfrefo, forrefo, ccl4o, no5 |
---|
265 | use rrlw_ncpar |
---|
266 | use netcdf |
---|
267 | |
---|
268 | implicit none |
---|
269 | save |
---|
270 | |
---|
271 | integer(kind=im) :: ab |
---|
272 | integer(kind=im), parameter :: bandNumber = 5 |
---|
273 | integer(kind=im), parameter :: numGPoints = no5 |
---|
274 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
275 | integer(kind=im) :: ncid, varID |
---|
276 | |
---|
277 | status(:) = nf90_NoErr |
---|
278 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
279 | |
---|
280 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
281 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
282 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
283 | count = (/numGPoints,keylower,1,1/)) |
---|
284 | |
---|
285 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
286 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
287 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
288 | count = (/numGPoints,keyupper,1,1/)) |
---|
289 | |
---|
290 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
291 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
292 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
293 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
294 | |
---|
295 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
296 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
297 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
298 | count = (/keyupper,Tdiff,pupper,numGPoints,1,1/)) |
---|
299 | |
---|
300 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
301 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
302 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
303 | count = (/Tself,numGPoints,1,1/)) |
---|
304 | |
---|
305 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
306 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
307 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
308 | count = (/Tforeign,numGPoints,1,1/)) |
---|
309 | |
---|
310 | !Get absorber index for O3 |
---|
311 | call getAbsorberIndex('O3',ab) |
---|
312 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
313 | status(15) = nf90_get_var(ncid, varID, kao_mo3, & |
---|
314 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
315 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
316 | |
---|
317 | !Get absorber index for CCL4 |
---|
318 | call getAbsorberIndex('CCL4',ab) |
---|
319 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
320 | status(17) = nf90_get_var(ncid, varID, ccl4o, & |
---|
321 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
322 | count = (/1,1,numGPoints,1,1,1/)) |
---|
323 | |
---|
324 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
325 | |
---|
326 | status(1) = nf90_close(ncid) |
---|
327 | |
---|
328 | end subroutine lw_kgb05 |
---|
329 | !******************************************************************************* |
---|
330 | |
---|
331 | !******************************************************************************* |
---|
332 | subroutine lw_kgb06 |
---|
333 | use rrlw_kg06, only : fracrefao, kao, kao_mco2, selfrefo, forrefo, & |
---|
334 | cfc11adjo, cfc12o, no6 |
---|
335 | use rrlw_ncpar |
---|
336 | use netcdf |
---|
337 | |
---|
338 | implicit none |
---|
339 | save |
---|
340 | |
---|
341 | integer(kind=im) :: ab |
---|
342 | integer(kind=im), parameter :: bandNumber = 6 |
---|
343 | integer(kind=im), parameter :: numGPoints = no6 |
---|
344 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
345 | integer(kind=im) :: ncid, varID |
---|
346 | |
---|
347 | status(:) = nf90_NoErr |
---|
348 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
349 | |
---|
350 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
351 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
352 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
353 | count = (/numGPoints,1,1,1/)) |
---|
354 | |
---|
355 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
356 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
357 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
358 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
359 | |
---|
360 | status(8) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
361 | status(9) = nf90_get_var(ncid, varID, selfrefo, & |
---|
362 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
363 | count = (/Tself,numGPoints,1,1/)) |
---|
364 | |
---|
365 | status(10) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
366 | status(11) = nf90_get_var(ncid, varID, forrefo, & |
---|
367 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
368 | count = (/Tforeign,numGPoints,1,1/)) |
---|
369 | |
---|
370 | !Get absorber index for CO2 |
---|
371 | call getAbsorberIndex('CO2',ab) |
---|
372 | status(12) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
373 | status(13) = nf90_get_var(ncid, varID, kao_mco2, & |
---|
374 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
375 | count = (/1,T,numGPoints,1,1,1/)) |
---|
376 | |
---|
377 | !Get absorber index for CFC11 |
---|
378 | call getAbsorberIndex('CFC11',ab) |
---|
379 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
380 | status(15) = nf90_get_var(ncid, varID, cfc11adjo, & |
---|
381 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
382 | count = (/1,1,numGPoints,1,1,1/)) |
---|
383 | |
---|
384 | !Get absorber index for CFC12 |
---|
385 | call getAbsorberIndex('CFC12',ab) |
---|
386 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
387 | status(17) = nf90_get_var(ncid, varID, cfc12o, & |
---|
388 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
389 | count = (/1,1,numGPoints,1,1,1/)) |
---|
390 | |
---|
391 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
392 | |
---|
393 | status(1) = nf90_close(ncid) |
---|
394 | |
---|
395 | end subroutine lw_kgb06 |
---|
396 | !******************************************************************************* |
---|
397 | |
---|
398 | !******************************************************************************* |
---|
399 | subroutine lw_kgb07 |
---|
400 | use rrlw_kg07, only : fracrefao, fracrefbo, kao, kbo, kao_mco2, & |
---|
401 | kbo_mco2, selfrefo, forrefo, no7 |
---|
402 | use rrlw_ncpar |
---|
403 | use netcdf |
---|
404 | |
---|
405 | implicit none |
---|
406 | save |
---|
407 | |
---|
408 | integer(kind=im) :: ab |
---|
409 | integer(kind=im), parameter :: bandNumber = 7 |
---|
410 | integer(kind=im), parameter :: numGPoints = no7 |
---|
411 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
412 | integer(kind=im) :: ncid, varID |
---|
413 | |
---|
414 | status(:) = nf90_NoErr |
---|
415 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
416 | |
---|
417 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
418 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
419 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
420 | count = (/numGPoints,keylower,1,1/)) |
---|
421 | |
---|
422 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
423 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
424 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
425 | count = (/numGPoints,1,1,1/)) |
---|
426 | |
---|
427 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
428 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
429 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
430 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
431 | |
---|
432 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
433 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
434 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
435 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
436 | |
---|
437 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
438 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
439 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
440 | count = (/Tself,numGPoints,1,1/)) |
---|
441 | |
---|
442 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
443 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
444 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
445 | count = (/Tforeign,numGPoints,1,1/)) |
---|
446 | |
---|
447 | !Get absorber index for CO2 |
---|
448 | call getAbsorberIndex('CO2',ab) |
---|
449 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
450 | status(15) = nf90_get_var(ncid, varID, kao_mco2, & |
---|
451 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
452 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
453 | |
---|
454 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
455 | status(17) = nf90_get_var(ncid, varID, kbo_mco2, & |
---|
456 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
457 | count = (/1,T,numGPoints,1,1,1/)) |
---|
458 | |
---|
459 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
460 | |
---|
461 | status(1) = nf90_close(ncid) |
---|
462 | |
---|
463 | end subroutine lw_kgb07 |
---|
464 | !******************************************************************************* |
---|
465 | |
---|
466 | !******************************************************************************* |
---|
467 | subroutine lw_kgb08 |
---|
468 | use rrlw_kg08, only : fracrefao, fracrefbo, kao, kao_mco2, kao_mn2o, & |
---|
469 | kao_mo3, kbo, kbo_mco2, kbo_mn2o, selfrefo, forrefo, & |
---|
470 | cfc12o, cfc22adjo, no8 |
---|
471 | use rrlw_ncpar |
---|
472 | use netcdf |
---|
473 | |
---|
474 | implicit none |
---|
475 | save |
---|
476 | |
---|
477 | integer(kind=im) :: ab |
---|
478 | integer(kind=im), parameter :: bandNumber = 8 |
---|
479 | integer(kind=im), parameter :: numGPoints = no8 |
---|
480 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
481 | integer(kind=im) :: ncid, varID |
---|
482 | |
---|
483 | status(:) = nf90_NoErr |
---|
484 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
485 | |
---|
486 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
487 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
488 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
489 | count = (/numGPoints,1,1,1/)) |
---|
490 | |
---|
491 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
492 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
493 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
494 | count = (/numGPoints,1,1,1/)) |
---|
495 | |
---|
496 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
497 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
498 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
499 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
500 | |
---|
501 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
502 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
503 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
504 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
505 | |
---|
506 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
507 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
508 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
509 | count = (/Tself,numGPoints,1,1/)) |
---|
510 | |
---|
511 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
512 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
513 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
514 | count = (/Tforeign,numGPoints,1,1/)) |
---|
515 | |
---|
516 | !Get absorber index for O3 |
---|
517 | call getAbsorberIndex('O3',ab) |
---|
518 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
519 | status(15) = nf90_get_var(ncid, varID, kao_mo3, & |
---|
520 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
521 | count = (/1,T,numGPoints,1,1,1/)) |
---|
522 | |
---|
523 | !Get absorber index for CO2 |
---|
524 | call getAbsorberIndex('CO2',ab) |
---|
525 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
526 | status(17) = nf90_get_var(ncid, varID, kao_mco2, & |
---|
527 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
528 | count = (/1,T,numGPoints,1,1,1/)) |
---|
529 | |
---|
530 | status(18) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
531 | status(19) = nf90_get_var(ncid, varID, kbo_mco2, & |
---|
532 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
533 | count = (/1,T,numGPoints,1,1,1/)) |
---|
534 | |
---|
535 | !Get absorber index for N2O |
---|
536 | call getAbsorberIndex('N2O',ab) |
---|
537 | status(20) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
538 | status(21) = nf90_get_var(ncid, varID, kao_mn2o, & |
---|
539 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
540 | count = (/1,T,numGPoints,1,1,1/)) |
---|
541 | |
---|
542 | status(22) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
543 | status(23) = nf90_get_var(ncid, varID, kbo_mn2o, & |
---|
544 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
545 | count = (/1,T,numGPoints,1,1,1/)) |
---|
546 | |
---|
547 | !Get absorber index for CFC12 |
---|
548 | call getAbsorberIndex('CFC12',ab) |
---|
549 | status(24) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
550 | status(25) = nf90_get_var(ncid, varID, cfc12o, & |
---|
551 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
552 | count = (/1,1,numGPoints,1,1,1/)) |
---|
553 | |
---|
554 | !Get absorber index for CFC22 |
---|
555 | call getAbsorberIndex('CFC22',ab) |
---|
556 | status(26) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
557 | status(27) = nf90_get_var(ncid, varID, cfc22adjo, & |
---|
558 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
559 | count = (/1,1,numGPoints,1,1,1/)) |
---|
560 | |
---|
561 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
562 | |
---|
563 | status(1) = nf90_close(ncid) |
---|
564 | |
---|
565 | end subroutine lw_kgb08 |
---|
566 | !******************************************************************************* |
---|
567 | |
---|
568 | !******************************************************************************* |
---|
569 | subroutine lw_kgb09 |
---|
570 | use rrlw_kg09, only : fracrefao, fracrefbo, kao, kbo, kao_mn2o, & |
---|
571 | kbo_mn2o, selfrefo, forrefo, no9 |
---|
572 | use rrlw_ncpar |
---|
573 | use netcdf |
---|
574 | |
---|
575 | implicit none |
---|
576 | save |
---|
577 | |
---|
578 | integer(kind=im) :: ab |
---|
579 | integer(kind=im), parameter :: bandNumber = 9 |
---|
580 | integer(kind=im), parameter :: numGPoints = no9 |
---|
581 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
582 | integer(kind=im) :: ncid, varID |
---|
583 | |
---|
584 | status(:) = nf90_NoErr |
---|
585 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
586 | |
---|
587 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
588 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
589 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
590 | count = (/numGPoints,keylower,1,1/)) |
---|
591 | |
---|
592 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
593 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
594 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
595 | count = (/numGPoints,1,1,1/)) |
---|
596 | |
---|
597 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
598 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
599 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
600 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
601 | |
---|
602 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
603 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
604 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
605 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
606 | |
---|
607 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
608 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
609 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
610 | count = (/Tself,numGPoints,1,1/)) |
---|
611 | |
---|
612 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
613 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
614 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
615 | count = (/Tforeign,numGPoints,1,1/)) |
---|
616 | |
---|
617 | !Get absorber index for N2O |
---|
618 | call getAbsorberIndex('N2O',ab) |
---|
619 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
620 | status(15) = nf90_get_var(ncid, varID, kao_mn2o, & |
---|
621 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
622 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
623 | |
---|
624 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
625 | status(17) = nf90_get_var(ncid, varID, kbo_mn2o, & |
---|
626 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
627 | count = (/1,T,numGPoints,1,1,1/)) |
---|
628 | |
---|
629 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
630 | |
---|
631 | status(1) = nf90_close(ncid) |
---|
632 | |
---|
633 | end subroutine lw_kgb09 |
---|
634 | !******************************************************************************* |
---|
635 | |
---|
636 | !******************************************************************************* |
---|
637 | subroutine lw_kgb10 |
---|
638 | use rrlw_kg10, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo, no10 |
---|
639 | use rrlw_ncpar |
---|
640 | use netcdf |
---|
641 | |
---|
642 | implicit none |
---|
643 | save |
---|
644 | |
---|
645 | integer(kind=im), parameter :: bandNumber = 10 |
---|
646 | integer(kind=im), parameter :: numGPoints = no10 |
---|
647 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
648 | integer(kind=im) :: ncid, varID |
---|
649 | |
---|
650 | status(:) = nf90_NoErr |
---|
651 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
652 | |
---|
653 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
654 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
655 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
656 | count = (/numGPoints,1,1,1/)) |
---|
657 | |
---|
658 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
659 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
660 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
661 | count = (/numGPoints,1,1,1/)) |
---|
662 | |
---|
663 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
664 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
665 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
666 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
667 | |
---|
668 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
669 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
670 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
671 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
672 | |
---|
673 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
674 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
675 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
676 | count = (/Tself,numGPoints,1,1/)) |
---|
677 | |
---|
678 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
679 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
680 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
681 | count = (/Tforeign,numGPoints,1,1/)) |
---|
682 | |
---|
683 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
684 | |
---|
685 | status(1) = nf90_close(ncid) |
---|
686 | |
---|
687 | end subroutine lw_kgb10 |
---|
688 | !******************************************************************************* |
---|
689 | |
---|
690 | !******************************************************************************* |
---|
691 | subroutine lw_kgb11 |
---|
692 | use rrlw_kg11, only : fracrefao, fracrefbo, kao, kbo, kao_mo2, & |
---|
693 | kbo_mo2, selfrefo, forrefo, no11 |
---|
694 | use rrlw_ncpar |
---|
695 | use netcdf |
---|
696 | |
---|
697 | implicit none |
---|
698 | save |
---|
699 | |
---|
700 | integer(kind=im) :: ab |
---|
701 | integer(kind=im), parameter :: bandNumber = 11 |
---|
702 | integer(kind=im), parameter :: numGPoints = no11 |
---|
703 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
704 | integer(kind=im) :: ncid, varID |
---|
705 | |
---|
706 | status(:) = nf90_NoErr |
---|
707 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
708 | |
---|
709 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
710 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
711 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
712 | count = (/numGPoints,1,1,1/)) |
---|
713 | |
---|
714 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
715 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
716 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
717 | count = (/numGPoints,1,1,1/)) |
---|
718 | |
---|
719 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
720 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
721 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
722 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
723 | |
---|
724 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
725 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
726 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
727 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
728 | |
---|
729 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
730 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
731 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
732 | count = (/Tself,numGPoints,1,1/)) |
---|
733 | |
---|
734 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
735 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
736 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
737 | count = (/Tforeign,numGPoints,1,1/)) |
---|
738 | |
---|
739 | !Get absorber index for O2 |
---|
740 | call getAbsorberIndex('O2',ab) |
---|
741 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
742 | status(15) = nf90_get_var(ncid, varID, kao_mo2, & |
---|
743 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
744 | count = (/1,T,numGPoints,1,1,1/)) |
---|
745 | |
---|
746 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
747 | status(17) = nf90_get_var(ncid, varID, kbo_mo2, & |
---|
748 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
749 | count = (/1,T,numGPoints,1,1,1/)) |
---|
750 | |
---|
751 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
752 | |
---|
753 | status(1) = nf90_close(ncid) |
---|
754 | |
---|
755 | end subroutine lw_kgb11 |
---|
756 | !******************************************************************************* |
---|
757 | |
---|
758 | !******************************************************************************* |
---|
759 | subroutine lw_kgb12 |
---|
760 | use rrlw_kg12, only : fracrefao, kao, selfrefo, forrefo, no12 |
---|
761 | use rrlw_ncpar |
---|
762 | use netcdf |
---|
763 | |
---|
764 | implicit none |
---|
765 | save |
---|
766 | |
---|
767 | integer(kind=im), parameter :: bandNumber = 12 |
---|
768 | integer(kind=im), parameter :: numGPoints = no12 |
---|
769 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
770 | integer(kind=im) :: ncid, varID |
---|
771 | |
---|
772 | status(:) = nf90_NoErr |
---|
773 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
774 | |
---|
775 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
776 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
777 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
778 | count = (/numGPoints,keylower,1,1/)) |
---|
779 | |
---|
780 | status(4) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
781 | status(5) = nf90_get_var(ncid, varID, kao, & |
---|
782 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
783 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
784 | |
---|
785 | status(6) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
786 | status(7) = nf90_get_var(ncid, varID, selfrefo, & |
---|
787 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
788 | count = (/Tself,numGPoints,1,1/)) |
---|
789 | |
---|
790 | status(8) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
791 | status(9) = nf90_get_var(ncid, varID, forrefo, & |
---|
792 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
793 | count = (/Tforeign,numGPoints,1,1/)) |
---|
794 | |
---|
795 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
796 | |
---|
797 | status(1) = nf90_close(ncid) |
---|
798 | |
---|
799 | end subroutine lw_kgb12 |
---|
800 | !******************************************************************************* |
---|
801 | |
---|
802 | !******************************************************************************* |
---|
803 | subroutine lw_kgb13 |
---|
804 | use rrlw_kg13, only : fracrefao, fracrefbo, kao, kao_mco2, kao_mco, & |
---|
805 | kbo_mo3, selfrefo, forrefo, no13 |
---|
806 | use rrlw_ncpar |
---|
807 | use netcdf |
---|
808 | |
---|
809 | implicit none |
---|
810 | save |
---|
811 | |
---|
812 | integer(kind=im) :: ab |
---|
813 | integer(kind=im), parameter :: bandNumber = 13 |
---|
814 | integer(kind=im), parameter :: numGPoints = no13 |
---|
815 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
816 | integer(kind=im) :: ncid, varID |
---|
817 | |
---|
818 | status(:) = nf90_NoErr |
---|
819 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
820 | |
---|
821 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
822 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
823 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
824 | count = (/numGPoints,keylower,1,1/)) |
---|
825 | |
---|
826 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
827 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
828 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
829 | count = (/numGPoints,1,1,1/)) |
---|
830 | |
---|
831 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
832 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
833 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
834 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
835 | |
---|
836 | status(8) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
837 | status(9) = nf90_get_var(ncid, varID, selfrefo, & |
---|
838 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
839 | count = (/Tself,numGPoints,1,1/)) |
---|
840 | |
---|
841 | status(10) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
842 | status(11) = nf90_get_var(ncid, varID, forrefo, & |
---|
843 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
844 | count = (/Tforeign,numGPoints,1,1/)) |
---|
845 | |
---|
846 | !Get absorber index for O3 |
---|
847 | call getAbsorberIndex('O3',ab) |
---|
848 | status(12) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
849 | status(13) = nf90_get_var(ncid, varID, kbo_mo3, & |
---|
850 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
851 | count = (/1,T,numGPoints,1,1,1/)) |
---|
852 | |
---|
853 | !Get absorber index for CO2 |
---|
854 | call getAbsorberIndex('CO2',ab) |
---|
855 | status(14) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
856 | status(15) = nf90_get_var(ncid, varID, kao_mco2, & |
---|
857 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
858 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
859 | |
---|
860 | !Get absorber index for CO |
---|
861 | call getAbsorberIndex('CO',ab) |
---|
862 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
863 | status(17) = nf90_get_var(ncid, varID, kao_mco, & |
---|
864 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
865 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
866 | |
---|
867 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
868 | |
---|
869 | status(1) = nf90_close(ncid) |
---|
870 | |
---|
871 | end subroutine lw_kgb13 |
---|
872 | !******************************************************************************* |
---|
873 | |
---|
874 | !******************************************************************************* |
---|
875 | subroutine lw_kgb14 |
---|
876 | use rrlw_kg14, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo, no14 |
---|
877 | use rrlw_ncpar |
---|
878 | use netcdf |
---|
879 | |
---|
880 | implicit none |
---|
881 | save |
---|
882 | |
---|
883 | integer(kind=im), parameter :: bandNumber = 14 |
---|
884 | integer(kind=im), parameter :: numGPoints = no14 |
---|
885 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
886 | integer(kind=im) :: ncid, varID |
---|
887 | |
---|
888 | status(:) = nf90_NoErr |
---|
889 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
890 | |
---|
891 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
892 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
893 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
894 | count = (/numGPoints,1,1,1/)) |
---|
895 | |
---|
896 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
897 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
898 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
899 | count = (/numGPoints,1,1,1/)) |
---|
900 | |
---|
901 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
902 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
903 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
904 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
905 | |
---|
906 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
907 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
908 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
909 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
910 | |
---|
911 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
912 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
913 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
914 | count = (/Tself,numGPoints,1,1/)) |
---|
915 | |
---|
916 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
917 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
918 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
919 | count = (/Tforeign,numGPoints,1,1/)) |
---|
920 | |
---|
921 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
922 | |
---|
923 | status(1) = nf90_close(ncid) |
---|
924 | |
---|
925 | end subroutine lw_kgb14 |
---|
926 | !******************************************************************************* |
---|
927 | |
---|
928 | !******************************************************************************* |
---|
929 | subroutine lw_kgb15 |
---|
930 | use rrlw_kg15, only : fracrefao, kao, kao_mn2, selfrefo, forrefo, no15 |
---|
931 | use rrlw_ncpar |
---|
932 | use netcdf |
---|
933 | |
---|
934 | implicit none |
---|
935 | save |
---|
936 | |
---|
937 | integer(kind=im) :: ab |
---|
938 | integer(kind=im), parameter :: bandNumber = 15 |
---|
939 | integer(kind=im), parameter :: numGPoints = no15 |
---|
940 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
941 | integer(kind=im) :: ncid, varID |
---|
942 | |
---|
943 | status(:) = nf90_NoErr |
---|
944 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
945 | |
---|
946 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
947 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
948 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
949 | count = (/numGPoints,keylower,1,1/)) |
---|
950 | |
---|
951 | status(4) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
952 | status(5) = nf90_get_var(ncid, varID, kao, & |
---|
953 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
954 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
955 | |
---|
956 | status(6) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
957 | status(7) = nf90_get_var(ncid, varID, selfrefo, & |
---|
958 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
959 | count = (/Tself,numGPoints,1,1/)) |
---|
960 | |
---|
961 | status(8) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
962 | status(9) = nf90_get_var(ncid, varID, forrefo, & |
---|
963 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
964 | count = (/Tforeign,numGPoints,1,1/)) |
---|
965 | |
---|
966 | !Get absorber index for N2 |
---|
967 | call getAbsorberIndex('N2',ab) |
---|
968 | status(10) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
969 | status(11) = nf90_get_var(ncid, varID, kao_mn2, & |
---|
970 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
971 | count = (/keylower,T,numGPoints,1,1,1/)) |
---|
972 | |
---|
973 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
974 | |
---|
975 | status(1) = nf90_close(ncid) |
---|
976 | |
---|
977 | end subroutine lw_kgb15 |
---|
978 | !******************************************************************************* |
---|
979 | |
---|
980 | !******************************************************************************* |
---|
981 | subroutine lw_kgb16 |
---|
982 | use rrlw_kg16, only : fracrefao, fracrefbo, kao, kbo, selfrefo, forrefo, no16 |
---|
983 | use rrlw_ncpar |
---|
984 | use netcdf |
---|
985 | |
---|
986 | implicit none |
---|
987 | save |
---|
988 | |
---|
989 | integer(kind=im), parameter :: bandNumber = 16 |
---|
990 | integer(kind=im), parameter :: numGPoints = no16 |
---|
991 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
992 | integer(kind=im) :: ncid, varID |
---|
993 | |
---|
994 | status(:) = nf90_NoErr |
---|
995 | status(1) = nf90_open('rrtmg_lw.nc',nf90_nowrite,ncid) |
---|
996 | |
---|
997 | status(2) = nf90_inq_varid(ncid,"PlanckFractionLowerAtmos",varID) |
---|
998 | status(3) = nf90_get_var(ncid, varID, fracrefao, & |
---|
999 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
1000 | count = (/numGPoints,keylower,1,1/)) |
---|
1001 | |
---|
1002 | status(4) = nf90_inq_varid(ncid,"PlanckFractionUpperAtmos",varID) |
---|
1003 | status(5) = nf90_get_var(ncid, varID, fracrefbo, & |
---|
1004 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
1005 | count = (/numGPoints,1,1,1/)) |
---|
1006 | |
---|
1007 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
1008 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
1009 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
1010 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
1011 | |
---|
1012 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
1013 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
1014 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
1015 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
1016 | |
---|
1017 | status(10) = nf90_inq_varid(ncid,"H20SelfAbsorptionCoefficients",varID) |
---|
1018 | status(11) = nf90_get_var(ncid, varID, selfrefo, & |
---|
1019 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
1020 | count = (/Tself,numGPoints,1,1/)) |
---|
1021 | |
---|
1022 | status(12) = nf90_inq_varid(ncid,"H20ForeignAbsorptionCoefficients",varID) |
---|
1023 | status(13) = nf90_get_var(ncid, varID, forrefo, & |
---|
1024 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
1025 | count = (/Tforeign,numGPoints,1,1/)) |
---|
1026 | |
---|
1027 | if(any(status(:) /= nf90_NoErr)) stop "Error reading variables from file" |
---|
1028 | |
---|
1029 | status(1) = nf90_close(ncid) |
---|
1030 | |
---|
1031 | end subroutine lw_kgb16 |
---|
1032 | !******************************************************************************* |
---|