add subroutine in twogap_ddw.f90