?? balance_a.f90
字號:
SUBROUTINE balance_a (kpt ,ivt ,msl ,dtime ,ldew ,scv ,& wice ,wliq ,rainrate ,snowrate ,fevpa ,rnof,& totwb ,errore ,xerr ,zerr)! ======================================================================! Source file: balance_a.f90! Original version: Yongjiu Dai, September 15, 1999!! accumulate the numerical truncation errors of water and energy balance! calculation. it is helpful to see the performance of the process of integration.!! the error for energy balance:! error = abs(Net radiation - the change of internal energy - Sensible heat - Latent heat)! should be less than 0.02 W/m2 in each time integration interval;! ! the error for water balance:! error = abs(precipitation - the change of water storage - evaporation - runoff)! should be less than 0.001 mm in each time integration interval.!! ====================================================================== implicit none integer, INTENT(in) :: & kpt, &!number of clm land points, including subgrid points ivt(kpt), &!land cover types msl !soil layer number real, INTENT(in) :: & dtime, &!time step (s) ldew(kpt), &!depth of water on foliage (kg/m2) scv(kpt), &! snow water equivalent (mm) wice(1:msl, 1:kpt), &!ice lens mass (kg/m2) wliq(1:msl, 1:kpt), &!liquid water mass (kg/m2) rainrate(kpt), &!rain rate (mm/s) snowrate(kpt), &!snow rate (mm/s) fevpa(kpt), &!evapotranspiration from canopy to atmosphere (mm/s) rnof(kpt), &!total runoff (mm h2o/s) errore(kpt), &!energy balnce error (W/m2) totwb(kpt) !water mass begining of the time step real, INTENT(inout) :: & xerr(kpt), &!accumulation of water balance error zerr(kpt) !accumulation of energy balnce error! local integer i, k !do loop index real endwb(kpt), &!water mass end of the time step errorw(kpt) !water balance error (mm)! ----------------------------------------------------------------------! water balance do k = 1, kpt if(ivt(k) == 17)then xerr(k) = 0. errorw(k) = 0. cycle endif if(ivt(k) == 11 .OR. ivt(k) == 15)then errorw(k) = 0. cycle endif endwb(k) = ldew(k) + scv(k) & + (- rainrate(k) - snowrate(k) + fevpa(k) + rnof(k))*dtime do i = 1, msl endwb(k) = endwb(k) + wice(i,k) + wliq(i,k) enddo if(wice(1,k)>30.) print*, 'ice over 20 mm in top soil layer', wice(1,k) errorw(k) = endwb(k) - totwb(k)!* if(abs(errorw(k)) > 1.e-3) &!* write(6,*) 'Warning: water balance violation',errorw(k),totwb(k),endwb(k) xerr(k) = xerr(k) + errorw(k) enddo! energy balance do k = 1, kpt if(abs(errore(k)) > .2) then!* write(6,*) 'Warning: energy balance violation ',errore(k) endif zerr(k) = zerr(k) + errore(k) enddo END SUBROUTINE balance_a
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -