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 integer,
private :: rd_kadd = 0
66 integer,
private :: rd_kmax
67 integer,
private :: rd_naero
68 integer,
private :: rd_hydro_str
69 integer,
private :: rd_hydro_end
70 integer,
private :: rd_aero_str
71 integer,
private :: rd_aero_end
73 real(RP),
private,
allocatable :: rd_zh (:)
74 real(RP),
private,
allocatable :: rd_z (:)
75 real(RP),
private,
allocatable :: rd_rhodz (:)
76 real(RP),
private,
allocatable :: rd_pres (:)
77 real(RP),
private,
allocatable :: rd_presh (:)
78 real(RP),
private,
allocatable :: rd_temp (:)
79 real(RP),
private,
allocatable :: rd_temph (:)
80 real(RP),
private,
allocatable :: rd_gas (:,:)
81 real(RP),
private,
allocatable :: rd_cfc (:,:)
82 real(RP),
private,
allocatable :: rd_aerosol_conc(:,:)
83 real(RP),
private,
allocatable :: rd_aerosol_radi(:,:)
84 real(RP),
private,
allocatable :: rd_cldfrac (:)
86 integer,
private,
allocatable :: i_mpae2rd (:)
88 character(len=H_LONG),
private :: mstrn_gaspara_inputfile =
'PARAG.29' 89 character(len=H_LONG),
private :: mstrn_aeropara_inputfile =
'PARAPC.29' 90 character(len=H_LONG),
private :: mstrn_hygropara_inputfile =
'VARDATA.RM29' 92 integer,
private :: mstrn_nband = 29
94 integer,
private,
parameter :: mstrn_nstream = 1
95 integer,
private,
parameter :: mstrn_ch_limit = 10
96 integer,
private,
parameter :: mstrn_nflag = 7
97 integer,
private,
parameter :: mstrn_nfitp = 26
98 integer,
private,
parameter :: mstrn_nfitt = 3
100 integer,
private,
parameter :: mstrn_ngas = 7
108 integer,
private,
parameter :: mstrn_ncfc = 28
136 integer,
private,
save :: mstrn_nptype = 11
148 integer,
private,
parameter :: mstrn_nsfc = 7
156 integer,
private,
parameter :: mstrn_nfitplk = 5
157 integer,
private,
parameter :: mstrn_nplkord = 3
158 integer,
private,
parameter :: mstrn_nmoment = 6
159 integer,
private,
save :: mstrn_nradius = 6
160 integer,
private,
parameter :: mstrn_ncloud = 2
162 logical,
private,
save :: atmos_phy_rd_mstrn_only_qci = .false.
165 real(RP),
private,
allocatable :: waveh (:)
167 real(RP),
private,
allocatable :: logfitp (:)
168 real(RP),
private,
allocatable :: fitt (:)
169 real(RP),
private,
allocatable :: logfitt (:)
170 integer,
private,
allocatable :: iflgb (:,:)
171 integer,
private,
allocatable :: nch (:)
172 real(RP),
private,
allocatable :: wgtch (:,:)
173 integer,
private,
allocatable :: ngasabs (:)
174 integer,
private,
allocatable :: igasabs (:,:)
176 real(RP),
private,
allocatable :: akd (:,:,:,:,:)
177 real(RP),
private,
allocatable :: skd (:,:,:,:)
178 real(RP),
private,
allocatable :: acfc (:,:)
180 real(RP),
private,
allocatable :: fitplk (:,:)
181 real(RP),
private,
allocatable :: fsol (:)
182 real(RP),
private :: fsol_tot
183 real(RP),
private,
allocatable :: sfc (:,:)
184 real(RP),
private,
allocatable :: rayleigh(:)
185 real(RP),
private,
allocatable :: qmol (:,:)
186 real(RP),
private,
allocatable :: q (:,:,:,:)
188 integer,
private,
allocatable :: hygro_flag(:)
189 real(RP),
private,
allocatable :: radmode (:,:)
194 integer,
private,
parameter :: i_swlw = 4
195 integer,
private,
parameter :: i_h2o_continuum = 5
196 integer,
private,
parameter :: i_cfc_continuum = 7
198 integer,
private,
parameter :: i_clearsky = 1
199 integer,
private,
parameter :: i_cloud = 2
202 real(RP),
private :: rho_std
204 real(RP),
private :: m(2)
205 real(RP),
private :: w(2)
206 real(RP),
private :: wmns(2), wpls(2)
207 real(RP),
private :: wbar(2), wscale(2)
210 real(RP),
private :: c_ocean_albedo(5,3)
211 data c_ocean_albedo / -2.8108_rp , -1.3651_rp, 2.9210e1_rp, -4.3907e1_rp, 1.8125e1_rp, &
212 6.5626e-1_rp, -8.7253_rp, -2.7749e1_rp, 4.9486e1_rp, -1.8345e1_rp, &
213 -6.5423e-1_rp, 9.9967_rp, 2.7769_rp , -1.7620e1_rp, 7.0838_rp /
232 character(len=*),
intent(in) :: RD_TYPE
234 integer :: ATMOS_PHY_RD_MSTRN_KADD
235 character(len=H_LONG) :: ATMOS_PHY_RD_MSTRN_GASPARA_IN_FILENAME
236 character(len=H_LONG) :: ATMOS_PHY_RD_MSTRN_AEROPARA_IN_FILENAME
237 character(len=H_LONG) :: ATMOS_PHY_RD_MSTRN_HYGROPARA_IN_FILENAME
238 integer :: ATMOS_PHY_RD_MSTRN_nband
239 integer :: ATMOS_PHY_RD_MSTRN_nptype
240 integer :: ATMOS_PHY_RD_MSTRN_nradius
242 namelist / param_atmos_phy_rd_mstrn / &
243 atmos_phy_rd_mstrn_kadd, &
244 atmos_phy_rd_mstrn_gaspara_in_filename, &
245 atmos_phy_rd_mstrn_aeropara_in_filename, &
246 atmos_phy_rd_mstrn_hygropara_in_filename, &
247 atmos_phy_rd_mstrn_nband, &
248 atmos_phy_rd_mstrn_nptype, &
249 atmos_phy_rd_mstrn_nradius, &
250 atmos_phy_rd_mstrn_only_qci
252 integer :: ngas, ncfc
253 integer :: ihydro, iaero
258 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[RADIATION] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 261 if ( rd_type /=
'MSTRNX' )
then 262 write(*,*)
'xxx RD_TYPE is not MSTRNX. Check!' 267 atmos_phy_rd_mstrn_kadd = rd_kadd
268 atmos_phy_rd_mstrn_gaspara_in_filename = mstrn_gaspara_inputfile
269 atmos_phy_rd_mstrn_aeropara_in_filename = mstrn_aeropara_inputfile
270 atmos_phy_rd_mstrn_hygropara_in_filename = mstrn_hygropara_inputfile
271 atmos_phy_rd_mstrn_nband = mstrn_nband
272 atmos_phy_rd_mstrn_nptype = mstrn_nptype
273 atmos_phy_rd_mstrn_nradius = mstrn_nradius
276 read(
io_fid_conf,nml=param_atmos_phy_rd_mstrn,iostat=ierr)
278 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 279 elseif( ierr > 0 )
then 280 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_MSTRN. Check!' 285 rd_kadd = atmos_phy_rd_mstrn_kadd
286 mstrn_gaspara_inputfile = atmos_phy_rd_mstrn_gaspara_in_filename
287 mstrn_aeropara_inputfile = atmos_phy_rd_mstrn_aeropara_in_filename
288 mstrn_hygropara_inputfile = atmos_phy_rd_mstrn_hygropara_in_filename
289 mstrn_nband = atmos_phy_rd_mstrn_nband
290 mstrn_nptype = atmos_phy_rd_mstrn_nptype
291 mstrn_nradius = atmos_phy_rd_mstrn_nradius
294 call rd_mstrn_setup( ngas, &
298 call rd_profile_setup
300 rd_kmax =
kmax + rd_kadd
304 rd_aero_str =
mp_qa + 1
309 allocate( rd_zh(rd_kmax+1) )
310 allocate( rd_z(rd_kmax ) )
312 allocate( rd_rhodz(rd_kmax ) )
313 allocate( rd_pres(rd_kmax ) )
314 allocate( rd_presh(rd_kmax+1) )
315 allocate( rd_temp(rd_kmax ) )
316 allocate( rd_temph(rd_kmax+1) )
318 allocate( rd_gas(rd_kmax,ngas ) )
319 allocate( rd_cfc(rd_kmax,ncfc ) )
320 allocate( rd_aerosol_conc(rd_kmax,rd_naero) )
321 allocate( rd_aerosol_radi(rd_kmax,rd_naero) )
322 allocate( rd_cldfrac(rd_kmax ) )
324 allocate( i_mpae2rd(rd_naero) )
328 i_mpae2rd(ihydro) =
i_mp2rd(ihydro)
336 call rd_profile_setup_zgrid( rd_kmax, rd_kadd, &
340 call rd_profile_read( rd_kmax, &
355 rd_aerosol_conc(:,:), &
356 rd_aerosol_radi(:,:), &
370 temp_sfc, albedo_land, &
388 thermodyn_temp_pres => atmos_thermodyn_temp_pres
390 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq
404 real(RP),
intent(in) :: DENS (
ka,
ia,
ja)
405 real(RP),
intent(in) :: RHOT (
ka,
ia,
ja)
406 real(RP),
intent(in) :: QTRC (
ka,
ia,
ja,
qa)
407 real(RP),
intent(in) :: CZ (
ka,
ia,
ja)
408 real(RP),
intent(in) :: FZ (0:
ka,
ia,
ja)
409 real(RP),
intent(in) :: fact_ocean (
ia,
ja)
410 real(RP),
intent(in) :: fact_land (
ia,
ja)
411 real(RP),
intent(in) :: fact_urban (
ia,
ja)
412 real(RP),
intent(in) :: temp_sfc (
ia,
ja)
413 real(RP),
intent(in) :: albedo_land (
ia,
ja,2)
414 real(RP),
intent(in) :: solins (
ia,
ja)
415 real(RP),
intent(in) :: cosSZA (
ia,
ja)
416 real(RP),
intent(out) :: flux_rad (
ka,
ia,
ja,2,2,2)
417 real(RP),
intent(out) :: flux_rad_top (
ia,
ja,2,2,2)
418 real(RP),
intent(out) :: flux_rad_sfc_dn(
ia,
ja,2,2)
421 real(RP) :: temp (
ka,
ia,
ja)
422 real(RP) :: pres (
ka,
ia,
ja)
423 real(RP) :: qsat (
ka,
ia,
ja)
425 real(RP) :: cldfrac(
ka,
ia,
ja)
430 real(RP),
parameter :: min_cldfrac = 1.e-8_rp
432 real(RP) :: rhodz_merge (rd_kmax,
ia,
ja)
433 real(RP) :: pres_merge (rd_kmax,
ia,
ja)
434 real(RP) :: temp_merge (rd_kmax,
ia,
ja)
435 real(RP) :: temph_merge (rd_kmax+1,
ia,
ja)
437 real(RP) :: gas_merge (rd_kmax,
ia,
ja,mstrn_ngas)
438 real(RP) :: cfc_merge (rd_kmax,
ia,
ja,mstrn_ncfc)
439 real(RP) :: aerosol_conc_merge(rd_kmax,
ia,
ja,rd_naero )
440 real(RP) :: aerosol_radi_merge(rd_kmax,
ia,
ja,rd_naero )
441 real(RP) :: cldfrac_merge (rd_kmax,
ia,
ja)
444 real(RP) :: flux_rad_merge(rd_kmax+1,
ia,
ja,2,2,mstrn_ncloud)
448 integer :: ihydro, iaero, iq
449 integer :: RD_k, k, i, j, v, ic
452 if(
io_l )
write(
io_fid_log,*)
'*** Physics step: Radiation(mstrnX)' 456 call thermodyn_temp_pres( temp(:,:,:), &
462 call saturation_dens2qsat_liq( qsat(:,:,:), &
470 rh(k,i,j) = qtrc(k,i,j,
i_qv) / qsat(k,i,j)
475 call mp_cloudfraction( cldfrac(:,:,:), &
478 call mp_effectiveradius( mp_re(:,:,:,:), &
483 call ae_effectiveradius( ae_re(:,:,:,:), &
487 call mp_mixingratio( mp_qe(:,:,:,:), &
490 if ( atmos_phy_rd_mstrn_only_qci )
then 493 if ( iq /=
i_qc .AND. iq /=
i_qi )
then 495 mp_qe(:,:,:,ihydro) = 0.0_rp
502 if ( rd_profile_use_climatology )
then 503 call rd_profile_read( rd_kmax, &
518 rd_aerosol_conc(:,:), &
519 rd_aerosol_radi(:,:), &
527 temph_merge(rd_k,i,j) = rd_temph(rd_k)
530 temp(
ke+1,i,j) = temp(
ke,i,j)
531 do rd_k = rd_kadd+1, rd_kmax
532 k =
ks + rd_kmax - rd_k
534 temph_merge(rd_k,i,j) = 0.5_rp * ( temp(k,i,j) + temp(k+1,i,j) )
536 temph_merge(rd_kmax+1,i,j) = temp(
ks,i,j)
544 rhodz_merge(rd_k,i,j) = rd_rhodz(rd_k)
545 pres_merge(rd_k,i,j) = rd_pres(rd_k)
546 temp_merge(rd_k,i,j) = rd_temp(rd_k)
549 do rd_k = rd_kadd+1, rd_kmax
550 k =
ks + rd_kmax - rd_k
552 rhodz_merge(rd_k,i,j) = dens(k,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
553 pres_merge(rd_k,i,j) = pres(k,i,j) * 1.e-2_rp
554 temp_merge(rd_k,i,j) = temp(k,i,j)
564 gas_merge(rd_k,i,j,v) = rd_gas(rd_k,v)
572 do rd_k = rd_kadd+1, rd_kmax
573 k =
ks + rd_kmax - rd_k
574 zerosw = sign(0.5_rp, qtrc(k,i,j,
i_qv)-eps) + 0.5_rp
575 gas_merge(rd_k,i,j,1) = qtrc(k,i,j,
i_qv) / mvap * mdry / ppm * zerosw
585 cfc_merge(rd_k,i,j,v) = rd_cfc(rd_k,v)
594 cldfrac_merge(rd_k,i,j) = rd_cldfrac(rd_k)
597 do rd_k = rd_kadd+1, rd_kmax
598 k =
ks + rd_kmax - rd_k
600 cldfrac_merge(rd_k,i,j) = 0.5_rp + sign( 0.5_rp, cldfrac(k,i,j)-min_cldfrac )
610 aerosol_conc_merge(rd_k,i,j,v) = rd_aerosol_conc(rd_k,v)
611 aerosol_radi_merge(rd_k,i,j,v) = rd_aerosol_radi(rd_k,v)
620 do rd_k = rd_kadd+1, rd_kmax
621 k =
ks + rd_kmax - rd_k
623 aerosol_conc_merge(rd_k,i,j,ihydro) = max( mp_qe(k,i,j,ihydro), 0.0_rp ) &
624 / mp_dens(ihydro) * rho_std / ppm
625 aerosol_radi_merge(rd_k,i,j,ihydro) = mp_re(k,i,j,ihydro)
635 do rd_k = rd_kadd+1, rd_kmax
636 k =
ks + rd_kmax - rd_k
638 aerosol_conc_merge(rd_k,i,j,
mp_qa+iaero) = max( qtrc(k,i,j,
i_ae2all(iaero)), 0.0_rp ) &
639 /
ae_dens(iaero) * rho_std / ppm
640 aerosol_radi_merge(rd_k,i,j,
mp_qa+iaero) = ae_re(k,i,j,iaero)
648 do rd_k = rd_kadd+1, rd_kmax
649 aerosol_conc_merge(rd_k,i,j,
mp_qa+iaero) = rd_aerosol_conc(rd_k,
mp_qa+iaero)
650 aerosol_radi_merge(rd_k,i,j,
mp_qa+iaero) = rd_aerosol_radi(rd_k,
mp_qa+iaero)
661 call rd_mstrn_dtrn3( rd_kmax, &
671 rhodz_merge(:,:,:), &
674 temph_merge(:,:,:), &
676 gas_merge(:,:,:,:), &
677 cfc_merge(:,:,:,:), &
678 aerosol_conc_merge(:,:,:,:), &
679 aerosol_radi_merge(:,:,:,:), &
681 cldfrac_merge(:,:,:), &
682 albedo_land(:,:,:), &
686 flux_rad_merge(:,:,:,:,:,:), &
687 flux_rad_sfc_dn(:,:,:,:) )
695 do rd_k = rd_kadd+1, rd_kmax+1
696 k =
ks + rd_kmax - rd_k
698 flux_rad(k,i,j,
i_lw,
i_up,ic) = flux_rad_merge(rd_k,i,j,
i_lw,
i_up,ic)
699 flux_rad(k,i,j,
i_lw,
i_dn,ic) = flux_rad_merge(rd_k,i,j,
i_lw,
i_dn,ic)
700 flux_rad(k,i,j,
i_sw,
i_up,ic) = flux_rad_merge(rd_k,i,j,
i_sw,
i_up,ic)
701 flux_rad(k,i,j,
i_sw,
i_dn,ic) = flux_rad_merge(rd_k,i,j,
i_sw,
i_dn,ic)
724 subroutine rd_mstrn_setup( &
734 integer,
intent(out) :: ngas
735 integer,
intent(out) :: ncfc
737 integer :: nband, nstream, nfitP, nfitT, nflag
738 integer :: nsfc, nptype, nplkord, nfitPLK
741 character(len=H_LONG) :: dummy
744 integer :: iw, ich, ip, it, igas, icfc, iptype, im
751 allocate( waveh(mstrn_nband+1) )
752 allocate( logfitp(mstrn_nfitp) )
753 allocate( fitt(mstrn_nfitt) )
754 allocate( logfitt(mstrn_nfitt) )
756 allocate( iflgb(mstrn_nflag, mstrn_nband) )
757 allocate( nch( mstrn_nband) )
758 allocate( wgtch(mstrn_ch_limit,mstrn_nband) )
759 allocate( ngasabs( mstrn_nband) )
760 allocate( igasabs(mstrn_ngas, mstrn_nband) )
762 allocate( akd(mstrn_ch_limit,mstrn_nfitp,mstrn_nfitt,mstrn_ngas,mstrn_nband) )
763 allocate( skd(mstrn_ch_limit,mstrn_nfitp,mstrn_nfitt, mstrn_nband) )
764 allocate( acfc(mstrn_ncfc,mstrn_nband) )
768 file = trim(mstrn_gaspara_inputfile), &
769 form =
'formatted', &
773 if ( ierr /= 0 )
then 774 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_gaspara_inputfile)
779 read(fid,*) nband, nstream, nfitp, nfitt, nflag, ncfc
781 if ( nband /= mstrn_nband )
then 782 write(*,*)
'xxx Inconsistent parameter value! nband(given,file)=', mstrn_nband, nband
785 if ( nstream /= mstrn_nstream )
then 786 write(*,*)
'xxx Inconsistent parameter value! nstream(given,file)=', mstrn_nstream, nstream
789 if ( nfitp /= mstrn_nfitp )
then 790 write(*,*)
'xxx Inconsistent parameter value! nfitP(given,file)=', mstrn_nfitp, nfitp
793 if ( nfitt /= mstrn_nfitt )
then 794 write(*,*)
'xxx Inconsistent parameter value! nfitT(given,file)=', mstrn_nfitt, nfitt
797 if ( nflag /= mstrn_nflag )
then 798 write(*,*)
'xxx Inconsistent parameter value! nflag(given,file)=', mstrn_nflag, nflag
801 if ( ncfc /= mstrn_ncfc )
then 802 write(*,*)
'xxx Inconsistent parameter value! ncfc(given,file)=', mstrn_ncfc, ncfc
811 read(fid,*) logfitp(:)
816 logfitt(:) = log10( fitt(:) )
819 do iw = 1, mstrn_nband
823 read(fid,*) iflgb(:,iw)
829 read(fid,*) (wgtch(ich,iw),ich=1,nch(iw))
832 read(fid,*) ngasabs(iw)
835 if ( ngasabs(iw) > 0 )
then 836 do igas = 1, ngasabs(iw)
837 read(fid,*) igasabs(igas,iw)
838 do it = 1, mstrn_nfitt
839 do ip = 1, mstrn_nfitp
840 read(fid,*) (akd(ich,ip,it,igasabs(igas,iw),iw),ich=1,nch(iw))
847 if ( iflgb(i_h2o_continuum,iw) > 0 )
then 849 do it = 1, mstrn_nfitt
850 do ip = 1, mstrn_nfitp
851 read(fid,*) (skd(ich,ip,it,iw),ich=1,nch(iw))
857 if ( iflgb(i_cfc_continuum,iw) > 0 )
then 859 read(fid,*) (acfc(icfc,iw),icfc=1,mstrn_ncfc)
869 allocate( fitplk(mstrn_nfitplk,mstrn_nband) )
870 allocate( fsol( mstrn_nband) )
871 allocate( sfc(mstrn_nsfc, mstrn_nband) )
872 allocate( rayleigh( mstrn_nband) )
874 allocate( qmol( mstrn_nmoment,mstrn_nband) )
875 allocate( q(mstrn_nradius+1,mstrn_nptype,mstrn_nmoment,mstrn_nband) )
876 q(mstrn_nradius+1,:,:,:) = 0.d0
879 file = trim(mstrn_aeropara_inputfile), &
880 form =
'formatted', &
884 if ( ierr /= 0 )
then 885 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_aeropara_inputfile)
890 read(fid,*) nband, nsfc, nptype, nstream, nplkord, nfitplk
892 if ( nband /= mstrn_nband )
then 893 write(*,*)
'xxx Inconsistent parameter value! nband(given,file)=', mstrn_nband, nband
896 if ( nsfc /= mstrn_nsfc )
then 897 write(*,*)
'xxx Inconsistent parameter value! nsfc(given,file)=', mstrn_nsfc, nsfc
900 if ( nptype /= mstrn_nptype )
then 901 write(*,*)
'xxx Inconsistent parameter value! nptype(given,file)=', mstrn_nptype, nptype
904 if ( nstream /= mstrn_nstream )
then 905 write(*,*)
'xxx Inconsistent parameter value! nstream(given,file)=', mstrn_nstream, nstream
908 if ( nplkord /= mstrn_nplkord )
then 909 write(*,*)
'xxx Inconsistent parameter value! nplkord(given,file)=', mstrn_nplkord, nplkord
912 if ( nfitplk /= mstrn_nfitplk )
then 913 write(*,*)
'xxx Inconsistent parameter value! nfitPLK(given,file)=', mstrn_nfitplk, nfitplk
922 do iw = 1, mstrn_nband
926 read(fid,*) fitplk(:,iw)
932 read(fid,*) sfc(:,iw)
935 read(fid,*) rayleigh(iw)
939 do im = 1, mstrn_nmoment
941 read(fid,*) qmol(im,iw)
943 do iptype = 1, nptype
944 read(fid,*) q(1:mstrn_nradius,iptype,im,iw)
953 do iw = 1, mstrn_nband
954 fsol_tot = fsol_tot + fsol(iw)
960 allocate( hygro_flag(mstrn_nptype) )
961 allocate( radmode(mstrn_nptype,mstrn_nradius) )
964 file = trim(mstrn_hygropara_inputfile), &
965 form =
'formatted', &
969 if ( ierr /= 0 )
then 970 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_hygropara_inputfile)
976 if ( nptype /= mstrn_nptype )
then 977 write(*,*)
'xxx Inconsistent parameter value! nptype(given,file)=', mstrn_nptype, nptype
981 do iptype = 1, nptype
983 read(fid,*) hygro_flag(iptype), nradius
985 if ( nradius /= mstrn_nradius )
then 986 write(*,*)
'xxx Inconsistent parameter value! nradius(given,file)=', mstrn_nradius, nradius
990 read(fid,*) radmode(iptype,:)
997 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.7)')
'*** Baseline of total solar insolation : ', fsol_tot
1000 rho_std = pstd / ( rdry * tem00 )
1002 m(
i_sw) = 1.0_rp / sqrt(3.0_rp)
1006 m(
i_lw) = 1.0_rp / 1.66_rp
1010 wmns(:) = sqrt( w(:) / m(:) )
1011 wpls(:) = sqrt( w(:) * m(:) )
1012 wscale(:) = wpls(:) / wbar(:)
1022 end subroutine rd_mstrn_setup
1026 subroutine rd_mstrn_dtrn3( &
1062 integer,
intent(in) :: rd_kmax
1063 integer,
intent(in) :: ngas
1064 integer,
intent(in) :: ncfc
1065 integer,
intent(in) :: naero
1066 integer,
intent(in) :: hydro_str
1067 integer,
intent(in) :: hydro_end
1068 integer,
intent(in) :: aero_str
1069 integer,
intent(in) :: aero_end
1070 real(RP),
intent(in) :: solins (
ia,
ja)
1071 real(RP),
intent(in) :: cosSZA (
ia,
ja)
1072 real(RP),
intent(in) :: rhodz (rd_kmax ,
ia,
ja)
1073 real(RP),
intent(in) :: pres (rd_kmax ,
ia,
ja)
1074 real(RP),
intent(in) :: temp (rd_kmax ,
ia,
ja)
1075 real(RP),
intent(in) :: temph (rd_kmax+1,
ia,
ja)
1076 real(RP),
intent(in) :: temp_sfc (
ia,
ja)
1077 real(RP),
intent(in) :: gas (rd_kmax,
ia,
ja,ngas )
1078 real(RP),
intent(in) :: cfc (rd_kmax,
ia,
ja,ncfc )
1079 real(RP),
intent(in) :: aerosol_conc(rd_kmax,
ia,
ja,naero)
1080 real(RP),
intent(in) :: aerosol_radi(rd_kmax,
ia,
ja,naero)
1081 integer,
intent(in) :: aero2ptype (naero)
1082 real(RP),
intent(in) :: cldfrac (rd_kmax,
ia,
ja)
1083 real(RP),
intent(in) :: albedo_land (
ia,
ja,2)
1084 real(RP),
intent(in) :: fact_ocean (
ia,
ja)
1085 real(RP),
intent(in) :: fact_land (
ia,
ja)
1086 real(RP),
intent(in) :: fact_urban (
ia,
ja)
1087 real(RP),
intent(out) :: rflux (rd_kmax+1,
ia,
ja,2,2,mstrn_ncloud)
1088 real(RP),
intent(out) :: rflux_sfc_dn(
ia,
ja,2,2)
1091 real(RP) :: dz_std (rd_kmax,
ia,
ja)
1092 real(RP) :: logP (rd_kmax,
ia,
ja)
1093 real(RP) :: logT (rd_kmax,
ia,
ja)
1094 integer :: indexP (rd_kmax,
ia,
ja)
1095 real(RP) :: factP (rd_kmax,
ia,
ja)
1096 real(RP) :: factT32(rd_kmax,
ia,
ja)
1097 real(RP) :: factT21(rd_kmax,
ia,
ja)
1098 integer :: indexR (rd_kmax,
ia,
ja,naero)
1099 real(RP) :: factR (rd_kmax,
ia,
ja,naero)
1102 real(RP) :: tauGAS(rd_kmax,
ia,
ja,mstrn_ch_limit)
1103 real(RP) :: A1, A2, A3, factPT
1104 real(RP) :: qv, length
1108 real(RP) :: tauPR (rd_kmax,
ia,
ja,mstrn_ncloud)
1109 real(RP) :: omgPR (rd_kmax,
ia,
ja,mstrn_ncloud)
1110 real(RP) :: optparam(rd_kmax,
ia,
ja,mstrn_nmoment,mstrn_ncloud)
1111 real(RP) :: q_fit, dp_P
1114 real(RP) :: albedo_sfc (
ia,
ja,mstrn_ncloud)
1119 real(RP) :: bbar (rd_kmax ,
ia,
ja)
1120 real(RP) :: bbarh(rd_kmax+1,
ia,
ja)
1121 real(RP) :: b_sfc(
ia,
ja)
1122 real(RP) :: wl, beta
1125 real(RP) :: tau(rd_kmax,
ia,
ja, mstrn_ncloud)
1126 real(RP) :: omg(rd_kmax,
ia,
ja, mstrn_ncloud)
1127 real(RP) :: g (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1131 real(RP) :: b (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1132 real(RP) :: fsol_rgn(
ia,
ja)
1134 real(RP) :: flux (rd_kmax+1,
ia,
ja,2,mstrn_ncloud)
1135 real(RP) :: flux_direct(rd_kmax+1,
ia,
ja ,mstrn_ncloud)
1140 integer :: ip, ir, irgn
1141 integer :: igas, icfc, iaero, iptype
1142 integer :: iw, ich, iplk, icloud, im
1162 dz_std(k,i,j) = rhodz(k,i,j) / rho_std * 100.0_rp
1176 logp(k,i,j) = log10( pres(k,i,j) )
1177 logt(k,i,j) = log10( temp(k,i,j) )
1190 indexp(k,i,j) = mstrn_nfitp
1192 do ip = mstrn_nfitp, 2, -1
1193 if( logp(k,i,j) >= logfitp(ip) ) indexp(k,i,j) = ip
1210 factp(k,i,j) = ( logp(k,i,j) - logfitp(ip-1) ) / ( logfitp(ip) - logfitp(ip-1) )
1212 factt32(k,i,j) = ( logt(k,i,j) - logfitt(2) ) / ( logfitt(3) - logfitt(2) ) &
1213 * ( temp(k,i,j) - fitt(1) ) / ( fitt(3) - fitt(1) )
1214 factt21(k,i,j) = ( logt(k,i,j) - logfitt(2) ) / ( logfitt(2) - logfitt(1) ) &
1215 * ( fitt(3) - temp(k,i,j) ) / ( fitt(3) - fitt(1) )
1223 iptype = aero2ptype(iaero)
1232 if ( aerosol_radi(k,i,j,iaero) <= radmode(iptype,1) )
then 1235 indexr(k,i,j,iaero) = ir
1236 factr(k,i,j,iaero) = ( aerosol_radi(k,i,j,iaero) - radmode(iptype,ir) ) &
1237 / ( radmode(iptype,ir+1) - radmode(iptype,ir) )
1239 elseif( aerosol_radi(k,i,j,iaero) > radmode(iptype,mstrn_nradius) )
then 1244 indexr(k,i,j,iaero) = ir
1245 factr(k,i,j,iaero) = 1.0_rp
1249 indexr(k,i,j,iaero) = -1
1250 do ir = 1, mstrn_nradius-1
1251 if ( aerosol_radi(k,i,j,iaero) <= radmode(iptype,ir+1) &
1252 .AND. aerosol_radi(k,i,j,iaero) > radmode(iptype,ir ) )
then 1254 indexr(k,i,j,iaero) = ir
1255 factr(k,i,j,iaero) = ( aerosol_radi(k,i,j,iaero) - radmode(iptype,ir) ) &
1256 / ( radmode(iptype,ir+1) - radmode(iptype,ir) )
1261 if ( indexr(k,i,j,iaero) == -1 )
then 1262 write(*,*)
'xxx invalid index', k,i,j, iaero, aerosol_radi(k,i,j,iaero)
1274 rflux(:,:,:,:,:,:) = 0.0_rp
1275 rflux_sfc_dn(:,:,:,:) = 0.0_rp
1280 do iw = 1, mstrn_nband
1281 irgn = iflgb(i_swlw,iw) + 1
1294 taugas(k,i,j,ich) = 0.0_rp
1302 do igas = 1, ngasabs(iw)
1303 gasno = igasabs(igas,iw)
1315 length = gas(k,i,j,igasabs(igas,iw)) * ppm * dz_std(k,i,j)
1319 a1 = akd(ich,ip-1,1,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1320 + akd(ich,ip ,1,gasno,iw) * ( factp(k,i,j) )
1321 a2 = akd(ich,ip-1,2,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1322 + akd(ich,ip ,2,gasno,iw) * ( factp(k,i,j) )
1323 a3 = akd(ich,ip-1,3,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1324 + akd(ich,ip ,3,gasno,iw) * ( factp(k,i,j) )
1326 factpt = factt32(k,i,j)*(a3-a2) + a2 + factt21(k,i,j)*(a2-a1)
1328 taugas(k,i,j,ich) = taugas(k,i,j,ich) + 10.0_rp**factpt * length
1337 if ( iflgb(i_h2o_continuum,iw) == 1 )
then 1348 qv = gas(k,i,j,1) * ppm * dz_std(k,i,j)
1349 length = qv*qv / ( qv + dz_std(k,i,j) )
1353 a1 = skd(ich,ip-1,1,iw) * ( 1.0_rp-factp(k,i,j) )&
1354 + skd(ich,ip ,1,iw) * ( factp(k,i,j) )
1355 a2 = skd(ich,ip-1,2,iw) * ( 1.0_rp-factp(k,i,j) )&
1356 + skd(ich,ip ,2,iw) * ( factp(k,i,j) )
1357 a3 = skd(ich,ip-1,3,iw) * ( 1.0_rp-factp(k,i,j) )&
1358 + skd(ich,ip ,3,iw) * ( factp(k,i,j) )
1360 factpt = factt32(k,i,j)*(a3-a2) + a2 + factt21(k,i,j)*(a2-a1)
1362 taugas(k,i,j,ich) = taugas(k,i,j,ich) + 10.0_rp**factpt * length
1370 if ( iflgb(i_cfc_continuum,iw) == 1 )
then 1381 valsum = valsum + 10.0_rp**acfc(icfc,iw) * cfc(k,i,j,icfc)
1383 valsum = valsum * ppm * dz_std(k,i,j)
1387 taugas(k,i,j,ich) = taugas(k,i,j,ich) + valsum
1409 dp_p = rhodz(k,i,j) * grav / pstd
1410 length = rayleigh(iw) * dp_p
1413 do im = 1, mstrn_nstream*2+2
1414 optparam(k,i,j,im,i_cloud ) = qmol(im,iw) * length
1415 optparam(k,i,j,im,i_clearsky) = qmol(im,iw) * length
1423 do iaero = hydro_str, hydro_end
1424 iptype = aero2ptype(iaero)
1433 ir = indexr(k,i,j,iaero)
1435 length = aerosol_conc(k,i,j,iaero) * ppm * dz_std(k,i,j)
1438 do im = 1, mstrn_nstream*2+2
1439 q_fit = q(ir ,iptype,im,iw) * ( 1.0_rp-factr(k,i,j,iaero) ) &
1440 + q(ir+1,iptype,im,iw) * ( factr(k,i,j,iaero) )
1442 optparam(k,i,j,im,i_cloud) = optparam(k,i,j,im,i_cloud) + q_fit * length
1451 do iaero = aero_str, aero_end
1452 iptype = aero2ptype(iaero)
1461 ir = indexr(k,i,j,iaero)
1463 length = aerosol_conc(k,i,j,iaero) * ppm * dz_std(k,i,j)
1466 do im = 1, mstrn_nstream*2+2
1467 q_fit = q(ir ,iptype,im,iw) * ( 1.0_rp-factr(k,i,j,iaero) ) &
1468 + q(ir+1,iptype,im,iw) * ( factr(k,i,j,iaero) )
1470 optparam(k,i,j,im,i_cloud ) = optparam(k,i,j,im,i_cloud ) + q_fit * length
1471 optparam(k,i,j,im,i_clearsky) = optparam(k,i,j,im,i_clearsky) + q_fit * length
1479 do icloud = 1, mstrn_ncloud
1487 taupr(k,i,j,icloud) = optparam(k,i,j,1,icloud)
1488 omgpr(k,i,j,icloud) = optparam(k,i,j,1,icloud) - optparam(k,i,j,2,icloud)
1491 zerosw = 0.5_rp - sign(0.5_rp,omgpr(k,i,j,icloud)-rd_eps)
1493 g(k,i,j,0,icloud) = 1.0_rp
1494 g(k,i,j,1,icloud) = optparam(k,i,j,3,icloud) * ( 1.0_rp-zerosw ) / ( omgpr(k,i,j,icloud)+zerosw )
1495 g(k,i,j,2,icloud) = optparam(k,i,j,4,icloud) * ( 1.0_rp-zerosw ) / ( omgpr(k,i,j,icloud)+zerosw )
1508 do icloud = 1, mstrn_ncloud
1534 albedo_sfc(i,j,icloud) = albedo_land(i,j,irgn)
1555 tau(k,i,j,icloud) = taugas(k,i,j,ich) + taupr(k,i,j,icloud)
1558 zerosw = 0.5_rp - sign( 0.5_rp, tau(k,i,j,icloud)-rd_eps )
1560 omg(k,i,j,icloud) = ( 1.0_rp-zerosw ) * omgpr(k,i,j,icloud) / ( tau(k,i,j,icloud)-zerosw ) &
1561 + ( zerosw ) * 1.0_rp
1571 if ( irgn ==
i_sw )
then 1582 b(k,i,j,0,icloud) = 0.0_rp
1583 b(k,i,j,1,icloud) = 0.0_rp
1584 b(k,i,j,2,icloud) = 0.0_rp
1597 fsol_rgn(i,j) = fsol(iw) / fsol_tot * solins(i,j)
1602 elseif( irgn ==
i_lw )
then 1604 wl = 10000.0_rp / sqrt( waveh(iw) * waveh(iw+1) )
1616 do iplk = mstrn_nfitplk, 1, -1
1617 beta = beta / ( wl*temp(k,i,j) ) + fitplk(iplk,iw)
1620 bbar(k,i,j) = exp(-beta) * temp(k,i,j) / (wl*wl)
1636 do iplk = mstrn_nfitplk, 1, -1
1637 beta = beta / ( wl*temph(k,i,j) ) + fitplk(iplk,iw)
1640 bbarh(k,i,j) = exp(-beta) * temph(k,i,j) / (wl*wl)
1654 zerosw = 0.5_rp - sign( 0.5_rp, tau(k,i,j,icloud)-rd_eps )
1656 b(k,i,j,0,icloud) = bbarh(k,i,j)
1657 b(k,i,j,1,icloud) = ( 1.0_rp-zerosw ) &
1658 * ( - bbarh(k+1,i,j) &
1659 + 4.0_rp * bbar(k ,i,j) &
1660 - 3.0_rp * bbarh(k ,i,j) &
1661 ) / ( tau(k,i,j,icloud)-zerosw )
1662 b(k,i,j,2,icloud) = ( 1.0_rp-zerosw ) &
1663 * ( + bbarh(k+1,i,j) &
1664 - 2.0_rp * bbar(k ,i,j) &
1666 ) / ( tau(k,i,j,icloud)*tau(k,i,j,icloud)-zerosw ) * 2.0_rp
1681 do iplk = mstrn_nfitplk, 1, -1
1682 beta = beta / ( wl*temp_sfc(i,j) ) + fitplk(iplk,iw)
1685 b_sfc(i,j) = exp(-beta) * temp_sfc(i,j) / (wl*wl)
1696 fsol_rgn(i,j) = 0.0_rp
1712 call rd_mstrn_two_stream( rd_kmax, &
1722 albedo_sfc(:,:,:), &
1725 flux_direct(:,:,:,:) )
1736 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)
1737 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)
1746 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)
1747 rflux_sfc_dn(i,j,irgn,2) = rflux_sfc_dn(i,j,irgn,2) &
1748 + ( flux(rd_kmax+1,i,j,
i_dn,i_cloud) - flux_direct(rd_kmax+1,i,j,i_cloud) ) * wgtch(ich,iw)
1766 end subroutine rd_mstrn_dtrn3
1770 subroutine rd_mstrn_two_stream( &
1792 integer,
intent(in) :: rd_kmax
1793 integer,
intent(in) :: iw, ich
1794 real(RP),
intent(in) :: cosSZA0 (
ia,
ja)
1795 real(RP),
intent(in) :: fsol (
ia,
ja)
1796 integer,
intent(in) :: irgn
1797 real(RP),
intent(in) :: tau (rd_kmax,
ia,
ja, mstrn_ncloud)
1798 real(RP),
intent(in) :: omg (rd_kmax,
ia,
ja, mstrn_ncloud)
1799 real(RP),
intent(in) :: g (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1800 real(RP),
intent(in) :: b (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1801 real(RP),
intent(in) :: b_sfc (
ia,
ja)
1802 real(RP),
intent(in) :: albedo_sfc (
ia,
ja,mstrn_ncloud)
1803 real(RP),
intent(in) :: cldfrac (rd_kmax,
ia,
ja)
1805 real(RP),
intent(out) :: flux (rd_kmax+1,
ia,
ja,2,mstrn_ncloud)
1806 real(RP),
intent(out) :: flux_direct(rd_kmax+1,
ia,
ja, mstrn_ncloud)
1818 real(RP) :: Pmns, Ppls
1819 real(RP) :: Smns, Spls
1822 real(RP) :: cosSZA(
ia,
ja)
1826 real(RP) :: Apls_mns, Bpls_mns
1827 real(RP) :: V0mns, V0pls
1828 real(RP) :: V1mns, V1pls
1829 real(RP) :: Dmns0, Dmns1, Dmns2
1830 real(RP) :: Dpls0, Dpls1, Dpls2
1831 real(RP) :: SIGmns, SIGpls
1833 real(RP) :: zerosw, tmp
1836 real(RP) :: Tdir0(rd_kmax,
ia,
ja,mstrn_ncloud)
1837 real(RP) :: R0 (rd_kmax,
ia,
ja,mstrn_ncloud)
1838 real(RP) :: T0 (rd_kmax,
ia,
ja,mstrn_ncloud)
1839 real(RP) :: Em_LW(rd_kmax,
ia,
ja,mstrn_ncloud)
1840 real(RP) :: Em_SW(rd_kmax,
ia,
ja,mstrn_ncloud)
1841 real(RP) :: Ep_LW(rd_kmax,
ia,
ja,mstrn_ncloud)
1842 real(RP) :: Ep_SW(rd_kmax,
ia,
ja,mstrn_ncloud)
1845 real(RP) :: cf (rd_kmax ,
ia,
ja)
1846 real(RP) :: tau_bar_sol(rd_kmax+1,
ia,
ja)
1847 real(RP) :: Tdir (rd_kmax+1,
ia,
ja)
1848 real(RP) :: R (rd_kmax+1,
ia,
ja)
1849 real(RP) :: T (rd_kmax+1,
ia,
ja)
1850 real(RP) :: Em (rd_kmax+1,
ia,
ja)
1851 real(RP) :: Ep (rd_kmax+1,
ia,
ja)
1854 real(RP) :: R12mns(rd_kmax+1,
ia,
ja)
1855 real(RP) :: R12pls(rd_kmax+1,
ia,
ja)
1856 real(RP) :: E12mns(rd_kmax+1,
ia,
ja)
1857 real(RP) :: E12pls(rd_kmax+1,
ia,
ja)
1858 real(RP) :: Umns, Upls
1860 real(RP) :: Em0(mstrn_ncloud)
1862 real(RP) :: Wmns_irgn, M_irgn, W_irgn, Wpls_irgn, Wscale_irgn
1864 integer,
parameter :: I_SFC2TOA = 1
1865 integer,
parameter :: I_TOA2SFC = 2
1866 integer :: direction
1869 integer :: k, i, j, icloud
1875 wmns_irgn = wmns(irgn)
1876 wpls_irgn = wpls(irgn)
1877 wscale_irgn = wscale(irgn)
1900 k = 1 + mod(kij-1, rd_kmax)
1901 i =
is + mod((kij-1)/rd_kmax,
imax)
1902 j =
js + (kij-1)/(rd_kmax*
imax)
1905 tau_new = ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) ) * tau(k,i,j,icloud)
1907 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)
1908 omg_new = min( omg_new, eps1 )
1910 g_new = ( g(k,i,j,1,icloud) - g(k,i,j,2,icloud) ) / ( 1.0_rp - g(k,i,j,2,icloud) )
1912 tdir0(k,i,j,icloud) = exp(-tau_new/cossza(i,j))
1914 factor = ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) )
1915 b_new0 = b(k,i,j,0,icloud)
1916 b_new1 = b(k,i,j,1,icloud) / factor
1917 b_new2 = b(k,i,j,2,icloud) / (factor*factor)
1918 c0 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new0
1919 c1 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new1
1920 c2 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new2
1923 pmns = omg_new * 0.5_rp * ( 1.0_rp - 3.0_rp * g_new * m_irgn*m_irgn )
1924 ppls = omg_new * 0.5_rp * ( 1.0_rp + 3.0_rp * g_new * m_irgn*m_irgn )
1927 smns = omg_new * 0.5_rp * ( 1.0_rp - 3.0_rp * g_new * m_irgn*cossza(i,j) )
1928 spls = omg_new * 0.5_rp * ( 1.0_rp + 3.0_rp * g_new * m_irgn*cossza(i,j) )
1931 sw = 0.5_rp + sign(0.5_rp,tau_new-rd_eps)
1932 tau_new = max( tau_new, rd_eps )
1935 x = ( 1.0_rp - w_irgn * ( ppls - pmns ) ) / m_irgn
1936 y = ( 1.0_rp - w_irgn * ( ppls + pmns ) ) / m_irgn
1940 e = exp(-lamda*tau_new)
1943 apls_mns = ( x * ( 1.0_rp+e ) - lamda * ( 1.0_rp-e ) ) &
1944 / ( x * ( 1.0_rp+e ) + lamda * ( 1.0_rp-e ) )
1945 bpls_mns = ( x * ( 1.0_rp-e ) - lamda * ( 1.0_rp+e ) ) &
1946 / ( x * ( 1.0_rp-e ) + lamda * ( 1.0_rp+e ) )
1949 r0(k,i,j,icloud) = ( sw ) * 0.5_rp * ( apls_mns + bpls_mns ) &
1950 + ( 1.0_rp-sw ) * ( tau_new * ( pmns ) / m_irgn )
1951 t0(k,i,j,icloud) = ( sw ) * 0.5_rp * ( apls_mns - bpls_mns ) &
1952 + ( 1.0_rp-sw ) * ( 1.0_rp - tau_new * ( 1.0_rp - ppls ) / m_irgn )
1955 dmns0 = c0 / y + 2.0_rp * c2 / (x*y*y) + c1 / (x*y)
1956 dpls0 = c0 / y + 2.0_rp * c2 / (x*y*y) - c1 / (x*y)
1957 dmns1 = c1 / y + 2.0_rp * c2 / (x*y)
1958 dpls1 = c1 / y - 2.0_rp * c2 / (x*y)
1964 v1mns = dmns0 + dmns1*tau_new + dmns2*tau_new*tau_new
1965 v1pls = dpls0 + dpls1*tau_new + dpls2*tau_new*tau_new
1967 em_lw(k,i,j,icloud) = ( sw ) * ( v0mns - r0(k,i,j,icloud) * v0pls - t0(k,i,j,icloud) * v1mns ) &
1968 + ( 1.0_rp-sw ) * 0.5_rp * tau_new * ( 2.0_rp*c0 + c1*tau_new + c2*tau_new*tau_new )
1969 ep_lw(k,i,j,icloud) = ( sw ) * ( v1pls - t0(k,i,j,icloud) * v0pls - r0(k,i,j,icloud) * v1mns ) &
1970 + ( 1.0_rp-sw ) * 0.5_rp * tau_new * ( 2.0_rp*c0 + c1*tau_new + c2*tau_new*tau_new )
1973 sigmns = wmns_irgn * ( spls - smns )
1974 sigpls = wmns_irgn * ( spls + smns )
1976 tmp = x*y*cossza(i,j)-1.0/cossza(i,j)
1977 zerosw = 1.0_rp - sign(1.0_rp,abs(tmp)-eps)
1978 qgamma = ( sigpls*x*cossza(i,j) + sigmns ) / ( tmp + zerosw*eps )
1980 v0pls = 0.5_rp * ( ( 1.0_rp + 1.0_rp/(x*cossza(i,j)) ) * qgamma + sigmns / x )
1981 v0mns = 0.5_rp * ( ( 1.0_rp - 1.0_rp/(x*cossza(i,j)) ) * qgamma - sigmns / x )
1983 v1pls = v0pls * tdir0(k,i,j,icloud)
1984 v1mns = v0mns * tdir0(k,i,j,icloud)
1986 em_sw(k,i,j,icloud) = ( sw ) * ( v0mns - r0(k,i,j,icloud) * v0pls - t0(k,i,j,icloud) * v1mns ) &
1987 + ( 1.0_rp-sw ) * wmns_irgn * smns * tau_new * sqrt( tdir0(k,i,j,icloud) )
1988 ep_sw(k,i,j,icloud) = ( sw ) * ( v1pls - t0(k,i,j,icloud) * v0pls - r0(k,i,j,icloud) * v1mns ) &
1989 + ( 1.0_rp-sw ) * wmns_irgn * spls * tau_new * sqrt( tdir0(k,i,j,icloud) )
2003 if ( icloud == 1 )
then 2006 cf(:,:,:) = cldfrac(:,:,:)
2015 tdir(k,i,j) = ( cf(k,i,j) ) * tdir0(k,i,j,i_cloud ) &
2016 + ( 1.0_rp-cf(k,i,j) ) * tdir0(k,i,j,i_clearsky)
2018 r(k,i,j) = ( cf(k,i,j) ) * r0(k,i,j,i_cloud ) &
2019 + ( 1.0_rp-cf(k,i,j) ) * r0(k,i,j,i_clearsky)
2021 t(k,i,j) = ( cf(k,i,j) ) * t0(k,i,j,i_cloud ) &
2022 + ( 1.0_rp-cf(k,i,j) ) * t0(k,i,j,i_clearsky)
2031 tau_bar_sol(1,i,j) = fsol(i,j)
2034 tau_bar_sol(k,i,j) = tau_bar_sol(k-1,i,j) * tdir(k-1,i,j)
2045 em(k,i,j) = ( cf(k,i,j) ) * ( em_lw(k,i,j,i_cloud ) &
2046 + em_sw(k,i,j,i_cloud ) * tau_bar_sol(k,i,j) ) &
2047 + ( 1.0_rp-cf(k,i,j) ) * ( em_lw(k,i,j,i_clearsky) &
2048 + em_sw(k,i,j,i_clearsky) * tau_bar_sol(k,i,j) )
2050 ep(k,i,j) = ( cf(k,i,j) ) * ( ep_lw(k,i,j,i_cloud ) &
2051 + ep_sw(k,i,j,i_cloud ) * tau_bar_sol(k,i,j) ) &
2052 + ( 1.0_rp-cf(k,i,j) ) * ( ep_lw(k,i,j,i_clearsky) &
2053 + ep_sw(k,i,j,i_clearsky) * tau_bar_sol(k,i,j) )
2055 flux_direct(k,i,j,icloud) = cossza(i,j) * tau_bar_sol(k,i,j)
2065 r(rd_kmax+1,i,j) = ( cf(rd_kmax,i,j) ) * albedo_sfc(i,j,i_cloud ) &
2066 + ( 1.0_rp-cf(rd_kmax,i,j) ) * albedo_sfc(i,j,i_clearsky)
2068 t(rd_kmax+1,i,j) = 0.0_rp
2070 flux_direct(rd_kmax+1,i,j,icloud) = cossza(i,j) * tau_bar_sol(rd_kmax+1,i,j)
2072 em0(i_cloud ) = wpls_irgn * ( flux_direct(rd_kmax+1,i,j,icloud) * albedo_sfc(i,j,i_cloud ) / (w_irgn*m_irgn) &
2073 + 2.0_rp * pi * ( 1.0_rp-albedo_sfc(i,j,i_cloud ) ) * b_sfc(i,j) )
2074 em0(i_clearsky) = wpls_irgn * ( flux_direct(rd_kmax+1,i,j,icloud) * albedo_sfc(i,j,i_clearsky) / (w_irgn*m_irgn) &
2075 + 2.0_rp * pi * ( 1.0_rp-albedo_sfc(i,j,i_clearsky) ) * b_sfc(i,j) )
2077 em(rd_kmax+1,i,j) = ( cf(rd_kmax,i,j) ) * em0(i_cloud ) &
2078 + ( 1.0_rp-cf(rd_kmax,i,j) ) * em0(i_clearsky)
2080 ep(rd_kmax+1,i,j) = 0.0_rp
2090 do direction = i_sfc2toa, i_toa2sfc
2092 if ( direction == i_sfc2toa )
then 2099 r12pls(rd_kmax+1,i,j) = r(rd_kmax+1,i,j)
2100 e12mns(rd_kmax+1,i,j) = em(rd_kmax+1,i,j)
2109 do k = rd_kmax, 1, -1
2110 r12pls(k,i,j) = r(k,i,j) + t(k,i,j) / ( 1.0_rp - r12pls(k+1,i,j) * r(k,i,j) ) &
2111 * ( r12pls(k+1,i,j) * t(k,i,j) )
2112 e12mns(k,i,j) = em(k,i,j) + t(k,i,j) / ( 1.0_rp - r12pls(k+1,i,j) * r(k,i,j) ) &
2113 * ( r12pls(k+1,i,j) * ep(k,i,j) + e12mns(k+1,i,j) )
2125 r12mns(1,i,j) = r(1,i,j)
2126 e12pls(1,i,j) = ep(1,i,j)
2136 r12mns(k,i,j) = r(k,i,j) + t(k,i,j) / ( 1.0_rp - r12mns(k-1,i,j) * r(k,i,j) ) &
2137 * ( r12mns(k-1,i,j) *t(k,i,j) )
2138 e12pls(k,i,j) = ep(k,i,j) + t(k,i,j) / ( 1.0_rp - r12mns(k-1,i,j) * r(k,i,j) ) &
2139 * ( r12mns(k-1,i,j)*em(k,i,j) + e12pls(k-1,i,j) )
2162 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) )
2164 umns = e12mns(k,i,j) + r12pls(k,i,j) * upls
2166 flux(k,i,j,
i_up,icloud) = wscale_irgn * umns
2167 flux(k,i,j,
i_dn,icloud) = wscale_irgn * upls + flux_direct(k,i,j,icloud)
2178 end subroutine rd_mstrn_two_stream
2182 subroutine rd_albedo_ocean( &
2188 real(RP),
intent(in) :: cosSZA (
ia,
ja)
2189 real(RP),
intent(in) :: tau (
ia,
ja)
2190 real(RP),
intent(out) :: albedo_ocean(
ia,
ja,2)
2192 real(RP) :: am1, tr1, s
2203 am1 = max( min( cossza(i,j), 0.961_rp ), 0.0349_rp )
2205 sw = 0.5_rp + sign(0.5_rp,tau(i,j))
2207 tr1 = max( min( am1 / ( 4.0_rp * tau(i,j) ), 1.0_rp ), 0.05_rp )
2212 s = s + c_ocean_albedo(n,1) * tr1**(n-1) &
2213 + c_ocean_albedo(n,2) * tr1**(n-1) * am1 &
2214 + c_ocean_albedo(n,3) * tr1**(n-1) * am1*am1
2217 albedo_ocean(i,j,
i_sw) = ( 1.0_rp-sw ) * 0.05_rp &
2220 albedo_ocean(i,j,
i_lw) = 0.05_rp
2226 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
subroutine, public atmos_phy_rd_profile_setup_zgrid(kmax, kadd, zh, z)
Setup vertical grid for radiation.
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
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)