REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticBiology_BioToy.H
Go to the documentation of this file.
1
2 Real cff1=Real(20.0)/Real(3.0);
3 Real cff2=Real( 2.0)/Real(3.0);
4 for (MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi) {
6 Array4< Real> const& cons = mf_cons.array(mfi);
7
8 Box bx = mfi.growntilebox(mf_cons.nGrowVect());
9
10 ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
11 Real SiO4;
12 if (temp(i,j,k) < Real(8.0)) {
13 SiO4 = Real(30.0);
14 } else if ((temp(i,j,k) >= Real(8.0)) && (temp(i,j,k) <= Real(11.0))) {
15 SiO4 = Real(30.0) - ((temp(i,j,k) - Real(8.0))*cff1);
16 } else if ((temp(i,j,k) > Real(11.0)) && (temp(i,j,k) <= Real(13.0))) {
17 SiO4 = Real(10.0) - ((temp(i,j,k) - Real(11.0))*Real(4.0));
18 } else if ((temp(i,j,k) > Real(13.0)) && (temp(i,j,k) <= Real(16.0))) {
19 SiO4 = Real(2.0) - ((temp(i,j,k) - Real(13.0))*cff2);
20 } else { //else if (temp(i,j,k) > Real(16.0))
21 SiO4 = Real(0.0);
22 }
23 cons(i,j,k,bio_comp.no3)=Real(1.67)+Real(0.5873)*SiO4+
24 Real(0.0144)*SiO4*SiO4+
25 Real(0.0003099)*SiO4*SiO4*SiO4;
26 cons(i,j,k,bio_comp.phyt)=Real(0.08);
27 cons(i,j,k,bio_comp.zoop)=Real(0.06);
28 cons(i,j,k,bio_comp.nh4)=Real(0.1);
29 cons(i,j,k,bio_comp.lden)=Real(0.02);
30 cons(i,j,k,bio_comp.sden)=Real(0.04);
31 cons(i,j,k,bio_comp.chlo)=Real(0.02);
32 if (m_fennel_params.oxygen) {
33 cons(i,j,k,bio_comp.oxyg)=Real(10.0)/Real(0.02241);
34 }
35 if (m_fennel_params.carbon) {
36 cons(i,j,k,bio_comp.tic)=Real(2100.0);
37 cons(i,j,k,bio_comp.talk)=Real(2350.0);
38 cons(i,j,k,bio_comp.ldec)=Real(0.002);
39 cons(i,j,k,bio_comp.sdec)=Real(0.06);
40 }
41 if (m_fennel_params.river_don) {
42 // ROMS ana_biology.h has no river DON profile, so pick values
43 // that make the pool visible: 0.05 mmol_N/m3 is the same order
44 // as SdetritusN above, so its remineralization to NH4 is a
45 // real contribution rather than a rounding artifact, and a
46 // zero start would leave the whole option a no-op no matter
47 // whether the terms are right.
48 cons(i,j,k,bio_comp.rden)=Real(0.05);
49 if (m_fennel_params.carbon) {
50 cons(i,j,k,bio_comp.rdec)=Real(0.3);
51 }
52 }
53 if (m_fennel_params.po4) {
54 // 0.5 mmol_P/m3: a plausible coastal subsurface value, far
55 // above the 1e-6 MinVal floor that would otherwise mask the
56 // uptake terms. With the default K_PO4=32 this gives
57 // L_PO4 ~ 0.94, deliberately the same order as LTOT so that
58 // MIN(LTOT, L_PO4) is a real comparison rather than a
59 // foregone conclusion.
60 //
61 // Note the PO4 branch of biology_tile is structurally
62 // different from the default one (mu-based cff4/cff5, and
63 // LMIN rather than LTOT in the chlorophyll denominator), and
64 // it is taken for any non-zero PO4 regardless of which side
65 // the MIN selects. Which side it selects does depend on the
66 // NO3/NH4 field, so a run that changes those should re-check
67 // that both sides still get exercised.
68 cons(i,j,k,bio_comp.po4)=Real(0.5);
69 }
70 if (m_fennel_params.odu) {
71 // ODU is inert on both paths: ROMS fennel.h never references
72 // iODU_ (zero occurrences), and the native kernel only clamps
73 // it on entry and writes it back on exit. This value exists so
74 // the tracer-count, index-mapping and pack/unpack comparison
75 // is not vacuous -- initialising it to zero would compare
76 // 0 against 0 and prove nothing about the plumbing.
77 cons(i,j,k,bio_comp.odu)=Real(1.0);
78 }
79 });
80 }
#define Temp_comp
mf_h setVal(geomdata.ProbHi(2))