Skip to content

Commit 0b4e8f5

Browse files
committed
WOMBAT: Fix up non-conservation error reporting
1 parent 697bda0 commit 0b4e8f5

File tree

2 files changed

+58
-68
lines changed

2 files changed

+58
-68
lines changed

generic_tracers/generic_WOMBATlite.F90

Lines changed: 54 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,6 @@ subroutine generic_WOMBATlite_update_from_source(tracer_list, Temp, Salt, &
20532053
character(len=fm_string_len), parameter :: sub_name = 'generic_WOMBATlite_update_from_source'
20542054
character(len=256), parameter :: error_header = &
20552055
'==>Error from ' // trim(mod_name) // '(' // trim(sub_name) // '): '
2056-
character(len=2048) :: mesg
20572056

20582057
call g_tracer_get_common(isc, iec, jsc, jec, isd, ied, jsd, jed, nk, ntau, &
20592058
grid_tmask=grid_tmask, grid_kmt=grid_kmt)
@@ -3007,71 +3006,62 @@ subroutine generic_WOMBATlite_update_from_source(tracer_list, Temp, Salt, &
30073006

30083007
if (tn.gt.1) then
30093008
if (abs(n_pools(i,j,k,2) - n_pools(i,j,k,1)).gt.1e-16) then
3010-
write (mesg, '( &
3011-
"Ecosystem model is not conserving nitrogen",/, &
3012-
" Longitude index = ",i6,/, &
3013-
" Latitude index = ",i6,/, &
3014-
" Depth index and value = ",i6,",",ES13.6,/, &
3015-
" Nested timestep number = ",i6,/,/, &
3016-
" Biological N budget (molN/kg) at two timesteps = ",ES13.6,",",ES13.6,/,/, &
3017-
" NO3 (molNO3/kg) = ",ES13.6,/, &
3018-
" PHY (molN/kg) = ",ES13.6,/, &
3019-
" ZOO (molN/kg) = ",ES13.6,/, &
3020-
" DET (molN/kg) = ",ES13.6,/,/, &
3021-
" phygrow (molC/kg/s) = ",ES13.6,/, &
3022-
" detremi (molC/kg/s) = ",ES13.6,/, &
3023-
" zooresp (molC/kg/s) = ",ES13.6,/, &
3024-
" zooexcrphy (molC/kg/s) = ",ES13.6,/, &
3025-
" zooexcrdet (molC/kg/s) = ",ES13.6,/, &
3026-
" phyresp (molC/kg/s) = ",ES13.6,/ &
3027-
)') &
3028-
i, j, k, wombat%zm(i,j,k), tn, n_pools(i,j,k,1), n_pools(i,j,k,2), &
3029-
wombat%f_no3(i,j,k), wombat%f_phy(i,j,k) * 16/122.0, wombat%f_zoo(i,j,k) * 16/122.0, &
3030-
wombat%f_det(i,j,k) * 16/122.0, wombat%phygrow(i,j,k), wombat%detremi(i,j,k), &
3031-
wombat%zooresp(i,j,k), wombat%zooexcrphy(i,j,k), wombat%zooexcrdet(i,j,k), &
3032-
wombat%phyresp(i,j,k)
3033-
call mpp_error(FATAL, trim(error_header) // mesg)
3009+
print *, "--------------------------------------------"
3010+
print *, trim(error_header) // " Ecosystem model is not conserving nitrogen"
3011+
print *, " Longitude index =", i
3012+
print *, " Latitude index =", j
3013+
print *, " Depth index and value =", k, wombat%zm(i,j,k)
3014+
print *, " Nested timestep number =", tn
3015+
print *, " "
3016+
print *, " Biological N budget (molN/kg) at two timesteps =", n_pools(i,j,k,1), n_pools(i,j,k,2)
3017+
print *, " "
3018+
print *, " NO3 (molNO3/kg) =", wombat%f_no3(i,j,k)
3019+
print *, " PHY (molN/kg) =", wombat%f_phy(i,j,k) * 16.0 / 122.0
3020+
print *, " ZOO (molN/kg) =", wombat%f_zoo(i,j,k) * 16.0 / 122.0
3021+
print *, " DET (molN/kg) =", wombat%f_det(i,j,k) * 16.0 / 122.0
3022+
print *, " "
3023+
print *, " phygrow (molC/kg/s) =", wombat%phygrow(i,j,k)
3024+
print *, " detremi (molC/kg/s) =", wombat%detremi(i,j,k)
3025+
print *, " zooresp (molC/kg/s) =", wombat%zooresp(i,j,k)
3026+
print *, " zooexcrphy (molC/kg/s) =", wombat%zooexcrphy(i,j,k)
3027+
print *, " zooexcrdet (molC/kg/s) =", wombat%zooexcrdet(i,j,k)
3028+
print *, " phyresp (molC/kg/s) =", wombat%phyresp(i,j,k)
3029+
print *, "--------------------------------------------"
3030+
call mpp_error(FATAL, trim(error_header) // " Terminating run due to non-conservation of tracer")
30343031
endif
30353032
if (abs(c_pools(i,j,k,2) - c_pools(i,j,k,1)).gt.1e-16) then
3036-
write (mesg, '( &
3037-
"Ecosystem model is not conserving carbon",/, &
3038-
" Longitude index = ",i6,/, &
3039-
" Latitude index = ",i6,/, &
3040-
" Depth index and value = ",i6,",",ES13.6,/, &
3041-
" Nested timestep number = ",i6,/,/, &
3042-
" Biological C budget (molC/kg) at two timesteps = ",ES13.6,",",ES13.6,/,/, &
3043-
" DIC (molC/kg) = ",ES13.6,/, &
3044-
" ALK (molC/kg) = ",ES13.6,/, &
3045-
" PHY (molC/kg) = ",ES13.6,/, &
3046-
" ZOO (molN/kg) = ",ES13.6,/, &
3047-
" DET (molN/kg) = ",ES13.6,/, &
3048-
" CaCO3 (molC/kg) = ",ES13.6,/, &
3049-
" Temp = ",ES13.6,/, &
3050-
" Salt = ",ES13.6,/, &
3051-
" surface pCO2 = ",ES13.6,/, &
3052-
" htotal = ",ES13.6,/,/, &
3053-
" phygrow (molC/kg/s) = ",ES13.6,/, &
3054-
" detremi (molC/kg/s) = ",ES13.6,/, &
3055-
" zooresp (molC/kg/s) = ",ES13.6,/, &
3056-
" zooexcrphy (molC/kg/s) = ",ES13.6,/, &
3057-
" zooexcrdet (molC/kg/s) = ",ES13.6,/, &
3058-
" phyresp (molC/kg/s) = ",ES13.6,/, &
3059-
" zooslopphy * pic2poc(i,j,k) (molC/kg/s) = ",ES13.6,/, &
3060-
" phymort * pic2poc(i,j,k) (molC/kg/s) = ",ES13.6,/, &
3061-
" zoomort * pic2poc(i,j,k) (molC/kg/s) = ",ES13.6,/, &
3062-
" caldiss (molC/kg/s) = ",ES13.6,/ &
3063-
)') &
3064-
i, j, k, wombat%zm(i,j,k), tn, c_pools(i,j,k,1), c_pools(i,j,k,2), &
3065-
wombat%f_dic(i,j,k), wombat%f_alk(i,j,k), wombat%f_phy(i,j,k), wombat%f_zoo(i,j,k), &
3066-
wombat%f_det(i,j,k), wombat%f_caco3(i,j,k), Temp(i,j,k), Salt(i,j,k), &
3067-
wombat%pco2_csurf(i,j), wombat%htotal(i,j,k), wombat%phygrow(i,j,k), &
3068-
wombat%detremi(i,j,k), wombat%zooresp(i,j,k), wombat%zooexcrphy(i,j,k), &
3069-
wombat%zooexcrdet(i,j,k), wombat%phyresp(i,j,k), &
3070-
wombat%zooslopphy(i,j,k) * wombat%pic2poc(i,j,k), &
3071-
wombat%phymort(i,j,k) * wombat%pic2poc(i,j,k), &
3072-
wombat%zoomort(i,j,k) * wombat%pic2poc(i,j,k), &
3073-
wombat%caldiss(i,j,k)
3074-
call mpp_error(FATAL, trim(error_header) // mesg)
3033+
print *, "--------------------------------------------"
3034+
print *, trim(error_header) // " Ecosystem model is not conserving carbon"
3035+
print *, " Longitude index =", i
3036+
print *, " Latitude index =", j
3037+
print *, " Depth index and value =", k, wombat%zm(i,j,k)
3038+
print *, " Nested timestep number =", tn
3039+
print *, " "
3040+
print *, " Biological C budget (molC/kg) at two timesteps =", c_pools(i,j,k,1), c_pools(i,j,k,2)
3041+
print *, " "
3042+
print *, " DIC (molC/kg) =", wombat%f_dic(i,j,k)
3043+
print *, " ALK (molC/kg) =", wombat%f_alk(i,j,k)
3044+
print *, " PHY (molC/kg) =", wombat%f_phy(i,j,k)
3045+
print *, " ZOO (molN/kg) =", wombat%f_zoo(i,j,k)
3046+
print *, " DET (molN/kg) =", wombat%f_det(i,j,k)
3047+
print *, " CaCO3 (molC/kg) =", wombat%f_caco3(i,j,k)
3048+
print *, " Temp =", Temp(i,j,k)
3049+
print *, " Salt =", Salt(i,j,k)
3050+
print *, " surface pCO2 =", wombat%pco2_csurf(i,j)
3051+
print *, " htotal =", wombat%htotal(i,j,k)
3052+
print *, " "
3053+
print *, " phygrow (molC/kg/s) =", wombat%phygrow(i,j,k)
3054+
print *, " detremi (molC/kg/s) =", wombat%detremi(i,j,k)
3055+
print *, " zooresp (molC/kg/s) =", wombat%zooresp(i,j,k)
3056+
print *, " zooexcrphy (molC/kg/s) =", wombat%zooexcrphy(i,j,k)
3057+
print *, " zooexcrdet (molC/kg/s) =", wombat%zooexcrdet(i,j,k)
3058+
print *, " phyresp (molC/kg/s) =", wombat%phyresp(i,j,k)
3059+
print *, " zooslopphy * pic2poc(i,j,k) (molC/kg/s) =", wombat%zooslopphy(i,j,k) * wombat%pic2poc(i,j,k)
3060+
print *, " phymort * pic2poc(i,j,k) (molC/kg/s) =", wombat%phymort(i,j,k) * wombat%pic2poc(i,j,k)
3061+
print *, " zoomort * pic2poc(i,j,k) (molC/kg/s) =", wombat%zoomort(i,j,k) * wombat%pic2poc(i,j,k)
3062+
print *, " caldiss (molC/kg/s) =", wombat%caldiss(i,j,k)
3063+
print *, "--------------------------------------------"
3064+
call mpp_error(FATAL, trim(error_header) // " Terminating run due to non-conservation of tracer")
30753065
endif
30763066
endif
30773067

generic_tracers/generic_WOMBATmid.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3755,7 +3755,7 @@ subroutine generic_WOMBATmid_update_from_source(tracer_list, Temp, Salt, &
37553755
if (tn.gt.1) then
37563756
if (abs(n_pools(i,j,k,2) - n_pools(i,j,k,1)).gt.1e-16) then
37573757
print *, "--------------------------------------------"
3758-
print *, trim(error_header) // "Ecosystem model is not conserving nitrogen"
3758+
print *, trim(error_header) // " Ecosystem model is not conserving nitrogen"
37593759
print *, " Longitude index =", i
37603760
print *, " Latitude index =", j
37613761
print *, " Depth index and value =", k, wombat%zm(i,j,k)
@@ -3784,11 +3784,11 @@ subroutine generic_WOMBATmid_update_from_source(tracer_list, Temp, Salt, &
37843784
print *, " phyresp (molC/kg/s) =", wombat%phyresp(i,j,k)
37853785
print *, " diaresp (molC/kg/s) =", wombat%diaresp(i,j,k)
37863786
print *, "--------------------------------------------"
3787-
call mpp_error(FATAL, trim(error_header) // "Terminating run due to non-conservation of tracer")
3787+
call mpp_error(FATAL, trim(error_header) // " Terminating run due to non-conservation of tracer")
37883788
endif
37893789
if (abs(c_pools(i,j,k,2) - c_pools(i,j,k,1)).gt.1e-16) then
37903790
print *, "--------------------------------------------"
3791-
print *, trim(error_header) // "Ecosystem model is not conserving carbon"
3791+
print *, trim(error_header) // " Ecosystem model is not conserving carbon"
37923792
print *, " Longitude index =", i
37933793
print *, " Latitude index =", j
37943794
print *, " Depth index and value =", k, wombat%zm(i,j,k)
@@ -3830,7 +3830,7 @@ subroutine generic_WOMBATmid_update_from_source(tracer_list, Temp, Salt, &
38303830
print *, " zoomort * pic2poc(i,j,k) (molC/kg/s) =", wombat%zoomort(i,j,k) * wombat%pic2poc(i,j,k)
38313831
print *, " caldiss (molC/kg/s) =", wombat%caldiss(i,j,k)
38323832
print *, "--------------------------------------------"
3833-
call mpp_error(FATAL, trim(error_header) // "Terminating run due to non-conservation of tracer")
3833+
call mpp_error(FATAL, trim(error_header) // " Terminating run due to non-conservation of tracer")
38343834
endif
38353835
endif
38363836

0 commit comments

Comments
 (0)