Here is a running list of FM cleaning before FM is merged with ORCHIDEE trunk[[BR]] - Add source file name, then add date and initials to help with tracking, e.g.,[[BR]] 1. stomate_forestry.f90 (BP: 11/09/12) - line XX: 2. ... ---- FROM CY and MS Units of ind are unclear - per ha or m2 Adding number of trees from circ classes does not equal ind ---- FROM TDG 1. stomate_forestry.f90 line 1292 the lai_max_calc for SRC is only called if lai_max_calc < 2. At the start of the plantation, the lai was higher than 2, from the spinup and therefore lai_max_calc was not calculated as it should in the first year of SRC.[[BR]] I solved it by moving it out of:[[BR]] {{{ IF ( lai_max_calc(i,j) .LT. 2.) THEN ... ENDIF }}} and rewriting it as:[[BR]] {{{ IF (clearfirst .AND. forest_managed(i,j) == 4) lai_max_calc(i,j)=min(real(0+1)**2/4.,1.)*lai_max(j) }}} 2. In stomate.f90 line 705, forest_managed16 is read and passed to stomateLPJ, readstart ..., but not to stomate_forestry.[[BR]] In stomate_forestry.f90 line 2404, forest_managed16 is read again and used passed around a lot.[[BR]] In stomate_constants.f90 line 567, the forest management flag is read again, but this time in a global variable. This variable is only used once in stomate_data.[[BR]] Maybe it's better to read the flag only once in a global variable, so you don't waste cpu on I/O operations and you don't need to pass it around that much. 3. In stomate_forestry.f90 line 2477-2485, the initial biomass after clearcut is set. Why does it add heartwood and doesn't it just use the values specified in stomate_data? [[BR]] I added the following line to overwrite this for SRC, because I start my plantation with cuttings, not saplings, and they don't contain heartwood.[[BR]] {{{ IF ((j==6).AND.(forest_managed(i,j)==4)) THEN bm_init(:) = bm_sapl(j,:) ENDIF }}} ---- 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) ---- another hard-coded parameter limiting the normal age development of the forest : in src_stomate/stomate_constants.f90 old_growth_age : after this target, the model switches back to ORCHIDEE-Standard.... (the other parameters to be careful about are age_target, age_target_def, early_cut, clearfirst)