Opened 10 years ago
Closed 5 years ago
#38 closed defect (fixed)
parameters of condveg_soilalb
Reported by: | nicolasviovy | Owned by: | peylin |
---|---|---|---|
Priority: | major | Milestone: | ORCHIDEE 3.0 |
Component: | Physical processes | Version: | orchidee_1_9_7 |
Keywords: | Cc: |
Description
we only pass soilalb_dry,soilalb_wet to subroutine condveg_soilalb
whereas we also calculate soilalb_moy that is not passed as argument (and was passed before).
Its work since soilalb_moy is a global variable but it seems strange and others dry and wet are passe and could lead to futur bugs
Change History (6)
comment:1 follow-up: ↓ 2 Changed 10 years ago by jpolcher
comment:2 in reply to: ↑ 1 Changed 10 years ago by nvuilsce
Replying to jpolcher:
I do not understand how this was coded ! It makes the code unnecessarily complicated.
I would propose to suppress the variable soilalb_moy and just for the case of alb_bare_model=TRUE define soilalb_dry = soilalb_wet. This way the soil moisture does not affect any more the bare soil moisture.
So the flag "alb_bare_model" is only needed in the subourtine condveg_soilalb and the entire condveg module simplified.
It could be done as suggested by Jan.
If so, I would suggest to use temporary variables to store vis_dry, nir_dry, vis_wet and nir_wet and to initialize them as followed, at the top of the condveg_soilalb subroutine:
IF ( alb_bare_model .EQ. TRUE) THEN vis_dry_temp=vis_dry nir_dry_temp=nir_dry vis_wet_temp=vis_wet nir_wet_temp=nir_wet ELSE vis_dry_temp=(vis_dry+vis_wet)/deux nir_dry_temp=(nir_dry+nir_wet)/deux vis_wet_temp=(vis_dry+vis_wet)/deux nir_wet_temp=(nir_dry+nir_wet)/deux ENDIF
and to use these temporary variables after within the code of condveg_soilalb.
Concerning the comment made by Nicolas, would it be ok if we suppress from the arguments list of condveg_soilalb the 2 variables soilalb_dry and soilalb_wet because they are, like soilalb_moy, module variables.
About this routine, how do you understand the setting of the 4 variables when there is not point associated into the soilcolor map.
soilalb_dry(ib,ivis) = (SUM(vis_dry)/classnb + SUM(vis_wet)/classnb)/deux soilalb_dry(ib,inir) = (SUM(nir_dry)/classnb + SUM(nir_wet)/classnb)/deux soilalb_wet(ib,ivis) = (SUM(vis_dry)/classnb + SUM(vis_wet)/classnb)/deux soilalb_wet(ib,inir) = (SUM(nir_dry)/classnb + SUM(nir_wet)/classnb)/deux
Why do we mix dry and wet classes for defining both dry and wet albedo ?
comment:3 Changed 10 years ago by peylin
- Owner changed from somebody to jpolcher
- Status changed from new to assigned
comment:4 Changed 5 years ago by jgipsl
- Milestone set to ORCHIDEE 3.0
- Owner changed from jpolcher to peylin
soilalb_dry,soilalb_wet are currently not used. Philippe and Vladislav will go through the code and maybe do some cleaning without remove the code.
comment:5 Changed 5 years ago by nvuilsce
Indeed, as suggested by Jan, soilalb_dry and soilalb_wet have been removed from the argument list of condveg_soilalb because they are global variables. This has been done in rev r2581
comment:6 Changed 5 years ago by nvuilsce
- Resolution set to fixed
- Status changed from assigned to closed
I do not understand how this was coded ! It makes the code unnecessarily complicated.
I would propose to suppress the variable soilalb_moy and just for the case of alb_bare_model=TRUE define soilalb_dry = soilalb_wet. This way the soil moisture does not affect any more the bare soil moisture.
So the flag "alb_bare_model" is only needed in the subourtine condveg_soilalb and the entire condveg module simplified.