24 SUBROUTINE calrad_wcloud
26 use vrbls3d, only: o3, pint, pmid, t, q, qqw, qqi, qqr, f_rimef, nlice, nrain, qqs, qqg, &
27 qqnr, qqni, qqnw, cfr, effri, effrl, effrs
28 use vrbls2d, only: czen, ivgtyp, sno, pctsno, ths, vegfrc, si, u10h, v10h, u10,&
29 v10, smstot, hbot, htop, cnvcfr
30 use masks, only: gdlat, gdlon, sm, lmh, sice
32 use gridspec_mod
, only: gridtype
34 use kinds, only: r_kind,r_single,r_double,i_kind
35 use crtm_module
, only: crtm_atmosphere_type,crtm_surface_type,crtm_geometry_type, &
36 crtm_surface_create,o3_id,co2_id,crtm_forward,mass_mixing_ratio_units, &
37 crtm_atmosphere_create, &
38 crtm_options_type,crtm_destroy,crtm_init,specific_amount_units, &
39 success,crtm_options_destroy,crtm_options_create, crtm_options_associated
41 use crtm_rtsolution_define
, only: crtm_rtsolution_type, crtm_rtsolution_create, &
42 crtm_rtsolution_destroy, crtm_rtsolution_associated
43 use crtm_spccoeff
, only: sc
44 use crtm_atmosphere_define
, only:h2o_id,crtm_atmosphere_associated, &
45 crtm_atmosphere_destroy,volume_mixing_ratio_units,crtm_atmosphere_zero
46 use crtm_surface_define
, only: crtm_surface_destroy, crtm_surface_associated, &
48 use crtm_channelinfo_define
, only: crtm_channelinfo_type
50 use crtm_parameters
, only: limit_exp,toa_pressure,max_n_layers,max_sensor_scan_angle
51 use crtm_cloud_define
, only: water_cloud,ice_cloud,rain_cloud,snow_cloud,graupel_cloud,hail_cloud
52 use message_handler
, only: success,warning, display_message
54 use params_mod, only: pi, rtd, p1000, capa, h1000, h1, g, rd, d608, qconv, small
56 use ctlblk_mod, only: modelname, ivegsrc, novegtype, imp_physics, lm, spval, icu_physics,&
57 grib, cfld, fld_info, datapd, idat, im, jsta, jend, jm, me, ista, iend
84 INTEGER,
PARAMETER :: invalid_land = 0
85 INTEGER,
PARAMETER :: compacted_soil = 1
86 INTEGER,
PARAMETER :: tilled_soil = 2
87 INTEGER,
PARAMETER :: sand = 3
88 INTEGER,
PARAMETER :: rock = 4
89 INTEGER,
PARAMETER :: irrigated_low_vegetation = 5
90 INTEGER,
PARAMETER :: meadow_grass = 6
91 INTEGER,
PARAMETER :: scrub = 7
92 INTEGER,
PARAMETER :: broadleaf_forest = 8
93 INTEGER,
PARAMETER :: pine_forest = 9
94 INTEGER,
PARAMETER :: tundra = 10
95 INTEGER,
PARAMETER :: grass_soil = 11
96 INTEGER,
PARAMETER :: broadleaf_pine_forest = 12
97 INTEGER,
PARAMETER :: grass_scrub = 13
98 INTEGER,
PARAMETER :: soil_grass_scrub = 14
99 INTEGER,
PARAMETER :: urban_concrete = 15
100 INTEGER,
PARAMETER :: pine_brush = 16
101 INTEGER,
PARAMETER :: broadleaf_brush = 17
102 INTEGER,
PARAMETER :: wet_soil = 18
103 INTEGER,
PARAMETER :: scrub_soil = 19
104 INTEGER,
PARAMETER :: broadleaf70_pine30 = 20
107 integer,
allocatable:: model_to_crtm(:)
108 integer,
parameter:: ndat=100
110 integer,
parameter:: n_absorbers = 2
112 integer,
parameter:: n_aerosols = 0
114 integer(i_kind),
parameter:: n_sensors=23
115 character(len=20),
parameter,
dimension(1:n_sensors):: sensorlist= &
139 character(len=13),
parameter,
dimension(1:n_sensors):: obslist= &
163 character(len=20),
dimension(1:n_sensors):: sensorlist_local
165 integer(i_kind) sensorindex
166 integer(i_kind) lunin,nobs,nchanl,nreal
167 integer(i_kind) error_status,itype
168 integer(i_kind) err1,err2,err3,err4
169 integer(i_kind) i,j,k,msig
170 integer(i_kind) lcbot,lctop
171 integer jdn,ichan,ixchan,igot
177 real(r_kind),
parameter:: r100=100.0_r_kind
178 real,
parameter:: ozsmall = 1.e-10
180 real(r_double),
dimension(4):: sfcpct
181 real(r_kind) snodepth,vegcover
184 real(r_kind),
dimension(ista:iend,jsta:jend):: tb1,tb2,tb3,tb4
185 real(r_kind),
allocatable :: tb(:,:,:)
186 real,
dimension(im,jm):: grid1
187 real sun_zenith,sun_azimuth, dpovg, sun_zenith_rad
190 real,
parameter:: constoz = 604229.0_r_kind
193 character(13)::obstype
195 character(20)::isis_local
197 logical hirs2,msu,goessndr,hirs3,hirs4,hirs,amsua,amsub,airs,hsb &
198 ,goes_img,abi,seviri, mhs,insat3d
199 logical avhrr,avhrr_navy,lextra,ssu
200 logical ssmi,ssmis,amsre,amsre_low,amsre_mid,amsre_hig,change
201 logical ssmis_las,ssmis_uas,ssmis_env,ssmis_img
202 logical sea,mixed,land,ice,snow,toss
203 logical micrim,microwave
204 logical post_abig16, post_abig17, post_abig18, post_abigr
205 logical fix_abig16, fix_abig17, fix_abig18
209 logical,
parameter :: debugprint = .false.
210 type(crtm_atmosphere_type
),
dimension(1):: atmosphere
211 type(crtm_surface_type
),
dimension(1) :: surface
212 type(crtm_geometry_type
),
dimension(1) :: geometryinfo
213 type(crtm_options_type
),
dimension(1) :: options
215 type(crtm_rtsolution_type
),
allocatable,
dimension(:,:):: rtsolution
216 type(crtm_channelinfo_type
),
allocatable,
dimension(:) :: channelinfo
218 integer ii,jj,n_clouds,n,nc
219 integer,
external :: iw3jdn
229 sensorlist_local(n) = sensorlist(n)
230 if (sensorlist(n) ==
'abi_g16')
then
231 inquire(file=
'abi_g16.SpcCoeff.bin',exist=fix_abig16)
232 if (.not.fix_abig16) sensorlist_local(n) =
'abi_gr '
234 if (sensorlist(n) ==
'abi_g17')
then
235 inquire(file=
'abi_g17.SpcCoeff.bin',exist=fix_abig17)
236 if (.not.fix_abig17) sensorlist_local(n) =
'abi_gr '
238 if (sensorlist(n) ==
'abi_g18')
then
239 inquire(file=
'abi_g18.SpcCoeff.bin',exist=fix_abig18)
240 if (.not.fix_abig18) sensorlist_local(n) =
'abi_gr '
248 allocate(model_to_crtm(novegtype) )
249 model_to_crtm=(/pine_forest, broadleaf_forest, pine_forest, &
250 broadleaf_forest,broadleaf_pine_forest, scrub, scrub_soil, &
251 broadleaf_brush,broadleaf_brush, scrub, broadleaf_brush, &
252 tilled_soil, urban_concrete,tilled_soil, invalid_land, &
253 compacted_soil, invalid_land, tundra,tundra, tundra/)
254 else if(ivegsrc==0)
then
255 allocate(model_to_crtm(novegtype) )
256 model_to_crtm=(/urban_concrete, &
257 compacted_soil, irrigated_low_vegetation, grass_soil, meadow_grass, &
258 meadow_grass, meadow_grass, scrub, grass_scrub, meadow_grass, &
259 broadleaf_forest, pine_forest, broadleaf_forest, pine_forest, &
260 broadleaf_pine_forest, compacted_soil, wet_soil, wet_soil, &
261 irrigated_low_vegetation, tundra, tundra, tundra, tundra, &
263 else if(ivegsrc==2)
then
264 allocate(model_to_crtm(0:novegtype) )
265 model_to_crtm=(/compacted_soil, &
266 broadleaf_forest, broadleaf_forest, broadleaf_pine_forest, &
267 pine_forest, pine_forest, broadleaf_brush, scrub, scrub, scrub_soil, &
268 tundra, compacted_soil, tilled_soil, compacted_soil/)
270 print*,
'novegtype=',novegtype
271 print*,
'model veg type not supported by post in calling crtm '
272 print*,
'skipping generation of simulated radiance'
280 if (iget(n) > 0) post_abig16=.true.
284 if (iget(n) > 0) post_abig17=.true.
288 if (iget(n) > 0) post_abig18=.true.
292 if (iget(n) > 0) post_abigr=.true.
296 if (iget(n) > 0) post_ahi8=.true.
300 if (iget(n) > 0) post_ssmis17=.true.
305 ifactive:
if (iget(327) > 0 .or. iget(328) > 0 .or. iget(329) > 0 &
306 .or. iget(330) > 0 .or. iget(446) > 0 .or. iget(447) > 0 &
307 .or. iget(448) > 0 .or. iget(449) > 0 .or. iget(456) > 0 &
308 .or. iget(457) > 0 .or. iget(458) > 0 .or. iget(459) > 0 &
309 .or. iget(460) > 0 .or. iget(461) > 0 .or. iget(462) > 0 &
310 .or. iget(463) > 0 .or. iget(483) > 0 .or. iget(484) > 0 &
311 .or. iget(485) > 0 .or. iget(486) > 0 .or. iget(488) > 0 &
312 .or. iget(489) > 0 .or. iget(490) > 0 .or. iget(491) > 0 &
313 .or. iget(492) > 0 .or. iget(493) > 0 .or. iget(494) > 0 &
314 .or. iget(495) > 0 .or. iget(496) > 0 .or. iget(497) > 0 &
315 .or. iget(498) > 0 .or. iget(499) > 0 .or. iget(800) > 0 &
316 .or. iget(801) > 0 .or. iget(802) > 0 .or. iget(803) > 0 &
317 .or. iget(804) > 0 .or. iget(805) > 0 .or. iget(806) > 0 &
318 .or. iget(807) > 0 .or. iget(809) > 0 &
319 .or. iget(810) > 0 .or. iget(811) > 0 .or. iget(812) > 0 &
320 .or. iget(813) > 0 .or. iget(814) > 0 .or. iget(815) > 0 &
321 .or. iget(816) > 0 .or. iget(817) > 0 .or. iget(818) > 0 &
322 .or. iget(819) > 0 .or. iget(820) > 0 .or. iget(821) > 0 &
323 .or. iget(822) > 0 .or. iget(823) > 0 .or. iget(824) > 0 &
324 .or. iget(825) > 0 .or. iget(826) > 0 .or. iget(827) > 0 &
325 .or. iget(828) > 0 .or. iget(829) > 0 .or. iget(830) > 0 &
326 .or. iget(831) > 0 .or. iget(832) > 0 .or. iget(833) > 0 &
327 .or. iget(834) > 0 .or. iget(835) > 0 .or. iget(836) > 0 &
328 .or. iget(837) > 0 .or. iget(838) > 0 .or. iget(839) > 0 &
329 .or. iget(840) > 0 .or. iget(841) > 0 .or. iget(842) > 0 &
330 .or. iget(843) > 0 .or. iget(844) > 0 .or. iget(845) > 0 &
331 .or. iget(846) > 0 .or. iget(847) > 0 .or. iget(848) > 0 &
332 .or. iget(849) > 0 .or. iget(850) > 0 .or. iget(851) > 0 &
333 .or. iget(852) > 0 .or. iget(856) > 0 .or. iget(857) > 0 &
334 .or. iget(860) > 0 .or. iget(861) > 0 &
335 .or. iget(862) > 0 .or. iget(863) > 0 .or. iget(864) > 0 &
336 .or. iget(865) > 0 .or. iget(866) > 0 .or. iget(867) > 0 &
337 .or. iget(868) > 0 .or. iget(869) > 0 .or. iget(870) > 0 &
338 .or. iget(871) > 0 .or. iget(872) > 0 .or. iget(873) > 0 &
339 .or. iget(874) > 0 .or. iget(875) > 0 .or. iget(876) > 0 &
340 .or. iget(877) > 0 .or. iget(878) > 0 .or. iget(879) > 0 &
341 .or. iget(880) > 0 .or. iget(881) > 0 .or. iget(882) > 0 &
342 .or. post_ahi8 .or. post_ssmis17 &
343 .or. post_abig16 .or. post_abig17 .or. post_abig18 &
344 .or. post_abigr )
then
346 ! specify numbers of cloud species
347 ! thompson==8, ferrier==5,95, wsm6==6, lin==2
348 if(imp_physics==99 .or. imp_physics==98)
then
350 else if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
352 else if(imp_physics==8 .or. imp_physics==6 .or. imp_physics==2 &
353 .or. imp_physics==28 .or. imp_physics==11)
then
357 print*,
'Warning: number of cloud species (n_clouds) being set to zero for imp_physics=',imp_physics
360 ! initialize debug print gridpoint index to middle of tile:
364 ! initialize ozone to zeros for wrf nmm and arw for now
365 if (modelname ==
'NMM' .OR. modelname ==
'NCAR' .OR. modelname ==
'RAPR' &
367 ! compute solar zenith angle for gfs, arw now computes czen in
initpost
369 jdn=iw3jdn(idat(3),idat(1),idat(2))
372 call
zensun(jdn,float(idat(4)),gdlat(i,j),gdlon(i,j) &
373 ,pi,sun_zenith,sun_azimuth)
374 sun_zenith_rad=sun_zenith/rtd
375 czen(i,j)=cos(sun_zenith_rad)
378 if(jj>=jsta .and. jj<=jend.and.debugprint) &
379 print*,
'sample GFS zenith angle=',acos(czen(ii,jj))*rtd
381 ! initialize crtm. load satellite sensor array.
382 ! the
optional arguments process_id and output_process_id limit
383 ! generation of runtime informative output to mpi task
384 ! output_process_id(which here is set to be task 0)
385 if(me==0)print*,
'success in CALRAD= ',success
386 allocate( channelinfo(n_sensors))
388 error_status = crtm_init(sensorlist_local,channelinfo, &
389 process_id=0,output_process_id=0 )
390 if(me==0)print*,
'channelinfo after init= ',channelinfo(1)%sensor_id, &
391 channelinfo(2)%sensor_id
392 if (error_status /= 0_i_kind) &
393 write(6,*)
'ERROR*** crtm_init error_status=',error_status
395 ! restrict channel list to those which are selected for simulation
396 ! in the lvls filed of wrf_cntrl.parm(does not currently apply
397 ! to all sensors / channels).
401 call select_channels_l(channelinfo(2),4,(/ 1,2,3,4 /),lvls(1:4,iget(868)),iget(868))
405 call select_channels_l(channelinfo(1),4,(/ 1,2,3,4 /),lvls(1:4,iget(872)),iget(872))
411 if (iget(n) > 0)
then
415 if (nchanl > 0 .and. nchanl <10)
then
417 if (iget(n) == 0) channelinfo(19)%Process_Channel(n-927+1)=.false.
425 if (iget(n) > 0)
then
429 if (nchanl > 0 .and. nchanl <10)
then
431 if (iget(n) == 0) channelinfo(20)%Process_Channel(n-937+1)=.false.
439 if (iget(n) > 0)
then
443 if (nchanl > 0 .and. nchanl <10)
then
445 if (iget(n) == 0) channelinfo(21)%Process_Channel(n-531+1)=.false.
449 ! goes-r for nadir output
453 if (iget(n) > 0)
then
457 if (nchanl > 0 .and. nchanl <10)
then
459 if (iget(n) == 0) channelinfo(20)%Process_Channel(n-958+1)=.false.
464 ! himawari-8 ahi infrared
468 if (iget(n) > 0)
then
472 if (nchanl > 0 .and. nchanl <10)
then
474 if (iget(n) == 0) channelinfo(22)%Process_Channel(n-969+1)=.false.
479 ! ssmis f17(37h, 37v, 91h, 91v)
483 if (iget(n) > 0)
then
487 if (nchanl > 14 .and. nchanl < 19)
then
489 if (iget(n) == 0) channelinfo(11)%Process_Channel(n-825+15)=.false.
494 ! ssmi, f13-f15(19h,19v,??h,37h,37v,85h,85v)
496 call select_channels_l(channelinfo(7),7,(/ 1,2,3,4,5,6,7 /),lvls(1:7,iget(800)),iget(800))
499 call select_channels_l(channelinfo(8),7,(/ 1,2,3,4,5,6,7 /),lvls(1:7,iget(806)),iget(806))
502 call select_channels_l(channelinfo(9),7,(/ 1,2,3,4,5,6,7 /),lvls(1:7,iget(812)),iget(812))
504 ! ssmis, f16-f20(183h,19h,19v,37h,37v,91h,91v)
506 call select_channels_l(channelinfo(10),24,(/ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 /),lvls(1:24,iget(818)),iget(818))
512 call select_channels_l(channelinfo(12),24,(/ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 /),lvls(1:24,iget(832)),iget(832))
515 call select_channels_l(channelinfo(13),24,(/ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 /),lvls(1:24,iget(839)),iget(839))
518 call select_channels_l(channelinfo(14),24,(/ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 /),lvls(1:24,iget(846)),iget(846))
522 call select_channels_l(channelinfo(15),8,(/ 1,2,3,4,5,6,7,8 /),lvls(1:8,iget(876)),iget(876))
526 call select_channels_l(channelinfo(16),4,(/ 1,2,3,4 /),lvls(1:4,iget(860)),iget(860))
530 call select_channels_l(channelinfo(17),4,(/ 1,2,3,4 /),lvls(1:4,iget(864)),iget(864))
534 call select_channels_l(channelinfo(18),4,(/ 1,2,3,4 /),lvls(1:4,iget(865)),iget(865))
537 ! loop over
data types to process
538 sensordo:
do isat=1,n_sensors
540 if(me==0)print*,
'n_sensor,obstype,isis',isat,obslist(isat),sensorlist(isat)
542 obstype=obslist(isat)
543 isis=trim(sensorlist(isat))
546 (isis==
'imgr_g12' .and. (iget(327) > 0 .or. iget(328) > 0 &
547 .or. iget(329) > 0 .or. iget(330) > 0 .or. iget(456) > 0 &
548 .or. iget(457) > 0 .or. iget(458) > 0 .or. iget(459) > 0 )) .OR. &
549 (isis==
'imgr_g11' .and. (iget(446) > 0 .or. iget(447) > 0 &
550 .or. iget(448) > 0 .or. iget(449) > 0 .or. iget(460) > 0 &
551 .or. iget(461) > 0 .or. iget(462) > 0 .or. iget(463) > 0)) .OR. &
552 (isis==
'amsre_aqua' .and. (iget(483) > 0 .or. iget(484) > 0 &
553 .or. iget(485) > 0 .or. iget(486) > 0)) .OR. &
554 (isis==
'tmi_trmm' .and. (iget(488) > 0 .or. iget(489) > 0 &
555 .or. iget(490) > 0 .or. iget(491) > 0)) .OR. &
556 (isis==
'ssmi_f13' .and. iget(800) > 0 ) .OR. &
557 (isis==
'ssmi_f14' .and. iget(806) > 0 ) .OR. &
558 (isis==
'ssmi_f15' .and. iget(812) > 0 ) .OR. &
559 (isis==
'ssmis_f16' .and. iget(818) > 0) .OR. &
560 (isis==
'ssmis_f17' .and. post_ssmis17) .OR. &
561 (isis==
'ssmis_f18' .and. iget(832) > 0) .OR. &
562 (isis==
'ssmis_f19' .and. iget(839) > 0) .OR. &
563 (isis==
'ssmis_f20' .and. iget(846) > 0) .OR. &
564 (isis==
'imgr_mt2' .and. iget(860)>0) .OR. &
565 (isis==
'imgr_mt1r' .and. iget(864)>0) .OR. &
566 (isis==
'imgr_insat3d' .and. iget(865)>0) .OR. &
567 (isis==
'imgr_g13' .and. iget(868)>0) .OR. &
568 (isis==
'imgr_g15' .and. iget(872)>0) .OR. &
569 (isis==
'abi_g16' .and. post_abig16) .OR. &
570 (isis==
'abi_g17' .and. post_abig17) .OR. &
571 (isis==
'abi_g18' .and. post_abig18) .OR. &
572 (isis==
'abi_gr' .and. post_abigr) .OR. &
573 (isis==
'seviri_m10' .and. iget(876)>0) .OR. &
574 (isis==
'ahi_himawari8' .and. post_ahi8) )
then
575 if(me==0)print*,
'obstype, isis= ',obstype,isis
580 hirs2 = obstype ==
'hirs2'
581 hirs3 = obstype ==
'hirs3'
582 hirs4 = obstype ==
'hirs4'
583 hirs = hirs2 .or. hirs3 .or. hirs4
584 msu = obstype ==
'msu'
585 ssu = obstype ==
'ssu'
586 goessndr = obstype ==
'sndr' .or. obstype ==
'sndrd1' .or. &
587 obstype ==
'sndrd2'.or. obstype ==
'sndrd3' .or. &
589 amsua = obstype ==
'amsua'
590 amsub = obstype ==
'amsub'
591 mhs = obstype ==
'mhs'
592 airs = obstype ==
'airs'
593 hsb = obstype ==
'hsb'
594 goes_img = obstype ==
'goes_img'
595 abi = obstype ==
'abi'
596 seviri = obstype ==
'seviri'
597 insat3d = obstype ==
'imgr_insat3d'
598 avhrr = obstype ==
'avhrr'
599 avhrr_navy = obstype ==
'avhrr_navy'
600 ssmi = obstype ==
'ssmi'
601 amsre_low = obstype ==
'amsre_low'
602 amsre_mid = obstype ==
'amsre_mid'
603 amsre_hig = obstype ==
'amsre_hig'
604 amsre = amsre_low .or. amsre_mid .or. amsre_hig
605 ssmis = obstype ==
'ssmis'
606 ssmis_las = obstype ==
'ssmis_las'
607 ssmis_uas = obstype ==
'ssmis_uas'
608 ssmis_img = obstype ==
'ssmis_img'
609 ssmis_env = obstype ==
'ssmis_env'
611 ssmis=ssmis_las.or.ssmis_uas.or.ssmis_img.or.ssmis_env.or.ssmis
613 micrim=ssmi .or. ssmis .or. amsre
615 microwave=amsua .or. amsub .or. mhs .or. msu .or. hsb .or. micrim
618 sensor_search:
do j = 1, n_sensors
620 if (isis==
'abi_g16' .and. .not.fix_abig16)
then
623 if (isis==
'abi_g17' .and. .not.fix_abig17)
then
626 if (isis==
'abi_g18' .and. .not.fix_abig18)
then
629 if (channelinfo(j)%sensor_id == isis_local )
then
634 if (sensorindex == 0 )
then
635 write(6,*)
'SETUPRAD: ***WARNING*** problem with sensorindex=',isis,&
636 ' --> CAN NOT PROCESS isis=',isis,
' TERMINATE PROGRAM EXECUTION'
642 if(isis==
'ssmis_f19')channelinfo(sensorindex)%WMO_Satellite_Id=287
643 if(isis==
'ssmis_f20')channelinfo(sensorindex)%WMO_Satellite_Id=289
645 if(isis==
'abi_g16')channelinfo(sensorindex)%WMO_Satellite_Id=270
646 if(isis==
'abi_g16')channelinfo(sensorindex)%WMO_Sensor_Id=617
647 if(isis==
'abi_g17')channelinfo(sensorindex)%WMO_Satellite_Id=271
648 if(isis==
'abi_g17')channelinfo(sensorindex)%WMO_Sensor_Id=617
650 if(isis==
'abi_g18')channelinfo(sensorindex)%WMO_Satellite_Id=272
651 if(isis==
'abi_g18')channelinfo(sensorindex)%WMO_Sensor_Id=617
652 if(isis==
'abi_gr')channelinfo(sensorindex)%WMO_Satellite_Id=270
653 if(isis==
'abi_gr')channelinfo(sensorindex)%WMO_Sensor_Id=617
655 allocate(rtsolution(channelinfo(sensorindex)%n_channels,1))
656 allocate(tb(ista:iend,jsta:jend,channelinfo(sensorindex)%n_channels))
657 err1=0; err2=0; err3=0; err4=0
658 if(lm > max_n_layers)
then
659 write(6,*)
'CALRAD: lm > max_n_layers - '// &
660 'increase crtm max_n_layers ', &
665 CALL crtm_atmosphere_create(atmosphere(1),lm,n_absorbers,n_clouds &
667 CALL crtm_surface_create(surface(1),channelinfo(sensorindex)%n_channels)
668 CALL crtm_rtsolution_create(rtsolution,lm)
669 if (.NOT.(crtm_atmosphere_associated(atmosphere(1)))) &
670 write(6,*)
' ***ERROR** creating atmosphere.'
671 if (.NOT.(crtm_surface_associated(surface(1)))) &
672 write(6,*)
' ***ERROR** creating surface.'
673 if (.NOT.(any(crtm_rtsolution_associated(rtsolution)))) &
674 write(6,*)
' ***ERROR** creating rtsolution.'
676 atmosphere(1)%n_layers = lm
678 atmosphere(1)%absorber_id(1) = h2o_id
679 atmosphere(1)%absorber_id(2) = o3_id
680 atmosphere(1)%absorber_units(1) = mass_mixing_ratio_units
681 atmosphere(1)%absorber_units(2) = volume_mixing_ratio_units
683 atmosphere(1)%level_pressure(0) = toa_pressure
685 if(imp_physics==99 .or. imp_physics==98)
then
686 atmosphere(1)%cloud(1)%n_layers = lm
687 atmosphere(1)%cloud(1)%Type = water_cloud
688 atmosphere(1)%cloud(2)%n_layers = lm
689 atmosphere(1)%cloud(2)%Type = ice_cloud
690 else if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
691 atmosphere(1)%cloud(1)%n_layers = lm
692 atmosphere(1)%cloud(1)%Type = water_cloud
693 atmosphere(1)%cloud(2)%n_layers = lm
694 atmosphere(1)%cloud(2)%Type = ice_cloud
695 atmosphere(1)%cloud(3)%n_layers = lm
696 atmosphere(1)%cloud(3)%Type = rain_cloud
697 atmosphere(1)%cloud(4)%n_layers = lm
698 atmosphere(1)%cloud(4)%Type = snow_cloud
699 atmosphere(1)%cloud(5)%n_layers = lm
700 atmosphere(1)%cloud(5)%Type = graupel_cloud
701 atmosphere(1)%cloud(6)%n_layers = lm
702 atmosphere(1)%cloud(6)%Type = hail_cloud
703 else if(imp_physics==8 .or. imp_physics==6 .or. imp_physics==2 .or. imp_physics==28 &
704 .or. imp_physics==11)
then
705 atmosphere(1)%cloud(1)%n_layers = lm
706 atmosphere(1)%cloud(1)%Type = water_cloud
707 atmosphere(1)%cloud(2)%n_layers = lm
708 atmosphere(1)%cloud(2)%Type = ice_cloud
709 atmosphere(1)%cloud(3)%n_layers = lm
710 atmosphere(1)%cloud(3)%Type = rain_cloud
711 atmosphere(1)%cloud(4)%n_layers = lm
712 atmosphere(1)%cloud(4)%Type = snow_cloud
713 atmosphere(1)%cloud(5)%n_layers = lm
714 atmosphere(1)%cloud(5)%Type = graupel_cloud
721 surface(1)%sensordata%n_channels = channelinfo(sensorindex)%n_channels
722 surface(1)%sensordata%sensor_id = channelinfo(sensorindex)%sensor_id
723 surface(1)%sensordata%WMO_sensor_id = channelinfo(sensorindex)%WMO_sensor_id
724 surface(1)%sensordata%WMO_Satellite_id = channelinfo(sensorindex)%WMO_Satellite_id
725 surface(1)%sensordata%sensor_channel = channelinfo(sensorindex)%sensor_channel
728 nadir:
if ( (isis==
'imgr_g12' .and. (iget(327)>0 .or. &
729 iget(328)>0 .or. iget(329)>0 .or. iget(330)>0)) .or. &
730 (isis==
'imgr_g11' .and. (iget(446)>0 .or. &
731 iget(447)>0 .or. iget(448)>0 .or. iget(449)>0)) .or. &
732 (isis==
'amsre_aqua' .and. (iget(483) > 0 .or. iget(484) > 0 &
733 .or. iget(485) > 0 .or. iget(486) > 0)) .OR. &
734 (isis==
'tmi_trmm' .and. (iget(488) > 0 .or. iget(489) > 0 &
735 .or. iget(490) > 0 .or. iget(491) > 0)) .OR. &
736 (isis==
'abi_gr' .and. post_abigr) )
then
739 loopi1:
do i=ista,iend
743 if(abs(pmid(i,j,k)-spval)<=small .or. &
744 abs(t(i,j,k)-spval)<=small)
then
745 do n=1,channelinfo(sensorindex)%n_channels
754 geometryinfo(1)%sensor_zenith_angle=0.
755 geometryinfo(1)%sensor_scan_angle=0.
758 IF(geometryinfo(1)%sensor_zenith_angle <= max_sensor_scan_angle &
759 .and. geometryinfo(1)%sensor_zenith_angle >= 0.0_r_kind)
THEN
760 geometryinfo(1)%source_zenith_angle = acos(czen(i,j))*rtd
761 geometryinfo(1)%sensor_scan_angle = 0.
762 if(i==ii.and.j==jj.and.debugprint)print*,
'sample geometry ', &
763 geometryinfo(1)%sensor_zenith_angle &
764 ,geometryinfo(1)%source_zenith_angle &
767 if(modelname ==
'NCAR' .OR. modelname ==
'RAPR')
then
768 sfcpct(4)=pctsno(i,j)
769 else if(ivegsrc==1)
then
771 IF(itype == 0)itype=8
772 if(sno(i,j)<spval)
then
777 CALL snfrac(snoeqv,ivgtyp(i,j),snofrac)
779 else if(ivegsrc==2)
then
781 itype = min(max(0,ivgtyp(i,j)),13)
782 if(sno(i,j)<spval)
then
787 if(i==ii.and.j==jj.and.debugprint)print*,
'sno,itype,ivgtyp B cing snfrc = ', &
788 snoeqv,itype,ivgtyp(i,j)
789 if(sm(i,j) > 0.1)
then
792 call snfrac_gfs(snoeqv,ivgtyp(i,j),snofrac)
826 if(sm(i,j) > 0.1)
then
828 tsfc = ths(i,j)*(pint(i,j,nint(lmh(i,j))+1)/p1000)**capa
830 if(sfcpct(4) > 0.0_r_kind)
then
831 sfcpct(1) = 1.0_r_kind-sfcpct(4)
832 sfcpct(2) = 0.0_r_kind
833 sfcpct(3) = 0.0_r_kind
835 sfcpct(1) = 1.0_r_kind
836 sfcpct(2) = 0.0_r_kind
837 sfcpct(3) = 0.0_r_kind
840 tsfc = ths(i,j)*(pint(i,j,nint(lmh(i,j))+1)/p1000)**capa
842 if(sice(i,j) > 0.1)
then
843 if(sfcpct(4) > 0.0_r_kind)
then
844 sfcpct(3) = 1.0_r_kind-sfcpct(4)
845 sfcpct(1) = 0.0_r_kind
846 sfcpct(2) = 0.0_r_kind
848 sfcpct(3)= 1.0_r_kind
849 sfcpct(1) = 0.0_r_kind
850 sfcpct(2) = 0.0_r_kind
853 if(sfcpct(4) > 0.0_r_kind)
then
854 sfcpct(2)= 1.0_r_kind-sfcpct(4)
855 sfcpct(1) = 0.0_r_kind
856 sfcpct(3) = 0.0_r_kind
858 sfcpct(2)= 1.0_r_kind
859 sfcpct(1) = 0.0_r_kind
860 sfcpct(3) = 0.0_r_kind
864 if(si(i,j)/=spval)
then
871 if(ivegsrc==1 .and. itype==15 .and. sfcpct(4)<1.0_r_kind)
then
872 if(debugprint)print*,
'changing land type for veg type 15',i,j,itype,sfcpct(1:4)
880 sea = sfcpct(1) >= 0.99_r_kind
881 land = sfcpct(2) >= 0.99_r_kind
882 ice = sfcpct(3) >= 0.99_r_kind
883 snow = sfcpct(4) >= 0.99_r_kind
884 mixed = .not. sea .and. .not. ice .and. &
885 .not. land .and. .not. snow
886 if((sfcpct(1)+sfcpct(2)+sfcpct(3)+sfcpct(4)) >1._r_kind) &
887 print*,
'ERROR sfcpct ',i,j,sfcpct(1) &
888 ,sfcpct(2),sfcpct(3),sfcpct(4)
898 itype = min(max(0,ivgtyp(i,j)),novegtype)
900 itype = min(max(1,ivgtyp(i,j)),novegtype)
902 surface(1)%land_type = model_to_crtm(itype)
904 if(gridtype==
'B' .or. gridtype==
'E')
then
905 surface(1)%wind_speed = sqrt(u10h(i,j)*u10h(i,j) &
906 +v10h(i,j)*v10h(i,j))
908 surface(1)%wind_speed = sqrt(u10(i,j)*u10(i,j) &
911 surface(1)%water_coverage = sfcpct(1)
912 surface(1)%land_coverage = sfcpct(2)
913 surface(1)%ice_coverage = sfcpct(3)
914 surface(1)%snow_coverage = sfcpct(4)
916 surface(1)%land_temperature = tsfc
917 surface(1)%snow_temperature = min(tsfc,280._r_kind)
918 surface(1)%water_temperature = max(tsfc,270._r_kind)
919 surface(1)%ice_temperature = min(tsfc,280._r_kind)
920 if(smstot(i,j)/=spval)
then
921 surface(1)%soil_moisture_content = smstot(i,j)/10.
923 surface(1)%soil_moisture_content = 0.05
925 surface(1)%vegetation_fraction = vegcover
927 surface(1)%soil_temperature = 283.
929 surface(1)%snow_depth = snodepth
932 if(surface(1)%wind_speed<0. .or. surface(1)%wind_speed>200.) &
933 print*,
'bad 10 m wind'
934 if(surface(1)%water_coverage<0. .or. surface(1)%water_coverage>1.) &
935 print*,
'bad water coverage'
936 if(surface(1)%land_coverage<0. .or. surface(1)%land_coverage>1.) &
937 print*,
'bad land coverage'
938 if(surface(1)%ice_coverage<0. .or. surface(1)%ice_coverage>1.) &
939 print*,
'bad ice coverage'
940 if(surface(1)%snow_coverage<0. .or. surface(1)%snow_coverage>1.) &
941 print*,
'bad snow coverage'
942 if(surface(1)%land_temperature<0. .or. surface(1)%land_temperature>350.) &
944 if(surface(1)%soil_moisture_content<0. .or. surface(1)%soil_moisture_content>600.) &
945 print*,
'bad soil_moisture_content'
946 if(surface(1)%vegetation_fraction<0. .or. surface(1)%vegetation_fraction>1.) &
947 print*,
'bad vegetation cover'
948 if(surface(1)%snow_depth<0. .or. surface(1)%snow_depth>10000.) &
949 print*,
'bad snow_depth'
951 if(i==ii.and.j==jj.and.debugprint)print*,
'sample surface in CALRAD=', &
952 i,j,surface(1)%wind_speed,surface(1)%water_coverage, &
953 surface(1)%land_coverage,surface(1)%ice_coverage, &
954 surface(1)%snow_coverage,surface(1)%land_temperature, &
955 surface(1)%snow_temperature,surface(1)%water_temperature, &
956 surface(1)%ice_temperature,surface(1)%vegetation_fraction, &
957 surface(1)%soil_temperature,surface(1)%snow_depth, &
958 surface(1)%land_type,sm(i,j)
964 if(i==ii.and.j==jj.and.debugprint)print*,
'TOA= ',atmosphere(1)%level_pressure(0)
966 atmosphere(1)%cloud_fraction(k) = min(max(cfr(i,j,k),0.),1.)
967 atmosphere(1)%level_pressure(k) = pint(i,j,k+1)/r100
968 atmosphere(1)%pressure(k) = pmid(i,j,k)/r100
969 atmosphere(1)%temperature(k) = t(i,j,k)
970 atmosphere(1)%absorber(k,1) = max(0. &
971 ,q(i,j,k)*h1000/(h1-q(i,j,k)))
972 atmosphere(1)%absorber(k,2) = max(ozsmall,o3(i,j,k)*constoz)
976 if(atmosphere(1)%level_pressure(k)<0. .or. atmosphere(1)%level_pressure(k)>1060.) &
977 & print*,
'bad atmosphere(1)%level_pressure' &
978 & ,i,j,k,atmosphere(1)%level_pressure(k)
979 if(atmosphere(1)%pressure(k)<0. .or. &
980 & atmosphere(1)%pressure(k)>1060.) &
981 & print*,
'bad atmosphere(1)%pressure' &
982 & ,i,j,k,atmosphere(1)%pressure(k)
983 if(atmosphere(1)%temperature(k)<0. .or. &
984 & atmosphere(1)%temperature(k)>400.) &
985 & print*,
'bad atmosphere(1)%temperature'
998 dpovg=(pint(i,j,k+1)-pint(i,j,k))/g
999 if(imp_physics==99 .or. imp_physics==98)
then
1000 atmosphere(1)%cloud(1)%effective_radius(k) = 10.
1001 atmosphere(1)%cloud(1)%water_content(k) = max(0.,qqw(i,j,k)*dpovg)
1005 atmosphere(1)%cloud(2)%effective_radius(k) = 50.
1006 atmosphere(1)%cloud(2)%water_content(k) = max(0.,qqi(i,j,k)*dpovg)
1008 if(atmosphere(1)%cloud(1)%water_content(k)<0. .or. &
1009 atmosphere(1)%cloud(1)%water_content(k)>1.) &
1010 print*,
'bad atmosphere cloud water'
1011 if(atmosphere(1)%cloud(2)%water_content(k)<0. .or. &
1012 atmosphere(1)%cloud(2)%water_content(k)>1.) &
1013 print*,
'bad atmosphere cloud ice'
1015 else if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
1016 atmosphere(1)%cloud(1)%effective_radius(k) = 10.
1017 atmosphere(1)%cloud(1)%water_content(k) = max(0.,qqw(i,j,k)*dpovg)
1018 atmosphere(1)%cloud(2)%effective_radius(k) = 75.
1019 atmosphere(1)%cloud(2)%water_content(k) = max(0.,qqi(i,j,k)*dpovg)
1021 rho=pmid(i,j,k)/(rd*t(i,j,k)*(1.+d608*q(i,j,k)))
1022 atmosphere(1)%cloud(3)%effective_radius(k) = 0.
1023 if(nrain(i,j,k)>0.) &
1024 atmosphere(1)%cloud(3)%effective_radius(k) = &
1025 1.0e6*1.5*(rho*qqr(i,j,k)/(pi*rhox*nrain(i,j,k)))**(1./3.)
1026 atmosphere(1)%cloud(3)%water_content(k) = max(0.,qqr(i,j,k)*dpovg)
1027 if(f_rimef(i,j,k)<=5.0)
then
1029 if(nlice(i,j,k)>0.) &
1030 atmosphere(1)%cloud(4)%effective_radius(k) = &
1031 1.0e6*1.5*(rho*qqs(i,j,k)/(pi*rhox*nlice(i,j,k)))**(1./3.)
1032 atmosphere(1)%cloud(4)%water_content(k) = max(0.,qqs(i,j,k)*dpovg)
1033 atmosphere(1)%cloud(5)%effective_radius(k) = 0.
1034 atmosphere(1)%cloud(5)%water_content(k) =0.
1035 atmosphere(1)%cloud(6)%effective_radius(k) = 0.
1036 atmosphere(1)%cloud(6)%water_content(k) =0.
1037 else if(f_rimef(i,j,k)<=20.0)
then
1038 atmosphere(1)%cloud(4)%effective_radius(k) = 0.
1039 atmosphere(1)%cloud(4)%water_content(k) =0.
1041 if(nlice(i,j,k)>0.) &
1042 atmosphere(1)%cloud(5)%effective_radius(k) = &
1043 1.0e6*1.5*(rho*qqs(i,j,k)/(pi*rhox*nlice(i,j,k)))**(1./3.)
1044 atmosphere(1)%cloud(5)%water_content(k) =max(0.,qqs(i,j,k)*dpovg)
1045 atmosphere(1)%cloud(6)%effective_radius(k) = 0.
1046 atmosphere(1)%cloud(6)%water_content(k) =0.
1048 atmosphere(1)%cloud(4)%effective_radius(k) = 0.
1049 atmosphere(1)%cloud(4)%water_content(k) =0.
1050 atmosphere(1)%cloud(5)%effective_radius(k) = 0.
1051 atmosphere(1)%cloud(5)%water_content(k) =0.
1053 if(nlice(i,j,k)>0.) &
1054 atmosphere(1)%cloud(6)%effective_radius(k) = &
1055 1.0e6*1.5*(rho*qqs(i,j,k)/(pi*rhox*nlice(i,j,k)))**(1./3.)
1056 atmosphere(1)%cloud(6)%water_content(k) =max(0.,qqs(i,j,k)*dpovg)
1058 if(debugprint .and. i==im/2 .and. j==jsta) &
1059 print*,
'sample precip ice radius= ',i,j,k, f_rimef(i,j,k), &
1060 atmosphere(1)%cloud(4)%effective_radius(k), atmosphere(1)%cloud(4)%water_content(k), &
1061 atmosphere(1)%cloud(5)%effective_radius(k), atmosphere(1)%cloud(5)%water_content(k), &
1062 atmosphere(1)%cloud(6)%effective_radius(k), atmosphere(1)%cloud(6)%water_content(k)
1064 else if(imp_physics==8 .or. imp_physics==6 .or. imp_physics==2 .or. &
1065 imp_physics==28 .or. imp_physics==11)
then
1066 atmosphere(1)%cloud(1)%water_content(k)=max(0.,qqw(i,j,k)*dpovg)
1067 atmosphere(1)%cloud(2)%water_content(k)=max(0.,qqi(i,j,k)*dpovg)
1068 atmosphere(1)%cloud(3)%water_content(k)=max(0.,qqr(i,j,k)*dpovg)
1069 atmosphere(1)%cloud(4)%water_content(k)=max(0.,qqs(i,j,k)*dpovg)
1070 atmosphere(1)%cloud(5)%water_content(k)=max(0.,qqg(i,j,k)*dpovg)
1071 atmosphere(1)%cloud(1)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1072 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1073 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'C')
1074 atmosphere(1)%cloud(2)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1075 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1076 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'I')
1077 atmosphere(1)%cloud(3)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1078 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1079 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'R')
1080 atmosphere(1)%cloud(4)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1081 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1082 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'S')
1083 atmosphere(1)%cloud(5)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1084 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1085 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'G')
1090 if (abs(atmosphere(1)%pressure(k)-atmosphere(1)%pressure(k+1)) &
1092 atmosphere(1)%pressure(k)=atmosphere(1)%pressure(k)+0.005
1098 if(icu_physics==2)
then
1099 lcbot=nint(hbot(i,j))
1100 lctop=nint(htop(i,j))
1101 if (lcbot-lctop > 1)
then
1105 q_conv = cnvcfr(i,j)*qconv
1107 dpovg=(pint(i,j,k+1)-pint(i,j,k))/g
1108 if (t(i,j,k) < trad_ice)
then
1109 atmosphere(1)%cloud(2)%water_content(k) = &
1110 atmosphere(1)%cloud(2)%water_content(k) + dpovg*q_conv
1112 atmosphere(1)%cloud(1)%water_content(k) = &
1113 atmosphere(1)%cloud(1)%water_content(k) + dpovg*q_conv
1121 error_status = crtm_forward(atmosphere,surface, &
1122 geometryinfo,channelinfo(sensorindex:sensorindex), &
1124 if (error_status /=0)
then
1125 print*,
'***ERROR*** during crtm_forward call ', error_status
1126 do n=1,channelinfo(sensorindex)%n_channels
1133 do n=1,channelinfo(sensorindex)%n_channels
1134 tb(i,j,n)=rtsolution(n,1)%brightness_temperature
1140 if(i==ii.and.j==jj)
then
1141 do n=1,channelinfo(sensorindex)%n_channels
1142 3301
format(
'Sample rtsolution(',i0,
',',i0,
') in CALRAD = ',f0.3)
1143 print 3301,n,1,rtsolution(n,1)%brightness_temperature
1145 do n=1,channelinfo(sensorindex)%n_channels
1146 3302
format(
'Sample tb(',i0,
',',i0,
',',i0,
') in CALRAD = ',f0.3)
1147 print 3302,ii,jj,n,tb(ii,jj,n)
1157 do n=1,channelinfo(sensorindex)%n_channels
1172 if (isis==
'amsre_aqua')
then
1175 igot=iget(482+ixchan)
1179 grid1(i,j)=tb(i,j,ichan)
1182 if (grib==
"grib2")
then
1184 fld_info(cfld)%ifld=iavblfld(igot)
1185 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1190 if (isis==
'tmi_trmm')
then
1193 igot=iget(487+ixchan)
1197 grid1(i,j) = tb(i,j,ichan)
1200 if (grib==
"grib2")
then
1202 fld_info(cfld)%ifld=iavblfld(igot)
1203 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1209 if (isis==
'imgr_g11')
then
1216 grid1(i,j) = tb(i,j,ichan)
1219 if (grib==
"grib2")
then
1221 fld_info(cfld)%ifld=iavblfld(igot)
1222 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1228 if (isis==
'imgr_g12')
then
1231 igot=iget(326+ixchan)
1235 grid1(i,j)=tb(i,j,ichan)
1238 if (grib==
"grib2")
then
1240 fld_info(cfld)%ifld=iavblfld(igot)
1241 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1246 if (isis==
'abi_gr')
then
1250 igot=iget(957+ixchan)
1254 grid1(i,j)=tb(i,j,ichan)
1257 if(grib==
"grib2" )
then
1259 fld_info(cfld)%ifld=iavblfld(igot)
1260 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1271 nonnadir:
if((isis==
'ssmi_f13' .and. iget(800) > 0 ) .OR. &
1272 (isis==
'ssmi_f14' .and. iget(806) > 0 ) .OR. &
1273 (isis==
'ssmi_f15' .and. iget(812) > 0 ) .OR. &
1274 (isis==
'ssmis_f16' .and. iget(818) > 0) .OR. &
1275 (isis==
'ssmis_f17' .and. post_ssmis17) .OR. &
1276 (isis==
'ssmis_f18' .and. iget(832) > 0) .OR. &
1277 (isis==
'ssmis_f19' .and. iget(839) > 0) .OR. &
1278 (isis==
'ssmis_f20' .and. iget(846) > 0) .OR. &
1279 (isis==
'imgr_mt2' .and. iget(860)>0) .OR. &
1280 (isis==
'imgr_mt1r' .and. iget(864)>0) .OR. &
1281 (isis==
'imgr_insat3d' .and. iget(865)>0) .OR. &
1282 (isis==
'imgr_g13' .and. iget(868)>0) .OR. &
1283 (isis==
'imgr_g15' .and. iget(872)>0) .OR. &
1284 (isis==
'abi_g16' .and. post_abig16) .OR. &
1285 (isis==
'abi_g17' .and. post_abig17) .OR. &
1286 (isis==
'abi_g18' .and. post_abig18) .OR. &
1287 (isis==
'seviri_m10' .and. iget(876)>0) .OR. &
1288 (isis==
'ahi_himawari8' .and. post_ahi8) .OR. &
1289 (isis==
'imgr_g12' .and. (iget(456)>0 .or. &
1290 iget(457)>0 .or. iget(458)>0 .or. iget(459)>0)) .or. &
1291 (isis==
'imgr_g11' .and. (iget(460)>0 .or. &
1292 iget(461)>0 .or. iget(462)>0 .or. iget(463)>0)))
then
1295 loopi2:
do i=ista,iend
1299 if(abs(pmid(i,j,k)-spval)<=small .or. &
1300 abs(t(i,j,k)-spval)<=small)
then
1301 do n=1,channelinfo(sensorindex)%n_channels
1311 if(isis==
'imgr_g12')
then
1314 else if(isis==
'seviri_m10')
then
1317 else if(isis==
'imgr_g13')
then
1320 else if(isis==
'imgr_g15')
then
1323 else if(isis==
'abi_g16')
then
1326 else if(isis==
'abi_g17')
then
1329 else if(isis==
'abi_g18')
then
1332 else if(isis==
'imgr_g11')
then
1335 else if(isis==
'imgr_mt2')
then
1338 else if(isis==
'imgr_mt1r')
then
1341 else if(isis==
'imgr_insat3d')
then
1344 else if(isis==
'ahi_himawari8')
then
1350 if(isis==
'ssmis_f16'.or.isis==
'ssmis_f17'.or.isis==
'ssmis_f18'.or. &
1351 isis==
'ssmis_f19'.or.isis==
'ssmis_f20'.or.isis==
'ssmi_f13'.or. &
1352 isis==
'ssmi_f14'.or.isis==
'ssmi_f15')
then
1356 call geo_zenith_angle(i,j,gdlat(i,j),gdlon(i,j) &
1357 ,sublat,sublon,sat_zenith)
1360 geometryinfo(1)%sensor_zenith_angle=sat_zenith
1361 geometryinfo(1)%sensor_scan_angle=sat_zenith
1363 if(i==ii .and. j==jj)
then
1364 print *,
'zenith info: zenith=',sat_zenith,
' scan=',sat_zenith, &
1365 ' MAX_SENSOR_SCAN_ANGLE=',max_sensor_scan_angle
1369 IF(geometryinfo(1)%sensor_zenith_angle <= max_sensor_scan_angle &
1370 .and. geometryinfo(1)%sensor_zenith_angle >= 0.0_r_kind)
THEN
1371 geometryinfo(1)%source_zenith_angle = acos(czen(i,j))*rtd
1372 geometryinfo(1)%sensor_scan_angle = 0.
1373 if(i==ii.and.j==jj)print*,
'sample geometry ', &
1374 geometryinfo(1)%sensor_zenith_angle &
1375 ,geometryinfo(1)%source_zenith_angle &
1379 if(modelname ==
'NCAR' .OR. modelname ==
'RAPR')
then
1380 sfcpct(4)=pctsno(i,j)
1381 else if(ivegsrc==1)
then
1383 IF(itype == 0)itype=8
1384 if(sno(i,j)<spval)
then
1389 CALL snfrac(snoeqv,ivgtyp(i,j),snofrac)
1391 else if(ivegsrc==2)
then
1393 itype = min(max(0,ivgtyp(i,j)),13)
1394 if(sno(i,j)<spval)
then
1399 if(i==ii.and.j==jj)print*,
'sno,itype,ivgtyp B cing snfrc = ', &
1400 snoeqv,itype,ivgtyp(i,j)
1401 if(sm(i,j) > 0.1)
then
1404 call snfrac_gfs(snoeqv,ivgtyp(i,j),snofrac)
1411 if(sm(i,j) > 0.1)
then
1413 tsfc = ths(i,j)*(pint(i,j,nint(lmh(i,j))+1)/p1000)**capa
1415 if(sfcpct(4) > 0.0_r_kind)
then
1416 sfcpct(1) = 1.0_r_kind-sfcpct(4)
1417 sfcpct(2) = 0.0_r_kind
1418 sfcpct(3) = 0.0_r_kind
1420 sfcpct(1) = 1.0_r_kind
1421 sfcpct(2) = 0.0_r_kind
1422 sfcpct(3) = 0.0_r_kind
1425 tsfc = ths(i,j)*(pint(i,j,nint(lmh(i,j))+1)/p1000)**capa
1426 vegcover=vegfrc(i,j)
1427 if(sice(i,j) > 0.1)
then
1428 if(sfcpct(4) > 0.0_r_kind)
then
1429 sfcpct(3) = 1.0_r_kind-sfcpct(4)
1430 sfcpct(1) = 0.0_r_kind
1431 sfcpct(2) = 0.0_r_kind
1433 sfcpct(3)= 1.0_r_kind
1434 sfcpct(1) = 0.0_r_kind
1435 sfcpct(2) = 0.0_r_kind
1438 if(sfcpct(4) > 0.0_r_kind)
then
1439 sfcpct(2)= 1.0_r_kind-sfcpct(4)
1440 sfcpct(1) = 0.0_r_kind
1441 sfcpct(3) = 0.0_r_kind
1443 sfcpct(2)= 1.0_r_kind
1444 sfcpct(1) = 0.0_r_kind
1445 sfcpct(3) = 0.0_r_kind
1449 if(si(i,j)/=spval)
then
1458 if(novegtype==20 .and. itype==15 .and.sfcpct(4)<1.0_r_kind)
then
1459 if(debugprint)print*,
'changing land type for veg type 15',i,j,itype,sfcpct(1:4)
1460 sfcpct(1)=0.0_r_kind
1461 sfcpct(2)=0.0_r_kind
1462 sfcpct(3)=0.0_r_kind
1463 sfcpct(4)=1.0_r_kind
1468 sea = sfcpct(1) >= 0.99_r_kind
1469 land = sfcpct(2) >= 0.99_r_kind
1470 ice = sfcpct(3) >= 0.99_r_kind
1471 snow = sfcpct(4) >= 0.99_r_kind
1472 mixed = .not. sea .and. .not. ice .and. &
1473 .not. land .and. .not. snow
1474 if((sfcpct(1)+sfcpct(2)+sfcpct(3)+sfcpct(4)) >1._r_kind) &
1475 print*,
'ERROR sfcpct ',i,j,sfcpct(1) &
1476 ,sfcpct(2),sfcpct(3),sfcpct(4)
1486 itype = min(max(0,ivgtyp(i,j)),novegtype)
1488 itype = min(max(1,ivgtyp(i,j)),novegtype)
1490 surface(1)%land_type = model_to_crtm(itype)
1492 if(gridtype==
'B' .or. gridtype==
'E')
then
1493 surface(1)%wind_speed = sqrt(u10h(i,j)*u10h(i,j) &
1494 +v10h(i,j)*v10h(i,j))
1496 surface(1)%wind_speed = sqrt(u10(i,j)*u10(i,j) &
1500 surface(1)%water_coverage = sfcpct(1)
1501 surface(1)%land_coverage = sfcpct(2)
1502 surface(1)%ice_coverage = sfcpct(3)
1503 surface(1)%snow_coverage = sfcpct(4)
1504 surface(1)%land_temperature = tsfc
1505 surface(1)%snow_temperature = min(tsfc,280._r_kind)
1506 surface(1)%water_temperature = max(tsfc,270._r_kind)
1507 surface(1)%ice_temperature = min(tsfc,280._r_kind)
1508 if(smstot(i,j)/=spval)
then
1509 surface(1)%soil_moisture_content = smstot(i,j)/10.
1511 surface(1)%soil_moisture_content = 0.05
1513 surface(1)%vegetation_fraction = vegcover
1515 surface(1)%soil_temperature = 283.
1517 surface(1)%snow_depth = snodepth
1520 if(surface(1)%wind_speed<0. .or. surface(1)%wind_speed>200.) &
1521 print*,
'bad 10 m wind'
1522 if(surface(1)%water_coverage<0. .or. surface(1)%water_coverage>1.) &
1523 print*,
'bad water coverage'
1524 if(surface(1)%land_coverage<0. .or. surface(1)%land_coverage>1.) &
1525 print*,
'bad land coverage'
1526 if(surface(1)%ice_coverage<0. .or. surface(1)%ice_coverage>1.) &
1527 print*,
'bad ice coverage'
1528 if(surface(1)%snow_coverage<0. .or. surface(1)%snow_coverage>1.) &
1529 print*,
'bad snow coverage'
1530 if(surface(1)%land_temperature<0. .or. surface(1)%land_temperature>350.) &
1532 if(surface(1)%soil_moisture_content<0. .or. surface(1)%soil_moisture_content>600.) &
1533 print*,
'bad soil_moisture_content'
1534 if(surface(1)%vegetation_fraction<0. .or. surface(1)%vegetation_fraction>1.) &
1535 print*,
'bad vegetation cover'
1536 if(surface(1)%snow_depth<0. .or. surface(1)%snow_depth>10000.) &
1537 print*,
'bad snow_depth'
1540 if(i==ii.and.j==jj)print*,
'sample surface in CALRAD=', &
1541 i,j,surface(1)%wind_speed,surface(1)%water_coverage, &
1542 surface(1)%land_coverage,surface(1)%ice_coverage, &
1543 surface(1)%snow_coverage,surface(1)%land_temperature, &
1544 surface(1)%snow_temperature,surface(1)%water_temperature, &
1545 surface(1)%ice_temperature,surface(1)%vegetation_fraction, &
1546 surface(1)%soil_temperature,surface(1)%snow_depth, &
1547 surface(1)%land_type,sm(i,j)
1553 if(i==ii.and.j==jj)print*,
'TOA= ',atmosphere(1)%level_pressure(0)
1555 atmosphere(1)%cloud_fraction(k) = min(max(cfr(i,j,k),0.),1.)
1556 atmosphere(1)%level_pressure(k) = pint(i,j,k+1)/r100
1557 atmosphere(1)%pressure(k) = pmid(i,j,k)/r100
1558 atmosphere(1)%temperature(k) = t(i,j,k)
1559 atmosphere(1)%absorber(k,1) = max(0. &
1560 ,q(i,j,k)*h1000/(h1-q(i,j,k)))
1561 atmosphere(1)%absorber(k,2) = max(ozsmall,o3(i,j,k)*constoz)
1565 if(atmosphere(1)%level_pressure(k)<0. .or. atmosphere(1)%level_pressure(k)>1060.) &
1566 print*,
'bad atmosphere(1)%level_pressure' &
1567 ,i,j,k,atmosphere(1)%level_pressure(k)
1568 if(atmosphere(1)%pressure(k)<0. .or. &
1569 atmosphere(1)%pressure(k)>1060.) &
1570 print*,
'bad atmosphere(1)%pressure' &
1571 ,i,j,k,atmosphere(1)%pressure(k)
1572 if(atmosphere(1)%temperature(k)<0. .or. &
1573 atmosphere(1)%temperature(k)>400.) &
1574 print*,
'bad atmosphere(1)%temperature'
1587 dpovg=(pint(i,j,k+1)-pint(i,j,k))/g
1588 if(imp_physics==99 .or. imp_physics==98)
then
1589 atmosphere(1)%cloud(1)%effective_radius(k) = 10.
1590 atmosphere(1)%cloud(1)%water_content(k) = max(0.,qqw(i,j,k)*dpovg)
1594 atmosphere(1)%cloud(2)%effective_radius(k) = 50.
1595 atmosphere(1)%cloud(2)%water_content(k) = max(0.,qqi(i,j,k)*dpovg)
1597 if(atmosphere(1)%cloud(1)%water_content(k)<0. .or. &
1598 atmosphere(1)%cloud(1)%water_content(k)>1.) &
1599 print*,
'bad atmosphere cloud water'
1600 if(atmosphere(1)%cloud(2)%water_content(k)<0. .or. &
1601 atmosphere(1)%cloud(2)%water_content(k)>1.) &
1602 print*,
'bad atmosphere cloud ice'
1604 else if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
1605 atmosphere(1)%cloud(1)%effective_radius(k) = 10.
1606 atmosphere(1)%cloud(1)%water_content(k) = max(0.,qqw(i,j,k)*dpovg)
1607 atmosphere(1)%cloud(2)%effective_radius(k) = 75.
1608 atmosphere(1)%cloud(2)%water_content(k) = max(0.,qqi(i,j,k)*dpovg)
1610 rho=pmid(i,j,k)/(rd*t(i,j,k)*(1.+d608*q(i,j,k)))
1611 atmosphere(1)%cloud(3)%effective_radius(k) = 0.
1612 if(nrain(i,j,k)>0.) &
1613 atmosphere(1)%cloud(3)%effective_radius(k) = &
1614 1.0e6*1.5*(rho*qqr(i,j,k)/(pi*rhox*nrain(i,j,k)))**(1./3.)
1615 atmosphere(1)%cloud(3)%water_content(k) = max(0.,qqr(i,j,k)*dpovg)
1616 if(f_rimef(i,j,k)<=5.0)
then
1618 if(nlice(i,j,k)>0.) &
1619 atmosphere(1)%cloud(4)%effective_radius(k) = &
1620 1.0e6*1.5*(rho*qqs(i,j,k)/(pi*rhox*nlice(i,j,k)))**(1./3.)
1621 atmosphere(1)%cloud(4)%water_content(k) = max(0.,qqs(i,j,k)*dpovg)
1622 atmosphere(1)%cloud(5)%effective_radius(k) = 0.
1623 atmosphere(1)%cloud(5)%water_content(k) =0.
1624 atmosphere(1)%cloud(6)%effective_radius(k) = 0.
1625 atmosphere(1)%cloud(6)%water_content(k) =0.
1626 else if(f_rimef(i,j,k)<=20.0)
then
1627 atmosphere(1)%cloud(4)%effective_radius(k) = 0.
1628 atmosphere(1)%cloud(4)%water_content(k) =0.
1630 if(nlice(i,j,k)>0.) &
1631 atmosphere(1)%cloud(5)%effective_radius(k) = &
1632 1.0e6*1.5*(rho*qqs(i,j,k)/(pi*rhox*nlice(i,j,k)))**(1./3.)
1633 atmosphere(1)%cloud(5)%water_content(k) =max(0.,qqs(i,j,k)*dpovg)
1634 atmosphere(1)%cloud(6)%effective_radius(k) = 0.
1635 atmosphere(1)%cloud(6)%water_content(k) =0.
1637 atmosphere(1)%cloud(4)%effective_radius(k) = 0.
1638 atmosphere(1)%cloud(4)%water_content(k) =0.
1639 atmosphere(1)%cloud(5)%effective_radius(k) = 0.
1640 atmosphere(1)%cloud(5)%water_content(k) =0.
1642 if(nlice(i,j,k)>0.) &
1643 atmosphere(1)%cloud(6)%effective_radius(k) = &
1644 1.0e6*1.5*(rho*qqs(i,j,k)/(pi*rhox*nlice(i,j,k)))**(1./3.)
1645 atmosphere(1)%cloud(6)%water_content(k) =max(0.,qqs(i,j,k)*dpovg)
1647 if(debugprint .and. i==im/2 .and. j==jsta) &
1648 print*,
'sample precip ice radius= ',i,j,k, f_rimef(i,j,k), &
1649 atmosphere(1)%cloud(4)%effective_radius(k), atmosphere(1)%cloud(4)%water_content(k), &
1650 atmosphere(1)%cloud(5)%effective_radius(k), atmosphere(1)%cloud(5)%water_content(k), &
1651 atmosphere(1)%cloud(6)%effective_radius(k), atmosphere(1)%cloud(6)%water_content(k)
1653 else if(imp_physics==8 .or. imp_physics==6 .or. imp_physics==2 .or. &
1654 imp_physics==28 .or. imp_physics==11)
then
1655 atmosphere(1)%cloud(1)%water_content(k)=max(0.,qqw(i,j,k)*dpovg)
1656 atmosphere(1)%cloud(2)%water_content(k)=max(0.,qqi(i,j,k)*dpovg)
1657 atmosphere(1)%cloud(3)%water_content(k)=max(0.,qqr(i,j,k)*dpovg)
1658 atmosphere(1)%cloud(4)%water_content(k)=max(0.,qqs(i,j,k)*dpovg)
1659 atmosphere(1)%cloud(5)%water_content(k)=max(0.,qqg(i,j,k)*dpovg)
1661 if(effrl(i,j,k)/=spval)
then
1662 atmosphere(1)%cloud(1)%effective_radius(k)=min(max(effrl(i,j,k),2.5),50.)
1664 atmosphere(1)%cloud(1)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1665 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1666 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'C')
1668 if(effri(i,j,k)/=spval)
then
1669 atmosphere(1)%cloud(2)%effective_radius(k)=min(max(effri(i,j,k),2.5),125.)
1671 atmosphere(1)%cloud(2)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1672 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1673 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'I')
1675 if(effrs(i,j,k)/=spval)
then
1676 atmosphere(1)%cloud(4)%effective_radius(k)=min(max(effrs(i,j,k),2.5),1000.)
1678 atmosphere(1)%cloud(4)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1679 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1680 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'S')
1682 atmosphere(1)%cloud(3)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1683 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1684 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'R')
1685 atmosphere(1)%cloud(5)%effective_radius(k)=effr(pmid(i,j,k),t(i,j,k), &
1686 q(i,j,k),qqw(i,j,k),qqi(i,j,k),qqr(i,j,k),f_rimef(i,j,k),nlice(i,j,k), &
1687 nrain(i,j,k),qqs(i,j,k),qqg(i,j,k),qqnr(i,j,k),qqni(i,j,k),qqnw(i,j,k),imp_physics,
'G')
1692 if (abs(atmosphere(1)%pressure(k)-atmosphere(1)%pressure(k+1)) &
1694 atmosphere(1)%pressure(k)=atmosphere(1)%pressure(k)+0.005
1699 if(icu_physics==2)
then
1700 lcbot=nint(hbot(i,j))
1701 lctop=nint(htop(i,j))
1702 if (lcbot-lctop > 1)
then
1706 q_conv = cnvcfr(i,j)*qconv
1708 dpovg=(pint(i,j,k+1)-pint(i,j,k))/g
1709 if (t(i,j,k) < trad_ice)
then
1710 atmosphere(1)%cloud(2)%water_content(k) = &
1711 atmosphere(1)%cloud(2)%water_content(k) + dpovg*q_conv
1713 atmosphere(1)%cloud(1)%water_content(k) = &
1714 atmosphere(1)%cloud(1)%water_content(k) + dpovg*q_conv
1722 error_status = crtm_forward(atmosphere,surface, &
1723 geometryinfo,channelinfo(sensorindex:sensorindex), &
1725 if (error_status /=0)
then
1726 print*,
'***ERROR*** during crtm_forward call ', &
1728 do n=1,channelinfo(sensorindex)%n_channels
1732 do n=1,channelinfo(sensorindex)%n_channels
1733 tb(i,j,n)=rtsolution(n,1)%brightness_temperature
1735 if(i==ii.and.j==jj)
then
1736 do n=1,channelinfo(sensorindex)%n_channels
1737 3303
format(
'Sample rtsolution(',i0,
',',i0,
') in CALRAD = ',f0.3)
1740 do n=1,channelinfo(sensorindex)%n_channels
1741 3304
format(
'Sample tb(',i0,
',',i0,
',',i0,
') in CALRAD = ',f0.3)
1742 print 3304,i,j,n,tb(i,j,n)
1752 do n=1,channelinfo(sensorindex)%n_channels
1763 if (isis==
'ssmi_f13')
then
1769 if(lvls(ixchan,igot)==1)
then
1773 grid1(i,j)=tb(i,j,nc)
1776 if (grib==
"grib2")
then
1778 fld_info(cfld)%ifld=iavblfld(igot)
1779 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1785 if (isis==
'ssmi_f14')
then
1791 if(lvls(ixchan,igot)==1)
then
1795 grid1(i,j)=tb(i,j,nc)
1798 if (grib==
"grib2")
then
1800 fld_info(cfld)%ifld=iavblfld(igot)
1801 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1807 if (isis==
'ssmi_f15')
then
1813 if(lvls(ixchan,igot)==1)
then
1817 grid1(i,j)=tb(i,j,nc)
1820 if (grib==
"grib2")
then
1822 fld_info(cfld)%ifld=iavblfld(igot)
1823 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1829 if (isis==
'ssmis_f16')
then
1835 print*,
'ixchan,lvls=',ixchan,lvls(ixchan,igot)
1836 if(lvls(ixchan,igot)==1)
then
1840 grid1(i,j)=tb(i,j,nc)
1843 if (grib==
"grib2")
then
1845 fld_info(cfld)%ifld=iavblfld(igot)
1846 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1852 if(isis==
'ssmis_f17')
then
1855 igot=iget(824+ixchan)
1859 grid1(i,j)=tb(i,j,ichan)
1862 if(grib==
"grib2" )
then
1864 fld_info(cfld)%ifld=iavblfld(igot)
1865 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1870 if (isis==
'ssmis_f18')
then
1876 if(lvls(ixchan,igot)==1)
then
1880 grid1(i,j)=tb(i,j,nc)
1883 if (grib==
"grib2")
then
1885 fld_info(cfld)%ifld=iavblfld(igot)
1886 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1892 if (isis==
'ssmis_f19')
then
1898 if(lvls(ixchan,igot)==1)
then
1902 grid1(i,j)=tb(i,j,nc)
1905 if (grib==
"grib2")
then
1907 fld_info(cfld)%ifld=iavblfld(igot)
1908 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1914 if (isis==
'ssmis_f20')
then
1920 if(lvls(ixchan,igot)==1)
then
1924 grid1(i,j)=tb(i,j,nc)
1927 if (grib==
"grib2")
then
1929 fld_info(cfld)%ifld=iavblfld(igot)
1930 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1936 if(isis==
'imgr_mt2')
then
1940 if(lvls(ichan,igot)==1)
then
1944 grid1(i,j)=tb(i,j,nc)
1947 if(grib==
"grib2")
then
1949 fld_info(cfld)%ifld=iavblfld(igot)
1950 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1955 if(isis==
'imgr_mt1r')
then
1959 if(lvls(ichan,igot)==1)
then
1963 grid1(i,j)=tb(i,j,nc)
1966 if(grib==
"grib2" )
then
1968 fld_info(cfld)%ifld=iavblfld(igot)
1969 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1974 if_insat3d:
if(isis==
'imgr_insat3d')
then
1978 if(lvls(ichan,igot)==1)
then
1982 grid1(i,j)=tb(i,j,nc)
1985 if(grib==
"grib2" )
then
1987 fld_info(cfld)%ifld=iavblfld(igot)
1988 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1993 if (isis==
'imgr_g11')
then
1996 igot=iget(459+ixchan)
2000 grid1(i,j)=tb(i,j,ichan)
2003 if(grib==
"grib2" )
then
2005 fld_info(cfld)%ifld=iavblfld(igot)
2006 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2011 if (isis==
'imgr_g12')
then
2014 igot=iget(455+ixchan)
2018 grid1(i,j)=tb(i,j,ichan)
2021 if(grib==
"grib2" )
then
2023 fld_info(cfld)%ifld=iavblfld(igot)
2024 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2029 if (isis==
'seviri_m10')
then
2035 if(lvls(ixchan,igot)==1)
then
2039 grid1(i,j)=tb(i,j,nc)
2042 if (grib==
"grib2")
then
2044 fld_info(cfld)%ifld=iavblfld(igot)
2045 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2051 if (isis==
'imgr_g13')
then
2057 if(lvls(ixchan,igot)==1)
then
2061 grid1(i,j)=tb(i,j,nc)
2064 if (grib==
"grib2")
then
2066 fld_info(cfld)%ifld=iavblfld(igot)
2067 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2073 if (isis==
'imgr_g15')
then
2079 if(lvls(ixchan,igot)==1)
then
2083 grid1(i,j)=tb(i,j,nc)
2086 if (grib==
"grib2")
then
2088 fld_info(cfld)%ifld=iavblfld(igot)
2089 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2095 if (isis==
'abi_g16')
then
2099 igot=iget(926+ixchan)
2103 grid1(i,j)=tb(i,j,ichan)
2106 if(grib==
"grib2" )
then
2108 fld_info(cfld)%ifld=iavblfld(igot)
2109 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2114 if (isis==
'abi_g17')
then
2118 igot=iget(936+ixchan)
2122 grid1(i,j)=tb(i,j,ichan)
2125 if(grib==
"grib2" )
then
2127 fld_info(cfld)%ifld=iavblfld(igot)
2128 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2134 if (isis==
'abi_g18')
then
2137 igot=iget(530+ixchan)
2142 grid1(i,j)=tb(i,j,ichan)
2149 if(grib==
"grib2" )
then
2151 fld_info(cfld)%ifld=iavblfld(igot)
2152 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2157 if(isis==
'ahi_himawari8')
then
2159 igot=iget(968+ichan)
2163 grid1(i,j)=tb(i,j,ichan)
2166 if(grib==
"grib2" )
then
2168 fld_info(cfld)%ifld=iavblfld(igot)
2169 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2178 CALL crtm_atmosphere_destroy(atmosphere(1))
2179 CALL crtm_surface_destroy(surface(1))
2180 CALL crtm_rtsolution_destroy(rtsolution)
2181 if (crtm_atmosphere_associated(atmosphere(1))) &
2182 write(6,*)
' ***ERROR** destroying atmosphere.'
2183 if (crtm_surface_associated(surface(1))) &
2184 write(6,*)
' ***ERROR** destroying surface.'
2185 if (any(crtm_rtsolution_associated(rtsolution))) &
2186 write(6,*)
' ***ERROR** destroying rtsolution.'
2188 deallocate (rtsolution)
2193 error_status = crtm_destroy(channelinfo)
2194 if (error_status /= success) &
2195 print*,
'ERROR*** crtm_destroy error_status=',error_status
2196 deallocate(channelinfo)
2197 if (
allocated(model_to_crtm))
deallocate(model_to_crtm)
2200 end SUBROUTINE calrad_wcloud
2202 REAL FUNCTION effr(pmid,t,q,qqw,qqi,qqr,f_rimef, nlice, nrain, &
2203 qqs,qqg,qqnr,qqni,qqnw,mp_opt,species)
2213 real :: pmid,t,q,qqw,qqi,qqr,qqs,qqg,f_rimef,nlice,nrain
2214 real :: qqnr,qqni,qqnw
2215 character(LEN=1) :: species
2217 integer :: n,count,count1,mp_opt
2218 real :: rho, ncc, rhox
2219 real :: n0_s, n0_r, n0_g
2220 real :: lambdar, lambdas, lambdag
2227 real :: gamma_crg, gamma_s
2230 real :: wgamma, gammln
2232 real :: rc,am_c,bm_c,cce(3,15),ccg(3,15),ocg1(15),ocg2(15)
2235 real,
dimension(0:15),
parameter:: g_ratio = (/6,24,60,120,210, &
2236 & 336,504,720,990,1320,1716,2184,2730,3360,4080,4896/)
2238 real :: rr, mu_r, am_r, bm_r, cre(3), crg(3), ore1, org1, org2
2239 real :: mvd_r, ron_sl, ron_r0, ron_c0, ron_c1, ron_c2, obmr
2241 real :: ri, mu_i, am_i, bm_i, cie(3), cig(3), oig1, oig2, obmi
2243 real :: rs, am_s, oams, cse(3)
2244 real :: loga, a, b, tc0, smob, smo2, smoc
2245 REAL,
PARAMETER:: mu_s = 0.6357
2246 REAL,
PARAMETER:: kap0 = 490.6
2247 REAL,
PARAMETER:: kap1 = 17.46
2248 REAL,
PARAMETER:: lam0 = 20.78
2249 REAL,
PARAMETER:: lam1 = 3.29
2255 real,
parameter :: eps=0.622, beta_crg=3., beta_i=2.,beta_s=2.4
2257 real,
parameter :: min_qc=1.e-7, min_qr=1.e-7, min_qi=1.e-8,min_qs=1.e-8, min_qg=1.e-7
2258 real,
parameter :: min_c=2.e-6, min_r=20.e-6, min_i=4.e-6,min_s=20.e-6, min_g=20.e-6
2259 real,
parameter :: max_c=1.e-2, max_r=1.e-2, max_i=1.e-3,max_s=2.e-2, max_g=5.e-0
2261 real :: am_g, bm_g, mu_g
2262 real :: cgg(3), cge(3), oge1, obmg, ogg1, ogg2
2264 real :: ygra1, zans1, rg2
2265 double precision :: no_exp, no_min, lm_exp, lamg, lamc, lamr, lami, lams
2271 real :: wsm6_nci, xmi, xmitemp
2277 real,
parameter :: wsm6_cnp=3.e8, wsm6_rhor=1000.
2278 real,
parameter :: wsm6_rhos=100., wsm6_rhog=500.
2279 real,
parameter :: wsm6_dimax=500.e-6, wsm6_dicon=11.9
2280 real,
parameter :: wsm6_alpha=.12, wsm6_t0c=273.15
2281 real,
parameter :: wsm6_n0s=2.e6, wsm6_n0smax=1.e11
2282 real,
parameter :: wsm6_n0r=8.e6, wsm6_n0g=4.e6
2283 real,
parameter :: wsm6_qmin=1.e-15
2289 real,
parameter :: lin_rhoi=100., lin_rhor=1000., lin_rhos=100.
2290 real,
parameter :: lin_rhog=400., lin_cnp=3.e8
2291 real,
parameter :: lin_n0r=8.e6, lin_n0s=3.e6, lin_n0g=4.e6
2297 real,
parameter :: nthom_rhor=1000., nthom_rhos=100.
2299 real,
parameter :: nthom_rhog=500., nthom_rhoi=890.
2300 real,
parameter :: nthom_gon_min=1.e4, nthom_gon_max=3.e6
2301 real,
parameter :: nthom_nt_c=100.e6
2303 real,
parameter :: nthom_min_nci=5.e2
2304 real,
parameter :: nthom_min_ncr=1.e-6
2306 real,
parameter :: nthom_bm_s=2.0
2308 real :: nci2, ncc2, ncr2
2310 real,
dimension(10),
parameter :: &
2311 nthom_sa = (/ 5.065339, -0.062659, -3.032362, 0.029469, -0.000285, &
2312 0.31255, 0.000204, 0.003199, 0.0, -0.015952/)
2313 real,
dimension(10),
parameter :: &
2314 nthom_sb = (/ 0.476221, -0.015896, 0.165977, 0.007468, -0.000141, &
2315 0.060366, 0.000079, 0.000594, 0.0, -0.003577/)
2321 real,
parameter :: gfdl_rhoi=100., gfdl_rhor=1000., gfdl_rhos=100.
2322 real,
parameter :: gfdl_rhog=400., gfdl_cnp=3.e8
2323 real,
parameter :: gfdl_tice = 273.16
2325 real,
parameter :: gfdl_qmin = 1.0e-5, gfdl_ccn = 1.0e8, gfdl_beta = 1.22
2326 real,
parameter :: gfdl_gammar = 17.837789, gfdl_gammas = 8.2850630, gfdl_gammag = 11.631769
2327 real,
parameter :: gfdl_alphar = 0.8, gfdl_alphas = 0.25, gfdl_alphag = 0.5
2328 real,
parameter :: gfdl_n0r=8.e6, gfdl_n0s=3.e6, gfdl_n0g=4.e6
2330 real,
parameter :: gfdl_rewmin = 5.0, gfdl_rewmax = 10.0
2331 real,
parameter :: gfdl_reimin = 10.0, gfdl_reimax = 150.0
2332 real,
parameter :: gfdl_rermin = 0.0, gfdl_rermax = 10000.0
2333 real,
parameter :: gfdl_resmin = 0.0, gfdl_resmax = 10000.0
2334 real,
parameter :: gfdl_regmin = 0.0, gfdl_regmax = 10000.0
2344 elseif(mp_opt==2)
then
2362 rho=pmid/(rd*t*(1.+d608*q))
2367 SELECT CASE(species)
2371 if ( qqw>min_qc )
then
2372 effr = 1.0e6*(( 6. * rho * qqw ) / &
2373 (pi * wsm6_rhor * wsm6_cnp))**(1/3.)
2379 if ( qqr>min_qr )
then
2380 effr = 1.0e6*( ( 6. * rho * qqr ) / &
2381 ( pi * wsm6_rhor * n0_r * gamma_crg ) ) ** (1/(1+beta_crg ) )
2386 if ( qqg>min_qg )
then
2387 effr = 1.0e6*( ( 6. * rho * qqg ) / &
2388 ( pi * wsm6_rhog * n0_g * gamma_crg ) ) ** (1/(1+beta_crg ) )
2393 if ( qqs>min_qs )
then
2394 effr = 1.0e6*( ( 6. * rho * qqs ) / &
2395 ( pi * wsm6_rhos * n0_s * gamma_s ) ) ** ( 1/(1+beta_s) )
2403 if ( qqi>min_qi )
then
2412 xmitemp=rho*max(qqi,wsm6_qmin)
2413 xmitemp=sqrt(sqrt(xmitemp*xmitemp*xmitemp))
2414 xmi= min(max(5.38e7*xmitemp,1.e3),1.e6)
2415 effr = 1.0e6*max(min(wsm6_dicon * sqrt(xmi),wsm6_dimax), 1.e-25)
2420 elseif(mp_opt==2)
then
2422 SELECT CASE(species)
2426 if ( qqw > min_qc )
then
2427 effr = 1.0e6*(( 6. * rho * qqw ) / &
2428 (pi * lin_rhor * lin_cnp))**(1/3.)
2433 if ( qqr > min_qr )
then
2434 effr = 1.0e6*( ( 6. * rho * qqr ) / &
2435 ( pi * lin_rhor * n0_r * gamma_crg ) ) ** (1/(1+beta_crg ) )
2440 if ( qqi > min_qi )
then
2441 effr = 1.0e6*( ( 6. * rho * qqi ) / &
2442 ( pi * lin_rhoi * lin_cnp ) ) ** ( 1/3.)
2447 if ( qqs > min_qs )
then
2448 effr = 1.0e6*( ( 6. * rho * qqs ) / &
2449 ( pi * lin_rhos * n0_s * gamma_s ) ) ** ( 1/(1+beta_s) )
2454 if ( qqg > min_qg )
then
2455 effr = 1.0e6*( ( 6. * rho * qqg ) / &
2456 ( pi * lin_rhog * n0_g * gamma_crg ) ) ** (1/(1+beta_crg ) )
2461 elseif(mp_opt==8 .or. mp_opt==28)
then
2468 am_r = pi * nthom_rhor / 6.0
2472 cre(3) = bm_r + mu_r + 1.
2474 crg(1) = wgamma(cre(1))
2475 crg(2) = wgamma(cre(2))
2476 crg(3) = wgamma(cre(3))
2488 cce(2,n) = bm_c + n + 1.
2490 ccg(1,n) = wgamma(cce(1,n))
2491 ccg(2,n) = wgamma(cce(2,n))
2493 ocg1(n) = 1./ccg(1,n)
2494 ocg2(n) = 1./ccg(2,n)
2499 am_i = pi * nthom_rhoi / 6.0
2504 cie(2) = bm_i + mu_i + 1.
2506 cig(1) = wgamma(cie(1))
2507 cig(2) = wgamma(cie(2))
2519 cse(1) = nthom_bm_s + 1.
2525 am_g = pi * nthom_rhog / 6.0
2529 cge(3) = bm_g + mu_g + 1.
2531 cgg(1) = wgamma(cge(1))
2532 cgg(2) = wgamma(cge(2))
2533 cgg(3) = wgamma(cge(3))
2541 SELECT CASE (species)
2545 if(qqw >= min_qc)
then
2547 rc = max(1.e-12, qqw * rho)
2551 elseif (mp_opt==28)
then
2552 ncc2 = max(1.e-6, qqnw * rho)
2555 if (ncc2 < 10.e6)
then
2558 nu_c = min(15, nint(1000.e6/ncc2) + 2)
2561 lamc = (ncc2/rc)**obmr * (am_r*g_ratio(nu_c))**obmr
2563 effr = 1.0e6*max(4.01e-6, min(sngl(1.0d0*dble(3.+nu_c)/lamc),50.e-6))
2574 if( qqr > min_qr)
then
2576 rr = max(1.e-12, qqr * rho)
2577 ncr2 = max(1.e-6, qqnr * rho)
2578 lamr = (ncr2/rr)**obmr * (am_r*crg(3)*org2)**obmr
2580 effr = 1.0e6*max(50.01e-6, min(sngl(1.0d0*dble(3.+mu_r)/lamr),1999.e-6))
2593 if(qqi >= min_qi)
then
2595 ri = max(1.e-12, qqi * rho)
2596 nci2 = max(1.e-6, qqni * rho)
2598 lami = (nci2/ri)**obmi * (am_i*cig(2)*oig1)**obmi
2600 effr = 1.0e6*max(10.01e-6, min(sngl(1.0d0*dble(3.+mu_i)/lami),250.e-6))
2611 rs = max(1.e-12, qqs * rho)
2613 if(qqs >= min_qs)
then
2615 tc0 = min(-0.1, t-273.15)
2618 if (nthom_bm_s>(2.0-1.e-3) .and. nthom_bm_s<(2.0+1.e-3))
then
2621 loga = nthom_sa(1) + nthom_sa(2)*tc0 + nthom_sa(3)*nthom_bm_s+ &
2622 nthom_sa(4)*tc0*nthom_bm_s + nthom_sa(5)*tc0*tc0 +&
2623 nthom_sa(6)*nthom_bm_s*nthom_bm_s +nthom_sa(7)*tc0*tc0*nthom_bm_s + &
2624 nthom_sa(8)*tc0*nthom_bm_s*nthom_bm_s +nthom_sa(9)*tc0*tc0*tc0 + &
2625 nthom_sa(10)*nthom_bm_s*nthom_bm_s*nthom_bm_s
2629 b = nthom_sb(1) + nthom_sb(2)*tc0 + nthom_sb(3)*nthom_bm_s+ &
2630 nthom_sb(4)*tc0*nthom_bm_s + nthom_sb(5)*tc0*tc0 +&
2631 nthom_sb(6)*nthom_bm_s*nthom_bm_s +nthom_sb(7)*tc0*tc0*nthom_bm_s + &
2632 nthom_sb(8)*tc0*nthom_bm_s*nthom_bm_s +nthom_sb(9)*tc0*tc0*tc0 + &
2633 nthom_sb(10)*nthom_bm_s*nthom_bm_s*nthom_bm_s
2634 smo2 = (smob/a)**(1./b)
2638 loga = nthom_sa(1) + nthom_sa(2)*tc0 + nthom_sa(3)*cse(1) +&
2639 nthom_sa(4)*tc0*cse(1) + nthom_sa(5)*tc0*tc0 +&
2640 nthom_sa(6)*cse(1)*cse(1) + nthom_sa(7)*tc0*tc0*cse(1)+ &
2641 nthom_sa(8)*tc0*cse(1)*cse(1) +nthom_sa(9)*tc0*tc0*tc0 + &
2642 nthom_sa(10)*cse(1)*cse(1)*cse(1)
2646 b = nthom_sb(1)+ nthom_sb(2)*tc0 + nthom_sb(3)*cse(1) +&
2647 nthom_sb(4)*tc0*cse(1) + nthom_sb(5)*tc0*tc0 +&
2648 nthom_sb(6)*cse(1)*cse(1) + nthom_sb(7)*tc0*tc0*cse(1) +&
2649 nthom_sb(8)*tc0*cse(1)*cse(1) + nthom_sb(9)*tc0*tc0*tc0 + &
2650 nthom_sb(10)*cse(1)*cse(1)*cse(1)
2654 effr = 1.0e6*max(50.e-6, min(smoc/smob, 1999.e-6))
2668 if(qqg >= min_qg)
then
2670 rg2 = max(1.e-12, qqg * rho)
2672 ygra1 = alog10(max(1.e-9, rg2))
2674 zans1 = 3. + 2./7. * (ygra1+7.)
2675 zans1 = max(2., min(zans1, 7.))
2677 no_exp = 10.**(zans1)
2679 lm_exp = (no_exp*am_g*cgg(1)/rg2)**oge1
2681 lamg = lm_exp * (cgg(3)*ogg2*ogg1)**obmg
2683 effr= 1.0e6*max(99.e-6, min(sngl((3.0+mu_g)/lamg), 9999.e-6))
2692 elseif(mp_opt==11)
then
2694 SELECT CASE(species)
2699 if (qqw > min_qc)
then
2700 effr = exp(1.0 / 3.0 * log((3. * qqw ) / (4. * pi * gfdl_rhor * gfdl_ccn))) * 1.0e6
2701 effr = max(gfdl_rewmin, min(gfdl_rewmax, effr))
2708 if (qqi > min_qi)
then
2709 if ((t-gfdl_tice) < - 50)
then
2710 effr = gfdl_beta / 9.917 * exp((1 - 0.891) * log(1.0e3 * qqi)) * 1.0e3
2711 elseif ((t-gfdl_tice) < - 40.)
then
2712 effr = gfdl_beta / 9.337 * exp((1 - 0.920) * log(1.0e3 * qqi)) * 1.0e3
2713 elseif ((t-gfdl_tice) < - 30.)
then
2714 effr = gfdl_beta / 9.208 * exp((1 - 0.945) * log(1.0e3 * qqi)) * 1.0e3
2716 effr = gfdl_beta / 9.387 * exp((1 - 0.969) * log(1.0e3 * qqi)) * 1.0e3
2718 effr = max(gfdl_reimin, min(gfdl_reimax, effr))
2724 if ( qqr > min_qr )
then
2725 lambdar = exp(0.25 * log(pi * gfdl_rhor * gfdl_n0r / qqr))
2726 effr = 0.5*exp(log(gfdl_gammar / 6.) / gfdl_alphar) / lambdar * 1.0e6
2727 effr = max(gfdl_rermin, min(gfdl_rermax, effr))
2734 if ( qqs > min_qs )
then
2735 lambdas = exp(0.25 * log(pi * gfdl_rhos * gfdl_n0s / qqs))
2736 effr = 0.5 * exp(log(gfdl_gammas / 6.) / gfdl_alphas) / lambdas * 1.0e6
2737 effr = max(gfdl_resmin, min(gfdl_resmax, effr))
2743 if ( qqg > min_qg )
then
2744 lambdag = exp(0.25 * log(pi * gfdl_rhog * gfdl_n0g / qqg))
2745 effr = 0.5 * exp(log(gfdl_gammag / 6.) / gfdl_alphag) / lambdag * 1.0e6
2746 effr = max(gfdl_regmin, min(gfdl_regmax, effr))
2753 elseif(mp_opt==5.or.mp_opt==85.or.mp_opt==95)
then
2755 SELECT CASE (species)
2767 if( qqr > min_qr)
then
2769 effr=2.*1.0e6*1.5*(rho*qqr/(pi*rhox*nrain))**(1./3.)
2779 if(f_rimef<=5.0)
then
2782 effr = 2.*1.0e6*1.5*(rho*qqs/(pi*rhox*nlice))**(1./3.)
2788 if(f_rimef>5.0.and.f_rimef<=20.0)
then
2791 effr = 2.*1.0e6*1.5*(rho*qqs/(pi*rhox*nlice))**(1./3.)
2797 if(f_rimef>20.0)
then
2800 effr = 2.*1.0e6*1.5*(rho*qqs/(pi*rhox*nlice))**(1./3.)
2818 REAL FUNCTION gammln(XX)
2821 REAL,
INTENT(IN):: xx
2822 DOUBLE PRECISION,
PARAMETER:: stp = 2.5066282746310005d0
2823 DOUBLE PRECISION,
DIMENSION(6),
PARAMETER:: &
2824 cof = (/76.18009172947146d0, -86.50532032941677d0, &
2825 24.01409824083091d0, -1.231739572450155d0, &
2826 .1208650973866179d-2, -.5395239384953d-5/)
2827 DOUBLE PRECISION:: ser,tmp,x,y
2833 tmp=(x+0.5d0)*log(tmp)-tmp
2834 ser=1.000000000190015d0
2839 gammln=tmp+log(stp*ser/x)
2842 REAL FUNCTION wgamma(y)
2845 REAL,
INTENT(IN):: y
2849 wgamma = exp(gammln(y))
subroutine initpost
This routine initializes constants and variables at the start of an ETA model or post processor run...
subroutine zensun(day, time, lat, lon, pi, sun_zenith, sun_azimuth)
This subroutine computes solar position information as a function of geographic coordinates, date and time.