Data Types | Functions/Subroutines
dc_units Module Reference

Functions/Subroutines

logical function, public add_okay (u1, u2)
 

Function/Subroutine Documentation

◆ add_okay()

logical function, public dc_units::add_okay ( type(units), intent(in)  u1,
type(units), intent(in)  u2 
)

Definition at line 175 of file dc_units.f90.

References cancel_exp(), dcunits_com::dcunitsgettoken(), dcunits_com::dcunitssetline(), dcunits_com::s_closepar, dcunits_com::s_divide, dcunits_com::s_eof, dcunits_com::s_exponent, dcunits_com::s_integer, dcunits_com::s_multiply, dcunits_com::s_openpar, dcunits_com::s_real, dcunits_com::s_shift, and dcunits_com::s_text.

175  type(units), intent(in):: u1, u2
176  type(units):: x
177  character(STRING):: debug
178  call clear(x)
179  x = u1 / u2
180  debug = u1
181  debug = u2
182  debug = x
183  if (x%nelems == 0) then
184  result = .true.
185  else if (all(abs(x%power(1:x%nelems)) < tiny(0.0_dp))) then
186  result = .true.
187  else
188  result = .false.
189  endif
190  call deallocate(x)
Here is the call graph for this function: