--- MITgcm_contrib/bling/pkg/bling_dvm.F 2016/05/15 00:30:35 1.2 +++ MITgcm_contrib/bling/pkg/bling_dvm.F 2016/05/19 16:30:00 1.3 @@ -1,4 +1,4 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/bling/pkg/bling_dvm.F,v 1.2 2016/05/15 00:30:35 mmazloff Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/bling/pkg/bling_dvm.F,v 1.3 2016/05/19 16:30:00 mmazloff Exp $ C $Name: $ #include "BLING_OPTIONS.h" @@ -362,7 +362,7 @@ C water, where O2 is available. tmp = 0 - DO k=1,Nr + DO k=1,Nr-2 IF ( (hFacC(i,j,k,bi,bj).gt.0. _d 0) .and. (tmp.eq.0)) THEN @@ -413,9 +413,10 @@ c & ( (epsln + 2. * sigma_dvm**2.)**0.5)) - ! Approximation of the complementary error function - ! From Numerical Recipes (F90, Ch. 6, p. 216) - ! Returns the complementary error function erfc(x) with fractional error everywhere less than 1.2e-7 +c ! Approximation of the complementary error function +c ! From Numerical Recipes (F90, Ch. 6, p. 216) +c ! Returns the complementary error function erfc(x) +c with fractional error everywhere less than 1.2e-7 x_erfcc = (-rf(k) - z_dvm) / & ( (epsln + 2. _d 0 * sigma_dvm**2. _d 0)**0.5) @@ -441,11 +442,10 @@ C underlying layer is suboxic, all fluxes at and below the current C layer remain at the initialized value of zero. This will cause all C remaining DVM remineralization to occur in this layer. - - if (PTR_O2(i,j,k+2) .lt. (5. _d 0*oxic_min)) tmp = 1 + IF (k.LT.NR-1) THEN + if (PTR_O2(i,j,k+2) .lt. (5. _d 0*oxic_min)) tmp = 1 + ENDIF c!! if (k .eq. grid_kmt(i,j)) exit - if (hFacC(i,j,k+1,bi,bj) .eq. 0) tmp = 1 - dvm(i,j,k) = fdvm_migr + fdvm_stat ENDIF