📄 radclwmx.f90
字号:
k1 = kxs(l,i,irgn) if (k >= k1) then nxsk = nxsk + 1 ksort(nxsk) = k1 endif end do endif!! Dummy value of index to insure computation of cloud amt is valid for l=nxsk+1! ksort(nxsk+1) = pverp!! Initialize iterated emissivity factors! do l = 1, nxsk emx(l) = emis(i,ksort(l)) end do!! Initialize iterated emissivity factor for bnd. condition at upper interface! emx(0) = emx0!! Initialize previous cloud amounts! cld0 = 1.0!! Indices for flux calculations! k2 = k+1 k3 = k2+1 tmp(i) = s(i,k2,min(k3,pverp))*min(1,pverp2-k3)!! Loop over number of cloud levels inside region (biggest to smallest cld area)! do l = 1, nxsk+1!! Calculate downward fluxes! cld1 = cldp(i,ksort(l))*min(1,nxsk+1-l) if (cld0 /= cld1) then fdl(i,k2) = fdl(i,k2)+(cld0-cld1)*fsdl(i,k2) do l1 = 0, l - 1 km1 = ksort(l1)-1 km4 = km1+3 tmp2(i) = s(i,k2,min(km4,pverp))* min(1,pverp2-km4) fdl(i,k2) = fdl(i,k2)+(cld0-cld1)*emx(l1)*(fclb4(i,km1)-tmp2(i)+tmp(i)- & fsdl(i,k2)) end do endif cld0 = cld1!! Multiply emissivity factors by current cloud transmissivity! if (l <= nxsk) then k1 = ksort(l) trans = 1.0-emis(i,k1)!! Ideally the upper bound on l1 would be l-1, but the sort routine! scrambles the order of layers with identical cloud amounts! do l1 = 0, nxsk if (ksort(l1) < k1) then emx(l1) = emx(l1)*trans endif end do end if!! End loop over number l of cloud levels! end do!! End loop over level k for fluxes! end do!! End loop over longitude i for fluxes! end do!! End loop over regions irgn for max-overlap! end do!!----------------------------------------------------------------------! UPWARD FLUXES:! Outermost loop over regions (sets of adjacent layers) to be max overlapped! do irgn = nmxrgn(ilon), 1, -1!! Compute clear-sky fluxes for regions without clouds! iimx = 1 if (ilon < indxmx(iimx,irgn) .and. irgn <= nrgn(ilon)) then!! Calculate emissivity so that upward flux at lower boundary of region! can be cast in form of solution for upward flux from cloud below that! boundary. Then solutions for fluxes at other levels take form of! random overlap expressions. Try to locate "cloud" as close as possible! to surface such that the "cloud" pseudo-emissivity is between 0 and 1.! Include allowance for surface emissivity (both numerator and denominator! equal 1)! k1 = kx2(ilon,irgn)+1 if (k1 < pverp) then do km1 = pver-1,kx2(ilon,irgn),-1 km3 = km1+2 k2 = k1 k3 = k2+1 tmp(ilon) = s(ilon,k2,min(km3,pverp))* min(1,pverp2-km3) emx0 = (ful(ilon,k1)-fsul(ilon,k1))/ & ((fclt4(ilon,km1)+s(ilon,k2,k3)-tmp(ilon))- fsul(ilon,k1)) if (emx0 >= 0.0 .and. emx0 <= 1.0) exit end do km1 = max(km1,kx2(ilon,irgn)) else km1 = k1-1 km3 = km1+2 emx0 = 1.0 endif do k2 = kx1(ilon,irgn), kx2(ilon,irgn) k3 = k2+1!! If km3 == pver+2, one of the s integrals = 0 (integration limits both = p_s)! tmp(ilon) = s(ilon,k2,min(km3,pverp))* min(1,pverp2-km3) ful(ilon,k2) =(1.0-emx0)*fsul(ilon,k2) + emx0* & (fclt4(ilon,km1)+s(ilon,k2,k3)-tmp(ilon)) end do else if (ilon==indxmx(iimx,irgn) .and. iimx<=ncolmx(irgn)) then iimx = iimx+1 end if!! Outer loop over columns with clouds in the max-overlap region! do iimx = 1, ncolmx(irgn) i = indxmx(iimx,irgn)!! Calculate emissivity so that upward flux at lower boundary of region! can be cast in form of solution for upward flux from cloud at that! boundary. Then solutions for fluxes at other levels take form of! random overlap expressions. Try to locate "cloud" as close as possible! to surface such that the "cloud" pseudo-emissivity is between 0 and 1.! Include allowance for surface emissivity (both numerator and denominator! equal 1)! k1 = kx2(i,irgn)+1 if (k1 < pverp) then do km1 = pver-1,kx2(i,irgn),-1 km3 = km1+2 k2 = k1 k3 = k2+1 tmp(i) = s(i,k2,min(km3,pverp))*min(1,pverp2-km3) emx0 = (ful(i,k1)-fsul(i,k1))/((fclt4(i,km1)+s(i,k2,k3)-tmp(i))-fsul(i,k1)) if (emx0 >= 0.0 .and. emx0 <= 1.0) exit end do km1 = max(km1,kx2(i,irgn)) else emx0 = 1.0 km1 = k1-1 endif ksort(0) = km1 + 1!! Loop to calculate fluxes at level k! nxsk = 0 do k = kx2(i,irgn), kx1(i,irgn), -1!! Identify clouds (largest to smallest area) between k and kx2! Since nxsk will increase with decreasing k up to nxs(i,irgn), once! nxsk == nxs(i,irgn) then use the list constructed for previous k! if (nxsk < nxs(i,irgn)) then nxsk = 0 do l = 1, nxs(i,irgn) k1 = kxs(l,i,irgn) if (k <= k1) then nxsk = nxsk + 1 ksort(nxsk) = k1 endif end do endif!! Dummy value of index to insure computation of cloud amt is valid for l=nxsk+1! ksort(nxsk+1) = pverp!! Initialize iterated emissivity factors! do l = 1, nxsk emx(l) = emis(i,ksort(l)) end do!! Initialize iterated emissivity factor for bnd. condition at lower interface! emx(0) = emx0!! Initialize previous cloud amounts! cld0 = 1.0!! Indices for flux calculations! k2 = k k3 = k2+1!! Loop over number of cloud levels inside region (biggest to smallest cld area)! do l = 1, nxsk+1!! Calculate upward fluxes! cld1 = cldp(i,ksort(l))*min(1,nxsk+1-l) if (cld0 /= cld1) then ful(i,k2) = ful(i,k2)+(cld0-cld1)*fsul(i,k2) do l1 = 0, l - 1 km1 = ksort(l1)-1 km3 = km1+2!! If km3 == pver+2, one of the s integrals = 0 (integration limits both = p_s)! tmp(i) = s(i,k2,min(km3,pverp))* min(1,pverp2-km3) ful(i,k2) = ful(i,k2)+(cld0-cld1)*emx(l1)* & (fclt4(i,km1)+s(i,k2,k3)-tmp(i)- fsul(i,k2)) end do endif cld0 = cld1!! Multiply emissivity factors by current cloud transmissivity! if (l <= nxsk) then k1 = ksort(l) trans = 1.0-emis(i,k1)!! Ideally the upper bound on l1 would be l-1, but the sort routine! scrambles the order of layers with identical cloud amounts! do l1 = 0, nxsk if (ksort(l1) > k1) then emx(l1) = emx(l1)*trans endif end do end if!! End loop over number l of cloud levels! end do!! End loop over level k for fluxes! end do!! End loop over longitude i for fluxes! end do!! End loop over regions irgn for max-overlap! end do!! End outermost longitude loop! end do!! End cloud modification loops!!----------------------------------------------------------------------! All longitudes: store history tape quantities! do i=1,ncol flwds(i) = fdl (i,pverp ) flns(i) = ful (i,pverp ) - fdl (i,pverp ) flnsc(i) = fsul(i,pverp ) - fsdl(i,pverp ) flnt(i) = ful (i,ntoplw) - fdl (i,ntoplw) flntc(i) = fsul(i,ntoplw) - fsdl(i,ntoplw) flut(i) = ful (i,ntoplw) flutc(i) = fsul(i,ntoplw) end do!! Computation of longwave heating (J/kg/s)! do k=ntoplw,pver do i=1,ncol qrl(i,k) = (ful(i,k) - fdl(i,k) - ful(i,k+1) + fdl(i,k+1))* & 1.E-4*gravit/((pint(i,k) - pint(i,k+1))) end do end do! Return 0 above solution domain if ( ntoplw > 1 )then qrl(:ncol,:ntoplw-1) = 0. end if! returnend subroutine radclwmx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -