!-----------------------------------------------------------------------------
Subroutine Define_Drought_Events
! D1: Mild or more intense drought, D2: Moderate more intense drought, D3: Severe of more intense drought, D4: Extreme drought
Integer :: ist, ireg, it
D1=Miss; D2=Miss; D3=Miss;
   Do ist=1, Nst
      Do it=1, Ntime
         if (PDSI(ist,it)/=Miss.AND.PDSI(ist,it)<=Thre_1) then; D1(ist,it)=1; else; D1(ist,it)=0; endif
         if (PDSI(ist,it)/=Miss.AND.PDSI(ist,it)<=Thre_2) then; D2(ist,it)=1; else; D2(ist,it)=0; endif
         if (PDSI(ist,it)/=Miss.AND.PDSI(ist,it)<=Thre_3) then; D3(ist,it)=1; else; D3(ist,it)=0; endif
      Enddo
   Enddo
End Subroutine Define_Drought_Events
!-----------------------------------------------------------------------------


