Opened 9 years ago

Closed 7 years ago

#44 closed enhancement (fixed)

Find and replace hard-coded values for dpu_max (hydrol)

Reported by: dsolyga Owned by: aducharne
Priority: minor Milestone: ORCHIDEE 1.9.8
Component: Physical processes Version: orchidee_1_9_6
Keywords: hydrology, hydrol module, CWRR Cc:

Description

In sechiba and specially in hydrol module, a parameter called "deux" (defined in constantes.f90) is used. But "deux" might represent the parameter "dpu_max". It is important to distinguish dpu_max from deux which take part in the hydrological process.
A grep command lists the following "deux" present in sechiba :

src_sechiba/condveg.f90:        soilalb_dry(ib,ivis) = (SUM(vis_dry)/classnb + SUM(vis_wet)/classnb)/deux
src_sechiba/condveg.f90:        soilalb_dry(ib,inir) = (SUM(nir_dry)/classnb + SUM(nir_wet)/classnb)/deux
src_sechiba/condveg.f90:        soilalb_wet(ib,ivis) = (SUM(vis_dry)/classnb + SUM(vis_wet)/classnb)/deux
src_sechiba/condveg.f90:        soilalb_wet(ib,inir) = (SUM(nir_dry)/classnb + SUM(nir_wet)/classnb)/deux
src_sechiba/condveg.f90:           soilalb_dry(ib,ivis) = (SUM(vis_dry)/classnb + SUM(vis_wet)/classnb)/deux
src_sechiba/condveg.f90:           soilalb_dry(ib,inir) = (SUM(nir_dry)/classnb + SUM(nir_wet)/classnb)/deux
src_sechiba/condveg.f90:           soilalb_wet(ib,ivis) = (SUM(vis_dry)/classnb + SUM(vis_wet)/classnb)/deux
src_sechiba/condveg.f90:           soilalb_wet(ib,inir) = (SUM(nir_dry)/classnb + SUM(nir_wet)/classnb)/deux
src_sechiba/diffuco.f90:                    (deux*curve_assim)
src_sechiba/hydrolc.f90:        gqseuil = min_sechiba * deux * ruu_ch(ji) ! min_sechiba = 1.e-8 (constantes.f90)
src_sechiba/hydrolc.f90:               ! *** la formule ci-dessous est d'un empirisme absolu : on ajoute deux stresses, on en retranche un autre...????
src_sechiba/hydrol.f90:                     & (EXP(humcste(jv)*dz(jsl,jst)/mille/deux) - &
src_sechiba/hydrol.f90:                     & EXP(-humcste(jv)*dz(jsl+1,jst)/mille/deux))/ &
src_sechiba/hydrol.f90:                     & (EXP(-humcste(jv)*dz(2,jst)/mille/deux) &
src_sechiba/hydrol.f90:          nroot(jv,jst,nslm) = (EXP(humcste(jv)*dz(nslm,jst)/mille/deux) -un) * &
src_sechiba/hydrol.f90:                  & (EXP(-humcste(jv)*dz(2,jst)/mille/deux) &
src_sechiba/hydrol.f90:                        & MAX((MAXVAL(ks_usda)/ks(njsc(ji)))**(- veget(ji,jv) * (humcste(jv)*zz(jsl,jst)/mille - un)/deux), &
src_sechiba/hydrol.f90:          !!??Aurelien: c koi ce deux? a remplacer par dpu_max?
src_sechiba/hydrol.f90:          tmc_litter_wilt(ji,jst) = dz(2,jst) * mcw(njsc(ji)) / deux
src_sechiba/hydrol.f90:          tmc_litter_res(ji,jst) = dz(2,jst) * mcr(njsc(ji)) / deux
src_sechiba/hydrol.f90:          tmc_litter_field(ji,jst) = dz(2,jst) * mcf(njsc(ji)) / deux
src_sechiba/hydrol.f90:          tmc_litter_sat(ji,jst) = dz(2,jst) * mcs(njsc(ji)) / deux
src_sechiba/hydrol.f90:          tmc_litter_awet(ji,jst) = dz(2,jst) * mc_awet(njsc(ji)) / deux
src_sechiba/hydrol.f90:          tmc_litter_adry(ji,jst) = dz(2,jst) * mc_adry(njsc(ji)) / deux
src_sechiba/hydrol.f90:                  & mcw(njsc(ji))/deux
src_sechiba/hydrol.f90:                  & mcr(njsc(ji))/deux
src_sechiba/hydrol.f90:                  & mcs(njsc(ji))/deux
src_sechiba/hydrol.f90:                  & mcf(njsc(ji))/deux
src_sechiba/hydrol.f90:                  & mc_awet(njsc(ji))/deux
src_sechiba/hydrol.f90:                  & mc_adry(njsc(ji))/deux
src_sechiba/hydrol.f90:          mc(ji,1,jst) = mc(ji,1,jst) - water2extract(ji) * deux / dz(2,jst)
src_sechiba/hydrol.f90:          mc(:,1,jst) = mc(:,1,jst) - flux(:) * deux / dz(2,jst)
src_sechiba/hydrol.f90:               &  - flux(ji) - (b(ji,1)+b(ji,2))/deux *(dtradia/one_day) - rootsink(ji,1,jst)
src_sechiba/hydrol.f90:                  & + (b(ji,jsl-1) - b(ji,jsl+1)) * (dtradia/one_day) / deux & 
src_sechiba/hydrol.f90:               & + (b(ji,jsl-1) - b(ji,jsl)) * (dtradia/one_day) / deux &
src_sechiba/hydrol.f90:!                  & /(quatre*mcs(jst)*pcent(jst))) )* (un-EXP(-humcste(jv)*dz(2,jst)/mille/deux)) &
src_sechiba/hydrol.f90:       wat_inf_pot(ji) = MAX((mcs(njsc(ji))-mc(ji,1,ins)) * dz(2,ins) / deux, zero)
src_sechiba/hydrol.f90:       mc(ji,1,ins) = mc(ji,1,ins) + wat_inf(ji) * deux / dz(2,ins)
src_sechiba/hydrol.f90:          k_m = (k(ji,jsl) + ks(njsc(ji))*kfact(jsl-1,njsc(ji))*kfact_root(ji,jsl,ins)) / deux 
src_sechiba/hydrol.f90:          wat_inf_pot(ji) =  MAX((mcs(njsc(ji))-mc(ji,jsl,ins)) * (dz(jsl,ins) + dz(jsl+1,ins)) / deux, zero)
src_sechiba/hydrol.f90:               & wat_inf(ji) * deux / (dz(jsl,ins) + dz(jsl+1,ins))
src_sechiba/hydrol.f90:          mc(ji,jsl,ins) = mc(ji,jsl,ins) + excessji(ji) * dz(2,ins) / (deux * dpu_max*mille)
src_sechiba/hydrol.f90:          mc(ji,jsl,ins) = mc(ji,jsl,ins) - excessji(ji) * dz(2,ins) / (deux * dpu_max*mille)
src_sechiba/hydrol.f90:       IF (ABS(qflux00(ji,ins)-temp(ji)).GT. deux*min_sechiba) THEN
src_sechiba/hydrol.f90:    temp3 = w_time*(dtradia/one_day)/deux
src_sechiba/hydrol.f90:    temp4 = (un-w_time)*(dtradia/one_day)/deux
src_sechiba/hydrol.f90:            & -a(ji,nslm)*(un-deux*free_drain_coef(ji,1)))
src_sechiba/hydrol.f90:            & -a(ji,nslm)*(un-deux*free_drain_coef(ji,1)))
src_sechiba/hydrol.f90:             evap_bare_lim_ns(ji,jst) =  (un/deux) * ae_ns(ji,jst) / evapot(ji)
src_sechiba/hydrol.f90:       swi(ji) = swi(ji) + shumdiag(ji,1) * (dz(2,jst))/(deux*dpu_max*mille)
src_sechiba/hydrol.f90:          swi(ji) = swi(ji) + shumdiag(ji,jsl) * (dz(jsl,jst)+dz(jsl+1,jst))/(deux*dpu_max*mille)
src_sechiba/hydrol.f90:       swi(ji) = swi(ji) + shumdiag(ji,jsl) * (dz(jsl,jst))/(deux*dpu_max*mille)
src_sechiba/hydrol.f90:       IF ( ABS(delta_water-tot_flux(ji)) .GT. deux*allowed_err ) THEN
src_sechiba/intersurf.f90:       diaglev(jv) = dpu_max/(2**(nslm-1) -1) * ( ( 2**(jv-1) -1) + ( 2**(jv) -1) ) / deux
src_sechiba/qsat_moisture.f90:              &   ((zz_c(ji)-deux*zz_b(ji)+zz_a(ji))*(zz_f(ji)-un) + &
src_sechiba/qsat_moisture.f90:      dev_qsat_result=((zz_c-deux*zz_b+zz_a)*(zz_f-un)+zz_c-zz_b)/pres_in
src_sechiba/slowproc.f90:             laimap(ib,jv,:) = (llaimax(jv)+llaimin(jv))/deux
src_sechiba/slowproc.f90:                laimap(ib,jv,:) = (laimap(ib,jv,:)-lmin)+(llaimax(jv)+llaimin(jv))/deux
src_sechiba/thermosoil.f90:    so_capa = (so_capa_dry + so_capa_wet)/deux
src_sechiba/thermosoil.f90:    so_cond = (so_cond_dry + so_cond_wet)/deux
src_sechiba/thermosoil.f90:    zalph = deux
src_stomate/stomate_alloc.f90:               deux * dt/tau_leafinit * lai_happy(j)/ sla(j) )
src_stomate/stomate_alloc.f90:               R0 * trois * limit_L(:) / ( limit_L(:) + deux * limit_WorN(:) ) )


Change History (9)

comment:1 follow-up: Changed 9 years ago by mguimberteau

For instance, I see one bug. It concerns hydrol.f90:
we should replace

          mx_eau_var(ji) = mx_eau_eau*deux

by

          mx_eau_var(ji) = mx_eau_eau*dpu_max

mx_eau_var is only used at the end of hydrol_alma subroutine.

But why do we need mx_eau_eau in hydrol.f90?

To my mind, mx_eau_eau=150kg/m3 should be only used for hydrolc.f90!

comment:2 in reply to: ↑ 1 ; follow-up: Changed 9 years ago by dsolyga

Replying to mguimberteau:

For instance, I see one bug. It concerns hydrol.f90:
we should replace

          mx_eau_var(ji) = mx_eau_eau*deux

by

          mx_eau_var(ji) = mx_eau_eau*dpu_max

mx_eau_var is only used at the end of hydrol_alma subroutine.

But why do we need mx_eau_eau in hydrol.f90?

To my mind, mx_eau_eau=150kg/m3 should be only used for hydrolc.f90!

This line has already been modified, look at :
http://forge.ipsl.jussieu.fr/orchidee/changeset/1082/trunk/ORCHIDEE#file4
Now mx_eau_eau is called mx_eau_nobio...But maybe this is not mx_eau_nobio but wmax_veg?

comment:3 in reply to: ↑ 2 Changed 9 years ago by nvuilsce

Replying to dsolyga:

This line has already been modified, look at :
http://forge.ipsl.jussieu.fr/orchidee/changeset/1082/trunk/ORCHIDEE#file4
Now mx_eau_eau is called mx_eau_nobio...But maybe this is not mx_eau_nobio but wmax_veg?

No. This instruction concerns land points where veg_tot is lower or equal to 0 (so points with 100% of nobio). In this case, it is ok to use a parameter related to the nobio fraction. But mx_eau_nobio is a water holding capacity (used in the scheme of Choisnel) here we should rather use a soil water content at saturation. Should it be the same than for the vegetation fraction (mcs(njsc(:))) ?

comment:4 follow-up: Changed 9 years ago by acampoy

What is the unity of mx_eau_nobio ?
If dpu_max is always in meter,
the soil water content at saturation is
in millimeter in hydrol.f90:

tmcs(ji,jst)=dpu_max* mille*mcs(njsc(ji))

comment:5 in reply to: ↑ 4 Changed 9 years ago by dsolyga

Replying to acampoy:

What is the unity of mx_eau_nobio ?
If dpu_max is always in meter,
the soil water content at saturation is
in millimeter in hydrol.f90:

tmcs(ji,jst)=dpu_max* mille*mcs(njsc(ji))

In constantes_soil.f90, mx_eau_nobio is defined as following :

 REAL(r_std), SAVE :: mx_eau_nobio = 150.              !! Volumetric available soil water capacity in nobio fractions
                                                        !! @tex $(kg.m^{-3} of soil)$ @endtex

This definition was corrected by Agnès for the externalization of the hydrological parameters.

comment:6 Changed 9 years ago by peylin

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

comment:7 Changed 8 years ago by aducharne

  • Owner changed from jgipsl to aducharne

comment:8 Changed 7 years ago by aducharne

None of the occurences of deux in the top list do corerspond to dpu_max.
This has been checked in [r2917], corresponding to the commit of the new vertical discretization.

https://forge.ipsl.jussieu.fr/orchidee/browser/trunk?rev=2917#ORCHIDEE/src_sechiba

Thus we close the ticket.

comment:9 Changed 7 years ago by aducharne

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.