From a064eb93c5126d1ca154db061f7913a997ea4850 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 13 Oct 2023 13:02:58 -0600 Subject: [PATCH] Clean up diag indices 1. renamed lconstructed() -> lallocated() 2. only allocate indices for autotroph / zooplankton diags if base_bio_on is true (requires checking base_bio_on before deallocating) -- this reverts some of the allocate statements to put them back where they are on development (modulo additional whitespace because it is now in a new "if (base_bio_on)" block) --- src/marbl_ciso_diagnostics_mod.F90 | 2 +- src/marbl_diagnostics_mod.F90 | 178 +++++++++++----------- src/marbl_interface_private_types.F90 | 205 +++++++++++++------------- 3 files changed, 196 insertions(+), 189 deletions(-) diff --git a/src/marbl_ciso_diagnostics_mod.F90 b/src/marbl_ciso_diagnostics_mod.F90 index d1e3c006..5cb01a71 100644 --- a/src/marbl_ciso_diagnostics_mod.F90 +++ b/src/marbl_ciso_diagnostics_mod.F90 @@ -608,7 +608,7 @@ subroutine marbl_ciso_diagnostics_init( & end if ! Nonstandard autotroph 2D and 3D fields for each autotroph - if (.not.ind%lconstructed()) then + if (.not.ind%lallocated()) then allocate(ind%CISO_eps_autotroph(autotroph_cnt)) allocate(ind%CISO_mui_to_co2star(autotroph_cnt)) allocate(ind%CISO_Ca13CO3_form(autotroph_cnt)) diff --git a/src/marbl_diagnostics_mod.F90 b/src/marbl_diagnostics_mod.F90 index 16b3ef01..cb587394 100644 --- a/src/marbl_diagnostics_mod.F90 +++ b/src/marbl_diagnostics_mod.F90 @@ -467,92 +467,6 @@ subroutine marbl_diagnostics_init( & diags => marbl_interior_tendency_diags & ) - ! Allocate memory for PFT diagnostics - if (.not.ind%lconstructed()) then - allocate(ind%N_lim_surf(autotroph_cnt)) - allocate(ind%N_lim_Cweight_avg_100m(autotroph_cnt)) - allocate(ind%P_lim_surf(autotroph_cnt)) - allocate(ind%P_lim_Cweight_avg_100m(autotroph_cnt)) - allocate(ind%Fe_lim_surf(autotroph_cnt)) - allocate(ind%Fe_lim_Cweight_avg_100m(autotroph_cnt)) - allocate(ind%SiO3_lim_surf(autotroph_cnt)) - allocate(ind%SiO3_lim_Cweight_avg_100m(autotroph_cnt)) - allocate(ind%C_lim_surf(autotroph_cnt)) - allocate(ind%C_lim_Cweight_avg_100m(autotroph_cnt)) - allocate(ind%light_lim_surf(autotroph_cnt)) - allocate(ind%light_lim_Cweight_avg_100m(autotroph_cnt)) - allocate(ind%photoC_zint(autotroph_cnt)) - allocate(ind%photoC_zint_100m(autotroph_cnt)) - allocate(ind%photoC_NO3_zint(autotroph_cnt)) - allocate(ind%CaCO3_form_zint(autotroph_cnt)) - allocate(ind%CaCO3_form_zint_100m(autotroph_cnt)) - allocate(ind%auto_graze_zint(autotroph_cnt)) - allocate(ind%auto_graze_zint_100m(autotroph_cnt)) - allocate(ind%auto_graze_poc_zint(autotroph_cnt)) - allocate(ind%auto_graze_poc_zint_100m(autotroph_cnt)) - allocate(ind%auto_graze_doc_zint(autotroph_cnt)) - allocate(ind%auto_graze_doc_zint_100m(autotroph_cnt)) - allocate(ind%auto_graze_zoo_zint(autotroph_cnt, zooplankton_cnt)) - allocate(ind%auto_graze_zoo_zint_100m(autotroph_cnt, zooplankton_cnt)) - allocate(ind%auto_loss_zint(autotroph_cnt)) - allocate(ind%auto_loss_zint_100m(autotroph_cnt)) - allocate(ind%auto_loss_poc_zint(autotroph_cnt)) - allocate(ind%auto_loss_poc_zint_100m(autotroph_cnt)) - allocate(ind%auto_loss_doc_zint(autotroph_cnt)) - allocate(ind%auto_loss_doc_zint_100m(autotroph_cnt)) - allocate(ind%auto_agg_zint(autotroph_cnt)) - allocate(ind%auto_agg_zint_100m(autotroph_cnt)) - allocate(ind%zoo_loss_zint(zooplankton_cnt)) - allocate(ind%zoo_loss_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_loss_zint_150m(zooplankton_cnt)) - allocate(ind%zoo_loss_basal_zint(zooplankton_cnt)) - allocate(ind%zoo_loss_basal_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_loss_poc_zint(zooplankton_cnt)) - allocate(ind%zoo_loss_poc_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_loss_doc_zint(zooplankton_cnt)) - allocate(ind%zoo_loss_doc_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_graze_zint(zooplankton_cnt)) - allocate(ind%zoo_graze_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_graze_poc_zint(zooplankton_cnt)) - allocate(ind%zoo_graze_poc_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_graze_doc_zint(zooplankton_cnt)) - allocate(ind%zoo_graze_doc_zint_100m(zooplankton_cnt)) - allocate(ind%zoo_graze_zoo_zint(zooplankton_cnt, zooplankton_cnt)) - allocate(ind%zoo_graze_zoo_zint_100m(zooplankton_cnt, zooplankton_cnt)) - allocate(ind%x_graze_zoo_zint(zooplankton_cnt)) - allocate(ind%x_graze_zoo_zint_100m(zooplankton_cnt)) - allocate(ind%Qp(autotroph_cnt)) - allocate(ind%photoC(autotroph_cnt)) - allocate(ind%photoC_NO3(autotroph_cnt)) - allocate(ind%photoFe(autotroph_cnt)) - allocate(ind%photoNO3(autotroph_cnt)) - allocate(ind%photoNH4(autotroph_cnt)) - allocate(ind%DOP_uptake(autotroph_cnt)) - allocate(ind%PO4_uptake(autotroph_cnt)) - allocate(ind%auto_graze(autotroph_cnt)) - allocate(ind%auto_graze_poc(autotroph_cnt)) - allocate(ind%auto_graze_doc(autotroph_cnt)) - allocate(ind%auto_graze_zootot(autotroph_cnt)) - allocate(ind%auto_graze_zoo(autotroph_cnt, zooplankton_cnt)) - allocate(ind%auto_loss(autotroph_cnt)) - allocate(ind%auto_loss_poc(autotroph_cnt)) - allocate(ind%auto_loss_doc(autotroph_cnt)) - allocate(ind%auto_agg(autotroph_cnt)) - allocate(ind%bSi_form(autotroph_cnt)) - allocate(ind%CaCO3_form(autotroph_cnt)) - allocate(ind%Nfix(autotroph_cnt)) - allocate(ind%zoo_loss(zooplankton_cnt)) - allocate(ind%zoo_loss_basal(zooplankton_cnt)) - allocate(ind%zoo_loss_poc(zooplankton_cnt)) - allocate(ind%zoo_loss_doc(zooplankton_cnt)) - allocate(ind%zoo_graze(zooplankton_cnt)) - allocate(ind%zoo_graze_poc(zooplankton_cnt)) - allocate(ind%zoo_graze_doc(zooplankton_cnt)) - allocate(ind%zoo_graze_zootot(zooplankton_cnt)) - allocate(ind%zoo_graze_zoo(zooplankton_cnt, zooplankton_cnt)) - allocate(ind%x_graze_zoo(zooplankton_cnt)) - end if - if (base_bio_on) then ! General 2D diags lname = 'Calcite Saturation Depth' @@ -929,6 +843,41 @@ subroutine marbl_diagnostics_init( & end if ! Autotroph 2D diags + if (.not.ind%lallocated()) then + allocate(ind%N_lim_surf(autotroph_cnt)) + allocate(ind%N_lim_Cweight_avg_100m(autotroph_cnt)) + allocate(ind%P_lim_surf(autotroph_cnt)) + allocate(ind%P_lim_Cweight_avg_100m(autotroph_cnt)) + allocate(ind%Fe_lim_surf(autotroph_cnt)) + allocate(ind%Fe_lim_Cweight_avg_100m(autotroph_cnt)) + allocate(ind%SiO3_lim_surf(autotroph_cnt)) + allocate(ind%SiO3_lim_Cweight_avg_100m(autotroph_cnt)) + allocate(ind%C_lim_surf(autotroph_cnt)) + allocate(ind%C_lim_Cweight_avg_100m(autotroph_cnt)) + allocate(ind%light_lim_surf(autotroph_cnt)) + allocate(ind%light_lim_Cweight_avg_100m(autotroph_cnt)) + allocate(ind%photoC_zint(autotroph_cnt)) + allocate(ind%photoC_zint_100m(autotroph_cnt)) + allocate(ind%photoC_NO3_zint(autotroph_cnt)) + allocate(ind%CaCO3_form_zint(autotroph_cnt)) + allocate(ind%CaCO3_form_zint_100m(autotroph_cnt)) + allocate(ind%auto_graze_zint(autotroph_cnt)) + allocate(ind%auto_graze_zint_100m(autotroph_cnt)) + allocate(ind%auto_graze_poc_zint(autotroph_cnt)) + allocate(ind%auto_graze_poc_zint_100m(autotroph_cnt)) + allocate(ind%auto_graze_doc_zint(autotroph_cnt)) + allocate(ind%auto_graze_doc_zint_100m(autotroph_cnt)) + allocate(ind%auto_graze_zoo_zint(autotroph_cnt, zooplankton_cnt)) + allocate(ind%auto_graze_zoo_zint_100m(autotroph_cnt, zooplankton_cnt)) + allocate(ind%auto_loss_zint(autotroph_cnt)) + allocate(ind%auto_loss_zint_100m(autotroph_cnt)) + allocate(ind%auto_loss_poc_zint(autotroph_cnt)) + allocate(ind%auto_loss_poc_zint_100m(autotroph_cnt)) + allocate(ind%auto_loss_doc_zint(autotroph_cnt)) + allocate(ind%auto_loss_doc_zint_100m(autotroph_cnt)) + allocate(ind%auto_agg_zint(autotroph_cnt)) + allocate(ind%auto_agg_zint_100m(autotroph_cnt)) + end if do n=1,autotroph_cnt lname = trim(autotroph_settings(n)%lname) // ' N Limitation, Surface' sname = trim(autotroph_settings(n)%sname) // '_N_lim_surf' @@ -1373,6 +1322,27 @@ subroutine marbl_diagnostics_init( & end if ! Zooplankton 2D diags + if (.not.ind%lallocated()) then + allocate(ind%zoo_loss_zint(zooplankton_cnt)) + allocate(ind%zoo_loss_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_loss_zint_150m(zooplankton_cnt)) + allocate(ind%zoo_loss_basal_zint(zooplankton_cnt)) + allocate(ind%zoo_loss_basal_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_loss_poc_zint(zooplankton_cnt)) + allocate(ind%zoo_loss_poc_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_loss_doc_zint(zooplankton_cnt)) + allocate(ind%zoo_loss_doc_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_graze_zint(zooplankton_cnt)) + allocate(ind%zoo_graze_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_graze_poc_zint(zooplankton_cnt)) + allocate(ind%zoo_graze_poc_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_graze_doc_zint(zooplankton_cnt)) + allocate(ind%zoo_graze_doc_zint_100m(zooplankton_cnt)) + allocate(ind%zoo_graze_zoo_zint(zooplankton_cnt, zooplankton_cnt)) + allocate(ind%zoo_graze_zoo_zint_100m(zooplankton_cnt, zooplankton_cnt)) + allocate(ind%x_graze_zoo_zint(zooplankton_cnt)) + allocate(ind%x_graze_zoo_zint_100m(zooplankton_cnt)) + end if do n = 1,zooplankton_cnt lname = trim(zooplankton_settings(n)%lname) // ' Loss Vertical Integral' sname = trim(zooplankton_settings(n)%sname) // '_loss_zint' @@ -2604,6 +2574,28 @@ subroutine marbl_diagnostics_init( & end if ! Autotroph 3D diags + if (.not.ind%lallocated()) then + allocate(ind%Qp(autotroph_cnt)) + allocate(ind%photoC(autotroph_cnt)) + allocate(ind%photoC_NO3(autotroph_cnt)) + allocate(ind%photoFe(autotroph_cnt)) + allocate(ind%photoNO3(autotroph_cnt)) + allocate(ind%photoNH4(autotroph_cnt)) + allocate(ind%DOP_uptake(autotroph_cnt)) + allocate(ind%PO4_uptake(autotroph_cnt)) + allocate(ind%auto_graze(autotroph_cnt)) + allocate(ind%auto_graze_poc(autotroph_cnt)) + allocate(ind%auto_graze_doc(autotroph_cnt)) + allocate(ind%auto_graze_zootot(autotroph_cnt)) + allocate(ind%auto_graze_zoo(autotroph_cnt, zooplankton_cnt)) + allocate(ind%auto_loss(autotroph_cnt)) + allocate(ind%auto_loss_poc(autotroph_cnt)) + allocate(ind%auto_loss_doc(autotroph_cnt)) + allocate(ind%auto_agg(autotroph_cnt)) + allocate(ind%bSi_form(autotroph_cnt)) + allocate(ind%CaCO3_form(autotroph_cnt)) + allocate(ind%Nfix(autotroph_cnt)) + end if do n=1,autotroph_cnt if (lvariable_PtoC) then lname = trim(autotroph_settings(n)%lname) // ' P:C ratio' @@ -2902,6 +2894,18 @@ subroutine marbl_diagnostics_init( & end if ! Zooplankton 3D diags + if (.not.ind%lallocated()) then + allocate(ind%zoo_loss(zooplankton_cnt)) + allocate(ind%zoo_loss_basal(zooplankton_cnt)) + allocate(ind%zoo_loss_poc(zooplankton_cnt)) + allocate(ind%zoo_loss_doc(zooplankton_cnt)) + allocate(ind%zoo_graze(zooplankton_cnt)) + allocate(ind%zoo_graze_poc(zooplankton_cnt)) + allocate(ind%zoo_graze_doc(zooplankton_cnt)) + allocate(ind%zoo_graze_zootot(zooplankton_cnt)) + allocate(ind%zoo_graze_zoo(zooplankton_cnt, zooplankton_cnt)) + allocate(ind%x_graze_zoo(zooplankton_cnt)) + end if do n = 1,zooplankton_cnt lname = trim(zooplankton_settings(n)%lname) // ' Loss' sname = trim(zooplankton_settings(n)%sname) // '_loss' @@ -3058,7 +3062,7 @@ subroutine marbl_diagnostics_init( & ! FIXME #60: this approach is not thread-safe ! i.e. if this is called from 2 threads simulatneously, a race condition ! on the allocation status check and allocation is introduced - if (.not.ind%lconstructed()) then + if (.not. ind%lallocated()) then allocate(ind%restore_tend(marbl_tracer_indices%total_cnt)) end if diff --git a/src/marbl_interface_private_types.F90 b/src/marbl_interface_private_types.F90 index 8ac48a2f..486c8941 100644 --- a/src/marbl_interface_private_types.F90 +++ b/src/marbl_interface_private_types.F90 @@ -790,7 +790,7 @@ module marbl_interface_private_types ! restoring 3D diags integer(int_kind), dimension(:), allocatable :: restore_tend contains - procedure, public :: lconstructed => interior_diag_ind_constructed + procedure, public :: lallocated => interior_diag_ind_allocated procedure, public :: destruct => interior_diag_ind_destructor end type marbl_interior_tendency_diagnostics_indexing_type @@ -1928,121 +1928,124 @@ end subroutine interior_tendency_forcing_index_constructor !***************************************************************************** - function interior_diag_ind_constructed(this) result(constructed) + function interior_diag_ind_allocated(this) result(constructed) class(marbl_interior_tendency_diagnostics_indexing_type), intent(inout) :: this logical(log_kind) :: constructed constructed = allocated(this%restore_tend) - end function interior_diag_ind_constructed + end function interior_diag_ind_allocated !***************************************************************************** subroutine interior_diag_ind_destructor(this) + use marbl_settings_mod, only : base_bio_on use marbl_settings_mod, only : ciso_on class(marbl_interior_tendency_diagnostics_indexing_type), intent(inout) :: this - if (this%lconstructed()) then - deallocate(this%N_lim_surf) - deallocate(this%N_lim_Cweight_avg_100m) - deallocate(this%P_lim_surf) - deallocate(this%P_lim_Cweight_avg_100m) - deallocate(this%Fe_lim_surf) - deallocate(this%Fe_lim_Cweight_avg_100m) - deallocate(this%SiO3_lim_surf) - deallocate(this%SiO3_lim_Cweight_avg_100m) - deallocate(this%C_lim_surf) - deallocate(this%C_lim_Cweight_avg_100m) - deallocate(this%light_lim_surf) - deallocate(this%light_lim_Cweight_avg_100m) - deallocate(this%photoC_zint) - deallocate(this%photoC_zint_100m) - deallocate(this%photoC_NO3_zint) - deallocate(this%CaCO3_form_zint) - deallocate(this%CaCO3_form_zint_100m) - deallocate(this%auto_graze_zint) - deallocate(this%auto_graze_zint_100m) - deallocate(this%auto_graze_poc_zint) - deallocate(this%auto_graze_poc_zint_100m) - deallocate(this%auto_graze_doc_zint) - deallocate(this%auto_graze_doc_zint_100m) - deallocate(this%auto_graze_zoo_zint) - deallocate(this%auto_graze_zoo_zint_100m) - deallocate(this%auto_loss_zint) - deallocate(this%auto_loss_zint_100m) - deallocate(this%auto_loss_poc_zint) - deallocate(this%auto_loss_poc_zint_100m) - deallocate(this%auto_loss_doc_zint) - deallocate(this%auto_loss_doc_zint_100m) - deallocate(this%auto_agg_zint) - deallocate(this%auto_agg_zint_100m) - deallocate(this%zoo_loss_zint) - deallocate(this%zoo_loss_zint_100m) - deallocate(this%zoo_loss_zint_150m) - deallocate(this%zoo_loss_basal_zint) - deallocate(this%zoo_loss_basal_zint_100m) - deallocate(this%zoo_loss_poc_zint) - deallocate(this%zoo_loss_poc_zint_100m) - deallocate(this%zoo_loss_doc_zint) - deallocate(this%zoo_loss_doc_zint_100m) - deallocate(this%zoo_graze_zint) - deallocate(this%zoo_graze_zint_100m) - deallocate(this%zoo_graze_poc_zint) - deallocate(this%zoo_graze_poc_zint_100m) - deallocate(this%zoo_graze_doc_zint) - deallocate(this%zoo_graze_doc_zint_100m) - deallocate(this%zoo_graze_zoo_zint) - deallocate(this%zoo_graze_zoo_zint_100m) - deallocate(this%x_graze_zoo_zint) - deallocate(this%x_graze_zoo_zint_100m) - deallocate(this%Qp) - deallocate(this%photoC) - deallocate(this%photoC_NO3) - deallocate(this%photoFe) - deallocate(this%photoNO3) - deallocate(this%photoNH4) - deallocate(this%DOP_uptake) - deallocate(this%PO4_uptake) - deallocate(this%auto_graze) - deallocate(this%auto_graze_poc) - deallocate(this%auto_graze_doc) - deallocate(this%auto_graze_zootot) - deallocate(this%auto_graze_zoo) - deallocate(this%auto_loss) - deallocate(this%auto_loss_poc) - deallocate(this%auto_loss_doc) - deallocate(this%auto_agg) - deallocate(this%bSi_form) - deallocate(this%CaCO3_form) - deallocate(this%Nfix) - deallocate(this%zoo_loss) - deallocate(this%zoo_loss_basal) - deallocate(this%zoo_loss_poc) - deallocate(this%zoo_loss_doc) - deallocate(this%zoo_graze) - deallocate(this%zoo_graze_poc) - deallocate(this%zoo_graze_doc) - deallocate(this%zoo_graze_zootot) - deallocate(this%zoo_graze_zoo) - deallocate(this%x_graze_zoo) - if (ciso_on) then - deallocate(this%CISO_eps_autotroph) - deallocate(this%CISO_mui_to_co2star) - deallocate(this%CISO_Ca13CO3_form) - deallocate(this%CISO_Ca14CO3_form) - deallocate(this%CISO_Ca13CO3_form_zint) - deallocate(this%CISO_Ca14CO3_form_zint) - deallocate(this%CISO_photo13C) - deallocate(this%CISO_photo14C) - deallocate(this%CISO_photo13C_zint) - deallocate(this%CISO_photo14C_zint) - deallocate(this%CISO_d13C) - deallocate(this%CISO_d14C) - deallocate(this%CISO_autotrophCaCO3_d14C) - deallocate(this%CISO_autotrophCaCO3_d13C) + if (this%lallocated()) then + if (base_bio_on) then + deallocate(this%N_lim_surf) + deallocate(this%N_lim_Cweight_avg_100m) + deallocate(this%P_lim_surf) + deallocate(this%P_lim_Cweight_avg_100m) + deallocate(this%Fe_lim_surf) + deallocate(this%Fe_lim_Cweight_avg_100m) + deallocate(this%SiO3_lim_surf) + deallocate(this%SiO3_lim_Cweight_avg_100m) + deallocate(this%C_lim_surf) + deallocate(this%C_lim_Cweight_avg_100m) + deallocate(this%light_lim_surf) + deallocate(this%light_lim_Cweight_avg_100m) + deallocate(this%photoC_zint) + deallocate(this%photoC_zint_100m) + deallocate(this%photoC_NO3_zint) + deallocate(this%CaCO3_form_zint) + deallocate(this%CaCO3_form_zint_100m) + deallocate(this%auto_graze_zint) + deallocate(this%auto_graze_zint_100m) + deallocate(this%auto_graze_poc_zint) + deallocate(this%auto_graze_poc_zint_100m) + deallocate(this%auto_graze_doc_zint) + deallocate(this%auto_graze_doc_zint_100m) + deallocate(this%auto_graze_zoo_zint) + deallocate(this%auto_graze_zoo_zint_100m) + deallocate(this%auto_loss_zint) + deallocate(this%auto_loss_zint_100m) + deallocate(this%auto_loss_poc_zint) + deallocate(this%auto_loss_poc_zint_100m) + deallocate(this%auto_loss_doc_zint) + deallocate(this%auto_loss_doc_zint_100m) + deallocate(this%auto_agg_zint) + deallocate(this%auto_agg_zint_100m) + deallocate(this%zoo_loss_zint) + deallocate(this%zoo_loss_zint_100m) + deallocate(this%zoo_loss_zint_150m) + deallocate(this%zoo_loss_basal_zint) + deallocate(this%zoo_loss_basal_zint_100m) + deallocate(this%zoo_loss_poc_zint) + deallocate(this%zoo_loss_poc_zint_100m) + deallocate(this%zoo_loss_doc_zint) + deallocate(this%zoo_loss_doc_zint_100m) + deallocate(this%zoo_graze_zint) + deallocate(this%zoo_graze_zint_100m) + deallocate(this%zoo_graze_poc_zint) + deallocate(this%zoo_graze_poc_zint_100m) + deallocate(this%zoo_graze_doc_zint) + deallocate(this%zoo_graze_doc_zint_100m) + deallocate(this%zoo_graze_zoo_zint) + deallocate(this%zoo_graze_zoo_zint_100m) + deallocate(this%x_graze_zoo_zint) + deallocate(this%x_graze_zoo_zint_100m) + deallocate(this%Qp) + deallocate(this%photoC) + deallocate(this%photoC_NO3) + deallocate(this%photoFe) + deallocate(this%photoNO3) + deallocate(this%photoNH4) + deallocate(this%DOP_uptake) + deallocate(this%PO4_uptake) + deallocate(this%auto_graze) + deallocate(this%auto_graze_poc) + deallocate(this%auto_graze_doc) + deallocate(this%auto_graze_zootot) + deallocate(this%auto_graze_zoo) + deallocate(this%auto_loss) + deallocate(this%auto_loss_poc) + deallocate(this%auto_loss_doc) + deallocate(this%auto_agg) + deallocate(this%bSi_form) + deallocate(this%CaCO3_form) + deallocate(this%Nfix) + deallocate(this%zoo_loss) + deallocate(this%zoo_loss_basal) + deallocate(this%zoo_loss_poc) + deallocate(this%zoo_loss_doc) + deallocate(this%zoo_graze) + deallocate(this%zoo_graze_poc) + deallocate(this%zoo_graze_doc) + deallocate(this%zoo_graze_zootot) + deallocate(this%zoo_graze_zoo) + deallocate(this%x_graze_zoo) + if (ciso_on) then + deallocate(this%CISO_eps_autotroph) + deallocate(this%CISO_mui_to_co2star) + deallocate(this%CISO_Ca13CO3_form) + deallocate(this%CISO_Ca14CO3_form) + deallocate(this%CISO_Ca13CO3_form_zint) + deallocate(this%CISO_Ca14CO3_form_zint) + deallocate(this%CISO_photo13C) + deallocate(this%CISO_photo14C) + deallocate(this%CISO_photo13C_zint) + deallocate(this%CISO_photo14C_zint) + deallocate(this%CISO_d13C) + deallocate(this%CISO_d14C) + deallocate(this%CISO_autotrophCaCO3_d14C) + deallocate(this%CISO_autotrophCaCO3_d13C) + end if end if deallocate(this%restore_tend) end if