Python code to calculate ocean reference state - main programme: calc_ref_state.py