Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master fix ningorg refill #283

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
Binary file modified data/biomee_gs_leuning_output.rda
Binary file not shown.
Binary file modified data/biomee_p_model_output.rda
Binary file not shown.
16 changes: 3 additions & 13 deletions src/datatypes.mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -932,26 +932,16 @@ end subroutine annual_diagnostics_post_mortality

subroutine Recover_N_balance(vegn)
!////////////////////////////////////////////////////////////////////////
! We scale the N pools to contrain the yearly N (soil + plant) to be constant.
! Update psoil_sl in order to keep the total N constant
! Note: this leads to negative N pools...
!------------------------------------------------------------------------
type(vegn_tile_type), intent(inout) :: vegn
real :: delta, scaling_factor

delta = vegn%totN - vegn%initialN0

if (abs(delta) > 1e-6) then
scaling_factor = 1 - delta / vegn%totN

vegn%psoil_sl%n%n14 = vegn%psoil_sl%n%n14 * scaling_factor
vegn%psoil_fs%n%n14 = vegn%psoil_fs%n%n14 * scaling_factor
vegn%pmicr%n%n14 = vegn%pmicr%n%n14 * scaling_factor
vegn%ninorg%n14 = vegn%ninorg%n14 * scaling_factor
vegn%plabl%n%n14 = vegn%plabl%n%n14 * scaling_factor
vegn%pseed%n%n14 = vegn%pseed%n%n14 * scaling_factor
vegn%pleaf%n%n14 = vegn%pleaf%n%n14 * scaling_factor
vegn%proot%n%n14 = vegn%proot%n%n14 * scaling_factor
vegn%psapw%n%n14 = vegn%psapw%n%n14 * scaling_factor
vegn%pwood%n%n14 = vegn%pwood%n%n14 * scaling_factor
vegn%psoil_sl%n%n14 = vegn%psoil_sl%n%n14 - delta
vegn%totN = vegn%initialN0
endif
end subroutine Recover_N_balance
Expand Down
2 changes: 1 addition & 1 deletion src/vegetation_biomee.mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ subroutine vegn_N_uptake(vegn, tsoil)
integer :: i

! We artificially refill N inorg
if (myinterface%params_siml%do_closedN_run) vegn%ninorg%n14 = 0.2
if (myinterface%params_siml%do_closedN_run) vegn%ninorg%n14 = myinterface%init_soil%init_Nmineral

! Nitrogen uptake parameter
! It considers competition here. How much N one can absorp depends on
Expand Down
Loading