Skip to main content
This page documents the exact formulas and constants used in src/lib/utils/ciiCalculator.ts.

Reference CII

Capacity is DWT for cargo and tanker types, GT for cruise ships. Constants are taken from IMO MEPC.354(78). 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

Reduction factors per MEPC.338(76):

Attained CII

CO₂ is supplied in tonnes and converted internally (× 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)):
A rating is the highest band that the Attained CII fits within:
  • 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

Positive margin = the ship is below the required line (good). The compliance status is 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