function [prdData, info] = predict_Ciliata_mustela(par, data, auxData)
% file generated by prt_predict

% unpack par, data, auxData
cPar = parscomp_st(par); vars_pull(par);
v2struct(par); v2struct(cPar); v2struct(data); v2struct(auxData);

% compute temperature correction factors
TC = tempcorr(temp.am, T_ref, T_A); kT_M = TC * k_M;

% life cycle
pars_tj = [g; k; l_T; v_Hb; v_Hj; v_Hp];
[tau_j, tau_p, tau_b, l_j, l_p, l_b, l_i, rho_j, rho_B, info] = get_tj(pars_tj, f);

if info == 0
  prdData = []; return;
end

% birth
L_b = L_m * l_b; % cm, structural length at puberty
Ww_b = L_b^3*(1+f*ome); % g,weight at birth

% puberty
L_p = L_m * l_p; % cm, structural length at puberty
t_p = (tau_p - tau_b)/ kT_M; % d, time since birth at puberty
Lw_p = L_p/ del_M; % cm, physical length at puberty

% ultimate
L_i = L_m * l_i; % cm, ultimate structural length
Lw_i = l_i * L_m/ del_M; % cm, ultimate physical length
pars_tm = [g; l_T; h_a/ k_M^2; s_G]; % compose parameter vector
tau_m = get_tm_s(pars_tm, f, l_b); % -, scaled mean life span
a_m = tau_m/ kT_M; % d, mean life span

% reproduction
pars_R = [kap; kap_R; g; k_J; k_M; L_T; v; U_Hb; U_Hj; U_Hp]; % compose parameter vector
R_i = TC * reprod_rate_j(L_i, f, pars_R); % #/d, ultimate reproduction rate

% males
p_Am_m = z_m * p_M/ kap; % J/d.cm^2, {p_Am} spec assimilation flux
E_m_m = p_Am_m/ v; % J/cm^3, reserve capacity [E_m]
g_m = E_G/ (kap* E_m_m); % -, energy investment ratio
m_Em_m = y_E_V * E_m_m/ E_G; % mol/mol, reserve capacity
ome_m = m_Em_m * w_E/ w_V; % -, contribution of reserve to weight
pars_tjm = [g_m k l_T v_Hb v_Hj v_Hpm];
[tau_jm, tau_pm, tau_bm, l_jm, l_pm, l_bm, l_im, rho_jm, rho_Bm] = get_tj(pars_tjm, f);
L_mm = v/ k_M/ g_m; % cm, max structural length
L_im = l_im * L_mm;  % cm, ultimate structural length
Lw_im = L_im/ del_M; % cm, ultimate physical length
L_pm = L_mm * l_pm; % cm, structural length at puberty
Lw_pm = L_pm/ del_M; % cm, physical at puberty

% pack to output
prdData.tp = t_p;
prdData.am = a_m;
prdData.Lp = Lw_p;
prdData.Lpm = Lw_pm;
prdData.Li = Lw_i;
prdData.Wwb = Ww_b;
prdData.Ri = R_i;

  % uni-variate data

  % length - wet weight
  LWw = (LWw(:,1) * del_M).^3 * (1 + f_LWw * ome); % g, wet weight

  % time-length
  % female
  [tvel, t_j, t_p, t_b, l_j, l_p, l_b] = get_tj(pars_tj, f_tL, [], tL_f(:,1)*kT_M);
  ELw_f = L_m * tvel(:,4)/ del_M;   % cm, length
  % male
  tvel = get_tj(pars_tjm, f_tL, [t_b, f_tL*z/z_m, l_b*z/z_m], tL_m(:,1)*kT_M);
  ELw_m = L_mm * tvel(:,4)/ del_M;   % cm, length

% pack to output
prdData.LWw = LWw;
prdData.tL_f = ELw_f;
prdData.tL_m = ELw_m;

