Module identity_mod
  use adj_mod
  implicit none

contains

!---------------------
  function identity_lop(adj,add,mm,dd) result(stat)
    logical, intent(in)         :: adj,add
    real              :: mm(:),dd(:)
    integer           :: stat
    call adjnull(adj,add,mm,dd)
    if (adj) then
       mm = mm + dd
    else
       dd = dd + mm
    end if
    stat=0
  end function

!---------------------
  function identity_lop2(adj,add,mm,dd) result(stat)
    logical, intent(in)         :: adj,add
    complex           :: mm(:),dd(:)
    integer           :: stat
    if (adj) then
       mm = mm + dd
    else
       dd = dd + mm
    end if
    stat=0
  end function
!---------------------
end module
