From a3dde532fd68b863bbfe7ee944226f658c723961 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 10 May 2022 13:25:58 -0600 Subject: [PATCH 1/4] Actually compute photoC_NO3_TOT_zint_100m 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. --- src/marbl_diagnostics_mod.F90 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/marbl_diagnostics_mod.F90 b/src/marbl_diagnostics_mod.F90 index 4596ec4b..c03daa0d 100644 --- a/src/marbl_diagnostics_mod.F90 +++ b/src/marbl_diagnostics_mod.F90 @@ -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) !----------------------------------------------------------------------- @@ -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 @@ -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)) From 8dd03e5440c3b48a4d18b64426cb483c8da709fe Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 10 May 2022 13:29:38 -0600 Subject: [PATCH 2/4] Change default frequency for pocToFloor frequency was changed from 'none' to 'medium' because this value is useful for forcing FEISTY and it would be nice to just have it in typical CESM output --- defaults/diagnostics_latest.yaml | 2 +- defaults/json/diagnostics_latest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/diagnostics_latest.yaml b/defaults/diagnostics_latest.yaml index fa870890..224837fa 100644 --- a/defaults/diagnostics_latest.yaml +++ b/defaults/diagnostics_latest.yaml @@ -464,7 +464,7 @@ pocToFloor : longname : POC Flux Hitting Sea Floor units : nmol/cm^2/s vertical_grid : none - frequency : never + frequency : medium operator : average pocToSed : longname : POC Flux to Sediments diff --git a/defaults/json/diagnostics_latest.json b/defaults/json/diagnostics_latest.json index aa109682..0755bf8c 100644 --- a/defaults/json/diagnostics_latest.json +++ b/defaults/json/diagnostics_latest.json @@ -2244,7 +2244,7 @@ "vertical_grid": "layer_avg" }, "pocToFloor": { - "frequency": "never", + "frequency": "medium", "longname": "POC Flux Hitting Sea Floor", "operator": "average", "units": "nmol/cm^2/s", From 2b1353ad7cec708664b233f606debe6476d17e2e Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 10 May 2022 14:03:43 -0600 Subject: [PATCH 3/4] Update py_requirements to avoid newer releases I was seeing an error that was introduced with jinja2 v3.0 in the CI, so I require <3 in the pip requirements file. In a sandbox, I was then seeing an error from MarkupSafe and it turns out that was introduced in v2.1 so I require <2.1 in the pip file. I also updated the github action to (hopefully) run the Fortran test suite even if building the documentation fails --- .github/workflows/run_test_suite.yml | 1 + docs/py_requirements.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/run_test_suite.yml b/.github/workflows/run_test_suite.yml index 90802ee9..e2f8d91d 100644 --- a/.github/workflows/run_test_suite.yml +++ b/.github/workflows/run_test_suite.yml @@ -26,6 +26,7 @@ jobs: sudo apt-get update sudo apt install make gfortran netcdf-bin libnetcdf-dev libnetcdff-dev openmpi-bin libopenmpi-dev - name: Build docs + continue-on-error: true run: | cd docs/src make html diff --git a/docs/py_requirements.txt b/docs/py_requirements.txt index 684d82b6..a8258487 100644 --- a/docs/py_requirements.txt +++ b/docs/py_requirements.txt @@ -2,4 +2,6 @@ pylint==2.10.2 Sphinx==1.7.5 sphinxcontrib-bibtex==0.4.0 pybtex==0.22 +jinja2<3 +MarkupSafe<2.1 git+https://github.com/marbl-ecosys/sphinx_rtd_theme.git@version-dropdown From e592cea2e9eba95be5aa5f4b9c8e22335147c9f5 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 10 May 2022 14:13:18 -0600 Subject: [PATCH 4/4] Update baseline for call_compute_subroutines a3dde53 changed the value of photoC_NO3_TOT_zint_100m from 0 to the actual integral that should be computed, and we need those correct values in the baseline for testing purposes. --- .../call_compute_subroutines.history.nc | Bin 628392 -> 628392 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/input_files/baselines/call_compute_subroutines.history.nc b/tests/input_files/baselines/call_compute_subroutines.history.nc index bdf3e24e72d58fb641a5129384e4c532905b685d..3990e5ae112fb3796d221f0276981a72652acfe6 100644 GIT binary patch delta 114 zcmZ3nR&B*vwT3N>KNL0WH_Vmnng8gR{nFe^RSTP@F+hQR-9Ob=%gl7_S4H^OKYaUg zyMhwqbtXYRyDQE%`Id+B?7|yF-#%hK-p--Q2*gZ4%nZaVK+FonY(UHo#2ni>R5=$E F0st^_C$j(m delta 78 zcmZ3nR&B*vwT3N>KNP1w)MeDzuAsztok@__?uxTbzU84jyYL3lw~v@lv~#F30x=U1 YGXpUT5VHa?8xXStF~@ceRn7&407U*5^8f$<