         NAME
              flux_sum - Calculates global carbon and water fluxes

         SYNOPSIS
              #include "lpj.h"

              Real flux_sum(Flux *flux,const Cell grid[],const Config *config);

         DESCRIPTION
              Function calculates global carbon and water fluxes.  The
              arguments of flux_sum are:

              flux Pointer to flux struct. Flux is defined in output.h as
                   follows:

                   typedef struct
                   {
                     Real nep;      /* Total NEP (gC) */
                     Real fire;     /* Total fire (gC) */
                     Real estab;    /* Total extablishment flux (gC) */
                     Real harvest;  /* Total harvested carbon (gC) */
                     Real transp;   /* Total transpiration (dm3) */
                     Real evap;     /* Total evaporation (dm3) */
                     Real interc;   /* Total interception (dm3) */
                     Real wd;       /* Total irrigation water withdrawal (dm3) */
                     Real wd_unsustainable;      /* Total irrigation water withdrawal from unsustainable sourc
                   e (dm3) */
                     Real wateruse;              /* Total wateruse for household industry and livestock */
                     Real discharge;             /* Total discharge (dm3) */
                     Real evap_lake;             /* Total evaporation from lakes (dm3) */
                     Real evap_res;              /* Total evaporation from reservoirs (dm3) */
                     Real irrig;                 /* Total field irrigation (dm3) */
                     Real conv_loss;             /* Total evaporation during conveyance (dm3) */
                     Real prec;                  /* Total precipitation (dm3) */
                     Real delta_surface_storage; /* Total change of surface storage (dm3), increase positive *
                   /
                     Real delta_soil_storage;    /* Total change of soil storage (dm3), increase positive */
                     Real area;                  /* Total area (m2) */
                     Real total_reservoir_out;   /* Total water extracted from reservoirs for irrigation */
                     Real total_irrig_from_reservoir; /*Total water added to fields from reservoirs */
                   } Flux;

              grid Cell grid array allocated and initialized by newgrid().

              config
                   LPJmL configuration data. Must be read by readconfig().

         RETURN VALUE
              Upon successful completion the total carbon flux in (gC) is
              returned.

         AUTHORS
              Werner von Bloh (Werner.von.Bloh@pik-potsdam.de), Sibyll
              Schaphoff (Sibyll.Schaphoff@pik-potsdam.de), Stefanie Rost
              (Jachner) (Stefanie.Rost@pik-potsdam.de), Marlies
              Gumpenberger (Marlies.Gumpenberger@pik-potsdam.de), Tim
              Beringer (Erbrecht) (Tim.Beringer@pik-potsdam.de), Christoph
              Mueller (Christoph.Mueller@pik-potsdam.de) Jens Heinke
              (Jens.Heinke@pik-potsdam.de), Hester Biemans
              (Hester.Biemans@wur.nl), Kirsten Thonicke
              (Kirsten.Thonicke@pik-potsdam.de), Ursula Heyder
              (Ursula.Heyder@pik-potsdam.de),

         SEE ALSO
              readconfig(3), newgrid(3), fprintflux(3)