Skip to content

Commit

Permalink
Actually compute photoC_NO3_TOT_zint_100m
Browse files Browse the repository at this point in the history
This diagnostic was added to the diagnostics list, but never actually computed.
I added an additional near_surface_integral argument to where we compute the
per-autotroph photoC_NO3_zint (full depth integral), and the sum of those
near_surface_integral values is the _100m equivalent.
  • Loading branch information
mnlevy1981 committed May 10, 2022
1 parent 51fac36 commit a3dde53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/marbl_diagnostics_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3473,7 +3473,7 @@ subroutine store_diagnostics_autotrophs(marbl_domain, &
!-----------------------------------------------------------------------
integer(int_kind) :: n, m
real(r8) :: autotrophC_weight(marbl_domain%km)
real(r8) :: autotrophC_zint_100m
real(r8) :: autotrophC_zint_100m, photoC_NO3_zint_100m
real(r8) :: limterm(marbl_domain%km)
!-----------------------------------------------------------------------

Expand All @@ -3495,6 +3495,7 @@ subroutine store_diagnostics_autotrophs(marbl_domain, &
diags(ind%photoC_TOT_zint)%field_2d(1) = c0
diags(ind%photoC_TOT_zint_100m)%field_2d(1) = c0
diags(ind%photoC_NO3_TOT_zint)%field_2d(1) = c0
diags(ind%photoC_NO3_TOT_zint_100m)%field_2d(1) = c0

do n = 1, autotroph_cnt
! compute biomass weighted average of limitation terms over 0..100m
Expand Down Expand Up @@ -3628,11 +3629,15 @@ subroutine store_diagnostics_autotrophs(marbl_domain, &
diags(ind%photoC_zint_100m(n))%field_2d(1)

call marbl_diagnostics_share_compute_vertical_integrals(diags(ind%photoC_NO3(n))%field_3d(:, 1), &
delta_z, kmt, full_depth_integral=diags(ind%photoC_NO3_zint(n))%field_2d(1))
delta_z, kmt, full_depth_integral=diags(ind%photoC_NO3_zint(n))%field_2d(1), &
near_surface_integral=photoC_NO3_zint_100m)

diags(ind%photoC_NO3_TOT_zint)%field_2d(1) = diags(ind%photoC_NO3_TOT_zint)%field_2d(1) + &
diags(ind%photoC_NO3_zint(n))%field_2d(1)

diags(ind%photoC_NO3_TOT_zint_100m)%field_2d(1) = diags(ind%photoC_NO3_TOT_zint_100m)%field_2d(1) + &
photoC_NO3_zint_100m

call marbl_diagnostics_share_compute_vertical_integrals(diags(ind%auto_graze(n))%field_3d(:, 1), &
delta_z, kmt, full_depth_integral=diags(ind%auto_graze_zint(n))%field_2d(1), &
near_surface_integral=diags(ind%auto_graze_zint_100m(n))%field_2d(1))
Expand Down

0 comments on commit a3dde53

Please sign in to comment.