Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#37 closed defect (fixed)

Routing.f90: bug correction for water conservation + new diagnostics of water conservation imbalance

Reported by: mguimberteau Owned by: mguimberteau
Priority: major Milestone: IPSLCM6.v1
Component: Physical processes Version:
Keywords: Routing, waterbal Cc:

Description

Platform: vargas (IDRIS)
Version: Trunk
Model specification: 11-layer hydrology, routing+floodplains+swamps activated
Geographical area and forcing for test: Amazonian region, Sheffield-GPCC (1°x1°)

When activating check_waterbal in the model to check the water conservation in the routing.f90 module, the test done in the subroutine routing_waterbal fails.

The error of the non-conservation of water results from the subroutine routing_lake which simulates the endorheic lakes.
It is a very short subroutine:

    DO ig=1,nbpt
       !
       total_area = SUM(routing_area(ig,:))
       !
       lake_reservoir(ig) = lake_reservoir(ig) + lakeinflow(ig)
       !uptake in Kg/dt
       refill = MAX(zero, maxevap_lake * (un - humrel(ig)) * dt_routing * total_area)
       return_lakes(ig) = MIN(refill, lake_reservoir(ig))
       lake_reservoir(ig) = lake_reservoir(ig) - return_lakes(ig)
       !Return in Kg/m^2/dt
       IF ( doswamps ) THEN
          return_lakes(ig) = return_lakes(ig)/total_area
       ELSE
          return_lakes(ig) = zero
       ENDIF
       !
       ! This is the volume of the lake scaled to the entire grid.
       ! It would be batter to scale it to the size of the lake
       ! but this information is not yet available.
       lake_diag(ig) = lake_reservoir(ig)/total_area
       !
    ENDDO

In this case, the water going to the lake (lakeinflow) is stored entirely in the reservoir (lake_reservoir).
According to the water amount "refill", return_lakes is removed from the reservoir in any case.
If the swamps are activated, return_lakes is kept and put into "returnflow" (line 534 after the call of routing_lakes) which comes back to soil moisture. In this case, water balance is ok.
But if the swamps are not activated, the water removed from the reservoir is put to zero!! Thus, the water is not conserved in this case!

This is a correction proposal:

    DO ig=1,nbpt
       !
       total_area = SUM(routing_area(ig,:))
       !
       lake_reservoir(ig) = lake_reservoir(ig) + lakeinflow(ig)
       !uptake in Kg/dt
       IF ( doswamps ) THEN
          refill = MAX(zero, maxevap_lake * (un - humrel(ig)) * dt_routing * total_area)
          return_lakes(ig) = MIN(refill, lake_reservoir(ig))
          lake_reservoir(ig) = lake_reservoir(ig) - return_lakes(ig)
          !Return in Kg/m^2/dt
          return_lakes(ig) = return_lakes(ig)/total_area
       ELSE
          return_lakes(ig) = zero
       ENDIF
       !
       ! This is the volume of the lake scaled to the entire grid.
       ! It would be batter to scale it to the size of the lake
       ! but this information is not yet available.
       lake_diag(ig) = lake_reservoir(ig)/total_area
       !
    ENDDO

With this correction, water conservation test is ok but only in monoprocessor simulation. In multiproc simulation, the bug of water conservation reappears!!

Attachments (1)

routing_wbr_diag_only.pdf (448.3 KB) - added by mguimberteau 5 years ago.
Verification of water conservation in the routing scheme reservoirs

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by jpolcher

Yes, this is very illogical. I see no reason why in the absence of swamps we should not put back some of the water of the lake into soil moisture ... so that it can be evaporated.

Still this will not guarantee moisture conservation on the points where we have endorheic lakes. In fact, the only way to demonstrate water conservation on these points will be to create a variable in which we archive the lake volume changes.

To avoid this problem we had in the very first version of routing.f90 return_lakes = lakeinflow. This gave some large runoff fluxes so people did not like it (but it ensure that we could trace water conservation because by this definition the lake volume does not change).

So as water conservation is our goal we need to introduce the lake volume change variable.

comment:2 Changed 8 years ago by peylin

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

comment:3 Changed 8 years ago by aducharne

  • Status changed from assigned to accepted

comment:4 Changed 8 years ago by aducharne

New correction proposed. Test will be done with and without doswamps by Matthieu G. Jan P. tests dofloodplains and doswamps.

    DO ig=1,nbpt
       !
       total_area = SUM(routing_area(ig,:))
       !
       lake_reservoir(ig) = lake_reservoir(ig) + lakeinflow(ig)
       !uptake in Kg/dt
       ! Maximum evaporation from the lake which will be put into the soil moisture reservoir for future evaporation
       refill = MAX(zero, maxevap_lake * (un - humrel(ig)) * dt_routing * total_area)
       return_lakes(ig) = MIN(refill, lake_reservoir(ig))
       lake_reservoir(ig) = lake_reservoir(ig) - return_lakes(ig)
       !Return in Kg/m^2/dt
       return_lakes(ig) = return_lakes(ig)/total_area
   
       !
       ! This is the volume of the lake scaled to the entire grid.
       ! It would be batter to scale it to the size of the lake
       ! but this information is not yet available.
       lake_diag(ig) = lake_reservoir(ig)/total_area
       !
    ENDDO

comment:5 Changed 7 years ago by aducharne

  • Milestone changed from ORCHIDEE 2.0 to IPSLCM6.v1
  • Owner changed from aducharne to mguimberteau
  • Status changed from accepted to assigned

Changed 5 years ago by mguimberteau

Verification of water conservation in the routing scheme reservoirs

comment:6 Changed 5 years ago by mguimberteau

  • Resolution set to fixed
  • Status changed from assigned to closed
  • Summary changed from Bug correction for water conservation in routing.f90. Test is ok with monoprocessor simulation but fails with multiproc. to Routing.f90: bug correction for water conservation + new diagnostics of water conservation imbalance

All the following modifications has been added in [rev3537]

1. Resolution of the non-conservation of water in the endorheic lakes

The water conservation in the endorheic lakes is resolved by distinguishing two fluxes which come from the lake reservoir: return_lakes and a new variable called lake_evap.

  • if the swamps are not activated, the water is only removed from lakes supposedly as evaporation which is not, at the moment, in interaction with the energy budget.
  • if the swamps are activated, the water removed from the lake flows back into soil moisture through returnflow and evaporation from lake is null.

The lake_evap variables was added in the output of sechiba with XIOS.

2. Addition of diagnostics to check the closure of the water budget in the routing scheme

A diagnostic of water conservation imbalance has been added in the routing scheme. In the same way than Agnès Ducharne coded the TWBR variable in hydrol.f90 (ticket #188), a wbr (Water Budget Residu) term is calculated for each reservoir of the routing scheme. For instance, it is done only for the stream, fast, slow and lake reservoirs. The same work will be done for the flood and pond reservoirs and verified when irrigation and swamps are activated. wbr is defined as the difference between the left-hand (storage) - right-hand (fluxes) terms of the classical expression of the water budget equation. As such, it should be zero if the routing scheme conserves water. These 4 variables were added in the output of sechiba with XIOS.

3. Removal of the variable delsurfstor

The resolution of the non-conservation of water in the endorheic lakes, the new diagnostic of wbr_lake and the next diagnostics that will be coded for flood and pond reservoirs make the variable delsurfstor useless and thus we closed the ticket #200 at the same time.

4. Test of the water conservation in the 4 routing reservoirs

Testing on 4 years simulation at daily time scale (routing time step), the water is conserved in each of the 4 reservoirs, in each grid-cell, at each daily time step (see https://forge.ipsl.jussieu.fr/orchidee/attachment/ticket/37/routing_wbr_diag_only.pdf). We note that in the endorheic lakes, even wbr is very low, it slightly increases with time. We have to check on longer time scale to see if it stabilizes.

comment:7 Changed 5 years ago by jgipsl

Done in the trunk rev [3537]

Note: See TracTickets for help on using tickets.