ROMS
Loading...
Searching...
No Matches
round_mod Module Reference

Functions/Subroutines

real(dp) function, public round (x, ct)
 
real(dp) function, public tceil (x, ct)
 
real(dp) function, public tfloor (x, ct)
 
real(dp) function, private ufloor (x)
 

Function/Subroutine Documentation

◆ round()

real(dp) function, public round_mod::round ( real (dp), intent(in) x,
real (dp), intent(in) ct )

Definition at line 64 of file round.F.

65!***********************************************************************
66!
67! Imported variable declarations.
68!
69 real (dp), intent(in) :: X, CT
70!
71! Local variable declarations.
72!
73 real(dp) :: Y
74!
75!------------------------------------------------------------------------
76! Compute tolerant round function.
77!------------------------------------------------------------------------
78!
79 y=tfloor(x+0.5_dp,ct)
80!
81 RETURN

References tfloor().

Referenced by dateclock_mod::caldate(), and dateclock_mod::datevec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tceil()

real(dp) function, public round_mod::tceil ( real (dp), intent(in) x,
real (dp), intent(in) ct )

Definition at line 85 of file round.F.

86!***********************************************************************
87!
88! Imported variable declarations.
89!
90 real (dp), intent(in) :: X, CT
91!
92! Local variable declarations.
93!
94 real(dp) :: Y
95!
96!------------------------------------------------------------------------
97! Compute tolerant ceiling function.
98!------------------------------------------------------------------------
99!
100 y=-tfloor(-x,ct)
101!
102 RETURN

References tfloor().

Here is the call graph for this function:

◆ tfloor()

real (dp) function, public round_mod::tfloor ( real (dp), intent(in) x,
real (dp), intent(in) ct )

Definition at line 106 of file round.F.

107!***********************************************************************
108!
109! Imported variable declarations.
110!
111 real (dp), intent(in) :: X, CT
112!
113! Local variable declarations.
114!
115 real (dp) :: EPS5, Q, RMAX, Y
116!
117!------------------------------------------------------------------------
118! Compute tolerant floor function.
119!------------------------------------------------------------------------
120!
121! Hagerty FL5 function
122!
123 q=1.0_dp
124 IF (x.lt.0.0_dp) q=1.0_dp-ct
125 rmax=q/(2.0_dp-ct)
126 eps5=ct/q
127 y=ufloor(x+max(ct,min(rmax,eps5*abs(1.0_dp+ufloor(x)))))
128 IF ((x.le.0.0_dp).or.(y-x).lt.rmax) RETURN
129 y=y-1.0_dp
130!
131 RETURN

References ufloor().

Referenced by round(), and tceil().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ufloor()

real(dp) function, private round_mod::ufloor ( real (dp), intent(in) x)
private

Definition at line 135 of file round.F.

136!***********************************************************************
137!
138! Imported variable declarations.
139!
140 real (dp), intent(in) :: X
141!
142! Local variable declarations.
143!
144 real(dp) :: Y
145!
146!-----------------------------------------------------------------------
147! Compute the largest integer algebraically less than or equal to X;
148! that is, the unfuzzy Floor Function.
149!-----------------------------------------------------------------------
150!
151 y=x-mod(x,1.0_dp)-mod(2.0_dp+sign(1.0_dp,x),3.0_dp)
152!
153 RETURN

Referenced by tfloor().

Here is the caller graph for this function: