Skip to content

Commit

Permalink
Fix grc structure (model for reunion) (#343)
Browse files Browse the repository at this point in the history
* Fix grc structure (model for reunion). remove leaking from slow transfert reservoir cl, because the model calibration was done with this structure

* Generate adjoint after change in grc structure

* update baseline

* update doc figure

---------

Co-authored-by: Apolline Elbaz <[email protected]>
  • Loading branch information
maximejay and Apolline Elbaz authored Nov 20, 2024
1 parent c871818 commit 1d1483a
Show file tree
Hide file tree
Showing 7 changed files with 743 additions and 810 deletions.
984 changes: 464 additions & 520 deletions doc/source/_static/grc_structure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/source/math_num_documentation/forward_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ Hydrological processes can be described at pixel scale in `smash` with one of th
\begin{eqnarray}
&p_{rr}(x, t)& &=& &0.6 \times 0.9(p_r(x, t) + p_{erc}(x, t)) + l_{exc}(x, t)\\
&p_{rl}(x, t)& &=& &0.4 \times 0.9(p_r(x, t) + p_{erc}(x, t)) + l_{exc}(x, t)\\
&p_{rl}(x, t)& &=& &0.4 \times 0.9(p_r(x, t) + p_{erc}(x, t)) \\
&p_{rd}(x, t)& &=& &0.1(p_r(x, t) + p_{erc}(x, t))
\end{eqnarray}
Expand Down
10 changes: 5 additions & 5 deletions smash/fcore/forward/forward_db.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18785,8 +18785,8 @@ SUBROUTINE GRC_TIME_STEP_D(setup, mesh, input_data, options, returns, &
END IF
prr_d = 0.9_sp*0.6_sp*(pr_d+perc_d) + l_d
prr = 0.6_sp*0.9_sp*(pr+perc) + l
prl_d = 0.9_sp*0.4_sp*(pr_d+perc_d) + l_d
prl = 0.4_sp*0.9_sp*(pr+perc) + l
prl_d = 0.9_sp*0.4_sp*(pr_d+perc_d)
prl = 0.4_sp*0.9_sp*(pr+perc)
prd_d = 0.1_sp*(pr_d+perc_d)
prd = 0.1_sp*(pr+perc)
CALL GR_TRANSFER_D(5._sp, ac_prcp(k), prr, prr_d, ac_ct(k), &
Expand Down Expand Up @@ -18883,7 +18883,7 @@ SUBROUTINE GRC_TIME_STEP_B(setup, mesh, input_data, options, returns, &
CALL PUSHREAL4(prr)
prr = 0.6_sp*0.9_sp*(pr+perc) + l
CALL PUSHREAL4(prl)
prl = 0.4_sp*0.9_sp*(pr+perc) + l
prl = 0.4_sp*0.9_sp*(pr+perc)
prd = 0.1_sp*(pr+perc)
CALL PUSHREAL4(ac_ht(k))
CALL GR_TRANSFER(5._sp, ac_prcp(k), prr, ac_ct(k), ac_ht(k), &
Expand Down Expand Up @@ -18930,9 +18930,9 @@ SUBROUTINE GRC_TIME_STEP_B(setup, mesh, input_data, options, returns, &
temp_b = 0.9_sp*0.4_sp*prl_b
pr_b = 0.1_sp*prd_b + temp_b
perc_b = 0.1_sp*prd_b + temp_b
l_b = l_b + prl_b + prr_b
CALL POPREAL4(prr)
temp_b = 0.9_sp*0.6_sp*prr_b
l_b = l_b + prr_b
pr_b = pr_b + temp_b
perc_b = perc_b + temp_b
CALL POPCONTROL1B(branch)
Expand Down Expand Up @@ -19001,7 +19001,7 @@ SUBROUTINE GRC_TIME_STEP(setup, mesh, input_data, options, returns, &
l = 0._sp
END IF
prr = 0.6_sp*0.9_sp*(pr+perc) + l
prl = 0.4_sp*0.9_sp*(pr+perc) + l
prl = 0.4_sp*0.9_sp*(pr+perc)
prd = 0.1_sp*(pr+perc)
CALL GR_TRANSFER(5._sp, ac_prcp(k), prr, ac_ct(k), ac_ht(k), &
& qr)
Expand Down
10 changes: 5 additions & 5 deletions smash/fcore/forward/forward_openmp_db.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19402,8 +19402,8 @@ SUBROUTINE GRC_TIME_STEP_D(setup, mesh, input_data, options, returns, &
END IF
prr_d = 0.9_sp*0.6_sp*(pr_d+perc_d) + l_d
prr = 0.6_sp*0.9_sp*(pr+perc) + l
prl_d = 0.9_sp*0.4_sp*(pr_d+perc_d) + l_d
prl = 0.4_sp*0.9_sp*(pr+perc) + l
prl_d = 0.9_sp*0.4_sp*(pr_d+perc_d)
prl = 0.4_sp*0.9_sp*(pr+perc)
prd_d = 0.1_sp*(pr_d+perc_d)
prd = 0.1_sp*(pr+perc)
CALL GR_TRANSFER_D(5._sp, ac_prcp(k), prr, prr_d, ac_ct(k), &
Expand Down Expand Up @@ -19508,7 +19508,7 @@ SUBROUTINE GRC_TIME_STEP_B(setup, mesh, input_data, options, returns, &
CALL PUSHREAL4(prr)
prr = 0.6_sp*0.9_sp*(pr+perc) + l
CALL PUSHREAL4(prl)
prl = 0.4_sp*0.9_sp*(pr+perc) + l
prl = 0.4_sp*0.9_sp*(pr+perc)
prd = 0.1_sp*(pr+perc)
CALL PUSHREAL4(ac_ht(k))
CALL GR_TRANSFER(5._sp, ac_prcp(k), prr, ac_ct(k), ac_ht(k), &
Expand Down Expand Up @@ -19584,9 +19584,9 @@ SUBROUTINE GRC_TIME_STEP_B(setup, mesh, input_data, options, returns, &
temp_b = 0.9_sp*0.4_sp*prl_b
pr_b = 0.1_sp*prd_b + temp_b
perc_b = 0.1_sp*prd_b + temp_b
l_b = l_b + prl_b + prr_b
CALL POPREAL4(prr)
temp_b = 0.9_sp*0.6_sp*prr_b
l_b = l_b + prr_b
pr_b = pr_b + temp_b
perc_b = perc_b + temp_b
CALL POPCONTROL1B(branch)
Expand Down Expand Up @@ -19661,7 +19661,7 @@ SUBROUTINE GRC_TIME_STEP(setup, mesh, input_data, options, returns, &
l = 0._sp
END IF
prr = 0.6_sp*0.9_sp*(pr+perc) + l
prl = 0.4_sp*0.9_sp*(pr+perc) + l
prl = 0.4_sp*0.9_sp*(pr+perc)
prd = 0.1_sp*(pr+perc)
CALL GR_TRANSFER(5._sp, ac_prcp(k), prr, ac_ct(k), ac_ht(k), &
& qr)
Expand Down
2 changes: 1 addition & 1 deletion smash/fcore/operator/md_gr_operator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ subroutine grc_time_step(setup, mesh, input_data, options, returns, time_step, a
end if

prr = 0.6_sp*0.9_sp*(pr + perc) + l
prl = 0.4_sp*0.9_sp*(pr + perc) + l
prl = 0.4_sp*0.9_sp*(pr + perc)
prd = 0.1_sp*(pr + perc)

call gr_transfer(5._sp, ac_prcp(k), prr, ac_ct(k), ac_ht(k), qr)
Expand Down
Binary file modified smash/tests/baseline.hdf5
Binary file not shown.
Loading

0 comments on commit 1d1483a

Please sign in to comment.