340 |
|
|
341 |
#else |
#else |
342 |
|
|
343 |
z_dvm_regr = 398. _d 0 - 0.56 _d 0*min(300. _d 0, |
z_dvm_regr = 398. _d 0 |
344 |
& max(-10. _d 0,(o2_upper - o2_lower))) - |
& - 0.56 _d 0*min(300. _d 0,max(-10. _d 0,(o2_upper - o2_lower))) |
345 |
& 115. _d 0*min(0.85 _d 0,max(-1.80 _d 0,log10(chl(i,j,1,bi,bj)))) |
& - 115. _d 0*min(0.85 _d 0,max(-1.80 _d 0, |
346 |
& + 0.36 _d 0*min(500. _d 0,max(epsln,mld(i,j))) - |
& log10(max(chl(i,j,1,bi,bj),chl_min)))) |
347 |
& 2.4 _d 0*min(20. _d 0,max(-3. _d 0, (temp_upper - temp_lower))) |
& + 0.36 _d 0*min(500. _d 0,max(epsln,mld(i,j))) |
348 |
|
& - 2.40 _d 0*min(20. _d 0,max(-3. _d 0,(temp_upper-temp_lower))) |
349 |
! Limit the depth of migration in polar winter. |
|
350 |
! Use irr_mem since this is averaged over multiple days, dampening the diurnal cycle. |
c ! Limit the depth of migration in polar winter. |
351 |
! Tapers Z_DVM to the minimum when surface irradince is below a given threshold (here 10 W/m2). |
c ! Use irr_mem since this is averaged over multiple days, dampening the diurnal cycle. |
352 |
|
c ! Tapers Z_DVM to the minimum when surface irradince is below a given threshold (here 10 W/m2). |
353 |
|
|
354 |
if ( irr_mem(i,j,1,bi,bj) .lt. 10. ) then |
if ( irr_mem(i,j,1,bi,bj) .lt. 10. ) then |
355 |
z_dvm_regr = 150. _d 0 + (z_dvm_regr - 150. _d 0) * |
z_dvm_regr = 150. _d 0 + (z_dvm_regr - 150. _d 0) * |
363 |
C water, where O2 is available. |
C water, where O2 is available. |
364 |
|
|
365 |
tmp = 0 |
tmp = 0 |
366 |
DO k=1,Nr |
DO k=1,Nr-2 |
367 |
|
|
368 |
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 |
369 |
|
|
396 |
! the bottom of each layer k. |
! the bottom of each layer k. |
397 |
|
|
398 |
|
|
|
C!! needed?? |
|
|
C$TAF STORE dvm = comlev1, key = ikey_dynamics, kind=isbyte |
|
|
|
|
|
|
|
399 |
tmp = 0 |
tmp = 0 |
400 |
DO k=1,Nr |
DO k=1,Nr |
401 |
|
|
414 |
c & ( (epsln + 2. * sigma_dvm**2.)**0.5)) |
c & ( (epsln + 2. * sigma_dvm**2.)**0.5)) |
415 |
|
|
416 |
|
|
417 |
! Approximation of the complementary error function |
c ! Approximation of the complementary error function |
418 |
! From Numerical Recipes (F90, Ch. 6, p. 216) |
c ! From Numerical Recipes (F90, Ch. 6, p. 216) |
419 |
! Returns the complementary error function erfc(x) with fractional error everywhere less than 1.2e-7 |
c ! Returns the complementary error function erfc(x) |
420 |
|
c with fractional error everywhere less than 1.2e-7 |
421 |
x_erfcc = (-rf(k) - z_dvm) / |
x_erfcc = (-rf(k) - z_dvm) / |
422 |
& ( (epsln + 2. _d 0 * sigma_dvm**2. _d 0)**0.5) |
& ( (epsln + 2. _d 0 * sigma_dvm**2. _d 0)**0.5) |
423 |
|
|
443 |
C underlying layer is suboxic, all fluxes at and below the current |
C underlying layer is suboxic, all fluxes at and below the current |
444 |
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 |
445 |
C remaining DVM remineralization to occur in this layer. |
C remaining DVM remineralization to occur in this layer. |
446 |
|
IF (k.LT.NR-1) THEN |
447 |
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 |
448 |
|
ENDIF |
449 |
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 |
|
|
|
|
450 |
dvm(i,j,k) = fdvm_migr + fdvm_stat |
dvm(i,j,k) = fdvm_migr + fdvm_stat |
451 |
|
|
452 |
ENDIF |
ENDIF |