diff --git a/columnphysics/icepack_algae.F90 b/columnphysics/icepack_algae.F90 index f841902f..6163c52f 100644 --- a/columnphysics/icepack_algae.F90 +++ b/columnphysics/icepack_algae.F90 @@ -375,8 +375,8 @@ subroutine zbio (dt, nblyr, & call icepack_warnings_add(warnstr) enddo endif - call icepack_warnings_add(warnstr) - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_add(warnstr) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) call icepack_warnings_add(subname//" zbio: Carbon conservation failure after z_biogeochemistry") endif @@ -674,7 +674,7 @@ subroutine skl_biogeochemistry (dt, & nn,nbtrcr,cinit(nn) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' cinit < c0') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) return endif enddo ! nbtrcr @@ -798,7 +798,7 @@ subroutine skl_biogeochemistry (dt, & write(warnstr,*) subname, 'congel, meltb: ',congel,meltb call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' N not conserved in skl_bgc') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) elseif (cinit(nn) < c0) then write(warnstr,*) subname, 'sk_bgc < 0 after algal fluxes, nn,cinit,flux_bio',& nn,cinit(nn),flux_bio(nn) @@ -811,7 +811,7 @@ subroutine skl_biogeochemistry (dt, & write(warnstr,*) subname, 'congel, meltb: ',congel,meltb call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//'sk_bgc < 0 after algal fluxes') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (icepack_warnings_aborted(subname)) return @@ -1089,7 +1089,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, trcrn(bio_index(m) + k-1) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' zbgc initialization error') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (icepack_warnings_aborted(subname)) return enddo !k @@ -1360,7 +1360,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname,'Category,mm:',n_cat,mm call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//'zbgc FCT tracer solution failed') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (icepack_warnings_aborted(subname)) return @@ -1453,7 +1453,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, react(k,m),iphin_N(k),biomat_brine(k,m) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' C in algal_dyn not conserved') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) elseif (abs(bio_tmp) < accuracy) then flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri/dt bio_tmp = c0 @@ -1469,7 +1469,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, react(k,m),iphin_N(k),biomat_brine(k,m) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' very large bgc value') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) elseif (bio_tmp < c0) then write(warnstr,*) subname, 'negative bgc' call icepack_warnings_add(warnstr) @@ -1488,7 +1488,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, 'exp_ret( m),exp_ret( m)',exp_ret( m),exp_ret( m) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//'negative bgc') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif trcrn(bio_index(m)+k-1) = max(c0, bio_tmp) if (icepack_warnings_aborted()) then @@ -2254,6 +2254,7 @@ subroutine algal_dyn (dt, n_doc, n_dic, & write(warnstr,*) subname, 'DOC_r(k),DOC_s(k),k' call icepack_warnings_add(warnstr) write(warnstr,*) subname, DOC_r(k),DOC_s(k),k + call icepack_warnings_add(warnstr) end do do k = 1,n_dic write(warnstr,*) subname, 'DICin' @@ -2267,8 +2268,8 @@ subroutine algal_dyn (dt, n_doc, n_dic, & write(warnstr,*) subname, 'DIC_r(k),DIC_s(k),k' call icepack_warnings_add(warnstr) write(warnstr,*) subname, DIC_r(k),DIC_s(k),k + call icepack_warnings_add(warnstr) end do - call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Zoo' call icepack_warnings_add(warnstr) write(warnstr,*) subname, Zoo @@ -2790,46 +2791,76 @@ subroutine check_conservation_FCT (C_init, C_new, C_low, S_top, & if (minval(C_low) < c0) then write(warnstr,*) subname, 'Positivity of zbgc low order solution failed: C_low:',C_low - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + call icepack_warnings_add(warnstr) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (abs(diff_dt) > accuracyC ) then write(warnstr,*) subname, '' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Conservation of zbgc low order solution failed: diff_dt:' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, diff_dt + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Total initial tracer' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, C_init_tot + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Total final1 tracer' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, C_new_tot + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'bottom final tracer' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, C_new(nblyr+1) + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'top final tracer' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, C_new(1) + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Near bottom final tracer' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, C_new(nblyr) + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Near top final tracer' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, C_new(2) + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Top flux*dt into ice:' + call icepack_warnings_add(warnstr) var_tmp = S_top*dt write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Bottom flux*dt into ice:' + call icepack_warnings_add(warnstr) var_tmp = S_bot*dt write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Remaining bot flux*dt into ice:' + call icepack_warnings_add(warnstr) var_tmp = L_bot*C_new(nblyr+1)*dt write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'S_bot*dt + L_bot*C_new(nblyr+1)*dt' + call icepack_warnings_add(warnstr) var_tmp = S_bot*dt + L_bot*C_new(nblyr+1)*dt write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'fluxbio*dt:' + call icepack_warnings_add(warnstr) var_tmp = fluxbio*dt write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'fluxbio:' + call icepack_warnings_add(warnstr) write(warnstr,*) subname, fluxbio + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Remaining top flux*dt into ice:' + call icepack_warnings_add(warnstr) var_tmp = L_top*C_new(1)*dt write(warnstr,*) subname, var_tmp - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + call icepack_warnings_add(warnstr) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif end subroutine check_conservation_FCT diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 829352fe..0d4dd6c6 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -318,7 +318,7 @@ subroutine linear_itd (ncat, hin_max, & write(warnstr,*) subname, & 'ITD Thermodynamics: hicen_init(n+1) <= hicen_init(n)' - call icepack_warnings_setabort(.true.) + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) call icepack_warnings_add(warnstr) endif diff --git a/columnphysics/icepack_warnings.F90 b/columnphysics/icepack_warnings.F90 index 459f2dc8..231f7128 100644 --- a/columnphysics/icepack_warnings.F90 +++ b/columnphysics/icepack_warnings.F90 @@ -68,9 +68,15 @@ subroutine icepack_warnings_setabort(abortflag,file,line) if (abortflag) then write(warnstr,*) subname,abortflag - if (present(file)) write(warnstr,*) trim(warnstr)//' :file '//trim(file) - if (present(line)) write(warnstr,*) trim(warnstr)//' :line ',line call icepack_warnings_add(warnstr) + if (present(file)) then + write(warnstr,*) trim(warnstr)//' :file '//trim(file) + call icepack_warnings_add(warnstr) + endif + if (present(line)) then + write(warnstr,*) trim(warnstr)//' :line ',line + call icepack_warnings_add(warnstr) + endif endif warning_abort = abortflag diff --git a/columnphysics/icepack_zbgc.F90 b/columnphysics/icepack_zbgc.F90 index d33b2989..a327778b 100644 --- a/columnphysics/icepack_zbgc.F90 +++ b/columnphysics/icepack_zbgc.F90 @@ -2231,7 +2231,7 @@ subroutine update_vertical_bio_tracers(nbiolyr, trc, h1, h2, trc0, zspace) !rnilyr = real(nilyr,dbl_kind) z2a = c0 z2b = c0 - if (h2 > c0) then + if (h2 > puny) then ! loop over new grid cells do k2 = 1, nbiolyr