REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_Upwelling.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
bool
l_use_salt
=
m_solverChoice
.use_salt;
7
8
auto
geomdata
=
geom
.data();
9
const
int
khi
=
geomdata
.Domain().bigEnd()[2];
10
11
[[
maybe_unused
]]
bool
EWPeriodic
=
geomdata
.isPeriodic(0);
12
[[
maybe_unused
]]
bool
NSPeriodic
=
geomdata
.isPeriodic(1);
13
14
auto
T0
=
m_solverChoice
.T0;
15
auto
S0
=
m_solverChoice
.S0;
16
for
(
MFIter
mfi
(
mf_cons
,
TilingIfNotGPU
());
mfi
.isValid(); ++
mfi
)
17
{
18
const
Box &
bx
=
mfi
.tilebox();
19
AMREX_ALWAYS_ASSERT
(
bx
.length()[2] ==
khi
+1);
20
21
Array4< Real>
const
&
state
=
mf_cons
.array(
mfi
);
22
Array4< Real>
const
&
x_vel
=
mf_xvel
.array(
mfi
);
23
Array4< Real>
const
&
y_vel
=
mf_yvel
.array(
mfi
);
24
25
Array4<const Real>
const
& z_r =
remora
.vec_z_r[
lev
]->const_array(
mfi
);
26
ParallelFor
(
bx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
27
{
28
const
Real
z
= z_r(
i
,
j
,
k
);
29
30
state
(
i
,
j
,
k
,
Temp_comp
) =
one
;
31
32
state
(
i
,
j
,
k
,
Temp_comp
)=
T0
+Real(8.0)*std::exp(
z
/Real(50.0));
33
if
(
l_use_salt
) {
34
state
(
i
,
j
,
k
,
Salt_comp
)=
S0
;
35
}
36
37
// Set tracer = 0 everywhere
38
if
(
l_do_dye
) {
state
(
i
,
j
,
k
,
Tracer_comp
) =
zero
; }
39
});
40
41
const
Box&
xbx
=
surroundingNodes
(
bx
,0);
42
const
Box&
ybx
=
surroundingNodes
(
bx
,1);
43
ParallelFor
(
xbx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
44
{
45
x_vel
(
i
,
j
,
k
) =
zero
;
46
});
47
ParallelFor
(
ybx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
48
{
49
y_vel
(
i
,
j
,
k
) =
zero
;
50
});
51
}
one
constexpr amrex::Real one
Definition
REMORA_Constants.H:7
zero
constexpr amrex::Real zero
Definition
REMORA_Constants.H:6
Coord::z
@ z
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)
T0
auto T0
Definition
REMORA_InitAnalyticProb_Upwelling.H:14
geomdata
auto geomdata
Definition
REMORA_InitAnalyticProb_Upwelling.H:8
khi
const int khi
Definition
REMORA_InitAnalyticProb_Upwelling.H:9
NSPeriodic
bool NSPeriodic
Definition
REMORA_InitAnalyticProb_Upwelling.H:12
S0
auto S0
Definition
REMORA_InitAnalyticProb_Upwelling.H:15
l_use_salt
bool l_use_salt
Definition
REMORA_InitAnalyticProb_Upwelling.H:6
EWPeriodic
bool EWPeriodic
Definition
REMORA_InitAnalyticProb_Upwelling.H:11
l_do_dye
const bool l_do_dye
Definition
REMORA_InitAnalyticProb_Upwelling.H:5
Source
Prob
REMORA_InitAnalyticProb_Upwelling.H
Generated by
1.9.8