REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_Fennel_Fortran_Interface.H
Go to the documentation of this file.
1#ifndef REMORA_FENNEL_FORTRAN_INTERFACE_H
2#define REMORA_FENNEL_FORTRAN_INTERFACE_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/**
9 * C interface to the ROMS Fennel kernel (Path A oracle).
10 *
11 * Wraps biology_tile from the tracked copy of ROMS fennel.h. See
12 * Source/Biology/Fortran/REMORA_fennel_roms.F for the isohelper and
13 * Source/Biology/Fortran/tag_map.md for the diagnostic contract.
14 *
15 * @note All arrays are contiguous packed buffers owned by the caller, in
16 * Fortran (column-major, i fastest) order. Nothing is aliased directly
17 * from an AMReX FArrayBox: REMORA FABs carry ghost cells and a
18 * 0-based k index, while ROMS wants 1-based k over the valid region,
19 * so the pack/unpack is explicit and lives in REMORA_FennelBridge.cpp.
20 *
21 * @note Storage bounds (ilo..ihi, jlo..jhi, nz) and active bounds
22 * (istr..iend, jstr..jend) are passed separately, matching the ROMS
23 * memory-extent versus compute-extent distinction.
24 *
25 * @note i and j are REMORA's own 0-based indices; the Fortran side sets its
26 * array lower bounds to match, so no horizontal index translation
27 * happens anywhere. Only k is shifted (REMORA k -> ROMS k+1), by the
28 * packer.
29 *
30 * Array shapes, in Fortran notation:
31 * rmask, srflx, uwind, vwind, pH (ilo:ihi, jlo:jhi)
32 * sustr, svstr (ilo:ihi+1, jlo:jhi+1)
33 * Hz, z_r (ilo:ihi, jlo:jhi, 1:nz)
34 * z_w (ilo:ihi, jlo:jhi, 0:nz)
35 * t_nstp, t_nnew (ilo:ihi, jlo:jhi, 1:nz, 1:nbt+2)
36 *
37 * The tracer dimension is ROMS-ordered: index 1 is temperature, 2 is
38 * salinity, 3.. are the biology tracers in Fennel order. That equals the
39 * REMORA component index plus one throughout.
40 *
41 * @param nbt biology tracer count; validated against the compiled
42 * ROMS option set, which aborts the run on mismatch
43 * @param dt_sec full baroclinic step in seconds (NOT divided by BioIter;
44 * the ROMS kernel does that division itself)
45 * @param rho0 reference density, for the ROMS kinematic-srflx
46 * conversion PARsur = PARfrac*srflx*rho0*Cp
47 * @param cp_heat seawater specific heat, same conversion
48 * @param pH inout for interface fidelity; write-only in practice,
49 * since fennel.h fixes DoNewton = 0 and the bisection
50 * brackets are constants
51 * @param dbg_level 0 off, 1 target column, 2 all columns
52 */
54 int ilo, int ihi, int jlo, int jhi, int nz, int nbt,
55 int istr, int iend, int jstr, int jend,
56 int use_po4, int use_carbon, int use_oxygen, int use_odu,
57 int use_denit, int use_biosed, int use_bulk,
58 int use_rivdon, int use_talknc,
59 int pco2air_kind, int co2_sc_kind, int o2_sc_kind,
60 int bioiter, double dt_sec, double rho0, double cp_heat,
61 double p_AttSW, double p_AttChl, double p_PARfrac,
62 double p_Vp0, double p_I_thNH4, double p_D_p5NH4,
63 double p_NitriR, double p_K_NO3, double p_K_NH4,
64 double p_K_PO4, double p_K_Phy, double p_Chl2C_m,
65 double p_ChlMin, double p_PhyCN, double p_R_P2N,
66 double p_PhyIP, double p_PhyIS, double p_PhyMin,
67 double p_PhyMR, double p_ZooAE_N, double p_ZooCN,
68 double p_ZooBM, double p_ZooER, double p_ZooGR,
69 double p_ZooMin, double p_ZooMR, double p_LDeRRN,
70 double p_LDeRRC, double p_CoagR, double p_SDeRRN,
71 double p_SDeRRC, double p_RDeRRN, double p_RDeRRC,
72 double p_wPhy, double p_wLDet,
73 double p_wSDet, double p_pCO2air,
74 const double* rmask,
75 const double* Hz,
76 const double* z_r,
77 const double* z_w,
78 const double* srflx,
79 const double* sustr,
80 const double* svstr,
81 const double* uwind,
82 const double* vwind,
83 double* pH,
84 const double* t_nstp,
85 double* t_nnew,
86 int dbg_level, int dbg_i, int dbg_j);
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif // REMORA_FENNEL_FORTRAN_INTERFACE_H
void fennel_bridge_advance_c(int ilo, int ihi, int jlo, int jhi, int nz, int nbt, int istr, int iend, int jstr, int jend, int use_po4, int use_carbon, int use_oxygen, int use_odu, int use_denit, int use_biosed, int use_bulk, int use_rivdon, int use_talknc, int pco2air_kind, int co2_sc_kind, int o2_sc_kind, int bioiter, double dt_sec, double rho0, double cp_heat, double p_AttSW, double p_AttChl, double p_PARfrac, double p_Vp0, double p_I_thNH4, double p_D_p5NH4, double p_NitriR, double p_K_NO3, double p_K_NH4, double p_K_PO4, double p_K_Phy, double p_Chl2C_m, double p_ChlMin, double p_PhyCN, double p_R_P2N, double p_PhyIP, double p_PhyIS, double p_PhyMin, double p_PhyMR, double p_ZooAE_N, double p_ZooCN, double p_ZooBM, double p_ZooER, double p_ZooGR, double p_ZooMin, double p_ZooMR, double p_LDeRRN, double p_LDeRRC, double p_CoagR, double p_SDeRRN, double p_SDeRRC, double p_RDeRRN, double p_RDeRRC, double p_wPhy, double p_wLDet, double p_wSDet, double p_pCO2air, const double *rmask, const double *Hz, const double *z_r, const double *z_w, const double *srflx, const double *sustr, const double *svstr, const double *uwind, const double *vwind, double *pH, const double *t_nstp, double *t_nnew, int dbg_level, int dbg_i, int dbg_j)