| 11 | |
| 12 | ---- |
| 13 | FROM FM (Ben will clean up) |
| 14 | - in stomate_alloc line 599 the denominator may be equal to 0 so I added: |
| 15 | IF ( SUM(biomass(:,j,(/isapabove,iheartabove,isapbelow,iheartbelow/))) > 0 ) |
| 16 | |
| 17 | - similar problem in stomate_lpj.f90 where I added: |
| 18 | WHERE ((biomass(:,:,isapabove)+biomass(:,:,iheartabove)+biomass(:,:,isapbelow) + biomass(:,:,iheartbelow)) >0 ) |
| 19 | |
| 20 | - similar problem in stomate_forestry.f90 : |
| 21 | IF ( sum(biomass(i,j,(/isapabove,isapbelow,iheartabove,iheartbelow/))) > 0 ) THEN !FM_120731 |
| 22 | frac_shoot=sum(biomass(i,j,(/isapabove,iheartabove/)))/& |
| 23 | &sum(biomass(i,j,(/isapabove,isapbelow,iheartabove,iheartbelow/))) |
| 24 | ENDIF !FM_120731 |
| 25 | |
| 26 | 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). |
| 27 | |
| 28 | 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. |
| 29 | |