Skip to content

iHAMOCC

Tomas Torsvik edited this page Jun 24, 2021 · 42 revisions

The origin of iHAMOCC is the Hamburg ocean carbon cycle model (HAMOCC), originally developed at MPI in Hamburg. This model has been adapted for an isopycnic ("constant density") vertical coordinate framework by researchers in Bergen, who have created the now independent iHAMOCC model. Although different versions of HAMOCC share the same origin (e.g. iHAMOCC used for NorESM2, HAMOCC6 used for MPI-ESM1.2), they are developed independently and are not interchangable at current time (June 2021).

Although iHAMOCC is developed as a BGC component in the BLOM/iHAMOCC system, we still try to maintain a separation between BLOM and iHAMOCC source code, and a clean interface between the two. Hence, the core iHAMOCC code should not reference BLOM variables or parameters directly, but only those that have been defined for the BLOM/iHAMOCC interface. There are some exceptions to this general rule, mainly for the mod_xc module that defines parameters for the model dimensions.

BLOM/iHAMOCC interface

iHAMOCC extends the number of ocean tracers that is defined in BLOM, and use the BLOM routines for calculation of tracer advection and diffusion.

NOTE: Tracer fields in BLOM are defined with units [mol / kg] whereas tracer fields in iHAMOCC are defined with units [kmol / m^3]. It is therefore necessary to do a unit conversion when passing tracers between BLOM and iHAMOCC.

modules & subroutines

  • mo_intfcblom.F90 :: Declaration and memory allocation related to the BLOM-iHAMOCC interface. This includes 2-time-level copies of sediment and atmospheric fields.
    • mo_intfcblom (module)
    • alloc_mem_intfcblom (subroutine, public)
  • mo_vgrid.F90 :: Declaration, memory allocation, and routines related to the vertical grid structure. These have to be recalculated every time step when iHAMOCC is coupled to BLOM.
    • mo_vgrid (module)
    • set_vgrid (subroutine, public)
    • alloc_mem_vgrid (subroutine, public)
  • blom2hamocc.F :: unit conversion, pass sediment and atmospheric fields from BLOM to iHAMOCC
  • hamocc2blom.F :: unit conversion, pass sediment and atmospheric fields from iHAMOCC to BLOM
  • hamocc_init.F :: HAMOCC intialization when coupled to BLOM.
  • hamocc_step.F :: HAMOCC time step when coupled to BLOM.

Support for iHAMOCC restart files

The ability to write and read restart files also depend partly on the BLOM structure, hence the support for iHAMOCC restart files also reference some BLOM modules directly.

  • aufr_bgc.F90 :: Read restart data to continue an interrupted integration.
  • aufw_bgc.F90 :: Write restart data for continuation of interrupted integration.
  • restart_hamoccwt.F :: Wrapper for aufw_bgc subroutine, called from external tracer routine restart_trcwt.

iHAMOCC main routine

The subroutine hamocc4bcm is called from hamocc_step, once per time step, and runs through the following steps:

  1. Increment BGC time step counter for run (ldtrunbgc) and for experiment (ldtbgc).
  2. call set_vgrid :: Calculate variables with respect to current vertical grid
  3. strahl :: Update net solar radiation
  4. atm :: Update atmospheric CO2 [optional: PROGCO2, DIAGCO2]
  5. call get_cfc :: Update atmospheric CFC [optional: CFC]
  6. call ocprod :: Update biological production, remineralisation and particle sinking.
  7. Set minimum ocetra values to zero.
  8. call cyano :: Nitrogen fixation by cyano bacteria, followed by remineralisation and nitrification.
  9. call carcham :: Inorganic carbon cycle.
  10. call n_deposition :: Apply nitrogen deposition to the top-most model layer
  11. call riverinpt :: Apply riverine input to oceanic tracer fields
  12. call update_boxatm :: Update atmospheric pCO2 [optional: BOXATM]
  13. call preftrc :: Update preformed tracers
  14. call powach :: Update sediment deposition [optional: SEDBYPASS]
  15. call sedshi :: Once per day, shift sediments [optional: SEDBYPASS]
  16. pflxco2 :: Pass CO2 flux, convert from [kmol / m^2] to [kg / m^2 / s].
  17. pflxdms :: Pass DMS flux, convert from [kmol / m^2] to [kg / m^2 / s].

NOTE: Steps marked by [optional: {LABEL}] are turned on/off depending on value of preprocessor flag {LABEL}.

General support routines

Tracer specific routines

Ocean biogeochemistry

  • mo_biomod.F90 :: Variables for marine biology.
    • mo_biomod (module)
    • alloc_mem_biomod (subroutine, public)
  • mo_carbch.F90 :: Variables for inorganic carbon cycle.
    • mo_carbch (module)
    • alloc_mem_carbch (subroutine, public)
  • mo_fedep.F90 :: Variables and routines for iron deposition
    • mo_fedep (module)
    • ini_fedep (subroutine, public)
    • get_fedep (subroutine, public)
  • mo_ndep.F90 :: Routines for reading and applying nitrogen deposition fluxes
    • mo_ndep (module)
    • ini_ndep (subroutine, public)
    • get_ndep (subroutine, public)
    • n_deposition (subroutine, public)
  • carchm.F90 :: Inorganic carbon cycle.
  • carchm_kequi.F90 :: Calculate equilibrium constant for the carbonate system
  • carchm_solve.F90 :: Solve carbon chemistry.
  • carchm_solve_DICsat.F90 :: Solve DICsat from TALK and pCO2.
  • cyano.F90 :: Nitrogen-fixation by cyano bacteria, followed by remineralisation and nitrification

Ocean BGC - initial conditions

  • mo_Gdata_read.F90 :: Routines for reading initial condition files for OMIP-BGC
    • mo_Gdata_read (module)
    • set_Gdata (subroutine, public)
    • clean_Gdata (subroutine, public)
    • get_profile (subroutine, public)
    • get_region (funtion, public)
  • get_pi_ph :: Read data for pi_ph variable (pre-industrial pH)

Atmospheric boundary layer

Sediments and pore water

  • mo_sedmnt.F90 :: Sediment declaration and memory allocation
    • mo_sedmnt (module)
    • alloc_mem_sedmnt (subroutine, public)
  • bodensed.F90 :: Set up of sediment layer
  • powach.F90 :: Main sediment routine - update sediment and pore water fluxes
  • powadi.F90 :: Sediment pore water vertical diffusion with simultaneous dissolution.
  • dipowa.F90 :: Calculate vertical diffusion of sediment pore water properties and diffusive flux through the ocean/sediment interface.
  • sedshi.F90 :: Shift solid sediment layer downwards, if layer is full.

River input

  • mo_riverinpt.F90 :: Routines for reading and applying riverine nutrient and carbon input data
    • mo_riverinpt (module)
    • ini_riverinput (subroutine, public)
    • riverinpt (subroutine, public)

I/O routines

  • mo_bgcmean.F90 :: Calculate mean values for BGC fields
    • mo_bgcmean (module)
    • alloc_mem_bgcmean (subroutine, public)
    • inisrf (subroutine, public)
    • inilyr (subroutine, public)
    • inilvl (subroutine, public)
    • inisdm (subroutine, public)
    • inibur (subroutine, public)
    • accsrf (subroutine, public)
    • acclyr (subroutine, public)
    • acclvl (subroutine, public)
    • accsdm (subroutine, public)
    • accbur (subroutine, public)
    • finsrf (subroutine, public)
    • finlyr (subroutine, public)
    • wrtsrf (subroutine, public)
    • wrtlyr (subroutine, public)
    • wrtlvl (subroutine, public)
    • wrtsdm (subroutine, public)
    • wrtbur (subroutine, public)
    • logsrf (subroutine, public)
    • loglyr (subroutine, public)
    • loglvl (subroutine, public)
    • logsdm (subroutine, public)
    • msksrf (subroutine, public)
    • msklvl (subroutine, public)
    • bgczlv (subroutine, public)
  • accfields.F90 :: Accumulate fields for time-avaraged output and write output
  • inventory_bgc.F90 :: calculate the BGC inventory.