362 |
C water, where O2 is available. |
C water, where O2 is available. |
363 |
|
|
364 |
tmp = 0 |
tmp = 0 |
365 |
DO k=1,Nr |
DO k=1,Nr-2 |
366 |
|
|
367 |
IF ( (hFacC(i,j,k,bi,bj).gt.0. _d 0) .and. (tmp.eq.0)) THEN |
IF ( (hFacC(i,j,k,bi,bj).gt.0. _d 0) .and. (tmp.eq.0)) THEN |
368 |
|
|
413 |
c & ( (epsln + 2. * sigma_dvm**2.)**0.5)) |
c & ( (epsln + 2. * sigma_dvm**2.)**0.5)) |
414 |
|
|
415 |
|
|
416 |
! Approximation of the complementary error function |
c ! Approximation of the complementary error function |
417 |
! From Numerical Recipes (F90, Ch. 6, p. 216) |
c ! From Numerical Recipes (F90, Ch. 6, p. 216) |
418 |
! Returns the complementary error function erfc(x) with fractional error everywhere less than 1.2e-7 |
c ! Returns the complementary error function erfc(x) |
419 |
|
c with fractional error everywhere less than 1.2e-7 |
420 |
x_erfcc = (-rf(k) - z_dvm) / |
x_erfcc = (-rf(k) - z_dvm) / |
421 |
& ( (epsln + 2. _d 0 * sigma_dvm**2. _d 0)**0.5) |
& ( (epsln + 2. _d 0 * sigma_dvm**2. _d 0)**0.5) |
422 |
|
|
442 |
C underlying layer is suboxic, all fluxes at and below the current |
C underlying layer is suboxic, all fluxes at and below the current |
443 |
C layer remain at the initialized value of zero. This will cause all |
C layer remain at the initialized value of zero. This will cause all |
444 |
C remaining DVM remineralization to occur in this layer. |
C remaining DVM remineralization to occur in this layer. |
445 |
|
IF (k.LT.NR-1) THEN |
446 |
if (PTR_O2(i,j,k+2) .lt. (5. _d 0*oxic_min)) tmp = 1 |
if (PTR_O2(i,j,k+2) .lt. (5. _d 0*oxic_min)) tmp = 1 |
447 |
|
ENDIF |
448 |
c!! if (k .eq. grid_kmt(i,j)) exit |
c!! if (k .eq. grid_kmt(i,j)) exit |
|
if (hFacC(i,j,k+1,bi,bj) .eq. 0) tmp = 1 |
|
|
|
|
449 |
dvm(i,j,k) = fdvm_migr + fdvm_stat |
dvm(i,j,k) = fdvm_migr + fdvm_stat |
450 |
|
|
451 |
ENDIF |
ENDIF |