anchor.diff:  
       subroutine sirius_create_potential(veffit, beffit, veffmt, beffmt)
           implicit none
  -        real(8),           target, intent(in) :: veffit
  +        real(8), optional, target, intent(in) :: veffit
           real(8), optional, target, intent(in) :: beffit
           real(8), optional, target, intent(in) :: veffmt
           real(8), optional, target, intent(in) :: beffmt
           type(C_PTR) veffit_ptr, veffmt_ptr, beffit_ptr, beffmt_ptr
   
  -        veffit_ptr = C_LOC(veffit)
  +        veffit_ptr = C_NULL_PTR
  +        if (present(veffit)) veffit_ptr = C_LOC(veffit)
   
           beffit_ptr = C_NULL_PTR
           if (present(beffit)) beffit_ptr = C_LOC(beffit)
  
positive.code:             integer,                 intent(in)  :: num_gvec
              integer,                 intent(in)  :: gvec
              complex(8),              intent(out) :: rho_pw
          end subroutine
  
          subroutine sirius_get_gvec_index(gvec, ig)&
  
negative.code:             real(8),                  intent(out) :: g
          end subroutine
  
          subroutine sirius_get_wave_functions(kset_id, ik, npw, gvec_k, evc, ld)&
              &bind(C, name="sirius_get_wave_functions")
              integer,                  intent(in)  :: kset_id
              integer,                  intent(in)  :: ik
              integer,                  intent(in)  :: npw
              integer,                  intent(in)  :: gvec_k
              complex(8),               intent(out) :: evc
              integer,                  intent(in)  :: ld
          end subroutine
  
          subroutine sirius_get_d_mtrx(ia, d_mtrx, ld)&
              &bind(C, name="sirius_get_d_mtrx")
              integer,                  intent(in)  :: ia
              real(8),                  intent(out) :: d_mtrx
              integer,                  intent(in)  :: ld
          end subroutine
  
          subroutine sirius_get_q_mtrx(iat, q_mtrx, ld)&
              &bind(C, name="sirius_get_q_mtrx")
              integer,                  intent(in)  :: iat
              real(8),                  intent(out) :: q_mtrx
              integer,                  intent(in)  :: ld
          end subroutine
  
          subroutine sirius_get_density_matrix(ih, jh, ia, dm)&
              &bind(C, name="sirius_get_density_matrix")
              integer,                  intent(in)  :: ih
              integer,                  intent(in)  :: jh
              integer,                  intent(in)  :: ia
              real(8),                  intent(out) :: dm
          end subroutine
  
      end interface
  
  contains
  