REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_DogboneAnalytic.H
Go to the documentation of this file.
1
2
// Whether this run carries a passive dye tracer. nComp() cannot answer this: with
3
// biology active and no dye, Tracer_comp is the first biology component, so testing
4
// nComp() would write the dye initial value into NO3.
5
const
bool
l_do_dye
= (
remora
.num_passive_scalars() > 0);
6
ParmParse
pp_prob
(
"remora.prob"
);
7
bool
traditional
=
true
;
8
pp_prob
.query(
"traditional"
,
traditional
);
9
10
bool
l_use_salt
=
m_solverChoice
.use_salt;
11
12
auto
geomdata
=
geom
.data();
13
const
int
khi
=
geomdata
.Domain().bigEnd()[2];
14
for
(
MFIter
mfi
(
mf_cons
,
TilingIfNotGPU
());
mfi
.isValid(); ++
mfi
)
15
{
16
const
Box &
bx
=
mfi
.tilebox();
17
AMREX_ALWAYS_ASSERT
(
bx
.length()[2] ==
khi
+1);
18
19
Array4< Real>
const
&
state
=
mf_cons
.array(
mfi
);
20
Array4< Real>
const
&
x_vel
=
mf_xvel
.array(
mfi
);
21
Array4< Real>
const
&
y_vel
=
mf_yvel
.array(
mfi
);
22
23
Array4<const Real>
const
&
x_r
=
remora
.vec_xr[
lev
]->const_array(
mfi
);
24
if
(
traditional
) {
25
ParallelFor
(
bx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
26
{
27
if
(
l_use_salt
) {
28
state
(
i
,
j
,
k
,
Salt_comp
) = Real(35.0);
29
}
30
31
state
(
i
,
j
,
k
,
Temp_comp
)= (
x_r
(
i
,
j
,0) < Real(1000.)) ? Real(5.0) : Real(10.0);
32
33
// Set tracer = 0 everywhere
34
if
(
l_do_dye
) {
state
(
i
,
j
,
k
,
Tracer_comp
) =
zero
; }
35
});
36
}
else
{
37
ParallelFor
(
bx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
38
{
39
[[
maybe_unused
]]
const
Real
x
=
x_r
(
i
,
j
,0);
40
41
if
(
l_use_salt
) {
42
state
(
i
,
j
,
k
,
Salt_comp
) = Real(10.0) - Real(10.0) * (
x_r
(
i
,
j
,0) - Real(8400.0)) / Real(8400.0);
43
}
44
45
state
(
i
,
j
,
k
,
Temp_comp
)= Real(10.0);
46
47
// Set tracer = 0 everywhere
48
if
(
l_do_dye
) {
state
(
i
,
j
,
k
,
Tracer_comp
) =
zero
; }
49
});
50
}
51
52
const
Box&
xbx
=
surroundingNodes
(
bx
,0);
53
const
Box&
ybx
=
surroundingNodes
(
bx
,1);
54
ParallelFor
(
xbx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
55
{
56
x_vel
(
i
,
j
,
k
) =
zero
;
57
});
58
ParallelFor
(
ybx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
59
{
60
y_vel
(
i
,
j
,
k
) =
zero
;
61
});
62
}
63
Gpu::streamSynchronize();
zero
constexpr amrex::Real zero
Definition
REMORA_Constants.H:6
Coord::x
@ x
Temp_comp
#define Temp_comp
Definition
REMORA_IndexDefines.H:10
Tracer_comp
#define Tracer_comp
Definition
REMORA_IndexDefines.H:12
Salt_comp
#define Salt_comp
Definition
REMORA_IndexDefines.H:11
setVal
mf_h setVal(geomdata.ProbHi(2))
AMREX_ALWAYS_ASSERT
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
geomdata
auto geomdata
Definition
REMORA_InitAnalyticProb_DogboneAnalytic.H:12
khi
const int khi
Definition
REMORA_InitAnalyticProb_DogboneAnalytic.H:13
l_use_salt
bool l_use_salt
Definition
REMORA_InitAnalyticProb_DogboneAnalytic.H:10
traditional
bool traditional
Definition
REMORA_InitAnalyticProb_DogboneAnalytic.H:7
pp_prob
ParmParse pp_prob("remora.prob")
l_do_dye
const bool l_do_dye
Definition
REMORA_InitAnalyticProb_DogboneAnalytic.H:5
Source
Prob
REMORA_InitAnalyticProb_DogboneAnalytic.H
Generated by
1.9.8