dc_units.f90 File Reference

Go to the source code of this file.

Data Types

type  dc_units::units
 
interface  dc_units::clear
 
interface  dc_units::deallocate
 
interface  dc_units::assignment(=)
 
interface  dc_units::operator(*)
 
interface  dc_units::operator(/)
 
interface  dc_units::operator(+)
 

Modules

module  dc_units
 

Functions/Subroutines

subroutine, private dc_units::units_simplify (u, name, power)
 
type(units) function dc_units::dcunitsmul (u1, u2)
 
type(units) function dc_units::dcunitsdiv (u1, u2)
 
type(units) function dc_units::dcunitsadd (u1, u2)
 
logical function, public dc_units::add_okay (u1, u2)
 
subroutine dc_units::dcunitsclear (u)
 
subroutine dc_units::dcunitsdeallocate (u)
 
subroutine dc_units::dcunitstostring (string, u)
 
subroutine dc_units::dcunitsbuild (u, cunits)
 
subroutine cancel_exp
 
subroutine error
 
subroutine power_next
 
subroutine factor_next
 
subroutine units_finalize
 
subroutine ustack_clear
 
subroutine ustack_grow
 
subroutine pstack_clear
 
subroutine pstack_push
 
subroutine pstack_pop
 

Function/Subroutine Documentation

◆ cancel_exp()

subroutine dcunitsbuild::cancel_exp ( )

Definition at line 411 of file dc_units.f90.

Referenced by dc_units::dcunitsbuild().

411  print *, operator"DCUnitsBuild: syntax error, (**) ignored"
Here is the caller graph for this function:

◆ error()

subroutine dcunitsbuild::error ( )
private

Definition at line 415 of file dc_units.f90.

Referenced by dc_units::dcunitsbuild().

415  print *, "DCUnitsBuild: unexpected token <", &
416  & trim(cvalue), "> ignored"
Here is the caller graph for this function:

◆ factor_next()

subroutine dcunitsbuild::factor_next ( )
private

Definition at line 426 of file dc_units.f90.

References power_next().

Referenced by dc_units::dcunitsbuild(), and units_finalize().

426  ! factor_exp の終了処理
427  real(DP):: factor
428  i = pstack(pi)%factor_exp
429  factor = product(ustack(i:ui)%factor) * pstack(pi)%factor
430  if (pstack(pi)%factor_inv) then
431  ustack(i:ui)%power = -ustack(i:ui)%power
432  factor = 1.0_dp / factor
433  endif
434  ustack(i)%factor = factor
435  ustack(i+1:ui)%factor = 1.0_dp
436  call power_next
437  pstack(pi)%factor = 1.0_dp
438  pstack(pi)%factor_exp = ui
subroutine power_next
Definition: dc_units.f90:420
Here is the call graph for this function:
Here is the caller graph for this function:

◆ power_next()

subroutine dcunitsbuild::power_next ( )
private

Definition at line 420 of file dc_units.f90.

References ustack_grow().

Referenced by dc_units::dcunitsbuild(), factor_next(), and pstack_pop().

420  ! power_exp の終了処理
421  call ustack_grow
422  pstack(pi)%power_exp = ui
subroutine ustack_grow
Definition: dc_units.f90:451
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pstack_clear()

subroutine dcunitsbuild::pstack_clear ( )
private

Definition at line 459 of file dc_units.f90.

References pstack_push().

Referenced by dc_units::dcunitsbuild().

459  pi = 0
460  call pstack_push
subroutine pstack_push
Definition: dc_units.f90:464
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pstack_pop()

subroutine dcunitsbuild::pstack_pop ( )
private

Definition at line 475 of file dc_units.f90.

References power_next().

Referenced by dc_units::dcunitsbuild().

475  ! factor_exp の終了処理
476  call power_next
477  pi = pi - 1
subroutine power_next
Definition: dc_units.f90:420
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pstack_push()

subroutine dcunitsbuild::pstack_push ( )
private

Definition at line 464 of file dc_units.f90.

References ustack_grow().

Referenced by dc_units::dcunitsbuild(), and pstack_clear().

464  if (pi >= size(pstack)) stop 'DCUnitsBuild: too many parens'
465  pi = pi + 1
466  call ustack_grow
467  pstack(pi)%factor_exp = ui
468  pstack(pi)%factor = 1.0_dp
469  pstack(pi)%factor_inv = .false.
470  pstack(pi)%power_exp = ui
471  pstack(pi)%paren_exp = ui
subroutine ustack_grow
Definition: dc_units.f90:451
Here is the call graph for this function:
Here is the caller graph for this function:

◆ units_finalize()

subroutine dcunitsbuild::units_finalize ( )
private

Definition at line 442 of file dc_units.f90.

References factor_next().

Referenced by dc_units::dcunitsbuild().

442  call factor_next
subroutine factor_next
Definition: dc_units.f90:426
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ustack_clear()

subroutine dcunitsbuild::ustack_clear ( )
private

Definition at line 446 of file dc_units.f90.

References ustack_grow().

Referenced by dc_units::dcunitsbuild().

446  ui = 0
447  call ustack_grow
subroutine ustack_grow
Definition: dc_units.f90:451
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ustack_grow()

subroutine dcunitsbuild::ustack_grow ( )
private

Definition at line 451 of file dc_units.f90.

Referenced by dc_units::dcunitsbuild(), power_next(), pstack_push(), and ustack_clear().

451  if (ui >= size(ustack)) stop 'DCUnitsBuild: too many elements'
452  ui = ui + 1
453  ustack(ui)%name = ""
454  ustack(ui)%factor = 1.0_dp
455  ustack(ui)%power = 1.0_dp
Here is the caller graph for this function: