Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mossco
mossco-code
Commits
d5dd27fe
Commit
d5dd27fe
authored
Feb 20, 2021
by
Carsten Lemmen
Browse files
Inversed if to circumvent real == zero comparison
parent
4d76ebb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/utilities/mossco_strings.F90
View file @
d5dd27fe
!> @brief Implementation of string utilities
!>
!> This computer program is part of MOSSCO.
!> @copyright Copyright 2014
, 2015, 2016, 2017, 2018
Helmholtz-Zentrum Geesthacht
!> @copyright Copyright 2014
--2021
Helmholtz-Zentrum Geesthacht
!> @author Carsten Lemmen <carsten.lemmen@hzg.de>
!
...
...
@@ -181,7 +181,7 @@ contains
integer
(
kind
=
4
),
intent
(
in
)
::
i
integer
(
kind
=
4
)
::
order
if
(
i
.eq.
0
)
then
if
(
i
==
0
)
then
order
=
1
else
order
=
int
(
log10
(
abs
(
real
(
i
))))
+
1
...
...
@@ -196,13 +196,15 @@ contains
function
order_r8
(
r
)
result
(
order
)
real
(
kind
=
8
),
intent
(
in
)
::
r
integer
(
kind
=
4
)
::
order
if
(
r
.eq.
0
)
then
order
=
1
elseif
(
abs
(
r
)
<
1
)
then
if
(
abs
(
r
)
>
1
)
then
order
=
int
(
log10
(
abs
(
r
)))
+
1
elseif
(
abs
(
r
)
>
0
)
then
order
=-
int
(
log10
(
abs
(
r
)))
+
1
else
order
=
int
(
log10
(
abs
(
r
)))
+
1
order
=
1
endif
end
function
order_r8
#undef ESMF_METHOD
...
...
@@ -210,13 +212,15 @@ contains
function
order_r4
(
r
)
result
(
order
)
real
(
kind
=
4
),
intent
(
in
)
::
r
integer
(
kind
=
4
)
::
order
if
(
r
.eq.
0
)
then
order
=
1
elseif
(
abs
(
r
)
<
1
)
then
if
(
abs
(
r
)
>
1
)
then
order
=
int
(
log10
(
abs
(
r
)))
+
1
elseif
(
abs
(
r
)
>
0
)
then
order
=-
int
(
log10
(
abs
(
r
)))
+
1
else
order
=
int
(
log10
(
abs
(
r
)))
+
1
order
=
1
endif
end
function
order_r4
#undef ESMF_METHOD
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment