# Introduction

The MATLAB functions in the biogeochem-phi repository evaluate the different equations presented by Humphreys et al. (2018).

# Installation

Add all MATLAB functions from the biogeochem-phi repository to your MATLAB path.

## Dependencies

To work correctly, the biogeochem-phi functions also require that you download the MATLAB functions from oceancarb-constants, and add them to your MATLAB path.

# Functions

## bgc_isocap

Evaluates the isocapnic quotient (*Q*) following Eq. (8) of Humphreys et al. (2018); its approximation, following their Eq. (6); and the "released CO_{2}:precipitated carbonate ratio" for calcification, of Frankignoulle et al. (1994).

### Usage

`[Q, Qx, Psi] = bgc_isocap(pco2, dic, temp, sal);`

### Inputs

Variable |
Description |
Unit |
Type |

`pco2` |
Partial pressure of CO_{2} in seawater |
μatm | double |

`dic` |
Dissolved inorganic carbon | μmol/kg-sw | double |

`temp` |
Seawater temperature | °C | double |

`sal` |
Practical salinity | - | double |

### Outputs

Variable |
Description |
Unit |
Type |

`Q` |
Isocap slope, i.e. ∂TA/∂DIC at constant seawater pCO_{2} |
- | double |

`Qx` |
Approximation to the isocap slope | - | double |

`Psi` |
Special case of Φ for calcification (i.e. Ψ of Frankignoulle et al., 1994) | - | double |

## bgc_phi

Calculates Φ, the amount of CO_{2} that must be released from or added to seawater after a change in TA and/or DIC in order to return back to the original seawater *p*CO_{2}, following Eq. (10) of Humphreys et al. (2018).

### Usage

`Phi = bgc_phi(Q,Aq_Cq);`

### Inputs

Variable |
Description |
Unit |
Type |

`Q` |
Isocap slope, i.e. ∂TA/∂DIC at constant seawater pCO_{2} |
- | double |

`Aq_Cq` |
1×2 vector of [ΔTA, ΔDIC] | μmol/kg-sw | double |

### Output

Variable |
Description |
Unit |
Type |

`Phi` |
Φ, of Humphreys et al. (2018) Eq. (10) | μmol/kg-sw | double |

## bgc_normalise

Normalises an input vector to a magnitude of unity.

### Usage

`nCq_nAq = bgc_normalise(Aq_Cq);`

### Input

Variable |
Description |
Unit |
Type |

`Aq_Cq` |
1×2 vector of [ΔTA, ΔDIC] | μmol/kg-sw | double |

### Output

Variable |
Description |
Unit |
Type |

`nAq_nCq` |
Input vector normalised with a magnitude of unity | μmol/kg-sw | double |