src/lib/utils/ciiCalculator.ts.
Reference CII
Vessel type strings from the database are normalised case-insensitively and matched against synonyms (e.g. “Crude Oil Tanker” →
TANKER, “Car Carrier” → RO_RO).
Required CII
Attained CII
× 1,000,000).
Rating boundaries
Ratings A–E are determined by multiplying the Required CII by ship-type-specific d-factors (boundary multipliers from MEPC.354(78)):- Attained ≤ d1 × Required → A
- Attained ≤ d2 × Required → B
- Attained ≤ d3 × Required → C (this is the compliance threshold)
- Attained ≤ d4 × Required → D
- Otherwise → E
Compliance margin
COMPLIANT if Attained ≤ Required, otherwise NON_COMPLIANT.
Implementation
src/lib/utils/ciiCalculator.ts — exports calculateCII, calculateCIISafe, calculateCIIWithReeferCorrection, and calculateCIIWithReeferCorrectionSafe.
Safe variants return null instead of throwing when inputs are missing — used throughout the app where data quality varies by vessel.
Reference
- IMO MEPC.353(78) — Reference lines (a, c coefficients)
- IMO MEPC.354(78) — Rating boundaries (d-vector values)
- IMO MEPC.339(76) — AER/CII calculation guidelines and reduction factors
- Reefer correction — MEPC.355(78)
- Open-IMO-CII-Calculator — open-source reference implementation