#763 closed enhancement (fixed)

Clean some XIOS output variables

Reported by: luyssaert Owned by: luyssaert
Priority: major Milestone: ORCHIDEE 4.1
Component: Validation Version: trunc
Keywords: Cc:


List of output corrections

1. MBC_NBP2_x

MBC_NBP2_x: calculated in gC m-2 (these are pools!) when witten to xios this is wrongly divided by 1000 and dt_stomate.

The correct line in stomate_lpj.f90 should be:

CALL xios_orchidee_send_field('MBC_NBP2'TRIM(element_str(iele)), &


The correct lines in field_def_orchidee.xml should be:

<field id="MBC_NBP2_c" name="MBC_NBP2_c" long_name="Cross-check of accumulated nep and biomass pools" unit="gC/m2"/>
<field id="MBC_NBP2_n" name="MBC_NBP2_n" long_name="Cross-check of accumulated nep and biomass pools" unit="gN/m2"/>

2. MBC_NBP1_x

MBC_NBP1_x: calculated in gC m-2 d-1 when written to xios converted to kg C m-2 s-1. Not wrong but it results in very small numbers. To better match the numbers of MBC_NBP2_x and other output variables in the stomate history file, the following changes are proposed:

In stomate_lpj.f90:

CALL xios_orchidee_send_field('MBC_NBP1'TRIM(element_str(iele)), &


In field_def_orchidee.xml

<field id="MBC_NBP1_c" name="MBC_NBP1_c" long_name="Cross-check of flux and pool based NBP" unit="gC/m2/day"/>

<field id="MBC_NBP1_n" name="MBC_NBP1_n" long_name="Cross-check of flux and pool based NBP" unit="gN/m2/day"/>


The calculation of MBC_STOM_x seems to be off by several orders of magnitude. Looking at the history file, it seems that the units are gC/grid/day, not gC/m2/day. And it is not converted to kg/m2/s before output in stomate.f90. But, in the code, the units seem to be the same as variables like soil_n_min(:,:,inspec), harvest_pool_acc, and som, which are all given as g/m2. This variable was a beta-version of the MBC_NBP2_x variables and can be removed.

Remove from stomate.f90:
! Write the mass balance error accumulated over the course of day
! to the history file
! If err_act = 3 the model should stop as soon as there is an
! imbalance. Hence, when this block of code is reached it means
! there is no mass balanc error. In case err_act is 1 or 2, the
! model will not be stopped. It is thus possible to end up here
! and to write a mass balance error.
DO iele = 1,nelements

IF (iele == icarbon) THEN

element_str(iele) = '_c'

ELSEIF (iele == initrogen) THEN

element_str(iele) = '_n'


CALL ipslerr_p(3,'stomate.f90','Define label for iele',,)


CALL histwrite_p (hist_id_stomate,'MBC_STOM'TRIM(element_str(iele)), itime, &

mass_balance_closure(:,iele), kjpindex, horipft_index)

CALL xios_orchidee_send_field('MBC_STOM'TRIM(element_str(iele)), &



Remove from stomate_lpj.f90
All references to the variable mass_balance_closure

Remove from field_def_orchidee.xml
<field id="MBC_STOM_c" name="MBC_STOM_c" long_name="Daily mass balance closure in stomate" unit="gC/grid/day"/>
<field id="MBC_STOM_n" name="MBC_STOM_n" long_name="Daily mass balance closure in stomate" unit="gN/grid/day"/>

Remove from file_def_orchidee.xml
<field field_ref="MBC_STOM_c" level="1"/>
<field field_ref="MBC_STOM_n" level="1"/>

This variable doesn’t seem to be printed anymore in the history file. There is a harvest_above_n but no harvest_above_c. The monitoring file makes reference to it twice, though: once in the variable fHarvest_lands, and once in the variable fHWP_FM_lands. I’m not sure it’s needed in the second, since my understanding is that the harvest_above variable just considered harvest from croplands. It would be good to have four variables in the monitoring: one for the carbon harvested from crops; one for the carbon harvested in wood from land use change; one for the carbon harvested from wood in forest management activities; and one maybe that combines all the three together in a total harvest. In this way, it’s easy to confirm that forest management and land cover change are activated.

Change History (2)

comment:1 Changed 18 months ago by luyssaert

  • Owner changed from somebody to luyssaert
  • Status changed from new to assigned

comment:2 Changed 18 months ago by luyssaert

  • Resolution set to fixed
  • Status changed from assigned to closed
  1. MBC_NBP2_x

Committed in r7113

  1. MBC_NBP1_x

Committed in r7113

  1. MBC_STOM_x

Committed in r7113


Mostly committed in r7113. Separate output was created for crop, grass and wood harvest. Distinguishing between land cover changes and land management requires restructuring the variable harvest_pool (see ticket #764)

Note: See TracTickets for help on using tickets.