Loading...
Searching...
No Matches
dc_units::operator(+) Interface Reference

Public Member Functions

type(units) function dcunitsadd (u1, u2)

Detailed Description

Definition at line 56 of file dc_units.f90.

Member Function/Subroutine Documentation

◆ dcunitsadd()

type(units) function dc_units::operator(+)::dcunitsadd ( type(units), intent(in) u1,
type(units), intent(in) u2 )

Definition at line 151 of file dc_units.f90.

152 type(UNITS), intent(in):: u1, u2
153 type(UNITS):: x
154 result%offset = u1%offset
155 result%nelems = u1%nelems
156 result%factor = u1%factor + u2%factor
157 x = u1 / u2
158 if (x%nelems == 0) then
159 nullify(result%name, result%power)
160 return
161 endif
162 if (all(abs(x%power(1:result%nelems)) < tiny(0.0_dp))) then
163 allocate(result%name(result%nelems), result%power(result%nelems))
164 result%name = u1%name
165 result%power = u1%power
166 return
167 endif
168 result%factor = 0.0
169 result%nelems = -1
170 result%offset = "MISMATCH"
171 nullify(result%name, result%power)

The documentation for this interface was generated from the following file: