Skip to content

Commit

Permalink
Re-enable Fe balance check, clean up code
Browse files Browse the repository at this point in the history
Stand-alone build found some unused variables and imports that I removed
  • Loading branch information
mnlevy1981 committed May 23, 2024
1 parent 961ca65 commit 6681874
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
16 changes: 7 additions & 9 deletions src/marbl_diagnostics_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4543,15 +4543,13 @@ subroutine store_diagnostics_iron_fluxes(marbl_domain, P_iron, dust, &
integrated_terms = P_iron%sed_loss - fesedflux - feRedsedflux - feventflux - (dust%remin * dust_to_Fe))


! if (abs(diags(ind%Jint_Fetot)%field_2d(1)) .gt. Jint_Fetot_thres) then
! write(log_message,"(A,E11.3e3,A,E11.3e3)") &
! 'abs(Jint_Fetot)=', abs(diags(ind%Jint_Fetot)%field_2d(1)), &
! ' exceeds Jint_Fetot_thres=', Jint_Fetot_thres
! call marbl_status_log%log_error(log_message, subname, ElemInd=1)


! return
! end if
if (abs(diags(ind%Jint_Fetot)%field_2d(1)) .gt. Jint_Fetot_thres) then
write(log_message,"(A,E11.3e3,A,E11.3e3)") &
'abs(Jint_Fetot)=', abs(diags(ind%Jint_Fetot)%field_2d(1)), &
' exceeds Jint_Fetot_thres=', Jint_Fetot_thres
call marbl_status_log%log_error(log_message, subname, ElemInd=1)
return
end if

end associate

Expand Down
25 changes: 5 additions & 20 deletions src/marbl_interior_tendency_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ subroutine marbl_interior_tendency_compute( &

call compute_scavenging(k, km, marbl_tracer_indices, tracer_local(:,:), &
POC, P_CaCO3, P_SiO2, dust, Fefree(:), Fe_scavenge_rate(:), &
Fe_scavenge(:), Lig_scavenge(:), marbl_status_log, autotroph_local, &
fesedflux(:), feRedsedflux(:), feventflux(:))
Fe_scavenge(:), Lig_scavenge(:), marbl_status_log, &
fesedflux(:), feventflux(:))

if (marbl_status_log%labort_marbl) then
call marbl_status_log%log_error_trace('compute_scavenging()', subname)
Expand All @@ -388,7 +388,7 @@ subroutine marbl_interior_tendency_compute( &

call compute_large_detritus_prod(k, domain, marbl_tracer_indices, zooplankton_derived_terms, &
autotroph_derived_terms, Fe_scavenge(:), &
POC, POP, PON, P_CaCO3, P_CaCO3_ALT_CO2, P_SiO2, dust, P_iron, &
POC, POP, PON, P_CaCO3, P_CaCO3_ALT_CO2, P_SiO2, P_iron, &
dissolved_organic_matter%DOP_loss_P_bal(k), &
dissolved_organic_matter%DON_loss_N_bal(k), marbl_status_log)

Expand Down Expand Up @@ -1154,8 +1154,6 @@ subroutine compute_autotroph_elemental_ratios(km, autotroph_local, marbl_tracer_
use marbl_settings_mod, only : gQsi_0
use marbl_settings_mod, only : gQsi_max
use marbl_settings_mod, only : gQsi_min
use marbl_settings_mod, only : gQ_Fe_kFe_thres
use marbl_settings_mod, only : gQ_Si_kSi_thres
use marbl_settings_mod, only : QCaCO3_max

integer, intent(in) :: km
Expand Down Expand Up @@ -1688,8 +1686,6 @@ subroutine compute_autotroph_nutrient_uptake(marbl_tracer_indices, autotroph_der
! Get nutrient uptakes by small phyto based on calculated C fixation
!-----------------------------------------------------------------------

use marbl_settings_mod, only : Q

type(marbl_tracer_index_type), intent(in) :: marbl_tracer_indices
type(autotroph_derived_terms_type), intent(inout) :: autotroph_derived_terms

Expand Down Expand Up @@ -2262,7 +2258,6 @@ subroutine compute_dissolved_organic_matter (km, marbl_tracer_indices, &
zooplankton_derived_terms, autotroph_derived_terms, &
dz1, tracer_local, dissolved_organic_matter)

use marbl_settings_mod, only : Q
use marbl_settings_mod, only : DOC_reminR_light
use marbl_settings_mod, only : DON_reminR_light
use marbl_settings_mod, only : DOP_reminR_light
Expand Down Expand Up @@ -2399,7 +2394,7 @@ end subroutine compute_dissolved_organic_matter
subroutine compute_scavenging(k, km, marbl_tracer_indices, &
tracer_local, POC, P_CaCO3, P_SiO2, dust, &
Fefree, Fe_scavenge_rate, Fe_scavenge, Lig_scavenge, &
marbl_status_log, autotroph_local, fesedflux, feRedsedflux, feventflux)
marbl_status_log, fesedflux, feventflux)

use marbl_constants_mod, only : c3, c4
use marbl_settings_mod , only : Lig_cnt
Expand All @@ -2417,14 +2412,12 @@ subroutine compute_scavenging(k, km, marbl_tracer_indices, &
type(column_sinking_particle_type), intent(in) :: P_CaCO3
type(column_sinking_particle_type), intent(in) :: P_SiO2
type(column_sinking_particle_type), intent(inout) :: dust
type(autotroph_local_type), intent(in) :: autotroph_local
real(r8), intent(out) :: Fefree(km)
real(r8), intent(out) :: Fe_scavenge_rate(km)
real(r8), intent(out) :: Fe_scavenge(km)
real(r8), intent(out) :: Lig_scavenge(km)
type(marbl_log_type), intent(inout) :: marbl_status_log
real(r8), intent(in) :: fesedflux(km) ! sedimentary Fe input
real(r8), intent(in) :: feRedsedflux(km) ! sedimentary Red Fe input
real(r8), intent(in) :: feventflux(km) ! vent Fe input


Expand Down Expand Up @@ -2630,7 +2623,7 @@ end subroutine compute_scavenging

subroutine compute_large_detritus_prod(k, domain, marbl_tracer_indices, &
zooplankton_derived_terms, autotroph_derived_terms, &
Fe_scavenge, POC, POP, PON, P_CaCO3, P_CaCO3_ALT_CO2, P_SiO2, dust, P_iron, &
Fe_scavenge, POC, POP, PON, P_CaCO3, P_CaCO3_ALT_CO2, P_SiO2, P_iron, &
DOP_loss_P_bal, DON_loss_N_bal, marbl_status_log)

use marbl_settings_mod, only : Jint_Ptot_thres
Expand All @@ -2656,7 +2649,6 @@ subroutine compute_large_detritus_prod(k, domain, marbl_tracer_indices, &
type(column_sinking_particle_type), intent(inout) :: P_CaCO3
type(column_sinking_particle_type), intent(inout) :: P_CaCO3_ALT_CO2
type(column_sinking_particle_type), intent(inout) :: P_SiO2
type(column_sinking_particle_type), intent(inout) :: dust
type(column_sinking_particle_type), intent(inout) :: P_iron
real(r8), intent(out) :: DOP_loss_P_bal
real(r8), intent(out) :: DON_loss_N_bal
Expand Down Expand Up @@ -2774,13 +2766,6 @@ subroutine compute_large_detritus_prod(k, domain, marbl_tracer_indices, &
endif
end do

!-----------------------------------------------------------------------
! Dust prod now set in compute_scavenging
!-----------------------------------------------------------------------

! dust%prod(k) = c0


end associate
end subroutine compute_large_detritus_prod

Expand Down

0 comments on commit 6681874

Please sign in to comment.