module outnull_
  implicit none
contains
  !----------------------------------------------------------------
  subroutine outnull(adj,add,m,d)
    logical, intent(in)    :: adj,add
    real,    intent(inout) :: m(:),d(:)  

    if(.not.add) then
       if(adj) then
          m=0.
       else
          d=0.
       end if
    end if
  end subroutine outnull
  !----------------------------------------------------------------
end module outnull_
