subroutine chck_spinup( $ nx,ny, $ i2flwdir,d0spnthr,d2rivsto,d2rivstopre,d2grdsto,d2grdstopre, $ i0spnsuc,i0spntot) cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cto check spin up cby Thanh NGO-DUC con last modified on 12th Feb 2008 cat IIS,UT c c count 'i0spnsuc' the number within the spin-up threshold (d0spnthr[%]), c in total number of grids, `i0spntot' cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc implicit none c parameter integer nx, ny c input integer i2flwdir(nx,ny) !! flow direction matrix double precision d0spnthr !! spin-up criteria double precision d2rivsto(nx,ny) !! river storage in the end of the year double precision d2rivstopre(nx,ny) !! river storage in the end of the previous year double precision d2grdsto(nx,ny) !! groundwater storage in the end of the year double precision d2grdstopre(nx,ny) !! groundwater storage in the end of the previous year c output integer i0spnsuc !! num of grids spin-up succeeded integer i0spntot !! num of grids in calculation c local integer ix, iy double precision d0rivsto double precision d0rivpre double precision d0errriv !! (sto[t]-sto[t-1])/sto[t-1] (%) cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c check spin up cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc i0spnsuc = 0 i0spntot = 0 c do iy = 1, ny do ix = 1, nx if ((i2flwdir(ix,iy).ge.1).and.(i2flwdir(ix,iy).le.8)) then d0rivsto = d2rivsto(ix,iy)+d2grdsto(ix,iy) d0rivpre = d2rivstopre(ix,iy)+d2grdstopre(ix,iy) if (d0rivpre.gt.0.0) then d0errriv = abs(d0rivsto - d0rivpre)/d0rivpre * 100.0 else d0errriv = d0spnthr +1 endif if (d0errriv.le.d0spnthr) i0spnsuc = i0spnsuc + 1 i0spntot = i0spntot + 1 end if end do end do c debug write(*,*) '[chck_spinup] spin up threshold (%) : ',d0spnthr write(*,*) '[chck_spinup] total number of grids : ',i0spntot write(*,*) '[chck_spinup] number of grids succeeded : ',i0spnsuc c end