52 private :: rd_mstrn_setup
53 private :: rd_mstrn_dtrn3
54 private :: rd_mstrn_two_stream
55 private :: rd_albedo_ocean
61 real(RP),
private,
parameter :: rd_cossza_min = 0.017_rp
62 real(RP),
private,
parameter :: rd_eps = 1.e-4_rp
64 real(RP),
private :: rd_toa = 100.0_rp
65 integer,
private :: rd_kadd = 10
67 integer,
private :: rd_kmax
68 integer,
private :: rd_naero
69 integer,
private :: rd_hydro_str
70 integer,
private :: rd_hydro_end
71 integer,
private :: rd_aero_str
72 integer,
private :: rd_aero_end
74 real(RP),
private,
allocatable :: rd_zh (:)
75 real(RP),
private,
allocatable :: rd_z (:)
76 real(RP),
private,
allocatable :: rd_rhodz (:)
77 real(RP),
private,
allocatable :: rd_pres (:)
78 real(RP),
private,
allocatable :: rd_presh (:)
79 real(RP),
private,
allocatable :: rd_temp (:)
80 real(RP),
private,
allocatable :: rd_temph (:)
81 real(RP),
private,
allocatable :: rd_gas (:,:)
82 real(RP),
private,
allocatable :: rd_cfc (:,:)
83 real(RP),
private,
allocatable :: rd_aerosol_conc(:,:)
84 real(RP),
private,
allocatable :: rd_aerosol_radi(:,:)
85 real(RP),
private,
allocatable :: rd_cldfrac (:)
87 integer,
private,
allocatable :: i_mpae2rd (:)
89 character(len=H_LONG),
private :: mstrn_gaspara_inputfile =
'PARAG.29' 90 character(len=H_LONG),
private :: mstrn_aeropara_inputfile =
'PARAPC.29' 91 character(len=H_LONG),
private :: mstrn_hygropara_inputfile =
'VARDATA.RM29' 93 integer,
private :: mstrn_nband = 29
95 integer,
private,
parameter :: mstrn_nstream = 1
96 integer,
private,
parameter :: mstrn_ch_limit = 10
97 integer,
private,
parameter :: mstrn_nflag = 7
98 integer,
private,
parameter :: mstrn_nfitp = 26
99 integer,
private,
parameter :: mstrn_nfitt = 3
101 integer,
private,
parameter :: mstrn_ngas = 7
109 integer,
private,
parameter :: mstrn_ncfc = 28
137 integer,
private,
save :: mstrn_nptype = 11
149 integer,
private,
parameter :: mstrn_nsfc = 7
157 integer,
private,
parameter :: mstrn_nfitplk = 5
158 integer,
private,
parameter :: mstrn_nplkord = 3
159 integer,
private,
parameter :: mstrn_nmoment = 6
160 integer,
private,
save :: mstrn_nradius = 6
161 integer,
private,
parameter :: mstrn_ncloud = 2
163 logical,
private,
save :: atmos_phy_rd_mstrn_only_qci = .false.
166 real(RP),
private,
allocatable :: waveh (:)
168 real(RP),
private,
allocatable :: logfitp (:)
169 real(RP),
private,
allocatable :: fitt (:)
170 real(RP),
private,
allocatable :: logfitt (:)
171 integer,
private,
allocatable :: iflgb (:,:)
172 integer,
private,
allocatable :: nch (:)
173 real(RP),
private,
allocatable :: wgtch (:,:)
174 integer,
private,
allocatable :: ngasabs (:)
175 integer,
private,
allocatable :: igasabs (:,:)
177 real(RP),
private,
allocatable :: akd (:,:,:,:,:)
178 real(RP),
private,
allocatable :: skd (:,:,:,:)
179 real(RP),
private,
allocatable :: acfc (:,:)
181 real(RP),
private,
allocatable :: fitplk (:,:)
182 real(RP),
private,
allocatable :: fsol (:)
183 real(RP),
private :: fsol_tot
184 real(RP),
private,
allocatable :: sfc (:,:)
185 real(RP),
private,
allocatable :: rayleigh(:)
186 real(RP),
private,
allocatable :: qmol (:,:)
187 real(RP),
private,
allocatable :: q (:,:,:,:)
189 integer,
private,
allocatable :: hygro_flag(:)
190 real(RP),
private,
allocatable :: radmode (:,:)
195 integer,
private,
parameter :: i_swlw = 4
196 integer,
private,
parameter :: i_h2o_continuum = 5
197 integer,
private,
parameter :: i_cfc_continuum = 7
199 integer,
private,
parameter :: i_clearsky = 1
200 integer,
private,
parameter :: i_cloud = 2
203 real(RP),
private :: rho_std
205 real(RP),
private :: m(2)
206 real(RP),
private :: w(2)
207 real(RP),
private :: wmns(2), wpls(2)
208 real(RP),
private :: wbar(2), wscale(2)
211 real(RP),
private :: c_ocean_albedo(5,3)
212 data c_ocean_albedo / -2.8108_rp , -1.3651_rp, 2.9210e1_rp, -4.3907e1_rp, 1.8125e1_rp, &
213 6.5626e-1_rp, -8.7253_rp, -2.7749e1_rp, 4.9486e1_rp, -1.8345e1_rp, &
214 -6.5423e-1_rp, 9.9967_rp, 2.7769_rp , -1.7620e1_rp, 7.0838_rp /
233 character(len=*),
intent(in) :: RD_TYPE
235 real(RP) :: ATMOS_PHY_RD_MSTRN_TOA
236 integer :: ATMOS_PHY_RD_MSTRN_KADD
237 character(len=H_LONG) :: ATMOS_PHY_RD_MSTRN_GASPARA_IN_FILENAME
238 character(len=H_LONG) :: ATMOS_PHY_RD_MSTRN_AEROPARA_IN_FILENAME
239 character(len=H_LONG) :: ATMOS_PHY_RD_MSTRN_HYGROPARA_IN_FILENAME
240 integer :: ATMOS_PHY_RD_MSTRN_nband
241 integer :: ATMOS_PHY_RD_MSTRN_nptype
242 integer :: ATMOS_PHY_RD_MSTRN_nradius
244 namelist / param_atmos_phy_rd_mstrn / &
245 atmos_phy_rd_mstrn_toa, &
246 atmos_phy_rd_mstrn_kadd, &
247 atmos_phy_rd_mstrn_gaspara_in_filename, &
248 atmos_phy_rd_mstrn_aeropara_in_filename, &
249 atmos_phy_rd_mstrn_hygropara_in_filename, &
250 atmos_phy_rd_mstrn_nband, &
251 atmos_phy_rd_mstrn_nptype, &
252 atmos_phy_rd_mstrn_nradius, &
253 atmos_phy_rd_mstrn_only_qci
255 integer :: ngas, ncfc
256 integer :: ihydro, iaero
261 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[RADIATION] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 264 if ( rd_type /=
'MSTRNX' )
then 265 write(*,*)
'xxx RD_TYPE is not MSTRNX. Check!' 270 atmos_phy_rd_mstrn_toa = rd_toa
271 atmos_phy_rd_mstrn_kadd = rd_kadd
272 atmos_phy_rd_mstrn_gaspara_in_filename = mstrn_gaspara_inputfile
273 atmos_phy_rd_mstrn_aeropara_in_filename = mstrn_aeropara_inputfile
274 atmos_phy_rd_mstrn_hygropara_in_filename = mstrn_hygropara_inputfile
275 atmos_phy_rd_mstrn_nband = mstrn_nband
276 atmos_phy_rd_mstrn_nptype = mstrn_nptype
277 atmos_phy_rd_mstrn_nradius = mstrn_nradius
280 read(
io_fid_conf,nml=param_atmos_phy_rd_mstrn,iostat=ierr)
282 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 283 elseif( ierr > 0 )
then 284 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_MSTRN. Check!' 289 rd_toa = atmos_phy_rd_mstrn_toa
290 rd_kadd = atmos_phy_rd_mstrn_kadd
291 mstrn_gaspara_inputfile = atmos_phy_rd_mstrn_gaspara_in_filename
292 mstrn_aeropara_inputfile = atmos_phy_rd_mstrn_aeropara_in_filename
293 mstrn_hygropara_inputfile = atmos_phy_rd_mstrn_hygropara_in_filename
294 mstrn_nband = atmos_phy_rd_mstrn_nband
295 mstrn_nptype = atmos_phy_rd_mstrn_nptype
296 mstrn_nradius = atmos_phy_rd_mstrn_nradius
299 call rd_mstrn_setup( ngas, &
303 call rd_profile_setup
305 rd_kmax =
kmax + rd_kadd
309 rd_aero_str =
mp_qa + 1
314 allocate( rd_zh(rd_kmax+1) )
315 allocate( rd_z(rd_kmax ) )
317 allocate( rd_rhodz(rd_kmax ) )
318 allocate( rd_pres(rd_kmax ) )
319 allocate( rd_presh(rd_kmax+1) )
320 allocate( rd_temp(rd_kmax ) )
321 allocate( rd_temph(rd_kmax+1) )
323 allocate( rd_gas(rd_kmax,ngas ) )
324 allocate( rd_cfc(rd_kmax,ncfc ) )
325 allocate( rd_aerosol_conc(rd_kmax,rd_naero) )
326 allocate( rd_aerosol_radi(rd_kmax,rd_naero) )
327 allocate( rd_cldfrac(rd_kmax ) )
329 allocate( i_mpae2rd(rd_naero) )
333 i_mpae2rd(ihydro) =
i_mp2rd(ihydro)
341 call rd_profile_setup_zgrid( rd_toa, rd_kmax, rd_kadd, &
345 call rd_profile_read( rd_kmax, &
360 rd_aerosol_conc(:,:), &
361 rd_aerosol_radi(:,:), &
375 temp_sfc, albedo_land, &
393 thermodyn_temp_pres => atmos_thermodyn_temp_pres
395 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq
409 real(RP),
intent(in) :: DENS (
ka,
ia,
ja)
410 real(RP),
intent(in) :: RHOT (
ka,
ia,
ja)
411 real(RP),
intent(in) :: QTRC (
ka,
ia,
ja,
qa)
412 real(RP),
intent(in) :: CZ (
ka,
ia,
ja)
413 real(RP),
intent(in) :: FZ (0:
ka,
ia,
ja)
414 real(RP),
intent(in) :: fact_ocean (
ia,
ja)
415 real(RP),
intent(in) :: fact_land (
ia,
ja)
416 real(RP),
intent(in) :: fact_urban (
ia,
ja)
417 real(RP),
intent(in) :: temp_sfc (
ia,
ja)
418 real(RP),
intent(in) :: albedo_land (
ia,
ja,2)
419 real(RP),
intent(in) :: solins (
ia,
ja)
420 real(RP),
intent(in) :: cosSZA (
ia,
ja)
421 real(RP),
intent(out) :: flux_rad (
ka,
ia,
ja,2,2,2)
422 real(RP),
intent(out) :: flux_rad_top (
ia,
ja,2,2,2)
423 real(RP),
intent(out) :: flux_rad_sfc_dn(
ia,
ja,2,2)
426 real(RP) :: temp (
ka,
ia,
ja)
427 real(RP) :: pres (
ka,
ia,
ja)
428 real(RP) :: qsat (
ka,
ia,
ja)
430 real(RP) :: cldfrac(
ka,
ia,
ja)
435 real(RP),
parameter :: min_cldfrac = 1.e-8_rp
437 real(RP) :: rhodz_merge (rd_kmax,
ia,
ja)
438 real(RP) :: pres_merge (rd_kmax,
ia,
ja)
439 real(RP) :: temp_merge (rd_kmax,
ia,
ja)
440 real(RP) :: temph_merge (rd_kmax+1,
ia,
ja)
442 real(RP) :: gas_merge (rd_kmax,
ia,
ja,mstrn_ngas)
443 real(RP) :: cfc_merge (rd_kmax,
ia,
ja,mstrn_ncfc)
444 real(RP) :: aerosol_conc_merge(rd_kmax,
ia,
ja,rd_naero )
445 real(RP) :: aerosol_radi_merge(rd_kmax,
ia,
ja,rd_naero )
446 real(RP) :: cldfrac_merge (rd_kmax,
ia,
ja)
449 real(RP) :: flux_rad_merge(rd_kmax+1,
ia,
ja,2,2,mstrn_ncloud)
453 integer :: ihydro, iaero, iq
454 integer :: RD_k, k, i, j, v, ic
457 if(
io_l )
write(
io_fid_log,*)
'*** Physics step: Radiation(mstrnX)' 461 call thermodyn_temp_pres( temp(:,:,:), &
467 call saturation_dens2qsat_liq( qsat(:,:,:), &
475 rh(k,i,j) = qtrc(k,i,j,
i_qv) / qsat(k,i,j)
480 call mp_cloudfraction( cldfrac(:,:,:), &
484 call mp_effectiveradius( mp_re(:,:,:,:), &
489 call ae_effectiveradius( ae_re(:,:,:,:), &
493 call mp_mixingratio( mp_qe(:,:,:,:), &
496 if ( atmos_phy_rd_mstrn_only_qci )
then 499 if ( iq /=
i_qc .AND. iq /=
i_qi )
then 501 mp_qe(:,:,:,ihydro) = 0.0_rp
508 if ( rd_profile_use_climatology )
then 509 call rd_profile_read( rd_kmax, &
524 rd_aerosol_conc(:,:), &
525 rd_aerosol_radi(:,:), &
533 temph_merge(rd_k,i,j) = rd_temph(rd_k)
536 temp(
ke+1,i,j) = temp(
ke,i,j)
537 do rd_k = rd_kadd+1, rd_kmax
538 k =
ks + rd_kmax - rd_k
540 temph_merge(rd_k,i,j) = 0.5_rp * ( temp(k,i,j) + temp(k+1,i,j) )
542 temph_merge(rd_kmax+1,i,j) = temp(
ks,i,j)
550 rhodz_merge(rd_k,i,j) = rd_rhodz(rd_k)
551 pres_merge(rd_k,i,j) = rd_pres(rd_k)
552 temp_merge(rd_k,i,j) = rd_temp(rd_k)
555 do rd_k = rd_kadd+1, rd_kmax
556 k =
ks + rd_kmax - rd_k
558 rhodz_merge(rd_k,i,j) = dens(k,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
559 pres_merge(rd_k,i,j) = pres(k,i,j) * 1.e-2_rp
560 temp_merge(rd_k,i,j) = temp(k,i,j)
570 gas_merge(rd_k,i,j,v) = rd_gas(rd_k,v)
578 do rd_k = rd_kadd+1, rd_kmax
579 k =
ks + rd_kmax - rd_k
580 zerosw = sign(0.5_rp, qtrc(k,i,j,
i_qv)-eps) + 0.5_rp
581 gas_merge(rd_k,i,j,1) = qtrc(k,i,j,
i_qv) / mvap * mdry / ppm * zerosw
591 cfc_merge(rd_k,i,j,v) = rd_cfc(rd_k,v)
600 cldfrac_merge(rd_k,i,j) = rd_cldfrac(rd_k)
603 do rd_k = rd_kadd+1, rd_kmax
604 k =
ks + rd_kmax - rd_k
606 cldfrac_merge(rd_k,i,j) = 0.5_rp + sign( 0.5_rp, cldfrac(k,i,j)-min_cldfrac )
616 aerosol_conc_merge(rd_k,i,j,v) = rd_aerosol_conc(rd_k,v)
617 aerosol_radi_merge(rd_k,i,j,v) = rd_aerosol_radi(rd_k,v)
626 do rd_k = rd_kadd+1, rd_kmax
627 k =
ks + rd_kmax - rd_k
629 aerosol_conc_merge(rd_k,i,j,ihydro) = max( mp_qe(k,i,j,ihydro), 0.0_rp ) &
630 / mp_dens(ihydro) * rho_std / ppm
631 aerosol_radi_merge(rd_k,i,j,ihydro) = mp_re(k,i,j,ihydro)
641 do rd_k = rd_kadd+1, rd_kmax
642 k =
ks + rd_kmax - rd_k
644 aerosol_conc_merge(rd_k,i,j,
mp_qa+iaero) = max( qtrc(k,i,j,
i_ae2all(iaero)), 0.0_rp ) &
645 /
ae_dens(iaero) * rho_std / ppm
646 aerosol_radi_merge(rd_k,i,j,
mp_qa+iaero) = ae_re(k,i,j,iaero)
654 do rd_k = rd_kadd+1, rd_kmax
655 aerosol_conc_merge(rd_k,i,j,
mp_qa+iaero) = rd_aerosol_conc(rd_k,
mp_qa+iaero)
656 aerosol_radi_merge(rd_k,i,j,
mp_qa+iaero) = rd_aerosol_radi(rd_k,
mp_qa+iaero)
667 call rd_mstrn_dtrn3( rd_kmax, &
677 rhodz_merge(:,:,:), &
680 temph_merge(:,:,:), &
682 gas_merge(:,:,:,:), &
683 cfc_merge(:,:,:,:), &
684 aerosol_conc_merge(:,:,:,:), &
685 aerosol_radi_merge(:,:,:,:), &
687 cldfrac_merge(:,:,:), &
688 albedo_land(:,:,:), &
692 flux_rad_merge(:,:,:,:,:,:), &
693 flux_rad_sfc_dn(:,:,:,:) )
701 do rd_k = rd_kadd+1, rd_kmax+1
702 k =
ks + rd_kmax - rd_k
704 flux_rad(k,i,j,
i_lw,
i_up,ic) = flux_rad_merge(rd_k,i,j,
i_lw,
i_up,ic)
705 flux_rad(k,i,j,
i_lw,
i_dn,ic) = flux_rad_merge(rd_k,i,j,
i_lw,
i_dn,ic)
706 flux_rad(k,i,j,
i_sw,
i_up,ic) = flux_rad_merge(rd_k,i,j,
i_sw,
i_up,ic)
707 flux_rad(k,i,j,
i_sw,
i_dn,ic) = flux_rad_merge(rd_k,i,j,
i_sw,
i_dn,ic)
730 subroutine rd_mstrn_setup( &
740 integer,
intent(out) :: ngas
741 integer,
intent(out) :: ncfc
743 integer :: nband, nstream, nfitP, nfitT, nflag
744 integer :: nsfc, nptype, nplkord, nfitPLK
747 character(len=H_LONG) :: dummy
750 integer :: iw, ich, ip, it, igas, icfc, iptype, im
757 allocate( waveh(mstrn_nband+1) )
758 allocate( logfitp(mstrn_nfitp) )
759 allocate( fitt(mstrn_nfitt) )
760 allocate( logfitt(mstrn_nfitt) )
762 allocate( iflgb(mstrn_nflag, mstrn_nband) )
763 allocate( nch( mstrn_nband) )
764 allocate( wgtch(mstrn_ch_limit,mstrn_nband) )
765 allocate( ngasabs( mstrn_nband) )
766 allocate( igasabs(mstrn_ngas, mstrn_nband) )
768 allocate( akd(mstrn_ch_limit,mstrn_nfitp,mstrn_nfitt,mstrn_ngas,mstrn_nband) )
769 allocate( skd(mstrn_ch_limit,mstrn_nfitp,mstrn_nfitt, mstrn_nband) )
770 allocate( acfc(mstrn_ncfc,mstrn_nband) )
774 file = trim(mstrn_gaspara_inputfile), &
775 form =
'formatted', &
779 if ( ierr /= 0 )
then 780 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_gaspara_inputfile)
785 read(fid,*) nband, nstream, nfitp, nfitt, nflag, ncfc
787 if ( nband /= mstrn_nband )
then 788 write(*,*)
'xxx Inconsistent parameter value! nband(given,file)=', mstrn_nband, nband
791 if ( nstream /= mstrn_nstream )
then 792 write(*,*)
'xxx Inconsistent parameter value! nstream(given,file)=', mstrn_nstream, nstream
795 if ( nfitp /= mstrn_nfitp )
then 796 write(*,*)
'xxx Inconsistent parameter value! nfitP(given,file)=', mstrn_nfitp, nfitp
799 if ( nfitt /= mstrn_nfitt )
then 800 write(*,*)
'xxx Inconsistent parameter value! nfitT(given,file)=', mstrn_nfitt, nfitt
803 if ( nflag /= mstrn_nflag )
then 804 write(*,*)
'xxx Inconsistent parameter value! nflag(given,file)=', mstrn_nflag, nflag
807 if ( ncfc /= mstrn_ncfc )
then 808 write(*,*)
'xxx Inconsistent parameter value! ncfc(given,file)=', mstrn_ncfc, ncfc
817 read(fid,*) logfitp(:)
822 logfitt(:) = log10( fitt(:) )
825 do iw = 1, mstrn_nband
829 read(fid,*) iflgb(:,iw)
835 read(fid,*) (wgtch(ich,iw),ich=1,nch(iw))
838 read(fid,*) ngasabs(iw)
841 if ( ngasabs(iw) > 0 )
then 842 do igas = 1, ngasabs(iw)
843 read(fid,*) igasabs(igas,iw)
844 do it = 1, mstrn_nfitt
845 do ip = 1, mstrn_nfitp
846 read(fid,*) (akd(ich,ip,it,igasabs(igas,iw),iw),ich=1,nch(iw))
853 if ( iflgb(i_h2o_continuum,iw) > 0 )
then 855 do it = 1, mstrn_nfitt
856 do ip = 1, mstrn_nfitp
857 read(fid,*) (skd(ich,ip,it,iw),ich=1,nch(iw))
863 if ( iflgb(i_cfc_continuum,iw) > 0 )
then 865 read(fid,*) (acfc(icfc,iw),icfc=1,mstrn_ncfc)
875 allocate( fitplk(mstrn_nfitplk,mstrn_nband) )
876 allocate( fsol( mstrn_nband) )
877 allocate( sfc(mstrn_nsfc, mstrn_nband) )
878 allocate( rayleigh( mstrn_nband) )
880 allocate( qmol( mstrn_nmoment,mstrn_nband) )
881 allocate( q(mstrn_nradius+1,mstrn_nptype,mstrn_nmoment,mstrn_nband) )
882 q(mstrn_nradius+1,:,:,:) = 0.d0
885 file = trim(mstrn_aeropara_inputfile), &
886 form =
'formatted', &
890 if ( ierr /= 0 )
then 891 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_aeropara_inputfile)
896 read(fid,*) nband, nsfc, nptype, nstream, nplkord, nfitplk
898 if ( nband /= mstrn_nband )
then 899 write(*,*)
'xxx Inconsistent parameter value! nband(given,file)=', mstrn_nband, nband
902 if ( nsfc /= mstrn_nsfc )
then 903 write(*,*)
'xxx Inconsistent parameter value! nsfc(given,file)=', mstrn_nsfc, nsfc
906 if ( nptype /= mstrn_nptype )
then 907 write(*,*)
'xxx Inconsistent parameter value! nptype(given,file)=', mstrn_nptype, nptype
910 if ( nstream /= mstrn_nstream )
then 911 write(*,*)
'xxx Inconsistent parameter value! nstream(given,file)=', mstrn_nstream, nstream
914 if ( nplkord /= mstrn_nplkord )
then 915 write(*,*)
'xxx Inconsistent parameter value! nplkord(given,file)=', mstrn_nplkord, nplkord
918 if ( nfitplk /= mstrn_nfitplk )
then 919 write(*,*)
'xxx Inconsistent parameter value! nfitPLK(given,file)=', mstrn_nfitplk, nfitplk
928 do iw = 1, mstrn_nband
932 read(fid,*) fitplk(:,iw)
938 read(fid,*) sfc(:,iw)
941 read(fid,*) rayleigh(iw)
945 do im = 1, mstrn_nmoment
947 read(fid,*) qmol(im,iw)
949 do iptype = 1, nptype
950 read(fid,*) q(1:mstrn_nradius,iptype,im,iw)
959 do iw = 1, mstrn_nband
960 fsol_tot = fsol_tot + fsol(iw)
966 allocate( hygro_flag(mstrn_nptype) )
967 allocate( radmode(mstrn_nptype,mstrn_nradius) )
970 file = trim(mstrn_hygropara_inputfile), &
971 form =
'formatted', &
975 if ( ierr /= 0 )
then 976 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_hygropara_inputfile)
982 if ( nptype /= mstrn_nptype )
then 983 write(*,*)
'xxx Inconsistent parameter value! nptype(given,file)=', mstrn_nptype, nptype
987 do iptype = 1, nptype
989 read(fid,*) hygro_flag(iptype), nradius
991 if ( nradius /= mstrn_nradius )
then 992 write(*,*)
'xxx Inconsistent parameter value! nradius(given,file)=', mstrn_nradius, nradius
996 read(fid,*) radmode(iptype,:)
1003 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.7)')
'*** Baseline of total solar insolation : ', fsol_tot
1006 rho_std = pstd / ( rdry * tem00 )
1008 m(
i_sw) = 1.0_rp / sqrt(3.0_rp)
1012 m(
i_lw) = 1.0_rp / 1.66_rp
1016 wmns(:) = sqrt( w(:) / m(:) )
1017 wpls(:) = sqrt( w(:) * m(:) )
1018 wscale(:) = wpls(:) / wbar(:)
1028 end subroutine rd_mstrn_setup
1032 subroutine rd_mstrn_dtrn3( &
1068 integer,
intent(in) :: rd_kmax
1069 integer,
intent(in) :: ngas
1070 integer,
intent(in) :: ncfc
1071 integer,
intent(in) :: naero
1072 integer,
intent(in) :: hydro_str
1073 integer,
intent(in) :: hydro_end
1074 integer,
intent(in) :: aero_str
1075 integer,
intent(in) :: aero_end
1076 real(RP),
intent(in) :: solins (
ia,
ja)
1077 real(RP),
intent(in) :: cosSZA (
ia,
ja)
1078 real(RP),
intent(in) :: rhodz (rd_kmax ,
ia,
ja)
1079 real(RP),
intent(in) :: pres (rd_kmax ,
ia,
ja)
1080 real(RP),
intent(in) :: temp (rd_kmax ,
ia,
ja)
1081 real(RP),
intent(in) :: temph (rd_kmax+1,
ia,
ja)
1082 real(RP),
intent(in) :: temp_sfc (
ia,
ja)
1083 real(RP),
intent(in) :: gas (rd_kmax,
ia,
ja,ngas )
1084 real(RP),
intent(in) :: cfc (rd_kmax,
ia,
ja,ncfc )
1085 real(RP),
intent(in) :: aerosol_conc(rd_kmax,
ia,
ja,naero)
1086 real(RP),
intent(in) :: aerosol_radi(rd_kmax,
ia,
ja,naero)
1087 integer,
intent(in) :: aero2ptype (naero)
1088 real(RP),
intent(in) :: cldfrac (rd_kmax,
ia,
ja)
1089 real(RP),
intent(in) :: albedo_land (
ia,
ja,2)
1090 real(RP),
intent(in) :: fact_ocean (
ia,
ja)
1091 real(RP),
intent(in) :: fact_land (
ia,
ja)
1092 real(RP),
intent(in) :: fact_urban (
ia,
ja)
1093 real(RP),
intent(out) :: rflux (rd_kmax+1,
ia,
ja,2,2,mstrn_ncloud)
1094 real(RP),
intent(out) :: rflux_sfc_dn(
ia,
ja,2,2)
1097 real(RP) :: dz_std (rd_kmax,
ia,
ja)
1098 real(RP) :: logP (rd_kmax,
ia,
ja)
1099 real(RP) :: logT (rd_kmax,
ia,
ja)
1100 integer :: indexP (rd_kmax,
ia,
ja)
1101 real(RP) :: factP (rd_kmax,
ia,
ja)
1102 real(RP) :: factT32(rd_kmax,
ia,
ja)
1103 real(RP) :: factT21(rd_kmax,
ia,
ja)
1104 integer :: indexR (rd_kmax,
ia,
ja,naero)
1105 real(RP) :: factR (rd_kmax,
ia,
ja,naero)
1108 real(RP) :: tauGAS(rd_kmax,
ia,
ja,mstrn_ch_limit)
1109 real(RP) :: A1, A2, A3, factPT
1110 real(RP) :: qv, length
1114 real(RP) :: tauPR (rd_kmax,
ia,
ja,mstrn_ncloud)
1115 real(RP) :: omgPR (rd_kmax,
ia,
ja,mstrn_ncloud)
1116 real(RP) :: optparam(rd_kmax,
ia,
ja,mstrn_nmoment,mstrn_ncloud)
1117 real(RP) :: q_fit, dp_P
1120 real(RP) :: albedo_sfc (
ia,
ja,mstrn_ncloud)
1125 real(RP) :: bbar (rd_kmax ,
ia,
ja)
1126 real(RP) :: bbarh(rd_kmax+1,
ia,
ja)
1127 real(RP) :: b_sfc(
ia,
ja)
1128 real(RP) :: wl, beta
1131 real(RP) :: tau(rd_kmax,
ia,
ja, mstrn_ncloud)
1132 real(RP) :: omg(rd_kmax,
ia,
ja, mstrn_ncloud)
1133 real(RP) :: g (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1137 real(RP) :: b (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1138 real(RP) :: fsol_rgn(
ia,
ja)
1140 real(RP) :: flux (rd_kmax+1,
ia,
ja,2,mstrn_ncloud)
1141 real(RP) :: flux_direct(rd_kmax+1,
ia,
ja ,mstrn_ncloud)
1146 integer :: ip, ir, irgn
1147 integer :: igas, icfc, iaero, iptype
1148 integer :: iw, ich, iplk, icloud, im
1168 dz_std(k,i,j) = rhodz(k,i,j) / rho_std * 100.0_rp
1182 logp(k,i,j) = log10( pres(k,i,j) )
1183 logt(k,i,j) = log10( temp(k,i,j) )
1196 indexp(k,i,j) = mstrn_nfitp
1198 do ip = mstrn_nfitp, 2, -1
1199 if( logp(k,i,j) >= logfitp(ip) ) indexp(k,i,j) = ip
1216 factp(k,i,j) = ( logp(k,i,j) - logfitp(ip-1) ) / ( logfitp(ip) - logfitp(ip-1) )
1218 factt32(k,i,j) = ( logt(k,i,j) - logfitt(2) ) / ( logfitt(3) - logfitt(2) ) &
1219 * ( temp(k,i,j) - fitt(1) ) / ( fitt(3) - fitt(1) )
1220 factt21(k,i,j) = ( logt(k,i,j) - logfitt(2) ) / ( logfitt(2) - logfitt(1) ) &
1221 * ( fitt(3) - temp(k,i,j) ) / ( fitt(3) - fitt(1) )
1229 iptype = aero2ptype(iaero)
1238 if ( aerosol_radi(k,i,j,iaero) <= radmode(iptype,1) )
then 1241 indexr(k,i,j,iaero) = ir
1242 factr(k,i,j,iaero) = ( aerosol_radi(k,i,j,iaero) - radmode(iptype,ir) ) &
1243 / ( radmode(iptype,ir+1) - radmode(iptype,ir) )
1245 elseif( aerosol_radi(k,i,j,iaero) > radmode(iptype,mstrn_nradius) )
then 1250 indexr(k,i,j,iaero) = ir
1251 factr(k,i,j,iaero) = 1.0_rp
1255 indexr(k,i,j,iaero) = -1
1256 do ir = 1, mstrn_nradius-1
1257 if ( aerosol_radi(k,i,j,iaero) <= radmode(iptype,ir+1) &
1258 .AND. aerosol_radi(k,i,j,iaero) > radmode(iptype,ir ) )
then 1260 indexr(k,i,j,iaero) = ir
1261 factr(k,i,j,iaero) = ( aerosol_radi(k,i,j,iaero) - radmode(iptype,ir) ) &
1262 / ( radmode(iptype,ir+1) - radmode(iptype,ir) )
1267 if ( indexr(k,i,j,iaero) == -1 )
then 1268 write(*,*)
'xxx invalid index', k,i,j, iaero, aerosol_radi(k,i,j,iaero)
1280 rflux(:,:,:,:,:,:) = 0.0_rp
1281 rflux_sfc_dn(:,:,:,:) = 0.0_rp
1286 do iw = 1, mstrn_nband
1287 irgn = iflgb(i_swlw,iw) + 1
1300 taugas(k,i,j,ich) = 0.0_rp
1308 do igas = 1, ngasabs(iw)
1309 gasno = igasabs(igas,iw)
1321 length = gas(k,i,j,igasabs(igas,iw)) * ppm * dz_std(k,i,j)
1325 a1 = akd(ich,ip-1,1,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1326 + akd(ich,ip ,1,gasno,iw) * ( factp(k,i,j) )
1327 a2 = akd(ich,ip-1,2,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1328 + akd(ich,ip ,2,gasno,iw) * ( factp(k,i,j) )
1329 a3 = akd(ich,ip-1,3,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1330 + akd(ich,ip ,3,gasno,iw) * ( factp(k,i,j) )
1332 factpt = factt32(k,i,j)*(a3-a2) + a2 + factt21(k,i,j)*(a2-a1)
1334 taugas(k,i,j,ich) = taugas(k,i,j,ich) + 10.0_rp**factpt * length
1343 if ( iflgb(i_h2o_continuum,iw) == 1 )
then 1354 qv = gas(k,i,j,1) * ppm * dz_std(k,i,j)
1355 length = qv*qv / ( qv + dz_std(k,i,j) )
1359 a1 = skd(ich,ip-1,1,iw) * ( 1.0_rp-factp(k,i,j) )&
1360 + skd(ich,ip ,1,iw) * ( factp(k,i,j) )
1361 a2 = skd(ich,ip-1,2,iw) * ( 1.0_rp-factp(k,i,j) )&
1362 + skd(ich,ip ,2,iw) * ( factp(k,i,j) )
1363 a3 = skd(ich,ip-1,3,iw) * ( 1.0_rp-factp(k,i,j) )&
1364 + skd(ich,ip ,3,iw) * ( factp(k,i,j) )
1366 factpt = factt32(k,i,j)*(a3-a2) + a2 + factt21(k,i,j)*(a2-a1)
1368 taugas(k,i,j,ich) = taugas(k,i,j,ich) + 10.0_rp**factpt * length
1376 if ( iflgb(i_cfc_continuum,iw) == 1 )
then 1387 valsum = valsum + 10.0_rp**acfc(icfc,iw) * cfc(k,i,j,icfc)
1389 valsum = valsum * ppm * dz_std(k,i,j)
1393 taugas(k,i,j,ich) = taugas(k,i,j,ich) + valsum
1415 dp_p = rhodz(k,i,j) * grav / pstd
1416 length = rayleigh(iw) * dp_p
1419 do im = 1, mstrn_nstream*2+2
1420 optparam(k,i,j,im,i_cloud ) = qmol(im,iw) * length
1421 optparam(k,i,j,im,i_clearsky) = qmol(im,iw) * length
1429 do iaero = hydro_str, hydro_end
1430 iptype = aero2ptype(iaero)
1439 ir = indexr(k,i,j,iaero)
1441 length = aerosol_conc(k,i,j,iaero) * ppm * dz_std(k,i,j)
1444 do im = 1, mstrn_nstream*2+2
1445 q_fit = q(ir ,iptype,im,iw) * ( 1.0_rp-factr(k,i,j,iaero) ) &
1446 + q(ir+1,iptype,im,iw) * ( factr(k,i,j,iaero) )
1448 optparam(k,i,j,im,i_cloud) = optparam(k,i,j,im,i_cloud) + q_fit * length
1457 do iaero = aero_str, aero_end
1458 iptype = aero2ptype(iaero)
1467 ir = indexr(k,i,j,iaero)
1469 length = aerosol_conc(k,i,j,iaero) * ppm * dz_std(k,i,j)
1472 do im = 1, mstrn_nstream*2+2
1473 q_fit = q(ir ,iptype,im,iw) * ( 1.0_rp-factr(k,i,j,iaero) ) &
1474 + q(ir+1,iptype,im,iw) * ( factr(k,i,j,iaero) )
1476 optparam(k,i,j,im,i_cloud ) = optparam(k,i,j,im,i_cloud ) + q_fit * length
1477 optparam(k,i,j,im,i_clearsky) = optparam(k,i,j,im,i_clearsky) + q_fit * length
1485 do icloud = 1, mstrn_ncloud
1493 taupr(k,i,j,icloud) = optparam(k,i,j,1,icloud)
1494 omgpr(k,i,j,icloud) = optparam(k,i,j,1,icloud) - optparam(k,i,j,2,icloud)
1497 zerosw = 0.5_rp - sign(0.5_rp,omgpr(k,i,j,icloud)-rd_eps)
1499 g(k,i,j,0,icloud) = 1.0_rp
1500 g(k,i,j,1,icloud) = optparam(k,i,j,3,icloud) * ( 1.0_rp-zerosw ) / ( omgpr(k,i,j,icloud)+zerosw )
1501 g(k,i,j,2,icloud) = optparam(k,i,j,4,icloud) * ( 1.0_rp-zerosw ) / ( omgpr(k,i,j,icloud)+zerosw )
1514 do icloud = 1, mstrn_ncloud
1540 albedo_sfc(i,j,icloud) = albedo_land(i,j,irgn)
1561 tau(k,i,j,icloud) = taugas(k,i,j,ich) + taupr(k,i,j,icloud)
1564 zerosw = 0.5_rp - sign( 0.5_rp, tau(k,i,j,icloud)-rd_eps )
1566 omg(k,i,j,icloud) = ( 1.0_rp-zerosw ) * omgpr(k,i,j,icloud) / ( tau(k,i,j,icloud)-zerosw ) &
1567 + ( zerosw ) * 1.0_rp
1577 if ( irgn ==
i_sw )
then 1588 b(k,i,j,0,icloud) = 0.0_rp
1589 b(k,i,j,1,icloud) = 0.0_rp
1590 b(k,i,j,2,icloud) = 0.0_rp
1603 fsol_rgn(i,j) = fsol(iw) / fsol_tot * solins(i,j)
1608 elseif( irgn ==
i_lw )
then 1610 wl = 10000.0_rp / sqrt( waveh(iw) * waveh(iw+1) )
1622 do iplk = mstrn_nfitplk, 1, -1
1623 beta = beta / ( wl*temp(k,i,j) ) + fitplk(iplk,iw)
1626 bbar(k,i,j) = exp(-beta) * temp(k,i,j) / (wl*wl)
1642 do iplk = mstrn_nfitplk, 1, -1
1643 beta = beta / ( wl*temph(k,i,j) ) + fitplk(iplk,iw)
1646 bbarh(k,i,j) = exp(-beta) * temph(k,i,j) / (wl*wl)
1660 zerosw = 0.5_rp - sign( 0.5_rp, tau(k,i,j,icloud)-rd_eps )
1662 b(k,i,j,0,icloud) = bbarh(k,i,j)
1663 b(k,i,j,1,icloud) = ( 1.0_rp-zerosw ) &
1664 * ( - bbarh(k+1,i,j) &
1665 + 4.0_rp * bbar(k ,i,j) &
1666 - 3.0_rp * bbarh(k ,i,j) &
1667 ) / ( tau(k,i,j,icloud)-zerosw )
1668 b(k,i,j,2,icloud) = ( 1.0_rp-zerosw ) &
1669 * ( + bbarh(k+1,i,j) &
1670 - 2.0_rp * bbar(k ,i,j) &
1672 ) / ( tau(k,i,j,icloud)*tau(k,i,j,icloud)-zerosw ) * 2.0_rp
1687 do iplk = mstrn_nfitplk, 1, -1
1688 beta = beta / ( wl*temp_sfc(i,j) ) + fitplk(iplk,iw)
1691 b_sfc(i,j) = exp(-beta) * temp_sfc(i,j) / (wl*wl)
1702 fsol_rgn(i,j) = 0.0_rp
1718 call rd_mstrn_two_stream( rd_kmax, &
1728 albedo_sfc(:,:,:), &
1731 flux_direct(:,:,:,:) )
1742 rflux(k,i,j,irgn,
i_up,icloud) = rflux(k,i,j,irgn,
i_up,icloud) + flux(k,i,j,
i_up,icloud) * wgtch(ich,iw)
1743 rflux(k,i,j,irgn,
i_dn,icloud) = rflux(k,i,j,irgn,
i_dn,icloud) + flux(k,i,j,
i_dn,icloud) * wgtch(ich,iw)
1752 rflux_sfc_dn(i,j,irgn,1) = rflux_sfc_dn(i,j,irgn,1) + flux_direct(rd_kmax+1,i,j,i_cloud) * wgtch(ich,iw)
1753 rflux_sfc_dn(i,j,irgn,2) = rflux_sfc_dn(i,j,irgn,2) &
1754 + ( flux(rd_kmax+1,i,j,
i_dn,i_cloud) - flux_direct(rd_kmax+1,i,j,i_cloud) ) * wgtch(ich,iw)
1772 end subroutine rd_mstrn_dtrn3
1776 subroutine rd_mstrn_two_stream( &
1798 integer,
intent(in) :: rd_kmax
1799 integer,
intent(in) :: iw, ich
1800 real(RP),
intent(in) :: cosSZA0 (
ia,
ja)
1801 real(RP),
intent(in) :: fsol (
ia,
ja)
1802 integer,
intent(in) :: irgn
1803 real(RP),
intent(in) :: tau (rd_kmax,
ia,
ja, mstrn_ncloud)
1804 real(RP),
intent(in) :: omg (rd_kmax,
ia,
ja, mstrn_ncloud)
1805 real(RP),
intent(in) :: g (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1806 real(RP),
intent(in) :: b (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1807 real(RP),
intent(in) :: b_sfc (
ia,
ja)
1808 real(RP),
intent(in) :: albedo_sfc (
ia,
ja,mstrn_ncloud)
1809 real(RP),
intent(in) :: cldfrac (rd_kmax,
ia,
ja)
1811 real(RP),
intent(out) :: flux (rd_kmax+1,
ia,
ja,2,mstrn_ncloud)
1812 real(RP),
intent(out) :: flux_direct(rd_kmax+1,
ia,
ja, mstrn_ncloud)
1824 real(RP) :: Pmns, Ppls
1825 real(RP) :: Smns, Spls
1828 real(RP) :: cosSZA(
ia,
ja)
1832 real(RP) :: Apls_mns, Bpls_mns
1833 real(RP) :: V0mns, V0pls
1834 real(RP) :: V1mns, V1pls
1835 real(RP) :: Dmns0, Dmns1, Dmns2
1836 real(RP) :: Dpls0, Dpls1, Dpls2
1837 real(RP) :: SIGmns, SIGpls
1839 real(RP) :: zerosw, tmp
1842 real(RP) :: Tdir0(rd_kmax,
ia,
ja,mstrn_ncloud)
1843 real(RP) :: R0 (rd_kmax,
ia,
ja,mstrn_ncloud)
1844 real(RP) :: T0 (rd_kmax,
ia,
ja,mstrn_ncloud)
1845 real(RP) :: Em_LW(rd_kmax,
ia,
ja,mstrn_ncloud)
1846 real(RP) :: Em_SW(rd_kmax,
ia,
ja,mstrn_ncloud)
1847 real(RP) :: Ep_LW(rd_kmax,
ia,
ja,mstrn_ncloud)
1848 real(RP) :: Ep_SW(rd_kmax,
ia,
ja,mstrn_ncloud)
1851 real(RP) :: cf (rd_kmax ,
ia,
ja)
1852 real(RP) :: tau_bar_sol(rd_kmax+1,
ia,
ja)
1853 real(RP) :: Tdir (rd_kmax+1,
ia,
ja)
1854 real(RP) :: R (rd_kmax+1,
ia,
ja)
1855 real(RP) :: T (rd_kmax+1,
ia,
ja)
1856 real(RP) :: Em (rd_kmax+1,
ia,
ja)
1857 real(RP) :: Ep (rd_kmax+1,
ia,
ja)
1860 real(RP) :: R12mns(rd_kmax+1,
ia,
ja)
1861 real(RP) :: R12pls(rd_kmax+1,
ia,
ja)
1862 real(RP) :: E12mns(rd_kmax+1,
ia,
ja)
1863 real(RP) :: E12pls(rd_kmax+1,
ia,
ja)
1864 real(RP) :: Umns, Upls
1866 real(RP) :: Em0(mstrn_ncloud)
1868 real(RP) :: Wmns_irgn, M_irgn, W_irgn, Wpls_irgn, Wscale_irgn
1870 integer,
parameter :: I_SFC2TOA = 1
1871 integer,
parameter :: I_TOA2SFC = 2
1872 integer :: direction
1875 integer :: k, i, j, icloud
1881 wmns_irgn = wmns(irgn)
1882 wpls_irgn = wpls(irgn)
1883 wscale_irgn = wscale(irgn)
1906 k = 1 + mod(kij-1, rd_kmax)
1907 i =
is + mod((kij-1)/rd_kmax,
imax)
1908 j =
js + (kij-1)/(rd_kmax*
imax)
1911 tau_new = ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) ) * tau(k,i,j,icloud)
1913 omg_new = ( 1.0_rp - g(k,i,j,2,icloud) ) / ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) ) * omg(k,i,j,icloud)
1914 omg_new = min( omg_new, eps1 )
1916 g_new = ( g(k,i,j,1,icloud) - g(k,i,j,2,icloud) ) / ( 1.0_rp - g(k,i,j,2,icloud) )
1918 tdir0(k,i,j,icloud) = exp(-tau_new/cossza(i,j))
1920 factor = ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) )
1921 b_new0 = b(k,i,j,0,icloud)
1922 b_new1 = b(k,i,j,1,icloud) / factor
1923 b_new2 = b(k,i,j,2,icloud) / (factor*factor)
1924 c0 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new0
1925 c1 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new1
1926 c2 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new2
1929 pmns = omg_new * 0.5_rp * ( 1.0_rp - 3.0_rp * g_new * m_irgn*m_irgn )
1930 ppls = omg_new * 0.5_rp * ( 1.0_rp + 3.0_rp * g_new * m_irgn*m_irgn )
1933 smns = omg_new * 0.5_rp * ( 1.0_rp - 3.0_rp * g_new * m_irgn*cossza(i,j) )
1934 spls = omg_new * 0.5_rp * ( 1.0_rp + 3.0_rp * g_new * m_irgn*cossza(i,j) )
1937 sw = 0.5_rp + sign(0.5_rp,tau_new-rd_eps)
1938 tau_new = max( tau_new, rd_eps )
1941 x = ( 1.0_rp - w_irgn * ( ppls - pmns ) ) / m_irgn
1942 y = ( 1.0_rp - w_irgn * ( ppls + pmns ) ) / m_irgn
1946 e = exp(-lamda*tau_new)
1949 apls_mns = ( x * ( 1.0_rp+e ) - lamda * ( 1.0_rp-e ) ) &
1950 / ( x * ( 1.0_rp+e ) + lamda * ( 1.0_rp-e ) )
1951 bpls_mns = ( x * ( 1.0_rp-e ) - lamda * ( 1.0_rp+e ) ) &
1952 / ( x * ( 1.0_rp-e ) + lamda * ( 1.0_rp+e ) )
1955 r0(k,i,j,icloud) = ( sw ) * 0.5_rp * ( apls_mns + bpls_mns ) &
1956 + ( 1.0_rp-sw ) * ( tau_new * ( pmns ) / m_irgn )
1957 t0(k,i,j,icloud) = ( sw ) * 0.5_rp * ( apls_mns - bpls_mns ) &
1958 + ( 1.0_rp-sw ) * ( 1.0_rp - tau_new * ( 1.0_rp - ppls ) / m_irgn )
1961 dmns0 = c0 / y + 2.0_rp * c2 / (x*y*y) + c1 / (x*y)
1962 dpls0 = c0 / y + 2.0_rp * c2 / (x*y*y) - c1 / (x*y)
1963 dmns1 = c1 / y + 2.0_rp * c2 / (x*y)
1964 dpls1 = c1 / y - 2.0_rp * c2 / (x*y)
1970 v1mns = dmns0 + dmns1*tau_new + dmns2*tau_new*tau_new
1971 v1pls = dpls0 + dpls1*tau_new + dpls2*tau_new*tau_new
1973 em_lw(k,i,j,icloud) = ( sw ) * ( v0mns - r0(k,i,j,icloud) * v0pls - t0(k,i,j,icloud) * v1mns ) &
1974 + ( 1.0_rp-sw ) * 0.5_rp * tau_new * ( 2.0_rp*c0 + c1*tau_new + c2*tau_new*tau_new )
1975 ep_lw(k,i,j,icloud) = ( sw ) * ( v1pls - t0(k,i,j,icloud) * v0pls - r0(k,i,j,icloud) * v1mns ) &
1976 + ( 1.0_rp-sw ) * 0.5_rp * tau_new * ( 2.0_rp*c0 + c1*tau_new + c2*tau_new*tau_new )
1979 sigmns = wmns_irgn * ( spls - smns )
1980 sigpls = wmns_irgn * ( spls + smns )
1982 tmp = x*y*cossza(i,j)-1.0/cossza(i,j)
1983 zerosw = 1.0_rp - sign(1.0_rp,abs(tmp)-eps)
1984 qgamma = ( sigpls*x*cossza(i,j) + sigmns ) / ( tmp + zerosw*eps )
1986 v0pls = 0.5_rp * ( ( 1.0_rp + 1.0_rp/(x*cossza(i,j)) ) * qgamma + sigmns / x )
1987 v0mns = 0.5_rp * ( ( 1.0_rp - 1.0_rp/(x*cossza(i,j)) ) * qgamma - sigmns / x )
1989 v1pls = v0pls * tdir0(k,i,j,icloud)
1990 v1mns = v0mns * tdir0(k,i,j,icloud)
1992 em_sw(k,i,j,icloud) = ( sw ) * ( v0mns - r0(k,i,j,icloud) * v0pls - t0(k,i,j,icloud) * v1mns ) &
1993 + ( 1.0_rp-sw ) * wmns_irgn * smns * tau_new * sqrt( tdir0(k,i,j,icloud) )
1994 ep_sw(k,i,j,icloud) = ( sw ) * ( v1pls - t0(k,i,j,icloud) * v0pls - r0(k,i,j,icloud) * v1mns ) &
1995 + ( 1.0_rp-sw ) * wmns_irgn * spls * tau_new * sqrt( tdir0(k,i,j,icloud) )
2009 if ( icloud == 1 )
then 2012 cf(:,:,:) = cldfrac(:,:,:)
2021 tdir(k,i,j) = ( cf(k,i,j) ) * tdir0(k,i,j,i_cloud ) &
2022 + ( 1.0_rp-cf(k,i,j) ) * tdir0(k,i,j,i_clearsky)
2024 r(k,i,j) = ( cf(k,i,j) ) * r0(k,i,j,i_cloud ) &
2025 + ( 1.0_rp-cf(k,i,j) ) * r0(k,i,j,i_clearsky)
2027 t(k,i,j) = ( cf(k,i,j) ) * t0(k,i,j,i_cloud ) &
2028 + ( 1.0_rp-cf(k,i,j) ) * t0(k,i,j,i_clearsky)
2037 tau_bar_sol(1,i,j) = fsol(i,j)
2040 tau_bar_sol(k,i,j) = tau_bar_sol(k-1,i,j) * tdir(k-1,i,j)
2051 em(k,i,j) = ( cf(k,i,j) ) * ( em_lw(k,i,j,i_cloud ) &
2052 + em_sw(k,i,j,i_cloud ) * tau_bar_sol(k,i,j) ) &
2053 + ( 1.0_rp-cf(k,i,j) ) * ( em_lw(k,i,j,i_clearsky) &
2054 + em_sw(k,i,j,i_clearsky) * tau_bar_sol(k,i,j) )
2056 ep(k,i,j) = ( cf(k,i,j) ) * ( ep_lw(k,i,j,i_cloud ) &
2057 + ep_sw(k,i,j,i_cloud ) * tau_bar_sol(k,i,j) ) &
2058 + ( 1.0_rp-cf(k,i,j) ) * ( ep_lw(k,i,j,i_clearsky) &
2059 + ep_sw(k,i,j,i_clearsky) * tau_bar_sol(k,i,j) )
2061 flux_direct(k,i,j,icloud) = cossza(i,j) * tau_bar_sol(k,i,j)
2071 r(rd_kmax+1,i,j) = ( cf(rd_kmax,i,j) ) * albedo_sfc(i,j,i_cloud ) &
2072 + ( 1.0_rp-cf(rd_kmax,i,j) ) * albedo_sfc(i,j,i_clearsky)
2074 t(rd_kmax+1,i,j) = 0.0_rp
2076 flux_direct(rd_kmax+1,i,j,icloud) = cossza(i,j) * tau_bar_sol(rd_kmax+1,i,j)
2078 em0(i_cloud ) = wpls_irgn * ( flux_direct(rd_kmax+1,i,j,icloud) * albedo_sfc(i,j,i_cloud ) / (w_irgn*m_irgn) &
2079 + 2.0_rp * pi * ( 1.0_rp-albedo_sfc(i,j,i_cloud ) ) * b_sfc(i,j) )
2080 em0(i_clearsky) = wpls_irgn * ( flux_direct(rd_kmax+1,i,j,icloud) * albedo_sfc(i,j,i_clearsky) / (w_irgn*m_irgn) &
2081 + 2.0_rp * pi * ( 1.0_rp-albedo_sfc(i,j,i_clearsky) ) * b_sfc(i,j) )
2083 em(rd_kmax+1,i,j) = ( cf(rd_kmax,i,j) ) * em0(i_cloud ) &
2084 + ( 1.0_rp-cf(rd_kmax,i,j) ) * em0(i_clearsky)
2086 ep(rd_kmax+1,i,j) = 0.0_rp
2096 do direction = i_sfc2toa, i_toa2sfc
2098 if ( direction == i_sfc2toa )
then 2105 r12pls(rd_kmax+1,i,j) = r(rd_kmax+1,i,j)
2106 e12mns(rd_kmax+1,i,j) = em(rd_kmax+1,i,j)
2115 do k = rd_kmax, 1, -1
2116 r12pls(k,i,j) = r(k,i,j) + t(k,i,j) / ( 1.0_rp - r12pls(k+1,i,j) * r(k,i,j) ) &
2117 * ( r12pls(k+1,i,j) * t(k,i,j) )
2118 e12mns(k,i,j) = em(k,i,j) + t(k,i,j) / ( 1.0_rp - r12pls(k+1,i,j) * r(k,i,j) ) &
2119 * ( r12pls(k+1,i,j) * ep(k,i,j) + e12mns(k+1,i,j) )
2131 r12mns(1,i,j) = r(1,i,j)
2132 e12pls(1,i,j) = ep(1,i,j)
2142 r12mns(k,i,j) = r(k,i,j) + t(k,i,j) / ( 1.0_rp - r12mns(k-1,i,j) * r(k,i,j) ) &
2143 * ( r12mns(k-1,i,j) *t(k,i,j) )
2144 e12pls(k,i,j) = ep(k,i,j) + t(k,i,j) / ( 1.0_rp - r12mns(k-1,i,j) * r(k,i,j) ) &
2145 * ( r12mns(k-1,i,j)*em(k,i,j) + e12pls(k-1,i,j) )
2168 upls = ( e12pls(k-1,i,j) + r12mns(k-1,i,j)*e12mns(k,i,j) ) / ( 1.0_rp - r12mns(k-1,i,j)*r12pls(k,i,j) )
2170 umns = e12mns(k,i,j) + r12pls(k,i,j) * upls
2172 flux(k,i,j,
i_up,icloud) = wscale_irgn * umns
2173 flux(k,i,j,
i_dn,icloud) = wscale_irgn * upls + flux_direct(k,i,j,icloud)
2184 end subroutine rd_mstrn_two_stream
2188 subroutine rd_albedo_ocean( &
2194 real(RP),
intent(in) :: cosSZA (
ia,
ja)
2195 real(RP),
intent(in) :: tau (
ia,
ja)
2196 real(RP),
intent(out) :: albedo_ocean(
ia,
ja,2)
2198 real(RP) :: am1, tr1, s
2209 am1 = max( min( cossza(i,j), 0.961_rp ), 0.0349_rp )
2211 sw = 0.5_rp + sign(0.5_rp,tau(i,j))
2213 tr1 = max( min( am1 / ( 4.0_rp * tau(i,j) ), 1.0_rp ), 0.05_rp )
2218 s = s + c_ocean_albedo(n,1) * tr1**(n-1) &
2219 + c_ocean_albedo(n,2) * tr1**(n-1) * am1 &
2220 + c_ocean_albedo(n,3) * tr1**(n-1) * am1*am1
2223 albedo_ocean(i,j,
i_sw) = ( 1.0_rp-sw ) * 0.05_rp &
2226 albedo_ocean(i,j,
i_lw) = 0.05_rp
2232 end subroutine rd_albedo_ocean
integer, public imax
of computational cells: x
integer, public is
start point of inner domain: x, local
procedure(cf), pointer, public atmos_phy_mp_cloudfraction
module ATMOSPHERE / Physics Radiation
integer, dimension(:), allocatable, public i_ae2rd
integer, public je
end point of inner domain: y, local
real(rp), parameter, public const_ppm
parts par million
real(rp), public const_huge
huge number
module ATMOSPHERE / Saturation adjustment
subroutine, public prc_mpistop
Abort MPI.
module ATMOSPHERE / Physics Aerosol Microphysics
real(rp), public real_basepoint_lat
position of base point in real world [rad,-pi,pi]
logical, public io_l
output log or not? (this process)
module ATMOSPHERE / Physics Cloud Microphysics
subroutine, public atmos_phy_rd_mstrnx(DENS, RHOT, QTRC, CZ, FZ, fact_ocean, fact_land, fact_urban, temp_sfc, albedo_land, solins, cosSZA, flux_rad, flux_rad_top, flux_rad_sfc_dn)
Radiation main.
integer, public ke
end point of inner domain: z, local
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
subroutine, public atmos_phy_rd_mstrnx_setup(RD_TYPE)
Setup.
module ATMOSPHERE / Physics Radiation / Vertical profile
integer, parameter, public i_lw
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
integer, parameter, public i_sw
real(rp), public const_mvap
mass weight (water vapor) [g/mol]
integer, public ia
of x whole cells (local, with HALO)
subroutine, public atmos_phy_rd_profile_setup
Setup.
integer function, public io_get_available_fid()
search & get available file ID
integer, parameter, public i_dn
integer, public ka
of z whole cells (local, with HALO)
procedure(mr), pointer, public atmos_phy_mp_mixingratio
integer, public kmax
of computational cells: z
integer, dimension(:), allocatable, public i_mp2all
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, public js
start point of inner domain: y, local
subroutine, public atmos_phy_rd_profile_setup_zgrid(toa, kmax, kadd, zh, z)
Setup vertical grid for radiation.
procedure(er), pointer, public atmos_phy_mp_effectiveradius
integer, public ks
start point of inner domain: z, local
integer, dimension(:), allocatable, public i_mp2rd
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
module ATMOSPHERE / Thermodynamics
real(rp), dimension(:), pointer, public ae_dens
subroutine, public atmos_phy_rd_profile_read(kmax, ngas, ncfc, naero, real_lat, now_date, zh, z, rhodz, pres, presh, temp, temph, gas, cfc, aerosol_conc, aerosol_radi, cldfrac)
Read profile for radiation.
logical, public io_lnml
output log or not? (for namelist, this process)
procedure(er), pointer, public atmos_phy_ae_effectiveradius
real(rp), public const_pi
pi
module ATMOSPHERE / Physics Radiation
integer, dimension(6), public time_nowdate
current time [YYYY MM DD HH MM SS]
integer, public io_fid_conf
Config file ID.
integer, dimension(:), allocatable, public i_ae2all
integer, public io_fid_log
Log file ID.
real(rp), public const_mdry
mass weight (dry air) [g/mol]
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
real(rp), dimension(:), pointer, public atmos_phy_mp_dens
logical, public atmos_phy_rd_profile_use_climatology
use climatology?
integer, parameter, public i_up
integer, public jmax
of computational cells: y
real(rp), public const_pstd
standard pressure [Pa]
real(rp), public const_eps1
small number
integer, public ja
of y whole cells (local, with HALO)