Skip to content

Commit 011b724

Browse files
Merge pull request #27 from nikizadehgfdl/tolerance_nml
Add imbalance tolerance to a namelist
2 parents edbe781 + e44be60 commit 011b724

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

generic_tracers/generic_COBALT.F90

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ module generic_COBALT
202202
real :: irr_inhibit = 10.
203203
real :: gamma_nitrif= 3.5e6 !month(-1)
204204
real :: k_nh3_nitrif= 3.1e-9 !mol/kg
205+
real :: imbalance_tolerance=1.0e-10 !the tolerance for non-conservation in C,N,P,Sc,Fe
205206

206207
integer :: scheme_no3_nh4_lim = 2 !1-Frost and Franzen (1992)
207208
!2-O'Neill
@@ -212,8 +213,7 @@ module generic_COBALT
212213

213214
namelist /generic_COBALT_nml/ do_14c, co2_calc, debug, do_nh3_atm_ocean_exchange, scheme_nitrif, &
214215
k_nh4_small,k_nh4_large,k_nh4_diazo,scheme_no3_nh4_lim,k_no3_small,k_no3_large,k_no3_diazo, &
215-
o2_min_nit,k_o2_nit,irr_inhibit,k_nh3_nitrif, &
216-
gamma_nitrif
216+
o2_min_nit,k_o2_nit,irr_inhibit,k_nh3_nitrif,gamma_nitrif,imbalance_tolerance
217217

218218
! Declare phytoplankton, zooplankton and cobalt variable types, which contain
219219
! the vast majority of all variables used in this module.
@@ -6494,7 +6494,6 @@ subroutine generic_COBALT_update_from_source(tracer_list,Temp,Salt,rho_dzt,dzt,h
64946494
real, dimension(:,:), Allocatable :: pka_nh3,phos_nh3_exchange
64956495

64966496
real :: tr,ltr
6497-
64986497
real :: imbal
64996498
integer :: stdoutunit, imbal_flag, outunit
65006499

@@ -8477,7 +8476,7 @@ subroutine generic_COBALT_update_from_source(tracer_list,Temp,Salt,rho_dzt,dzt,h
84778476
cobalt%p_nsmz(i,j,k,tau) + cobalt%p_nmdz(i,j,k,tau) + &
84788477
cobalt%p_nlgz(i,j,k,tau))*grid_tmask(i,j,k)
84798478
imbal = (post_totn(i,j,k) - pre_totn(i,j,k) - net_srcn(i,j,k))*86400.0/dt*1.03e6
8480-
if (abs(imbal).gt.1.0e-10) then
8479+
if (abs(imbal).gt.imbalance_tolerance) then
84818480
call mpp_error(FATAL,&
84828481
'==>biological source/sink imbalance (generic_COBALT_update_from_source): Nitrogen')
84838482
endif
@@ -8491,7 +8490,7 @@ subroutine generic_COBALT_update_from_source(tracer_list,Temp,Salt,rho_dzt,dzt,h
84918490
cobalt%p_nsmz(i,j,k,tau) + cobalt%p_nmdz(i,j,k,tau) + &
84928491
cobalt%p_nlgz(i,j,k,tau)))*grid_tmask(i,j,k)
84938492
imbal = (post_totc(i,j,k) - pre_totc(i,j,k))*86400.0/dt*1.03e6
8494-
if (abs(imbal).gt.1.0e-9) then
8493+
if (abs(imbal).gt.imbalance_tolerance) then
84958494
call mpp_error(FATAL,&
84968495
'==>biological source/sink imbalance (generic_COBALT_update_from_source): Carbon')
84978496
endif
@@ -8506,7 +8505,7 @@ subroutine generic_COBALT_update_from_source(tracer_list,Temp,Salt,rho_dzt,dzt,h
85068505
cobalt%p_nlgz(i,j,k,tau)*zoo(3)%q_p_2_n + &
85078506
bact(1)%q_p_2_n*cobalt%p_nbact(i,j,k,tau))*grid_tmask(i,j,k)
85088507
imbal = (post_totp(i,j,k) - pre_totp(i,j,k))*86400.0/dt*1.03e6
8509-
if (abs(imbal).gt.1.0e-10) then
8508+
if (abs(imbal).gt.imbalance_tolerance) then
85108509
call mpp_error(FATAL,&
85118510
'==>biological source/sink imbalance (generic_COBALT_update_from_source): Phosphorus')
85128511
endif
@@ -8515,15 +8514,15 @@ subroutine generic_COBALT_update_from_source(tracer_list,Temp,Salt,rho_dzt,dzt,h
85158514
cobalt%p_felg(i,j,k,tau) + cobalt%p_fesm(i,j,k,tau) + &
85168515
cobalt%p_fedet(i,j,k,tau))*grid_tmask(i,j,k)
85178516
imbal = (post_totfe(i,j,k) - pre_totfe(i,j,k) - net_srcfe(i,j,k))*86400.0/dt*1.03e6
8518-
if (abs(imbal).gt.1.0e-10) then
8517+
if (abs(imbal).gt.imbalance_tolerance) then
85198518
call mpp_error(FATAL,&
85208519
'==>biological source/sink imbalance (generic_COBALT_update_from_source): Iron')
85218520
endif
85228521

85238522
post_totsi(i,j,k) = (cobalt%p_sio4(i,j,k,tau) + cobalt%p_silg(i,j,k,tau) + &
85248523
cobalt%p_sidet(i,j,k,tau))*grid_tmask(i,j,k)
85258524
imbal = (post_totsi(i,j,k) - pre_totsi(i,j,k))*86400.0/dt*1.03e6
8526-
if (abs(imbal).gt.1.0e-10) then
8525+
if (abs(imbal).gt.imbalance_tolerance) then
85278526
call mpp_error(FATAL,&
85288527
'==>biological source/sink imbalance (generic_COBALT_update_from_source): Silica')
85298528
endif

0 commit comments

Comments
 (0)