Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SPINS_main
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Donovan Allum
SPINS_main
Commits
00e7b84f
Commit
00e7b84f
authored
3 years ago
by
kar
Committed by
Christopher Subich
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
more bug fixes
parent
4358e9e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Science/QSPCount.cpp
+23
-17
23 additions, 17 deletions
src/Science/QSPCount.cpp
src/cases/derivatives/derivatives.cpp
+5
-5
5 additions, 5 deletions
src/cases/derivatives/derivatives.cpp
with
28 additions
and
22 deletions
src/Science/QSPCount.cpp
+
23
−
17
View file @
00e7b84f
...
@@ -265,18 +265,22 @@ void QSPCount(QSPOptions qsp_options, QSPData qsp_data) {
...
@@ -265,18 +265,22 @@ void QSPCount(QSPOptions qsp_options, QSPData qsp_data) {
return
;
return
;
}
}
TArrayn
::
DTArray
*
temp_ptr
;
int
i_low
,
j_low
,
k_low
,
i_high
,
j_high
,
k_high
;
if
(
S1_ptr
)
{
// If S1 is not ke
temp_ptr
=
S1_ptr
;
{
}
else
{
// If S1 is ke we know u must exist
TArrayn
::
DTArray
*
temp_ptr
;
temp_ptr
=
qsp_data
.
u
;
if
(
S1_ptr
)
{
// If S1 is not ke
temp_ptr
=
S1_ptr
;
}
else
{
// If S1 is ke we know u must exist
temp_ptr
=
qsp_data
.
u
;
}
i_low
=
temp_ptr
->
lbound
(
blitz
::
firstDim
);
j_low
=
temp_ptr
->
lbound
(
blitz
::
secondDim
);
k_low
=
temp_ptr
->
lbound
(
blitz
::
thirdDim
);
i_high
=
temp_ptr
->
ubound
(
blitz
::
firstDim
);
j_high
=
temp_ptr
->
ubound
(
blitz
::
secondDim
);
k_high
=
temp_ptr
->
ubound
(
blitz
::
thirdDim
);
}
}
int
i_low
=
S1_ptr
->
lbound
(
blitz
::
firstDim
);
int
j_low
=
S1_ptr
->
lbound
(
blitz
::
secondDim
);
int
k_low
=
S1_ptr
->
lbound
(
blitz
::
thirdDim
);
int
i_high
=
S1_ptr
->
ubound
(
blitz
::
firstDim
);
int
j_high
=
S1_ptr
->
ubound
(
blitz
::
secondDim
);
int
k_high
=
S1_ptr
->
ubound
(
blitz
::
thirdDim
);
double
double_max
=
std
::
numeric_limits
<
double
>::
max
();
double
double_max
=
std
::
numeric_limits
<
double
>::
max
();
if
(
qsp_options
.
T1_max
==
double_max
||
qsp_options
.
S1_max
==
double_max
||
if
(
qsp_options
.
T1_max
==
double_max
||
qsp_options
.
S1_max
==
double_max
||
...
@@ -285,8 +289,10 @@ void QSPCount(QSPOptions qsp_options, QSPData qsp_data) {
...
@@ -285,8 +289,10 @@ void QSPCount(QSPOptions qsp_options, QSPData qsp_data) {
j_low
,
k_low
,
i_high
,
j_high
,
k_high
);
j_low
,
k_low
,
i_high
,
j_high
,
k_high
);
}
}
double
hS
=
(
qsp_options
.
S1_max
-
qsp_options
.
S1_min
)
/
(
double
)
qsp_options
.
NS
;
double
hS
=
double
hT
=
(
qsp_options
.
T1_max
-
qsp_options
.
T1_min
)
/
(
double
)
qsp_options
.
NT
;
(
qsp_options
.
S1_max
-
qsp_options
.
S1_min
)
/
(
double
)
qsp_options
.
NS
;
double
hT
=
(
qsp_options
.
T1_max
-
qsp_options
.
T1_min
)
/
(
double
)
qsp_options
.
NT
;
double
hS_inv
=
1
/
hS
;
double
hS_inv
=
1
/
hS
;
double
hT_inv
=
1
/
hT
;
double
hT_inv
=
1
/
hT
;
...
@@ -375,10 +381,10 @@ void QSPCount(QSPOptions qsp_options, QSPData qsp_data) {
...
@@ -375,10 +381,10 @@ void QSPCount(QSPOptions qsp_options, QSPData qsp_data) {
break
;
break
;
}
}
int
idxS
=
floor
((
Sval
-
S1_min
)
*
hS_inv
);
int
idxS
=
floor
((
Sval
-
qsp_options
.
S1_min
)
*
hS_inv
);
int
idxT
=
floor
((
Tval
-
T1_min
)
*
hT_inv
);
int
idxT
=
floor
((
Tval
-
qsp_options
.
T1_min
)
*
hT_inv
);
idxS
=
std
::
max
(
std
::
min
(
idxS
,
qsp_options
.
NS
),
0
);
idxS
=
std
::
max
(
std
::
min
(
idxS
,
qsp_options
.
NS
-
1
),
0
);
idxT
=
std
::
max
(
std
::
min
(
idxT
,
qsp_options
.
NT
),
0
);
idxT
=
std
::
max
(
std
::
min
(
idxT
,
qsp_options
.
NT
-
1
),
0
);
double
volume_weight
;
double
volume_weight
;
if
(
qsp_data
.
mapped
)
{
if
(
qsp_data
.
mapped
)
{
...
...
This diff is collapsed.
Click to expand it.
src/cases/derivatives/derivatives.cpp
+
5
−
5
View file @
00e7b84f
...
@@ -445,7 +445,7 @@ class userControl : public BaseCase {
...
@@ -445,7 +445,7 @@ class userControl : public BaseCase {
QSPOptions
qsp_opts
;
QSPOptions
qsp_opts
;
qsp_opts
.
S1_name
=
S1_name
;
qsp_opts
.
S1_name
=
S1_name
;
qsp_opts
.
T1_name
=
T1_name
;
qsp_opts
.
T1_name
=
T1_name
;
qsp_opts
.
filename
=
filename
;
qsp_opts
.
filename
=
QSP_
filename
;
qsp_opts
.
NS
=
NS
;
qsp_opts
.
NS
=
NS
;
qsp_opts
.
NT
=
NT
;
qsp_opts
.
NT
=
NT
;
qsp_opts
.
S1_max
=
S1_max
;
qsp_opts
.
S1_max
=
S1_max
;
...
@@ -475,11 +475,11 @@ class userControl : public BaseCase {
...
@@ -475,11 +475,11 @@ class userControl : public BaseCase {
qsp_data
.
salinity
=
temp1
;
qsp_data
.
salinity
=
temp1
;
}
}
if
(
T1_name
.
compare
(
"temp"
)
==
0
||
S1_name
.
compare
(
"temp"
)
==
0
)
{
if
(
T1_name
.
compare
(
"temp"
)
==
0
||
S1_name
.
compare
(
"temp"
)
==
0
)
{
init_tracer_restart
(
"
T
"
,
*
temp2
);
init_tracer_restart
(
"
t
"
,
*
temp2
);
qsp_data
.
temp
=
temp2
;
qsp_data
.
temp
=
temp2
;
}
}
if
(
T1_name
.
compare
(
"rho"
)
==
0
||
S1_name
.
compare
(
"rho"
)
==
0
)
{
if
(
T1_name
.
compare
(
"rho"
)
==
0
||
S1_name
.
compare
(
"rho"
)
==
0
)
{
init_tracer_restart
(
"
t
"
,
*
temp3
);
init_tracer_restart
(
"
rho
"
,
*
temp3
);
qsp_data
.
rho
=
temp3
;
qsp_data
.
rho
=
temp3
;
}
}
...
@@ -563,8 +563,8 @@ int main(int argc, char ** argv) {
...
@@ -563,8 +563,8 @@ int main(int argc, char ** argv) {
add_option
(
"do_Q_and_R"
,
&
do_Q_and_R
,
false
,
"Calculate Q and R?"
);
add_option
(
"do_Q_and_R"
,
&
do_Q_and_R
,
false
,
"Calculate Q and R?"
);
add_option
(
"do_lambda2"
,
&
do_lambda2
,
false
,
"Calculate Lambda2?"
);
add_option
(
"do_lambda2"
,
&
do_lambda2
,
false
,
"Calculate Lambda2?"
);
add_option
(
"do_hist"
,
&
do_hist
,
false
,
"Create QSP Data?"
);
add_option
(
"do_hist"
,
&
do_hist
,
false
,
"Create QSP Data?"
);
add_option
(
"T1"
,
&
T1_name
,
"u"
,
"Name of tracer 1 for QSP.
Valid values are
t (for
rho
)
,u,v,w,
T (for
temp
)
or k
for K.E.
"
);
add_option
(
"T1"
,
&
T1_name
,
"u"
,
"Name of tracer 1 for QSP. Valid values are rho,u,v,w,temp or k
e
"
);
add_option
(
"S1"
,
&
S1_name
,
"w"
,
"Name of tracer 2 for QSP.
Valid values are
t (for
rho
)
,u,v,w,
T (for
temp
)
or k
for K.E.
"
);
add_option
(
"S1"
,
&
S1_name
,
"w"
,
"Name of tracer 2 for QSP. Valid values are rho,u,v,w,temp or k
e
"
);
add_option
(
"T1_max"
,
&
T1_max
,
std
::
numeric_limits
<
double
>::
max
(),
"Maximum explicit bin for T1 in QSP."
);
add_option
(
"T1_max"
,
&
T1_max
,
std
::
numeric_limits
<
double
>::
max
(),
"Maximum explicit bin for T1 in QSP."
);
add_option
(
"T1_min"
,
&
T1_min
,
std
::
numeric_limits
<
double
>::
min
(),
"Minimum explicit bin for T1 in QSP."
);
add_option
(
"T1_min"
,
&
T1_min
,
std
::
numeric_limits
<
double
>::
min
(),
"Minimum explicit bin for T1 in QSP."
);
add_option
(
"S1_max"
,
&
S1_max
,
std
::
numeric_limits
<
double
>::
max
(),
"Maximum explicit bin for S1 in QSP."
);
add_option
(
"S1_max"
,
&
S1_max
,
std
::
numeric_limits
<
double
>::
max
(),
"Maximum explicit bin for S1 in QSP."
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment