18 #include "inc_openmp.h" 58 private :: rd_mstrn_setup
59 private :: rd_mstrn_dtrn3
60 private :: rd_mstrn_two_stream
61 private :: rd_albedo_ocean
67 real(RP),
private,
parameter :: RD_cosSZA_min = 0.017_rp
68 real(RP),
private,
parameter :: RD_EPS = 1.e-4_rp
70 real(RP),
private :: RD_TOA = 100.0_rp
71 integer,
private :: RD_KADD = 10
72 integer,
private,
parameter :: RD_naero =
n_hyd +
n_ae 73 integer,
private,
parameter :: RD_hydro_str = 1
74 integer,
private,
parameter :: RD_hydro_end =
n_hyd 75 integer,
private,
parameter :: RD_aero_str =
n_hyd + 1
76 integer,
private,
parameter :: RD_aero_end =
n_hyd +
n_ae 78 integer,
private :: RD_KMAX
80 real(RP),
private,
allocatable :: RD_zh (:)
81 real(RP),
private,
allocatable :: RD_z (:)
82 real(RP),
private,
allocatable :: RD_rhodz (:)
83 real(RP),
private,
allocatable :: RD_pres (:)
84 real(RP),
private,
allocatable :: RD_presh (:)
85 real(RP),
private,
allocatable :: RD_temp (:)
86 real(RP),
private,
allocatable :: RD_temph (:)
87 real(RP),
private,
allocatable :: RD_gas (:,:)
88 real(RP),
private,
allocatable :: RD_cfc (:,:)
89 real(RP),
private,
allocatable :: RD_aerosol_conc(:,:)
90 real(RP),
private,
allocatable :: RD_aerosol_radi(:,:)
91 real(RP),
private,
allocatable :: RD_cldfrac (:)
93 integer,
private :: I_MPAE2RD (RD_naero)
94 data i_mpae2rd(1 :
n_hyd ) / 1, 1, 2, 2, 2, 2 /
97 character(len=H_LONG),
private :: MSTRN_GASPARA_INPUTFILE =
'PARAG.29' 98 character(len=H_LONG),
private :: MSTRN_AEROPARA_INPUTFILE =
'PARAPC.29' 99 character(len=H_LONG),
private :: MSTRN_HYGROPARA_INPUTFILE =
'VARDATA.RM29' 101 integer,
private :: MSTRN_nband = 29
103 integer,
private,
parameter :: MSTRN_nstream = 1
104 integer,
private,
parameter :: MSTRN_ch_limit = 10
105 integer,
private,
parameter :: MSTRN_nflag = 7
106 integer,
private,
parameter :: MSTRN_nfitP = 26
107 integer,
private,
parameter :: MSTRN_nfitT = 3
109 integer,
private,
parameter :: MSTRN_ngas = 7
117 integer,
private,
parameter :: MSTRN_ncfc = 28
145 integer,
private :: MSTRN_nptype = 9
156 integer,
private,
parameter :: MSTRN_nsfc = 7
164 integer,
private,
parameter :: MSTRN_nfitPLK = 5
165 integer,
private,
parameter :: MSTRN_nplkord = 3
166 integer,
private,
parameter :: MSTRN_nmoment = 6
167 integer,
private :: MSTRN_nradius = 8
168 integer,
private,
parameter :: MSTRN_ncloud = 2
170 logical,
private :: ATMOS_PHY_RD_MSTRN_ONLY_QCI = .false.
171 logical,
private :: ATMOS_PHY_RD_MSTRN_ONLY_TROPOCLOUD = .false.
175 real(RP),
private,
allocatable :: waveh (:)
177 real(RP),
private,
allocatable :: logfitP (:)
178 real(RP),
private,
allocatable :: fitT (:)
179 real(RP),
private,
allocatable :: logfitT (:)
180 integer,
private,
allocatable :: iflgb (:,:)
181 integer,
private,
allocatable :: nch (:)
182 real(RP),
private,
allocatable :: wgtch (:,:)
183 integer,
private,
allocatable :: ngasabs (:)
184 integer,
private,
allocatable :: igasabs (:,:)
186 real(RP),
private,
allocatable :: akd (:,:,:,:,:)
187 real(RP),
private,
allocatable :: skd (:,:,:,:)
188 real(RP),
private,
allocatable :: acfc (:,:)
190 real(RP),
private,
allocatable :: fitPLK (:,:)
191 real(RP),
private,
allocatable :: fsol (:)
192 real(RP),
private :: fsol_tot
193 real(RP),
private,
allocatable :: sfc (:,:)
194 real(RP),
private,
allocatable :: rayleigh(:)
195 real(RP),
private,
allocatable :: qmol (:,:)
196 real(RP),
private,
allocatable :: q (:,:,:,:)
198 integer,
private,
allocatable :: hygro_flag(:)
199 real(RP),
private,
allocatable :: radmode (:,:)
204 integer,
private,
parameter :: I_SWLW = 4
205 integer,
private,
parameter :: I_H2O_continuum = 5
206 integer,
private,
parameter :: I_CFC_continuum = 7
208 integer,
private,
parameter :: I_ClearSky = 1
209 integer,
private,
parameter :: I_Cloud = 2
212 real(RP),
private :: RHO_std
214 real(RP),
private :: M(2)
215 real(RP),
private :: W(2)
216 real(RP),
private :: Wmns(2), Wpls(2)
217 real(RP),
private :: Wbar(2), Wscale(2)
220 real(RP),
private :: c_ocean_albedo(5,3)
221 data c_ocean_albedo / -2.8108_rp , -1.3651_rp, 2.9210e1_rp, -4.3907e1_rp, 1.8125e1_rp, &
222 6.5626e-1_rp, -8.7253_rp, -2.7749e1_rp, 4.9486e1_rp, -1.8345e1_rp, &
223 -6.5423e-1_rp, 9.9967_rp, 2.7769_rp , -1.7620e1_rp, 7.0838_rp /
246 character(len=*),
intent(in) :: rd_type
248 real(RP) :: atmos_phy_rd_mstrn_toa
249 integer :: atmos_phy_rd_mstrn_kadd
250 character(len=H_LONG) :: atmos_phy_rd_mstrn_gaspara_in_filename
251 character(len=H_LONG) :: atmos_phy_rd_mstrn_aeropara_in_filename
252 character(len=H_LONG) :: atmos_phy_rd_mstrn_hygropara_in_filename
253 integer :: atmos_phy_rd_mstrn_nband
254 integer :: atmos_phy_rd_mstrn_nptype
255 integer :: atmos_phy_rd_mstrn_nradius
257 namelist / param_atmos_phy_rd_mstrn / &
258 atmos_phy_rd_mstrn_toa, &
259 atmos_phy_rd_mstrn_kadd, &
260 atmos_phy_rd_mstrn_gaspara_in_filename, &
261 atmos_phy_rd_mstrn_aeropara_in_filename, &
262 atmos_phy_rd_mstrn_hygropara_in_filename, &
263 atmos_phy_rd_mstrn_nband, &
264 atmos_phy_rd_mstrn_nptype, &
265 atmos_phy_rd_mstrn_nradius, &
266 atmos_phy_rd_mstrn_only_qci, &
267 atmos_phy_rd_mstrn_only_tropocloud
269 integer :: ngas, ncfc
274 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[RADIATION] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 275 if(
io_l )
write(
io_fid_log,*)
'*** Sekiguchi and Nakajima (2008) mstrnX radiation process' 277 if ( rd_type /=
'MSTRNX' )
then 278 write(*,*)
'xxx RD_TYPE is not MSTRNX. Check!' 283 atmos_phy_rd_mstrn_toa = rd_toa
284 atmos_phy_rd_mstrn_kadd = rd_kadd
285 atmos_phy_rd_mstrn_gaspara_in_filename = mstrn_gaspara_inputfile
286 atmos_phy_rd_mstrn_aeropara_in_filename = mstrn_aeropara_inputfile
287 atmos_phy_rd_mstrn_hygropara_in_filename = mstrn_hygropara_inputfile
288 atmos_phy_rd_mstrn_nband = mstrn_nband
289 atmos_phy_rd_mstrn_nptype = mstrn_nptype
290 atmos_phy_rd_mstrn_nradius = mstrn_nradius
293 read(
io_fid_conf,nml=param_atmos_phy_rd_mstrn,iostat=ierr)
295 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 296 elseif( ierr > 0 )
then 297 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_MSTRN. Check!' 302 rd_toa = atmos_phy_rd_mstrn_toa
303 rd_kadd = atmos_phy_rd_mstrn_kadd
304 mstrn_gaspara_inputfile = atmos_phy_rd_mstrn_gaspara_in_filename
305 mstrn_aeropara_inputfile = atmos_phy_rd_mstrn_aeropara_in_filename
306 mstrn_hygropara_inputfile = atmos_phy_rd_mstrn_hygropara_in_filename
307 mstrn_nband = atmos_phy_rd_mstrn_nband
308 mstrn_nptype = atmos_phy_rd_mstrn_nptype
309 mstrn_nradius = atmos_phy_rd_mstrn_nradius
312 call rd_mstrn_setup( ngas, &
316 call rd_profile_setup
318 rd_kmax =
kmax + rd_kadd
322 allocate( rd_zh(rd_kmax+1) )
323 allocate( rd_z(rd_kmax ) )
325 allocate( rd_rhodz(rd_kmax ) )
326 allocate( rd_pres(rd_kmax ) )
327 allocate( rd_presh(rd_kmax+1) )
328 allocate( rd_temp(rd_kmax ) )
329 allocate( rd_temph(rd_kmax+1) )
331 allocate( rd_gas(rd_kmax,ngas ) )
332 allocate( rd_cfc(rd_kmax,ncfc ) )
333 allocate( rd_aerosol_conc(rd_kmax,rd_naero) )
334 allocate( rd_aerosol_radi(rd_kmax,rd_naero) )
335 allocate( rd_cldfrac(rd_kmax ) )
338 call rd_profile_setup_zgrid( rd_toa, rd_kmax, rd_kadd, &
342 call rd_profile_read( rd_kmax, &
357 rd_aerosol_conc(:,:), &
358 rd_aerosol_radi(:,:), &
372 temp_sfc, albedo_land, &
390 thermodyn_temp_pres => atmos_thermodyn_temp_pres
392 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq
415 real(RP),
intent(in) :: dens (
ka,
ia,
ja)
416 real(RP),
intent(in) :: rhot (
ka,
ia,
ja)
417 real(RP),
intent(in) :: qtrc (
ka,
ia,
ja,
qa)
418 real(RP),
intent(in) :: cz (
ka,
ia,
ja)
419 real(RP),
intent(in) :: fz (0:
ka,
ia,
ja)
420 real(RP),
intent(in) :: fact_ocean (
ia,
ja)
421 real(RP),
intent(in) :: fact_land (
ia,
ja)
422 real(RP),
intent(in) :: fact_urban (
ia,
ja)
423 real(RP),
intent(in) :: temp_sfc (
ia,
ja)
424 real(RP),
intent(in) :: albedo_land (
ia,
ja,2)
425 real(RP),
intent(in) :: solins (
ia,
ja)
426 real(RP),
intent(in) :: cossza (
ia,
ja)
427 real(RP),
intent(out) :: flux_rad (
ka,
ia,
ja,2,2,2)
428 real(RP),
intent(out) :: flux_rad_top (
ia,
ja,2,2,2)
429 real(RP),
intent(out) :: flux_rad_sfc_dn(
ia,
ja,2,2)
432 real(RP) :: temp (
ka,
ia,
ja)
433 real(RP) :: pres (
ka,
ia,
ja)
434 real(RP) :: qsat (
ka,
ia,
ja)
436 real(RP) :: cldfrac(
ka,
ia,
ja)
441 integer :: tropopause(
ia,
ja)
444 real(RP),
parameter :: min_cldfrac = 1.e-8_rp
446 real(RP) :: rhodz_merge (rd_kmax,
ia,
ja)
447 real(RP) :: pres_merge (rd_kmax,
ia,
ja)
448 real(RP) :: temp_merge (rd_kmax,
ia,
ja)
449 real(RP) :: temph_merge (rd_kmax+1,
ia,
ja)
451 real(RP) :: gas_merge (rd_kmax,
ia,
ja,mstrn_ngas)
452 real(RP) :: cfc_merge (rd_kmax,
ia,
ja,mstrn_ncfc)
453 real(RP) :: aerosol_conc_merge(rd_kmax,
ia,
ja,rd_naero )
454 real(RP) :: aerosol_radi_merge(rd_kmax,
ia,
ja,rd_naero )
455 real(RP) :: cldfrac_merge (rd_kmax,
ia,
ja)
458 real(RP) :: flux_rad_merge(rd_kmax+1,
ia,
ja,2,2,mstrn_ncloud)
462 integer :: ihydro, iaero
463 integer :: rd_k, k, i, j, v, ic
466 if(
io_l )
write(
io_fid_log,*)
'*** Atmos physics step: Radiation(mstrnX)' 470 call thermodyn_temp_pres( temp(:,:,:), &
479 call saturation_dens2qsat_liq( qsat(:,:,:), &
488 rh(k,i,j) = qtrc(k,i,j,
i_qv) / qsat(k,i,j)
502 call mp_cloudfraction( cldfrac(:,:,:), &
506 call mp_effectiveradius( mp_re(:,:,:,:), &
511 call ae_effectiveradius( ae_re(:,:,:,:), &
515 call mp_mixingratio( mp_qe(:,:,:,:), &
521 if ( atmos_phy_rd_mstrn_only_qci )
then 523 if ( ihydro /=
i_hc .and. ihydro /=
i_hi )
then 524 mp_qe(:,:,:,ihydro) = 0.0_rp
529 if ( atmos_phy_rd_mstrn_only_tropocloud )
then 532 tropopause(i,j) =
ke+1
534 if ( pres(k,i,j) >= 300.e+2_rp )
then 536 elseif( pres(k,i,j) < 50.e+2_rp )
then 539 gamma = ( temp(k+1,i,j) - temp(k,i,j) ) / ( cz(k+1,i,j) - cz(k,i,j) )
540 if( gamma > 1.e-4 ) tropopause(i,j) = k
549 do k = tropopause(i,j),
ke 550 mp_qe(k,i,j,ihydro) = 0.0_rp
559 if ( rd_profile_use_climatology )
then 560 call rd_profile_read( rd_kmax, &
575 rd_aerosol_conc(:,:), &
576 rd_aerosol_radi(:,:), &
587 temph_merge(rd_k,i,j) = rd_temph(rd_k)
590 temp(
ke+1,i,j) = temp(
ke,i,j)
591 do rd_k = rd_kadd+1, rd_kmax
592 k =
ks + rd_kmax - rd_k
594 temph_merge(rd_k,i,j) = ( temp(k ,i,j) * (cz(k+1,i,j)-fz(k,i,j)) / (cz(k+1,i,j)-cz(k,i,j)) &
595 + temp(k+1,i,j) * (fz(k ,i,j)-cz(k,i,j)) / (cz(k+1,i,j)-cz(k,i,j)) )
597 temph_merge(rd_kmax+1,i,j) = temp(
ks,i,j)
608 rhodz_merge(rd_k,i,j) = rd_rhodz(rd_k)
609 pres_merge(rd_k,i,j) = rd_pres(rd_k)
610 temp_merge(rd_k,i,j) = rd_temp(rd_k)
613 do rd_k = rd_kadd+1, rd_kmax
614 k =
ks + rd_kmax - rd_k
616 rhodz_merge(rd_k,i,j) = dens(k,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
617 pres_merge(rd_k,i,j) = pres(k,i,j) * 1.e-2_rp
618 temp_merge(rd_k,i,j) = temp(k,i,j)
630 gas_merge(rd_k,i,j,v) = rd_gas(rd_k,v)
639 do rd_k = rd_kadd+1, rd_kmax
640 k =
ks + rd_kmax - rd_k
641 zerosw = sign(0.5_rp, qtrc(k,i,j,
i_qv)-eps) + 0.5_rp
642 gas_merge(rd_k,i,j,1) = qtrc(k,i,j,
i_qv) / mvap * mdry / ppm * zerosw
655 cfc_merge(rd_k,i,j,v) = rd_cfc(rd_k,v)
664 cldfrac_merge(rd_k,i,j) = rd_cldfrac(rd_k)
667 do rd_k = rd_kadd+1, rd_kmax
668 k =
ks + rd_kmax - rd_k
670 cldfrac_merge(rd_k,i,j) = 0.5_rp + sign( 0.5_rp, cldfrac(k,i,j)-min_cldfrac )
682 aerosol_conc_merge(rd_k,i,j,v) = rd_aerosol_conc(rd_k,v)
683 aerosol_radi_merge(rd_k,i,j,v) = rd_aerosol_radi(rd_k,v)
694 do rd_k = rd_kadd+1, rd_kmax
695 k =
ks + rd_kmax - rd_k
697 aerosol_conc_merge(rd_k,i,j,ihydro) = max( mp_qe(k,i,j,ihydro), 0.0_rp ) &
698 / mp_dens(ihydro) * rho_std / ppm
699 aerosol_radi_merge(rd_k,i,j,ihydro) = mp_re(k,i,j,ihydro)
723 do rd_k = rd_kadd+1, rd_kmax
724 aerosol_conc_merge(rd_k,i,j,
n_hyd+iaero) = rd_aerosol_conc(rd_k,
n_hyd+iaero)
725 aerosol_radi_merge(rd_k,i,j,
n_hyd+iaero) = rd_aerosol_radi(rd_k,
n_hyd+iaero)
736 call rd_mstrn_dtrn3( rd_kmax, &
746 rhodz_merge(:,:,:), &
749 temph_merge(:,:,:), &
751 gas_merge(:,:,:,:), &
752 cfc_merge(:,:,:,:), &
753 aerosol_conc_merge(:,:,:,:), &
754 aerosol_radi_merge(:,:,:,:), &
756 cldfrac_merge(:,:,:), &
757 albedo_land(:,:,:), &
761 flux_rad_merge(:,:,:,:,:,:), &
762 flux_rad_sfc_dn(:,:,:,:) )
772 do rd_k = rd_kadd+1, rd_kmax+1
773 k =
ks + rd_kmax - rd_k
775 flux_rad(k,i,j,
i_lw,
i_up,ic) = flux_rad_merge(rd_k,i,j,
i_lw,
i_up,ic)
776 flux_rad(k,i,j,
i_lw,
i_dn,ic) = flux_rad_merge(rd_k,i,j,
i_lw,
i_dn,ic)
777 flux_rad(k,i,j,
i_sw,
i_up,ic) = flux_rad_merge(rd_k,i,j,
i_sw,
i_up,ic)
778 flux_rad(k,i,j,
i_sw,
i_dn,ic) = flux_rad_merge(rd_k,i,j,
i_sw,
i_dn,ic)
803 subroutine rd_mstrn_setup( &
813 integer,
intent(out) :: ngas
814 integer,
intent(out) :: ncfc
816 integer :: nband, nstream, nfitp, nfitt, nflag
817 integer :: nsfc, nptype, nplkord, nfitplk
820 character(len=H_LONG) :: dummy
823 integer :: iw, ich, ip, it, igas, icfc, iptype, im
830 allocate( waveh(mstrn_nband+1) )
831 allocate( logfitp(mstrn_nfitp) )
832 allocate( fitt(mstrn_nfitt) )
833 allocate( logfitt(mstrn_nfitt) )
835 allocate( iflgb(mstrn_nflag, mstrn_nband) )
836 allocate( nch( mstrn_nband) )
837 allocate( wgtch(mstrn_ch_limit,mstrn_nband) )
838 allocate( ngasabs( mstrn_nband) )
839 allocate( igasabs(mstrn_ngas, mstrn_nband) )
841 allocate( akd(mstrn_ch_limit,mstrn_nfitp,mstrn_nfitt,mstrn_ngas,mstrn_nband) )
842 allocate( skd(mstrn_ch_limit,mstrn_nfitp,mstrn_nfitt, mstrn_nband) )
843 allocate( acfc(mstrn_ncfc,mstrn_nband) )
847 file = trim(mstrn_gaspara_inputfile), &
848 form =
'formatted', &
852 if ( ierr /= 0 )
then 853 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_gaspara_inputfile)
858 read(fid,*) nband, nstream, nfitp, nfitt, nflag, ncfc
860 if ( nband /= mstrn_nband )
then 861 write(*,*)
'xxx Inconsistent parameter value! nband(given,file)=', mstrn_nband, nband
864 if ( nstream /= mstrn_nstream )
then 865 write(*,*)
'xxx Inconsistent parameter value! nstream(given,file)=', mstrn_nstream, nstream
868 if ( nfitp /= mstrn_nfitp )
then 869 write(*,*)
'xxx Inconsistent parameter value! nfitP(given,file)=', mstrn_nfitp, nfitp
872 if ( nfitt /= mstrn_nfitt )
then 873 write(*,*)
'xxx Inconsistent parameter value! nfitT(given,file)=', mstrn_nfitt, nfitt
876 if ( nflag /= mstrn_nflag )
then 877 write(*,*)
'xxx Inconsistent parameter value! nflag(given,file)=', mstrn_nflag, nflag
880 if ( ncfc /= mstrn_ncfc )
then 881 write(*,*)
'xxx Inconsistent parameter value! ncfc(given,file)=', mstrn_ncfc, ncfc
890 read(fid,*) logfitp(:)
895 logfitt(:) = log10( fitt(:) )
898 do iw = 1, mstrn_nband
902 read(fid,*) iflgb(:,iw)
908 read(fid,*) (wgtch(ich,iw),ich=1,nch(iw))
911 read(fid,*) ngasabs(iw)
914 if ( ngasabs(iw) > 0 )
then 915 do igas = 1, ngasabs(iw)
916 read(fid,*) igasabs(igas,iw)
917 do it = 1, mstrn_nfitt
918 do ip = 1, mstrn_nfitp
919 read(fid,*) (akd(ich,ip,it,igasabs(igas,iw),iw),ich=1,nch(iw))
926 if ( iflgb(i_h2o_continuum,iw) > 0 )
then 928 do it = 1, mstrn_nfitt
929 do ip = 1, mstrn_nfitp
930 read(fid,*) (skd(ich,ip,it,iw),ich=1,nch(iw))
936 if ( iflgb(i_cfc_continuum,iw) > 0 )
then 938 read(fid,*) (acfc(icfc,iw),icfc=1,mstrn_ncfc)
948 allocate( fitplk(mstrn_nfitplk,mstrn_nband) )
949 allocate( fsol( mstrn_nband) )
950 allocate( sfc(mstrn_nsfc, mstrn_nband) )
951 allocate( rayleigh( mstrn_nband) )
953 allocate( qmol( mstrn_nmoment,mstrn_nband) )
954 allocate( q(-1:mstrn_nradius+1,mstrn_nptype,mstrn_nmoment,mstrn_nband) )
955 q(-1:0 ,:,:,:) = 0.d0
956 q(mstrn_nradius+1,:,:,:) = 0.d0
959 file = trim(mstrn_aeropara_inputfile), &
960 form =
'formatted', &
964 if ( ierr /= 0 )
then 965 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_aeropara_inputfile)
970 read(fid,*) nband, nsfc, nptype, nstream, nplkord, nfitplk
972 if ( nband /= mstrn_nband )
then 973 write(*,*)
'xxx Inconsistent parameter value! nband(given,file)=', mstrn_nband, nband
976 if ( nsfc /= mstrn_nsfc )
then 977 write(*,*)
'xxx Inconsistent parameter value! nsfc(given,file)=', mstrn_nsfc, nsfc
980 if ( nptype /= mstrn_nptype )
then 981 write(*,*)
'xxx Inconsistent parameter value! nptype(given,file)=', mstrn_nptype, nptype
984 if ( nstream /= mstrn_nstream )
then 985 write(*,*)
'xxx Inconsistent parameter value! nstream(given,file)=', mstrn_nstream, nstream
988 if ( nplkord /= mstrn_nplkord )
then 989 write(*,*)
'xxx Inconsistent parameter value! nplkord(given,file)=', mstrn_nplkord, nplkord
992 if ( nfitplk /= mstrn_nfitplk )
then 993 write(*,*)
'xxx Inconsistent parameter value! nfitPLK(given,file)=', mstrn_nfitplk, nfitplk
1002 do iw = 1, mstrn_nband
1006 read(fid,*) fitplk(:,iw)
1009 read(fid,*) fsol(iw)
1012 read(fid,*) sfc(:,iw)
1015 read(fid,*) rayleigh(iw)
1019 do im = 1, mstrn_nmoment
1021 read(fid,*) qmol(im,iw)
1023 do iptype = 1, nptype
1024 read(fid,*) q(1:mstrn_nradius,iptype,im,iw)
1033 do iw = 1, mstrn_nband
1034 fsol_tot = fsol_tot + fsol(iw)
1040 allocate( hygro_flag(mstrn_nptype) )
1041 allocate( radmode(mstrn_nptype,mstrn_nradius) )
1044 file = trim(mstrn_hygropara_inputfile), &
1045 form =
'formatted', &
1049 if ( ierr /= 0 )
then 1050 write(*,*)
'xxx Input data file does not found! ', trim(mstrn_hygropara_inputfile)
1056 if ( nptype /= mstrn_nptype )
then 1057 write(*,*)
'xxx Inconsistent parameter value! nptype(given,file)=', mstrn_nptype, nptype
1061 do iptype = 1, nptype
1063 read(fid,*) hygro_flag(iptype), nradius
1065 if ( nradius /= mstrn_nradius )
then 1066 write(*,*)
'xxx Inconsistent parameter value! nradius(given,file)=', mstrn_nradius, nradius
1070 read(fid,*) radmode(iptype,:)
1077 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.7)')
'*** Baseline of total solar insolation : ', fsol_tot
1080 rho_std = pstd / ( rdry * tem00 )
1082 m(
i_sw) = 1.0_rp / sqrt(3.0_rp)
1086 m(
i_lw) = 1.0_rp / 1.66_rp
1090 wmns(:) = sqrt( w(:) / m(:) )
1091 wpls(:) = sqrt( w(:) * m(:) )
1092 wscale(:) = wpls(:) / wbar(:)
1102 end subroutine rd_mstrn_setup
1106 subroutine rd_mstrn_dtrn3( &
1142 integer,
intent(in) :: rd_kmax
1143 integer,
intent(in) :: ngas
1144 integer,
intent(in) :: ncfc
1145 integer,
intent(in) :: naero
1146 integer,
intent(in) :: hydro_str
1147 integer,
intent(in) :: hydro_end
1148 integer,
intent(in) :: aero_str
1149 integer,
intent(in) :: aero_end
1150 real(RP),
intent(in) :: solins (
ia,
ja)
1151 real(RP),
intent(in) :: cossza (
ia,
ja)
1152 real(RP),
intent(in) :: rhodz (rd_kmax ,
ia,
ja)
1153 real(RP),
intent(in) :: pres (rd_kmax ,
ia,
ja)
1154 real(RP),
intent(in) :: temp (rd_kmax ,
ia,
ja)
1155 real(RP),
intent(in) :: temph (rd_kmax+1,
ia,
ja)
1156 real(RP),
intent(in) :: temp_sfc (
ia,
ja)
1157 real(RP),
intent(in) :: gas (rd_kmax,
ia,
ja,ngas )
1158 real(RP),
intent(in) :: cfc (rd_kmax,
ia,
ja,ncfc )
1159 real(RP),
intent(in) :: aerosol_conc(rd_kmax,
ia,
ja,naero)
1160 real(RP),
intent(in) :: aerosol_radi(rd_kmax,
ia,
ja,naero)
1161 integer,
intent(in) :: aero2ptype (naero)
1162 real(RP),
intent(in) :: cldfrac (rd_kmax,
ia,
ja)
1163 real(RP),
intent(in) :: albedo_land (
ia,
ja,2)
1164 real(RP),
intent(in) :: fact_ocean (
ia,
ja)
1165 real(RP),
intent(in) :: fact_land (
ia,
ja)
1166 real(RP),
intent(in) :: fact_urban (
ia,
ja)
1167 real(RP),
intent(out) :: rflux (rd_kmax+1,
ia,
ja,2,2,mstrn_ncloud)
1168 real(RP),
intent(out) :: rflux_sfc_dn(
ia,
ja,2,2)
1171 real(RP) :: dz_std (rd_kmax,
ia,
ja)
1172 real(RP) :: logp (rd_kmax,
ia,
ja)
1173 real(RP) :: logt (rd_kmax,
ia,
ja)
1174 integer :: indexp (rd_kmax,
ia,
ja)
1175 real(RP) :: factp (rd_kmax,
ia,
ja)
1176 real(RP) :: factt32(rd_kmax,
ia,
ja)
1177 real(RP) :: factt21(rd_kmax,
ia,
ja)
1178 integer :: indexr (rd_kmax,
ia,
ja,naero)
1179 real(RP) :: factr (rd_kmax,
ia,
ja,naero)
1182 real(RP) :: taugas(rd_kmax,
ia,
ja,mstrn_ch_limit)
1183 real(RP) :: a1, a2, a3, factpt
1184 real(RP) :: qv, length
1188 real(RP) :: taupr (rd_kmax,
ia,
ja,mstrn_ncloud)
1189 real(RP) :: omgpr (rd_kmax,
ia,
ja,mstrn_ncloud)
1190 real(RP) :: optparam(rd_kmax,
ia,
ja,mstrn_nmoment,mstrn_ncloud)
1191 real(RP) :: q_fit, dp_p
1194 real(RP) :: albedo_sfc (
ia,
ja,mstrn_ncloud)
1199 real(RP) :: bbar (rd_kmax ,
ia,
ja)
1200 real(RP) :: bbarh(rd_kmax+1,
ia,
ja)
1201 real(RP) :: b_sfc(
ia,
ja)
1202 real(RP) :: wl, beta
1205 real(RP) :: tau(rd_kmax,
ia,
ja, mstrn_ncloud)
1206 real(RP) :: omg(rd_kmax,
ia,
ja, mstrn_ncloud)
1207 real(RP) :: g (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1211 real(RP) :: b (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1212 real(RP) :: fsol_rgn(
ia,
ja)
1214 real(RP) :: flux (rd_kmax+1,
ia,
ja,2,mstrn_ncloud)
1215 real(RP) :: flux_direct(rd_kmax+1,
ia,
ja ,mstrn_ncloud)
1220 integer :: ip, ir, irgn
1221 integer :: igas, icfc, iaero, iptype
1222 integer :: iw, ich, iplk, icloud, im
1242 dz_std(k,i,j) = rhodz(k,i,j) / rho_std * 100.0_rp
1256 logp(k,i,j) = log10( pres(k,i,j) )
1257 logt(k,i,j) = log10( temp(k,i,j) )
1270 indexp(k,i,j) = mstrn_nfitp
1272 do ip = mstrn_nfitp, 2, -1
1273 if( logp(k,i,j) >= logfitp(ip) ) indexp(k,i,j) = ip
1293 factp(k,i,j) = ( logp(k,i,j) - logfitp(ip-1) ) / ( logfitp(ip) - logfitp(ip-1) )
1295 factt32(k,i,j) = ( logt(k,i,j) - logfitt(2) ) / ( logfitt(3) - logfitt(2) ) &
1296 * ( temp(k,i,j) - fitt(1) ) / ( fitt(3) - fitt(1) )
1297 factt21(k,i,j) = ( logt(k,i,j) - logfitt(2) ) / ( logfitt(2) - logfitt(1) ) &
1298 * ( fitt(3) - temp(k,i,j) ) / ( fitt(3) - fitt(1) )
1307 iptype = aero2ptype(iaero)
1320 if ( aerosol_radi(k,i,j,iaero) <= radmode(iptype,1) )
then 1323 indexr(k,i,j,iaero) = ir
1324 factr(k,i,j,iaero) = ( aerosol_radi(k,i,j,iaero) - radmode(iptype,ir) ) &
1325 / ( radmode(iptype,ir+1) - radmode(iptype,ir) )
1327 elseif( aerosol_radi(k,i,j,iaero) > radmode(iptype,mstrn_nradius) )
then 1332 indexr(k,i,j,iaero) = ir
1333 factr(k,i,j,iaero) = 1.0_rp
1336 indexr(k,i,j,iaero) = -1
1338 do ir = 1, mstrn_nradius-1
1339 if ( aerosol_radi(k,i,j,iaero) <= radmode(iptype,ir+1) &
1340 .AND. aerosol_radi(k,i,j,iaero) > radmode(iptype,ir ) )
then 1342 indexr(k,i,j,iaero) = ir
1343 factr(k,i,j,iaero) = ( aerosol_radi(k,i,j,iaero) - radmode(iptype,ir) ) &
1344 / ( radmode(iptype,ir+1) - radmode(iptype,ir) )
1364 rflux(:,:,:,:,:,:) = 0.0_rp
1365 rflux_sfc_dn(:,:,:,:) = 0.0_rp
1370 do iw = 1, mstrn_nband
1371 irgn = iflgb(i_swlw,iw) + 1
1386 taugas(k,i,j,ich) = 0.0_rp
1395 do igas = 1, ngasabs(iw)
1396 gasno = igasabs(igas,iw)
1413 length = gas(k,i,j,igasabs(igas,iw)) * ppm * dz_std(k,i,j)
1417 a1 = akd(ich,ip-1,1,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1418 + akd(ich,ip ,1,gasno,iw) * ( factp(k,i,j) )
1419 a2 = akd(ich,ip-1,2,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1420 + akd(ich,ip ,2,gasno,iw) * ( factp(k,i,j) )
1421 a3 = akd(ich,ip-1,3,gasno,iw) * ( 1.0_rp - factp(k,i,j) )&
1422 + akd(ich,ip ,3,gasno,iw) * ( factp(k,i,j) )
1424 factpt = factt32(k,i,j)*(a3-a2) + a2 + factt21(k,i,j)*(a2-a1)
1426 taugas(k,i,j,ich) = taugas(k,i,j,ich) + 10.0_rp**factpt * length
1435 if ( iflgb(i_h2o_continuum,iw) == 1 )
then 1449 qv = gas(k,i,j,1) * ppm * dz_std(k,i,j)
1450 length = qv*qv / ( qv + dz_std(k,i,j) )
1454 a1 = skd(ich,ip-1,1,iw) * ( 1.0_rp-factp(k,i,j) )&
1455 + skd(ich,ip ,1,iw) * ( factp(k,i,j) )
1456 a2 = skd(ich,ip-1,2,iw) * ( 1.0_rp-factp(k,i,j) )&
1457 + skd(ich,ip ,2,iw) * ( factp(k,i,j) )
1458 a3 = skd(ich,ip-1,3,iw) * ( 1.0_rp-factp(k,i,j) )&
1459 + skd(ich,ip ,3,iw) * ( factp(k,i,j) )
1461 factpt = factt32(k,i,j)*(a3-a2) + a2 + factt21(k,i,j)*(a2-a1)
1463 taugas(k,i,j,ich) = taugas(k,i,j,ich) + 10.0_rp**factpt * length
1471 if ( iflgb(i_cfc_continuum,iw) == 1 )
then 1484 valsum = valsum + 10.0_rp**acfc(icfc,iw) * cfc(k,i,j,icfc)
1486 valsum = valsum * ppm * dz_std(k,i,j)
1490 taugas(k,i,j,ich) = taugas(k,i,j,ich) + valsum
1515 dp_p = rhodz(k,i,j) * grav / pstd
1516 length = rayleigh(iw) * dp_p
1519 do im = 1, mstrn_nstream*2+2
1520 optparam(k,i,j,im,i_cloud ) = qmol(im,iw) * length
1521 optparam(k,i,j,im,i_clearsky) = qmol(im,iw) * length
1529 do iaero = hydro_str, hydro_end
1530 iptype = aero2ptype(iaero)
1542 ir = indexr(k,i,j,iaero)
1544 length = aerosol_conc(k,i,j,iaero) * ppm * dz_std(k,i,j)
1547 do im = 1, mstrn_nstream*2+2
1548 q_fit = q(ir ,iptype,im,iw) * ( 1.0_rp-factr(k,i,j,iaero) ) &
1549 + q(ir+1,iptype,im,iw) * ( factr(k,i,j,iaero) )
1551 optparam(k,i,j,im,i_cloud) = optparam(k,i,j,im,i_cloud) + q_fit * length
1560 do iaero = aero_str, aero_end
1561 iptype = aero2ptype(iaero)
1573 ir = indexr(k,i,j,iaero)
1575 length = aerosol_conc(k,i,j,iaero) * ppm * dz_std(k,i,j)
1578 do im = 1, mstrn_nstream*2+2
1579 q_fit = q(ir ,iptype,im,iw) * ( 1.0_rp-factr(k,i,j,iaero) ) &
1580 + q(ir+1,iptype,im,iw) * ( factr(k,i,j,iaero) )
1582 optparam(k,i,j,im,i_cloud ) = optparam(k,i,j,im,i_cloud ) + q_fit * length
1583 optparam(k,i,j,im,i_clearsky) = optparam(k,i,j,im,i_clearsky) + q_fit * length
1592 do icloud = 1, mstrn_ncloud
1604 taupr(k,i,j,icloud) = optparam(k,i,j,1,icloud)
1605 omgpr(k,i,j,icloud) = optparam(k,i,j,1,icloud) - optparam(k,i,j,2,icloud)
1608 zerosw = 0.5_rp - sign(0.5_rp,omgpr(k,i,j,icloud)-rd_eps)
1610 g(k,i,j,0,icloud) = 1.0_rp
1611 g(k,i,j,1,icloud) = optparam(k,i,j,3,icloud) * ( 1.0_rp-zerosw ) / ( omgpr(k,i,j,icloud)+zerosw )
1612 g(k,i,j,2,icloud) = optparam(k,i,j,4,icloud) * ( 1.0_rp-zerosw ) / ( omgpr(k,i,j,icloud)+zerosw )
1626 do icloud = 1, mstrn_ncloud
1654 albedo_sfc(i,j,icloud) = albedo_land(i,j,irgn)
1680 tau(k,i,j,icloud) = taugas(k,i,j,ich) + taupr(k,i,j,icloud)
1683 zerosw = 0.5_rp - sign( 0.5_rp, tau(k,i,j,icloud)-rd_eps )
1685 omg(k,i,j,icloud) = ( 1.0_rp-zerosw ) * omgpr(k,i,j,icloud) / ( tau(k,i,j,icloud)-zerosw ) &
1686 + ( zerosw ) * 1.0_rp
1696 if ( irgn ==
i_sw )
then 1712 b(k,i,j,0,icloud) = 0.0_rp
1713 b(k,i,j,1,icloud) = 0.0_rp
1714 b(k,i,j,2,icloud) = 0.0_rp
1727 fsol_rgn(i,j) = fsol(iw) / fsol_tot * solins(i,j)
1732 elseif( irgn ==
i_lw )
then 1734 wl = 10000.0_rp / sqrt( waveh(iw) * waveh(iw+1) )
1748 do iplk = mstrn_nfitplk, 1, -1
1749 beta = beta / ( wl*temp(k,i,j) ) + fitplk(iplk,iw)
1752 bbar(k,i,j) = exp(-beta) * temp(k,i,j) / (wl*wl)
1771 do iplk = mstrn_nfitplk, 1, -1
1772 beta = beta / ( wl*temph(k,i,j) ) + fitplk(iplk,iw)
1775 bbarh(k,i,j) = exp(-beta) * temph(k,i,j) / (wl*wl)
1794 zerosw = 0.5_rp - sign( 0.5_rp, tau(k,i,j,icloud)-rd_eps )
1796 b(k,i,j,0,icloud) = bbarh(k,i,j)
1797 b(k,i,j,1,icloud) = ( 1.0_rp-zerosw ) &
1798 * ( - bbarh(k+1,i,j) &
1799 + 4.0_rp * bbar(k ,i,j) &
1800 - 3.0_rp * bbarh(k ,i,j) &
1801 ) / ( tau(k,i,j,icloud)-zerosw )
1802 b(k,i,j,2,icloud) = ( 1.0_rp-zerosw ) &
1803 * ( + bbarh(k+1,i,j) &
1804 - 2.0_rp * bbar(k ,i,j) &
1806 ) / ( tau(k,i,j,icloud)*tau(k,i,j,icloud)-zerosw ) * 2.0_rp
1823 do iplk = mstrn_nfitplk, 1, -1
1824 beta = beta / ( wl*temp_sfc(i,j) ) + fitplk(iplk,iw)
1827 b_sfc(i,j) = exp(-beta) * temp_sfc(i,j) / (wl*wl)
1838 fsol_rgn(i,j) = 0.0_rp
1854 call rd_mstrn_two_stream( rd_kmax, &
1864 albedo_sfc(:,:,:), &
1867 flux_direct(:,:,:,:) )
1882 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)
1883 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)
1892 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)
1893 rflux_sfc_dn(i,j,irgn,2) = rflux_sfc_dn(i,j,irgn,2) &
1894 + ( flux(rd_kmax+1,i,j,
i_dn,i_cloud) - flux_direct(rd_kmax+1,i,j,i_cloud) ) * wgtch(ich,iw)
1912 end subroutine rd_mstrn_dtrn3
1916 subroutine rd_mstrn_two_stream( &
1937 integer,
intent(in) :: rd_kmax
1938 integer,
intent(in) :: iw, ich
1939 real(RP),
intent(in) :: cossza0 (
ia,
ja)
1940 real(RP),
intent(in) :: fsol (
ia,
ja)
1941 integer,
intent(in) :: irgn
1942 real(RP),
intent(in) :: tau (rd_kmax,
ia,
ja, mstrn_ncloud)
1943 real(RP),
intent(in) :: omg (rd_kmax,
ia,
ja, mstrn_ncloud)
1944 real(RP),
intent(in) :: g (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1945 real(RP),
intent(in) :: b (rd_kmax,
ia,
ja,0:2,mstrn_ncloud)
1946 real(RP),
intent(in) :: b_sfc (
ia,
ja)
1947 real(RP),
intent(in) :: albedo_sfc (
ia,
ja,mstrn_ncloud)
1948 real(RP),
intent(in) :: cldfrac (rd_kmax,
ia,
ja)
1950 real(RP),
intent(out) :: flux (rd_kmax+1,
ia,
ja,2,mstrn_ncloud)
1951 real(RP),
intent(out) :: flux_direct(rd_kmax+1,
ia,
ja, mstrn_ncloud)
1963 real(RP) :: pmns, ppls
1964 real(RP) :: smns, spls
1967 real(RP) :: cossza(
ia,
ja)
1971 real(RP) :: apls_mns, bpls_mns
1972 real(DP) :: v0mns, v0pls
1973 real(DP) :: v1mns, v1pls
1974 real(DP) :: dmns0, dmns1, dmns2
1975 real(DP) :: dpls0, dpls1, dpls2
1976 real(RP) :: sigmns, sigpls
1978 real(RP) :: zerosw, tmp
1981 real(RP) :: tdir0(rd_kmax,
ia,
ja,mstrn_ncloud)
1982 real(RP) :: r0 (rd_kmax,
ia,
ja,mstrn_ncloud)
1983 real(RP) :: t0 (rd_kmax,
ia,
ja,mstrn_ncloud)
1984 real(RP) :: em_lw(rd_kmax,
ia,
ja,mstrn_ncloud)
1985 real(RP) :: em_sw(rd_kmax,
ia,
ja,mstrn_ncloud)
1986 real(RP) :: ep_lw(rd_kmax,
ia,
ja,mstrn_ncloud)
1987 real(RP) :: ep_sw(rd_kmax,
ia,
ja,mstrn_ncloud)
1990 real(RP) :: cf (rd_kmax ,
ia,
ja)
1991 real(RP) :: tau_bar_sol(rd_kmax+1,
ia,
ja)
1992 real(RP) :: tdir (rd_kmax+1,
ia,
ja)
1993 real(RP) :: r (rd_kmax+1,
ia,
ja)
1994 real(RP) :: t (rd_kmax+1,
ia,
ja)
1995 real(RP) :: em (rd_kmax+1,
ia,
ja)
1996 real(RP) :: ep (rd_kmax+1,
ia,
ja)
1999 real(RP) :: r12mns(rd_kmax+1,
ia,
ja)
2000 real(RP) :: r12pls(rd_kmax+1,
ia,
ja)
2001 real(RP) :: e12mns(rd_kmax+1,
ia,
ja)
2002 real(RP) :: e12pls(rd_kmax+1,
ia,
ja)
2003 real(RP) :: umns, upls
2005 real(RP) :: em0(mstrn_ncloud)
2007 real(RP) :: wmns_irgn, m_irgn, w_irgn, wpls_irgn, wscale_irgn
2009 integer,
parameter :: i_sfc2toa = 1
2010 integer,
parameter :: i_toa2sfc = 2
2011 integer :: direction
2014 integer :: k, i, j, icloud
2019 wmns_irgn = wmns(irgn)
2020 wpls_irgn = wpls(irgn)
2021 wscale_irgn = wscale(irgn)
2051 tau_new = ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) ) * tau(k,i,j,icloud)
2053 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)
2054 omg_new = min( omg_new, eps1 )
2056 g_new = ( g(k,i,j,1,icloud) - g(k,i,j,2,icloud) ) / ( 1.0_rp - g(k,i,j,2,icloud) )
2058 #if defined(PGI) || defined(SX) 2059 tdir0(k,i,j,icloud) = exp( -min( tau_new/cossza(i,j), 1.e+3_rp ) )
2061 tdir0(k,i,j,icloud) = exp(-tau_new/cossza(i,j))
2064 factor = ( 1.0_rp - omg(k,i,j,icloud)*g(k,i,j,2,icloud) )
2065 b_new0 = b(k,i,j,0,icloud)
2066 b_new1 = b(k,i,j,1,icloud) / factor
2067 b_new2 = b(k,i,j,2,icloud) / (factor*factor)
2068 c0 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new0
2069 c1 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new1
2070 c2 = wmns_irgn * 2.0_rp * pi * ( 1.0_rp - omg_new ) * b_new2
2073 pmns = omg_new * 0.5_rp * ( 1.0_rp - 3.0_rp * g_new * m_irgn*m_irgn )
2074 ppls = omg_new * 0.5_rp * ( 1.0_rp + 3.0_rp * g_new * m_irgn*m_irgn )
2077 smns = omg_new * 0.5_rp * ( 1.0_rp - 3.0_rp * g_new * m_irgn*cossza(i,j) )
2078 spls = omg_new * 0.5_rp * ( 1.0_rp + 3.0_rp * g_new * m_irgn*cossza(i,j) )
2081 sw = 0.5_rp + sign(0.5_rp,tau_new-rd_eps)
2082 tau_new = max( tau_new, rd_eps )
2085 x = ( 1.0_rp - w_irgn * ( ppls - pmns ) ) / m_irgn
2086 y = ( 1.0_rp - w_irgn * ( ppls + pmns ) ) / m_irgn
2090 #if defined(PGI) || defined(SX) 2091 e = exp( -min( lamda*tau_new, 1.e+3_rp ) )
2093 e = exp(-lamda*tau_new)
2097 apls_mns = ( x * ( 1.0_dp+e ) - lamda * ( 1.0_dp-e ) ) &
2098 / ( x * ( 1.0_dp+e ) + lamda * ( 1.0_dp-e ) )
2099 bpls_mns = ( x * ( 1.0_dp-e ) - lamda * ( 1.0_dp+e ) ) &
2100 / ( x * ( 1.0_dp-e ) + lamda * ( 1.0_dp+e ) )
2103 r0(k,i,j,icloud) = ( sw ) * 0.5_rp * ( apls_mns + bpls_mns ) &
2104 + ( 1.0_rp-sw ) * ( tau_new * ( pmns ) / m_irgn )
2105 t0(k,i,j,icloud) = ( sw ) * 0.5_rp * ( apls_mns - bpls_mns ) &
2106 + ( 1.0_rp-sw ) * ( 1.0_rp - tau_new * ( 1.0_rp - ppls ) / m_irgn )
2109 dmns0 = c0 / y + 2.0_rp * c2 / (x*y*y) + c1 / (x*y)
2110 dpls0 = c0 / y + 2.0_rp * c2 / (x*y*y) - c1 / (x*y)
2111 dmns1 = c1 / y + 2.0_rp * c2 / (x*y)
2112 dpls1 = c1 / y - 2.0_rp * c2 / (x*y)
2118 v1mns = dmns0 + dmns1*tau_new + dmns2*tau_new*tau_new
2119 v1pls = dpls0 + dpls1*tau_new + dpls2*tau_new*tau_new
2121 em_lw(k,i,j,icloud) = ( sw ) * ( v0mns - r0(k,i,j,icloud) * v0pls - t0(k,i,j,icloud) * v1mns ) &
2122 + ( 1.0_rp-sw ) * 0.5_rp * tau_new * ( 2.0_rp*c0 + c1*tau_new + c2*tau_new*tau_new )
2123 ep_lw(k,i,j,icloud) = ( sw ) * ( v1pls - t0(k,i,j,icloud) * v0pls - r0(k,i,j,icloud) * v1mns ) &
2124 + ( 1.0_rp-sw ) * 0.5_rp * tau_new * ( 2.0_rp*c0 + c1*tau_new + c2*tau_new*tau_new )
2127 sigmns = wmns_irgn * ( spls - smns )
2128 sigpls = wmns_irgn * ( spls + smns )
2130 tmp = x*y*cossza(i,j)-1.0/cossza(i,j)
2131 zerosw = 1.0_rp - sign(1.0_rp,abs(tmp)-eps)
2132 qgamma = ( sigpls*x*cossza(i,j) + sigmns ) / ( tmp + zerosw*eps )
2134 v0pls = 0.5_rp * ( ( 1.0_rp + 1.0_rp/(x*cossza(i,j)) ) * qgamma + sigmns / x )
2135 v0mns = 0.5_rp * ( ( 1.0_rp - 1.0_rp/(x*cossza(i,j)) ) * qgamma - sigmns / x )
2137 v1pls = v0pls * tdir0(k,i,j,icloud)
2138 v1mns = v0mns * tdir0(k,i,j,icloud)
2140 em_sw(k,i,j,icloud) = ( sw ) * ( v0mns - r0(k,i,j,icloud) * v0pls - t0(k,i,j,icloud) * v1mns ) &
2141 + ( 1.0_rp-sw ) * wmns_irgn * smns * tau_new * sqrt( tdir0(k,i,j,icloud) )
2142 ep_sw(k,i,j,icloud) = ( sw ) * ( v1pls - t0(k,i,j,icloud) * v0pls - r0(k,i,j,icloud) * v1mns ) &
2143 + ( 1.0_rp-sw ) * wmns_irgn * spls * tau_new * sqrt( tdir0(k,i,j,icloud) )
2154 if ( icloud == 1 )
then 2168 cf(k,i,j) = cldfrac(k,i,j)
2185 tdir(k,i,j) = ( cf(k,i,j) ) * tdir0(k,i,j,i_cloud ) &
2186 + ( 1.0_rp-cf(k,i,j) ) * tdir0(k,i,j,i_clearsky)
2197 tau_bar_sol(1,i,j) = fsol(i,j)
2200 tau_bar_sol(k,i,j) = tau_bar_sol(k-1,i,j) * tdir(k-1,i,j)
2214 em(k,i,j) = ( cf(k,i,j) ) * ( em_lw(k,i,j,i_cloud ) &
2215 + em_sw(k,i,j,i_cloud ) * tau_bar_sol(k,i,j) ) &
2216 + ( 1.0_rp-cf(k,i,j) ) * ( em_lw(k,i,j,i_clearsky) &
2217 + em_sw(k,i,j,i_clearsky) * tau_bar_sol(k,i,j) )
2219 ep(k,i,j) = ( cf(k,i,j) ) * ( ep_lw(k,i,j,i_cloud ) &
2220 + ep_sw(k,i,j,i_cloud ) * tau_bar_sol(k,i,j) ) &
2221 + ( 1.0_rp-cf(k,i,j) ) * ( ep_lw(k,i,j,i_clearsky) &
2222 + ep_sw(k,i,j,i_clearsky) * tau_bar_sol(k,i,j) )
2224 flux_direct(k,i,j,icloud) = cossza(i,j) * tau_bar_sol(k,i,j)
2237 r(rd_kmax+1,i,j) = ( cf(rd_kmax,i,j) ) * albedo_sfc(i,j,i_cloud ) &
2238 + ( 1.0_rp-cf(rd_kmax,i,j) ) * albedo_sfc(i,j,i_clearsky)
2239 t(rd_kmax+1,i,j) = 0.0_rp
2241 flux_direct(rd_kmax+1,i,j,icloud) = cossza(i,j) * tau_bar_sol(rd_kmax+1,i,j)
2243 em0(i_cloud ) = wpls_irgn * ( flux_direct(rd_kmax+1,i,j,icloud) * albedo_sfc(i,j,i_cloud ) / (w_irgn*m_irgn) &
2244 + 2.0_rp * pi * ( 1.0_rp-albedo_sfc(i,j,i_cloud ) ) * b_sfc(i,j) )
2245 em0(i_clearsky) = wpls_irgn * ( flux_direct(rd_kmax+1,i,j,icloud) * albedo_sfc(i,j,i_clearsky) / (w_irgn*m_irgn) &
2246 + 2.0_rp * pi * ( 1.0_rp-albedo_sfc(i,j,i_clearsky) ) * b_sfc(i,j) )
2248 em(rd_kmax+1,i,j) = ( cf(rd_kmax,i,j) ) * em0(i_cloud ) &
2249 + ( 1.0_rp-cf(rd_kmax,i,j) ) * em0(i_clearsky)
2250 ep(rd_kmax+1,i,j) = 0.0_rp
2262 do direction = i_sfc2toa, i_toa2sfc
2264 if ( direction == i_sfc2toa )
then 2271 r12pls(rd_kmax+1,i,j) = r(rd_kmax+1,i,j)
2272 e12mns(rd_kmax+1,i,j) = em(rd_kmax+1,i,j)
2283 do k = rd_kmax, 1, -1
2284 r(k,i,j) = ( cf(k,i,j) ) * r0(k,i,j,i_cloud ) &
2285 + ( 1.0_rp-cf(k,i,j) ) * r0(k,i,j,i_clearsky)
2286 t(k,i,j) = ( cf(k,i,j) ) * t0(k,i,j,i_cloud ) &
2287 + ( 1.0_rp-cf(k,i,j) ) * t0(k,i,j,i_clearsky)
2289 r12pls(k,i,j) = r(k,i,j) + t(k,i,j) / ( 1.0_rp - r12pls(k+1,i,j) * r(k,i,j) ) &
2290 * ( r12pls(k+1,i,j) * t(k,i,j) )
2291 e12mns(k,i,j) = em(k,i,j) + t(k,i,j) / ( 1.0_rp - r12pls(k+1,i,j) * r(k,i,j) ) &
2292 * ( r12pls(k+1,i,j) * ep(k,i,j) + e12mns(k+1,i,j) )
2303 r12mns(1,i,j) = r(1,i,j)
2304 e12pls(1,i,j) = ep(1,i,j)
2316 r12mns(k,i,j) = r(k,i,j) + t(k,i,j) / ( 1.0_rp - r12mns(k-1,i,j) * r(k,i,j) ) &
2317 * ( r12mns(k-1,i,j) *t(k,i,j) )
2318 e12pls(k,i,j) = ep(k,i,j) + t(k,i,j) / ( 1.0_rp - r12mns(k-1,i,j) * r(k,i,j) ) &
2319 * ( r12mns(k-1,i,j)*em(k,i,j) + e12pls(k-1,i,j) )
2344 umns = e12mns(1,i,j) + r12pls(1,i,j) * upls
2346 flux(1,i,j,
i_up,icloud) = wscale_irgn * umns
2347 flux(1,i,j,
i_dn,icloud) = wscale_irgn * upls + flux_direct(1,i,j,icloud)
2362 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) )
2363 umns = e12mns(k,i,j) + r12pls(k,i,j) * upls
2365 flux(k,i,j,
i_up,icloud) = wscale_irgn * umns
2366 flux(k,i,j,
i_dn,icloud) = wscale_irgn * upls + flux_direct(k,i,j,icloud)
2378 end subroutine rd_mstrn_two_stream
2382 subroutine rd_albedo_ocean( &
2388 real(RP),
intent(in) :: cossza (
ia,
ja)
2389 real(RP),
intent(in) :: tau (
ia,
ja)
2390 real(RP),
intent(out) :: albedo_ocean(
ia,
ja,2)
2392 real(RP) :: am1, tr1, s
2403 am1 = max( min( cossza(i,j), 0.961_rp ), 0.0349_rp )
2405 sw = 0.5_rp + sign(0.5_rp,tau(i,j))
2407 tr1 = max( min( am1 / ( 4.0_rp * tau(i,j) ), 1.0_rp ), 0.05_rp )
2412 s = s + c_ocean_albedo(n,1) * tr1**(n-1) &
2413 + c_ocean_albedo(n,2) * tr1**(n-1) * am1 &
2414 + c_ocean_albedo(n,3) * tr1**(n-1) * am1*am1
2417 albedo_ocean(i,j,
i_sw) = ( 1.0_rp-sw ) * 0.05_rp &
2420 albedo_ocean(i,j,
i_lw) = 0.05_rp
2426 end subroutine rd_albedo_ocean
integer, public is
start point of inner domain: x, local
procedure(cf), pointer, public atmos_phy_mp_cloudfraction
module ATMOSPHERE / Physics Radiation
integer, public je
end point of inner domain: y, local
real(rp), parameter, public const_ppm
parts par million
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]
integer, parameter, public n_ae
real(rp), dimension(qa_max), public tracer_r
logical, public io_l
output log or not? (this process)
module ATMOSPHERE / Physics Cloud Microphysics
integer, parameter, public i_hi
ice water cloud
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
real(rp), dimension(qa_max), public tracer_cv
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]
logical, public io_nml
output log or not? (for namelist, this process)
integer, public ia
of whole cells: x, 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 whole cells: z, local, with HALO
procedure(mr), pointer, public atmos_phy_mp_mixingratio
integer, public kmax
of computational cells: z, local
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, parameter, public i_hc
liquid water cloud
integer, public ks
start point of inner domain: z, local
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
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.
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.
real(rp), dimension(:), pointer, public atmos_phy_ae_dens
integer, public io_fid_log
Log file ID.
integer, parameter, public n_hyd
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 io_fid_nml
Log file ID (only for output namelist)
real(rp), public const_pstd
standard pressure [Pa]
real(rp), public const_eps1
small number
real(rp), dimension(qa_max), public tracer_mass
integer, public ja
of whole cells: y, local, with HALO