1 subroutine getlvls(param,ithfld,ifld,found_fld,kpv,pv)
6 use xml_perl_data,
only :
param_t
7 use ctlblk_mod,
only : lsm, spl, nsoil, isf_surface_physics, &
8 me, nfd, htfd, nbnd, petabnd
9 use rqstfld_mod,
only : lvls, lvlsxml, mxlvl, lvls, iget, ident, &
11 use soil,
only : sldpth,sllevel
14 type(param_t),
intent(in) :: param
15 integer,
intent(in) :: ithfld,kpv
16 integer,
intent(inout) :: ifld
17 logical,
intent(inout) :: found_fld
18 real,
intent(in) :: pv(1:kpv)
20 real,
parameter :: small=1.e-5
21 real,
parameter :: small1=1.e-3
22 real,
parameter :: small2=1
23 integer i,j,nlevel,scalef,lvlcape,lvlcin
27 nlevel=
size(param%level)
29 if(trim(param%fixed_sfc1_type)==
'isobaric_sfc')
then
33 if(abs(param%level(j)-spl(i))<small1)
then
42 if(trim(param%fixed_sfc1_type)==
'hybrid_lvl')
then
45 if(nint(param%level(j))==i)
then
54 if(trim(param%fixed_sfc1_type)==
'depth_bel_land_sfc'.and. &
55 trim(param%fixed_sfc2_type)==
'depth_bel_land_sfc' )
then
60 if(isf_surface_physics ==3)
then
61 if(nint(param%level(j))==nint(sllevel(i)*100.))
then
67 if(nint(param%level2(j))==nint(sum(sldpth(1:i))*100.) )
then
75 if(trim(param%pname)==
'TSOIL')
then
80 elseif(trim(param%pname)==
'TMP')
then
98 if(trim(param%pname)==
'RH'.and.trim(param%fixed_sfc1_type)==
'sigma_lvl'.and. &
99 trim(param%fixed_sfc2_type)==
'sigma_lvl')
then
101 if(abs(param%level(j)-33)<small.and.abs(param%level2(j)-100)<small)
then
106 iavblfld(ifld)=ithfld
109 else if(abs(param%level(j)-67)<small.and.abs(param%level2(j)-100)<small)
then
114 iavblfld(ifld)=ithfld
117 else if(abs(param%level(j)-33)<small.and.abs(param%level2(j)-67)<small)
then
122 iavblfld(ifld)=ithfld
125 else if(abs(param%level(j)-47)<small.and.abs(param%level2(j)-100)<small)
then
130 iavblfld(ifld)=ithfld
133 else if(abs(param%level(j)-47)<small.and.abs(param%level2(j)-96)<small)
then
138 iavblfld(ifld)=ithfld
141 else if(abs(param%level(j)-18)<small.and.abs(param%level2(j)-47)<small)
then
146 iavblfld(ifld)=ithfld
149 else if(abs(param%level(j)-84)<small.and.abs(param%level2(j)-98)<small)
then
154 iavblfld(ifld)=ithfld
157 else if(abs(param%level(j)-44)<small.and.abs(param%level2(j)-100)<small)
then
162 iavblfld(ifld)=ithfld
165 else if(abs(param%level(j)-44)<small.and.abs(param%level2(j)-72)<small)
then
170 iavblfld(ifld)=ithfld
173 else if(abs(param%level(j)-72)<small.and.abs(param%level2(j)-94)<small)
then
178 iavblfld(ifld)=ithfld
189 if(trim(param%pname)==
'RH'.and.trim(param%fixed_sfc1_type)==
'sigma_lvl'.and. &
190 trim(param%fixed_sfc2_type)==
'')
then
192 if(abs(param%level(j)-9823)<small)
then
197 iavblfld(ifld)=ithfld
200 else if(abs(param%level(j)-9950)<small)
then
205 iavblfld(ifld)=ithfld
216 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'PRES')
then
218 if(abs(param%level(j)-98230)<small)
then
223 iavblfld(ifld)=ithfld
229 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'TMP')
then
231 if(abs(param%level(j)-9823)<small1)
then
236 iavblfld(ifld)=ithfld
240 else if(abs(param%level(j)-8967)<small1)
then
245 iavblfld(ifld)=ithfld
249 else if(abs(param%level(j)-7848)<small1)
then
250 if(me==0)print *,
'indie tmp sigma 7848'
255 iavblfld(ifld)=ithfld
259 else if(abs(param%level(j)-9950)<small1)
then
264 iavblfld(ifld)=ithfld
270 if(lincfld) ifld=ifld-1
272 if(abs(param%level(j)-7000)<small1.or. abs(param%level(j)-7500)<small1 &
273 .or. abs(param%level(j)-8000)<small1 .or. abs(param%level(j)-8500)<small1 &
274 .or. abs(param%level(j)-9000)<small )
then
277 iavblfld(ifld)=ithfld
279 if(abs(param%level(j)-7000)<small1)
then
282 else if(abs(param%level(j)-7500)<small1)
then
285 else if(abs(param%level(j)-8000)<small1)
then
288 else if(abs(param%level(j)-8500)<small1)
then
291 else if(abs(param%level(j)-9000)<small1)
then
300 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'SPF_H')
then
302 if(abs(param%level(j)-98230)<small)
then
307 iavblfld(ifld)=ithfld
313 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'U_GRD')
then
315 if(abs(param%level(j)-98230)<small)
then
320 iavblfld(ifld)=ithfld
323 else if(abs(param%level(j)-9950)<small)
then
328 iavblfld(ifld)=ithfld
336 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'V_GRD')
then
338 if(abs(param%level(j)-98230)<small)
then
343 iavblfld(ifld)=ithfld
346 else if(abs(param%level(j)-9950)<small)
then
351 iavblfld(ifld)=ithfld
359 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'PWAT')
then
361 if(abs(param%level(j)-33)<small.and.abs(param%level2(j)-100)<small)
then
368 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'MCONV')
then
370 if(abs(param%level(j)-85)<small.and.abs(param%level2(j)-100)<small)
then
377 if(trim(param%fixed_sfc1_type)==
'sigma_lvl'.and.trim(param%pname)==
'V_VEL')
then
379 if(abs(param%level(j)-9950)<small)
then
388 if(trim(param%pname)==
'CAPE')
then
389 if(trim(param%fixed_sfc1_type)==
'surface')
then
394 iavblfld(ifld)=ithfld
395 elseif (trim(param%fixed_sfc1_type)==
'spec_pres_above_grnd'.and. &
396 trim(param%fixed_sfc2_type)==
'spec_pres_above_grnd' )
then
398 if(abs(param%level(j)-18000.)<small1.and.abs(param%level2(j)-0.)<small1)
then
403 iavblfld(ifld)=ithfld
418 if(trim(param%pname)==
'CIN')
then
419 if(trim(param%fixed_sfc1_type)==
'surface')
then
423 iavblfld(ifld)=ithfld
424 elseif (trim(param%fixed_sfc1_type)==
'spec_pres_above_grnd'.and. &
425 trim(param%fixed_sfc2_type)==
'spec_pres_above_grnd' )
then
427 if(abs(param%level(j)-18000.)<small1.and.abs(param%level2(j)-0.)<small1)
then
432 iavblfld(ifld)=ithfld
440 if(trim(param%fixed_sfc1_type)==
'pot_vort_sfc')
then
442 scalef=param%scale_fact_fixed_sfc1(j)-6
443 if(param%scale_fact_fixed_sfc1(j)<6) scalef=0
445 if(pv(i)/=0.and.abs(param%level(j)*10.**(-1*scalef)-pv(i))<=1.e-5)
then
458 if(trim(param%fixed_sfc1_type)==
'spec_alt_above_mean_sea_lvl')
then
461 if(nint(param%level(j))==nint(htfd(i)) )
then
462 if(htfd(i)>300.)
then
474 if(trim(param%fixed_sfc1_type)==
'spec_pres_above_grnd')
then
477 if(nint(param%level(j)/100.)==nint(petabnd(i)+15.))
then
483 if(nint(param%level(j)/100.)==255)
then
485 lvlsxml(nbnd+1,ifld)=j
490 if(trim(param%fixed_sfc1_type)==
'spec_hgt_lvl_above_grnd')
then
Parameters that are used to read in Perl XML processed flat file and handle parameter marshalling for...