@@ -6,15 +6,15 @@ module evaluate_mod
66!
77! Started: August 2021
88!
9- ! Last Modified: Monday, September 25, 2023 PM08:52:04
9+ ! Last Modified: Thu 03 Apr 2025 05:48:45 PM CST
1010!- -------------------------------------------------------------------------------------------------!
1111
1212implicit none
1313private
14- public :: moderatex
15- public :: moderatef
16- public :: moderatec
17- public :: evaluate
14+ public :: moderatex
15+ public :: moderatef
16+ public :: moderatec
17+ public :: evaluate
1818
1919interface evaluate
2020 module procedure evaluatef, evaluatefc
@@ -28,15 +28,15 @@ function moderatex(x) result(y)
2828!- -------------------------------------------------------------------------------------------------!
2929! This function moderates a decision variable. It replaces NaN by 0 and Inf/-Inf by REALMAX/-REALMAX.
3030!- -------------------------------------------------------------------------------------------------!
31- use , non_intrinsic :: consts_mod, only : RP, ZERO, REALMAX
32- use , non_intrinsic :: infnan_mod, only : is_nan
33- use , non_intrinsic :: linalg_mod, only : trueloc
31+ use , non_intrinsic:: consts_mod, only : RP, ZERO, REALMAX
32+ use , non_intrinsic:: infnan_mod, only : is_nan
33+ use , non_intrinsic:: linalg_mod, only : trueloc
3434implicit none
3535
3636! Inputs
37- real (RP), intent (in ) :: x(:)
37+ real (RP), intent (in ):: x(:)
3838! Outputs
39- real (RP) :: y(size (x))
39+ real (RP):: y(size (x))
4040
4141y = x
4242y(trueloc(is_nan(x))) = ZERO
@@ -49,14 +49,14 @@ pure elemental function moderatef(f) result(y)
4949! This function moderates the function value of a MINIMIZATION problem. It replaces NaN and any
5050! value above FUNCMAX by FUNCMAX.
5151!- -------------------------------------------------------------------------------------------------!
52- use , non_intrinsic :: consts_mod, only : RP, REALMAX, FUNCMAX
53- use , non_intrinsic :: infnan_mod, only : is_nan
52+ use , non_intrinsic:: consts_mod, only : RP, REALMAX, FUNCMAX
53+ use , non_intrinsic:: infnan_mod, only : is_nan
5454implicit none
5555
5656! Inputs
57- real (RP), intent (in ) :: f
57+ real (RP), intent (in ):: f
5858! Outputs
59- real (RP) :: y
59+ real (RP):: y
6060
6161y = f
6262if (is_nan(y)) then
@@ -71,18 +71,18 @@ end function moderatef
7171function moderatec (c ) result(y)
7272!- -------------------------------------------------------------------------------------------------!
7373! This function moderates the constraint value, the constraint demanding this value to be NONNEGATIVE.
74- ! It replaces any value below -CONSTRMAX by -CONSTRMAX, and any NaN or value above CONSTRMAX by
74+ ! It replaces any value below-CONSTRMAX by-CONSTRMAX, and any NaN or value above CONSTRMAX by
7575! CONSTRMAX.
7676!- -------------------------------------------------------------------------------------------------!
77- use , non_intrinsic :: consts_mod, only : RP, CONSTRMAX
78- use , non_intrinsic :: infnan_mod, only : is_nan
79- use , non_intrinsic :: linalg_mod, only : trueloc
77+ use , non_intrinsic:: consts_mod, only : RP, CONSTRMAX
78+ use , non_intrinsic:: infnan_mod, only : is_nan
79+ use , non_intrinsic:: linalg_mod, only : trueloc
8080implicit none
8181
8282! Inputs
83- real (RP), intent (in ) :: c(:)
83+ real (RP), intent (in ):: c(:)
8484! Outputs
85- real (RP) :: y(size (c))
85+ real (RP):: y(size (c))
8686
8787y = c
8888y(trueloc(is_nan(c))) = CONSTRMAX
@@ -96,21 +96,21 @@ subroutine evaluatef(calfun, x, f)
9696! handled by a moderated extreme barrier.
9797!- -------------------------------------------------------------------------------------------------!
9898! Common modules
99- use , non_intrinsic :: consts_mod, only : RP, DEBUGGING
100- use , non_intrinsic :: debug_mod, only : assert
101- use , non_intrinsic :: infnan_mod, only : is_nan, is_posinf
102- use , non_intrinsic :: pintrf_mod, only : OBJ
99+ use , non_intrinsic:: consts_mod, only : RP, DEBUGGING
100+ use , non_intrinsic:: debug_mod, only : assert
101+ use , non_intrinsic:: infnan_mod, only : is_nan, is_posinf
102+ use , non_intrinsic:: pintrf_mod, only : OBJ
103103implicit none
104104
105105! Inputs
106- procedure (OBJ) :: calfun ! N.B.: INTENT cannot be specified if a dummy procedure is not a POINTER
107- real (RP), intent (in ) :: x(:)
106+ procedure (OBJ):: calfun ! N.B.: INTENT cannot be specified if a dummy procedure is not a POINTER
107+ real (RP), intent (in ):: x(:)
108108
109109! Output
110- real (RP), intent (out ) :: f
110+ real (RP), intent (out ):: f
111111
112112! Local variables
113- character (len=* ), parameter :: srname = ' EVALUATEF'
113+ character (len=* ), parameter :: srname = ' EVALUATEF'
114114
115115! Preconditions
116116if (DEBUGGING) then
@@ -154,22 +154,22 @@ subroutine evaluatefc(calcfc, x, f, constr)
154154! constraint value. Nan/Inf are handled by a moderated extreme barrier.
155155!- -------------------------------------------------------------------------------------------------!
156156! Common modules
157- use , non_intrinsic :: consts_mod, only : RP, DEBUGGING
158- use , non_intrinsic :: debug_mod, only : assert
159- use , non_intrinsic :: infnan_mod, only : is_nan, is_posinf
160- use , non_intrinsic :: pintrf_mod, only : OBJCON
157+ use , non_intrinsic:: consts_mod, only : RP, DEBUGGING
158+ use , non_intrinsic:: debug_mod, only : assert
159+ use , non_intrinsic:: infnan_mod, only : is_nan, is_posinf
160+ use , non_intrinsic:: pintrf_mod, only : OBJCON
161161implicit none
162162
163163! Inputs
164- procedure (OBJCON) :: calcfc ! N.B.: INTENT cannot be specified if a dummy procedure is not a POINTER
165- real (RP), intent (in ) :: x(:)
164+ procedure (OBJCON):: calcfc ! N.B.: INTENT cannot be specified if a dummy procedure is not a POINTER
165+ real (RP), intent (in ):: x(:)
166166
167167! Outputs
168- real (RP), intent (out ) :: f
169- real (RP), intent (out ) :: constr(:)
168+ real (RP), intent (out ):: f
169+ real (RP), intent (out ):: constr(:)
170170
171171! Local variables
172- character (len=* ), parameter :: srname = ' EVALUATEFC'
172+ character (len=* ), parameter :: srname = ' EVALUATEFC'
173173
174174! Preconditions
175175if (DEBUGGING) then
0 commit comments