13.3. Coupled variables#
13.3.1. Coupling with an atmospheric model#
When coupling CROCO to an atmospheric model, to have a consistent interface, you should use momentum and heat fluxes computed from the atmospheric model bulk formula.
No surface forcing file is required (only boundary forcing, and eventually tidal forcing).
The following cppkeys have to be set:
# define OA_COUPLING
# define MPI
# undef BULK_FLUX
# undef SMFLUX_CFB
Note
SMFLUX_CFB
is a cppkey to use a wind stress relative to the current in
forced mode. In coupled mode, as current is sent to the atmosphere, the
wind stress from the atmospheric model account for such a current feedback.
Fields sent by CROCO 


Name (units) 
name and eventual oper. in the model 
OASIS name 
SST (K) 
t(:,:,N,nnew,itemp) + 273.15 
CROCO_SST 
Ucomponent of current (m/s) 
u (at rho points):
0.5*(u(1:Lmmpi,1:Mmmpi,N,nnew)
+u(2:Lmmpi+1,1:Mmmpi,N,nnew))

CROCO_UOCE 
Vcomponent of current (m/s) 
v (at rho points):
0.5*(v(1:Lmmpi,1:Mmmpi,N,nnew)
+v(1:Lmmpi,2:Mmmpi+1,N,nnew))

CROCO_VOCE 
Eastward component of current (m/s) 
u (at rho points) rotated eastwards
(useful for rotated grids)
(0.5 * (u(1:Lmmpi ,1:Mmmpi,N,nnew)
+ u(2:Lmmpi+1,1:Mmmpi,N,nnew)) )
* cos(angler(1:Lmmpi ,1:Mmmpi))
 (0.5 * (v(1:Lmmpi,1:Mmmpi ,N,nnew)
+ v(1:Lmmpi,2:Mmmpi+1,N,nnew)) )
* sin(angler(1:Lmmpi ,1:Mmmpi))
+u(2:Lmmpi+1,1:Mmmpi,N,nnew))

CROCO_EOCE 
Northward component of current (m/s) 
v (at rho points) rotated northward
(useful for rotated grids)
(0.5 * (u(1:Lmmpi ,1:Mmmpi,N,nnew)
+ u(2:Lmmpi+1,1:Mmmpi,N,nnew)) )
* sin(angler(1:Lmmpi ,1:Mmmpi))
+ (0.5 * (v(1:Lmmpi,1:Mmmpi ,N,nnew)
+ v(1:Lmmpi,2:Mmmpi+1,N,nnew)) )
* cos(angler(1:Lmmpi ,1:Mmmpi))

CROCO_NOCE 
Fields received by CROCO 


Name (units) 
name and eventual oper. in the model 
OASIS name 
U component of wind stress (N/m2) 
sustr (at u point):
0.5*(FIELD(io1,jo)+FIELD(io,jo))/rho0
if eastward, it is first rotated:
FIELD = etau * cos(angler)
+ ntau * sin(angler)

CROCO_UTAW or CROCO_ETAW 
V component of wind stress (N/m2) 
svstr (at v point):
0.5*(FIELD(io,jo1)+FIELD(io,jo))/rho
if northward, it is first rotated:
FIELD = ntau * cos(angler)
 etau * sin(angler)

CROCO_VTAW or CROCO_NTAW 
Wind stress module (N/m2) 
smstr = FIELD / rho0 
CROCO_TAUM 
Surface net solar flux (W/m2) 
srflx = FIELD / (rho0*Cp) 
CROCO_SRFL 
Surface net nonsolar flux (W/m2) 
stflx(:,:,itemp) = FIELD / (rho0*Cp) 
CROCO_STFL 
EvaporationPrecipitation (kg/m2/s) 
stflx(:,:,isalt) = FIELD / 1000 
CROCO_EVPR 
Surface atmospheric pressure (Pa) 
patm2d = FIELD 
CROCO_PSFC 
Fields received by WRF 


Name (units) 
name (in the model) 
OASIS name 
SST (K) 
SST 
WRF_d01_EXT_d01_SST 
U component of current (m/s) 
UOCE 
WRF_d01_EXT_d01_UOCE 
V component of current (m/s) 
VOCE 
WRF_d01_EXT_d01_VOCE 
Eastward component of current (m/s) 
EOCE 
WRF_d01_EXT_d01_EOCE 
Northward component of current (m/s) 
NOCE 
WRF_d01_EXT_d01_NOCE 
Fields sent by WRF 


Name (units) 
name (in the model) 
OASIS name 
Surface net solar flux (W/m2) 
GSW 
WRF_d01_EXT_d01_SURF_NET_SOLAR 
Surface net nonsolar flux (W/m2) 
GLWSTBOLT*EMISS*SST**4LHHFX 
WRF_d01_EXT_d01_SURF_NET_NONSOLAR 
Evaporationprecipitation (kg/m2/s) 
QFX(RAINCV+RAINNCV)/DT 
WRF_d01_EXT_d01_EVAPPRECIP 
Surface atmospheric pressure (Pa) 
PSFC 
WRF_d01_EXT_d01_PSFC 
Wind stress module (N/m2) 
taut = rho * ust**2 
WRF_d01_EXT_d01_TAUMOD 
U component of wind stress (N/m2) 
taui = taut * u_uo / wspd 
WRF_d01_EXT_d01_TAUX 
V component of wind stress (N/m2) 
tauj = taut * v_uo / wspd 
WRF_d01_EXT_d01_TAUY 
Eastward comp. of wind stress(N/m2) 
cosa * taui  sina * tauj 
WRF_d01_EXT_d01_TAUE 
Northward comp. of wind stress(N/m2) 
cosa * tauj + sina * taui 
WRF_d01_EXT_d01_TAUN 
Note
If you decide to couple CROCO with multiple WRF domains, variables coming from WRF will be defined by adding _EXT*. Here * corresponds to which domains the variable is coming (1=Parent, 2=Nest 1 ,…).
13.3.2. Coupling with a wave model#
When coupling CROCO to a wave model, the wavecurrent interactions have to be set on. At the moment, only mean wave parameters are exchanged, their contribution to ocean dynamics is computed into the wavecurrent interaction routine in CROCO.
The following cppkeys have to be set:
# define OW_COUPLING
# define MPI
# define MRL_WCI
Note
You also have to be careful to the choice of the momentum flux. For better consistency, here we suggest to account for the momentum flux seen by the wave model, and thus set:
# undef BULK_FLUX
# define WAVE_SMFLUX
Fields sent by CROCO 


Name (units) 
name and eventual oper. in the model 
OASIS name 
SSH (m) 
zeta 
CROCO_SSH 
Ucomponent of current (m/s) 
u (at rho points):
0.5*(u(1:Lmmpi,1:Mmmpi,N,nnew)
+u(2:Lmmpi+1,1:Mmmpi,N,nnew))

CROCO_UOCE 
Vcomponent of current (m/s) 
v (at rho points):
0.5*(v(1:Lmmpi,1:Mmmpi,N,nnew)
+v(1:Lmmpi,2:Mmmpi+1,N,nnew))

CROCO_VOCE 
Eastward component of current (m/s) 
u (at rho points) rotated to east
(useful for rotated grids)
(0.5 * (u(1:Lmmpi ,1:Mmmpi,N,nnew)
+ u(2:Lmmpi+1,1:Mmmpi,N,nnew)) )
* cos(angler(1:Lmmpi ,1:Mmmpi))
 (0.5 * (v(1:Lmmpi,1:Mmmpi ,N,nnew)
+ v(1:Lmmpi,2:Mmmpi+1,N,nnew)) )
* sin(angler(1:Lmmpi ,1:Mmmpi))
+u(2:Lmmpi+1,1:Mmmpi,N,nnew))

CROCO_EOCE 
Northward component of current (m/s) 
v (at rho points) rotated to north
(useful for rotated grids)
(0.5 * (u(1:Lmmpi ,1:Mmmpi,N,nnew)
+ u(2:Lmmpi+1,1:Mmmpi,N,nnew)) )
* sin(angler(1:Lmmpi ,1:Mmmpi))
+ (0.5 * (v(1:Lmmpi,1:Mmmpi ,N,nnew)
+ v(1:Lmmpi,2:Mmmpi+1,N,nnew)) )
* cos(angler(1:Lmmpi ,1:Mmmpi))

CROCO_NOCE 
Fields received by CROCO 


Name (units) 
name and eventual oper. in the model 
OASIS name 
Significant wave height (m) 
whrm = FIELD * 0.70710678 
CROCO_HS 
Mean wave period (s) > frequency 
wfrq = 2*pi / FIELD 
CROCO_T0M1 
Mean wave direction > wavenumbers 
wdrx = cos(FIELD  angler)
wdre = sin(FIELD  angler)

CROCO_DIR 
U component of wave stress (m2/s2) 
twox (at u point):
0.5*(FIELD(io1,jo)+FIELD(io,jo))
if eastward, it is first rotated:
FIELD = etwo * cos(angler)
+ ntwo * sin(angler)

CROCO_UTWO or CROCO_ETWO 
V component of wave stress (m2/s2) 
twoy (at v point):
0.5*(FIELD(io,jo1)+FIELD(io,jo))
if northward, it is first rotated:
FIELD = ntwo * cos(angler)
 etwo * sin(angler)

CROCO_VTWO or CROCO_NTWO 
U comp. of windtowave stress (m2/s2) 
tawx (at u point):
0.5*(FIELD(io1,jo)+FIELD(io,jo))
if eastward, it is first rotated:
FIELD = etaw * cos(angler)
+ ntaw * sin(angler)

CROCO_UTAW or CROCO_ETAW 
V comp. of windtowave stress (m2/s2) 
tawy (at v point):
0.5*(FIELD(io,jo1)+FIELD(io,jo))
if northward, it is first rotated:
FIELD = ntaw * cos(angler)
 etaw * sin(angler)

CROCO_VTAW or CROCO_NTAW 
Other optional fields enventually sent, if not, they are analytically computed in the MRL_WCI routine 

Bernoulli head pressure (N/m) 
bhd 
CROCO_BHD 
Wavetoocean TKE flux (W/m2) 
foc 
CROCO_FOC 
Mean wavelength (m) 
wlm 
CROCO_LM 
Wave orbital bottom velocity (m/s) 
ubr = sqrt(ubrx**2+ubry**2) 
CROCO_UBRX and CROCO_UBRY 
Stokes drift surface velocity (m/s) 
ust_ext = sqrt(ustx_ext**2+usty_ext**2) 
CROCO_USSX and CROCO_USSY 
Fields received by WW3 


Name (units) 
name (in the model) 
OASIS name 
SSH = water level (m) 
LEV 
WW3__SSH 
Zonal current (m/s) 
CUR 
WW3_OSSU 
Meridional current (m/s) 
CUR 
WW3_OSSV 
Fields sent by WW3 


Name (units) 
name (in the model) 
OASIS name 
Mean wave period (s) 
T0M1 
WW3_T0M1 
Significant wave height (m) 
HS 
WW3__OHS 
Mean wave direction 
THM 
WW3__DIR 
Zonal wave stress (N/m2) 
TWOX 
WW3_TWOX 
Meridional wave stress (N/m2) 
TWOY 
WW3_TWOY 
Zonal wind stress (N/m2) 
TAWX 
WW3_TAWX 
Meridional wind stress(N/m2) TAWY WW3_TAWY 

Other fields possibly sent, but not used in coupling with CROCO at the moment 

Bernoulli head pressure (N/m) 
BHD 
WW3__BHD 
Bottom orbital velocity (m/s) 
UBR 
WW3__UBR 
Wavetoocean TKE flux (W/m2) 
FOC 
WW3__FOC 
Mean wavelength (m) 
LM 
WW3___LM 
Wave peak frequency (/s) 
FP 
WW3___FP 
13.3.3. Coupling atmosphere and wave models#
Fields received by WW3 


Name (units) 
name (in the model) 
OASIS name 
Zonal wind (m/s) 
WND 
WW3__U10 
Meridional wind (m/s) 
WND 
WW3__V10 
Fields sent by WW3 


Name (units) 
name (in the model) 
OASIS name 
Significant wave height (m) 
HS 
WW3__AHS 
Charnock coefficient 
ACHA 
WW3_ACHA 
Fields sent by WRF 


Name (units) 
name (in the model) 
OASIS name 
Zonal wind at first level( (m/s) 
u_uo 
WRF_d01_EXT_d01_WND_E_01 
Meridional wind at first level (m/s) 
v_vo 
WRF_d01_EXT_d01_WND_N_01 
Fields received by WRF 


Name (units) 
name (in the model) 
OASIS name 
Charnock coefficient 
CHA_COEF 
WRF_d01_EXT_d01_CHA_COEF 
13.3.4. Note on momentum flux when coupling 3 models#
As the wave model has a quite complex parameterization of wave generation by winds, which is in subtle balance with the wave dissipation, the wind stress for the wave model is computed by its own parameterization. Therefore, to ensure energetic consistency of the momentum flux when coupling 3 models, we prescribe the wind stress in CROCO as:
sustr = sustr_from_atm_model  tawx + twox
svstr = svstr_from_atm_model  tawy + twoy
# where taw is stress from atm to waves
# and two is stress from waves to ocean
13.3.5. Note on coupling with AGRIF#
You may decide to coupled CROCO while using AGRIF. To do so, the variables
sent by the parent domain (0) and the child domains (1,2,…) must be separated.
Thus the variables sent, in case of using AGRIF, take the radical defined above
(CROCO_VAR) to which we add _0 (for parent) or _1 (for first child). This gives,
for example for variable SST, CROCO_SST_0
or CROCO_SST_1
for parent and
child respectively.
For the variables received by CROCO, we will use its ability to handle CPLMASK. Each of the domains (parent or children) will be assigned a coupling mask named coupling_mask0.nc (parent), coupling_mask1.nc (child 1), each coupling mask being relative to its grid. The CROCO domain that receives a variable will be identified by its mask (CPLMASK*), which will be added to the previous radical. This will give CROCO_VAR_CPLMASK0 for the parent or CROCO_VAR_CPLMASK1 for child 1.
This makes it easy to define the received variables in a case where one decides
to couple CROCOAGRIF with several WRF domains. In this case the variables will
have the nomenclature CROCO_VAR_CPLMASK0
for the parent CROCO to which we
add _EXT1 for the first domain of coupling_mask0.nc. By continuity _EXT2
will correspond to domain 2 of coupling_mask0.nc. Then the variables received
by CROCO, in a case of CROCOAGRIF/WRFnest simulation, will follow the
format CROCO_VAR_CPLMASK*_EXT*
.