wiki:FMCleanUp

Version 4 (modified by bpoulter, 12 years ago) (diff)

--

Here is a running list of FM cleaning before FM is merged with ORCHIDEE trunk

  • Add source file name, then add date and initials to help with tracking, e.g.,
  1. stomate_forestry.f90 (BP: 11/09/12)
    • line XX:
  2. ...

FROM FM (Ben will clean up)

  • in stomate_alloc line 599 the denominator may be equal to 0 so I added:

IF ( SUM(biomass(:,j,(/isapabove,iheartabove,isapbelow,iheartbelow/))) > 0 )

  • similar problem in stomate_lpj.f90 where I added:

WHERE ((biomass(:,:,isapabove)+biomass(:,:,iheartabove)+biomass(:,:,isapbelow) + biomass(:,:,iheartbelow)) >0 )

  • similar problem in stomate_forestry.f90 :

IF ( sum(biomass(i,j,(/isapabove,isapbelow,iheartabove,iheartbelow/))) > 0 ) THEN !FM_120731 frac_shoot=sum(biomass(i,j,(/isapabove,iheartabove/)))/& &sum(biomass(i,j,(/isapabove,isapbelow,iheartabove,iheartbelow/))) ENDIF !FM_120731

I think we should check all these types of division where the SUM may be 0 and protect the code using either WHERE or IF (and provide another solution when the SUM is 0).

In general I find this branch needs to be updated and some modules are quite messy (diffuco.f90) with a mixture of things more or less related to forestry (such as isotopes). In the last weekly meeting, Didier and Nicolas were more in favor of merging the forestry module within the code. That would be a nicer environment for Chao to begin his tests.


  1. FROM TL (Ben will clean up) (will be organized with more consistency)

What we do not know : z0 (surface roughness) and roughheight (effective height for roughness) are set up as function of HEIGHT. But HEIGHT (cf « Solved, 3°) ») is constant. Z0 and roughheight could be set up as function of HEIGHT AND AV_HEIGHT ?

Solved : 1°) Kun Tan : AGE_TARGET changed, so that an automatic clearcut is not set too early. Modification made in home/satellites5/tlaunois/modipsl/ORCHIDEE_FORESTRY/modipsl_c13_forestry/modeles/ORCHIDEE/src_stomate/stomate_forestry.f90

(In fact, in stomate_forestry.f90, there is another parameter "age_target_def", that we can modify in run.def to control the value of "age_target", but we donot use it in run.def right now)

2°) 21/10/2010 : Thomas Launois suppressed 365 multiplicator coefficient in home/satellites5/tlaunois/modipsl/ORCHIDEE_FORESTRY/modipsl_c13_forestry/modeles/ORCHIDEE/src_stomate/stomate_lpj.f90 (solving problem for incoherent AV_CIRC, AV_HEIGHT , DOM_HEIGHT, IND, LAI_MAX_LYEAR, SIGMA, GAMMA)

3°) HEIGHT : what does it represent ? A best-guess of the height of each PFT. Constant value trhough the simulations AV_HEIGHT gives the evolution of the height of each PFT through the years.

Problem : 1°) Concatenation not possible using ncrcat (option available at the end of /home/users/tlaunois/MODELE/run_c13forestry.bat)

2°) Line added in ORCHIDEE/src_stomate/stomate_forestry.f90, to avoid the check by compiler for variable CIRC (argument unproperly set) :

REAL(r_std) FUNCTION vol_circ(circ,ntrees,pft)

!DEC$ ATTRIBUTES NO_ARG_CHECK
CIRC

ideas to solve this : need an « array » argument, but problem we just send a scalar or constant.

3°) problems with some yearly output (?? don't remember what this was about)