compx_to_dbcsr_scalar Function

public function compx_to_dbcsr_scalar(z, data_type) result(res)

Arguments

Type IntentOptional Attributes Name
complex(kind=real_8) :: z
integer :: data_type

Return Value type(dbcsr_scalar_type)


Source Code

   FUNCTION compx_to_dbcsr_scalar(z, data_type) RESULT(res)
      COMPLEX(real_8)                                    :: z
      INTEGER                                            :: data_type
      TYPE(dbcsr_scalar_type)                            :: res

      SELECT CASE (data_type)
      CASE (dbcsr_type_real_4)
         res = dbcsr_scalar(REAL(z, kind=real_4))
      CASE (dbcsr_type_real_8)
         res = dbcsr_scalar(REAL(z, kind=real_8))
      CASE (dbcsr_type_complex_4)
         res = dbcsr_scalar(CMPLX(z, kind=real_4))
      CASE (dbcsr_type_complex_8)
         res = dbcsr_scalar(z)
      END SELECT

   END FUNCTION compx_to_dbcsr_scalar