!--------------------------------------------------------------------------------
Subroutine Reg_Drought_Event(X, ireg, it, Thre, Drought, No_Drought)
! Ham xac dinh thang thu it co Drought Event hay khong. Neu 50% so tram co Drought thi Drought=1, No_Drought=0
! Drought=1/0 and No_Drought=0/1
Integer :: it, ilon, ilat, ireg, idr, igrd, Drought, No_Drought
Real :: Thre, Area_Percent
Real, Dimension(Nlon,Nlat,Ntime) :: X
idr=0; igrd=0
Do ilon=1, Nlon
   Do ilat=1, Nlat
      if (INT(Reg(ilon,ilat))==ireg) then
         igrd=igrd+1
         if (X(ilon,ilat,it)/=Miss.AND.X(ilon,ilat,it)<Thre) idr=idr+1
      endif
   Enddo
Enddo
Area_Percent=Real(idr)/Real(igrd)
if (Area_Percent>0.5) then; Drought=1; No_Drought=0; else; Drought=0; No_Drought=1; endif
End Subroutine Reg_Drought_Event
!--------------------------------------------------------------------------------

