--- MITgcm_contrib/bling/pkg/bling_dvm.F 2016/02/28 21:53:37 1.1 +++ MITgcm_contrib/bling/pkg/bling_dvm.F 2016/05/19 20:00:53 1.4 @@ -1,4 +1,4 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/bling/pkg/bling_dvm.F,v 1.1 2016/02/28 21:53:37 mmazloff Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/bling/pkg/bling_dvm.F,v 1.4 2016/05/19 20:00:53 mmazloff Exp $ C $Name: $ #include "BLING_OPTIONS.h" @@ -340,15 +340,16 @@ #else - z_dvm_regr = 398. _d 0 - 0.56 _d 0*min(300. _d 0, - & max(-10. _d 0,(o2_upper - o2_lower))) - - & 115. _d 0*min(0.85 _d 0,max(-1.80 _d 0,log10(chl(i,j,1,bi,bj)))) - & + 0.36 _d 0*min(500. _d 0,max(epsln,mld(i,j))) - - & 2.4 _d 0*min(20. _d 0,max(-3. _d 0, (temp_upper - temp_lower))) - - ! Limit the depth of migration in polar winter. - ! Use irr_mem since this is averaged over multiple days, dampening the diurnal cycle. - ! Tapers Z_DVM to the minimum when surface irradince is below a given threshold (here 10 W/m2). + z_dvm_regr = 398. _d 0 + & - 0.56 _d 0*min(300. _d 0,max(-10. _d 0,(o2_upper - o2_lower))) + & - 115. _d 0*min(0.85 _d 0,max(-1.80 _d 0, + & log10(max(chl(i,j,1,bi,bj),chl_min)))) + & + 0.36 _d 0*min(500. _d 0,max(epsln,mld(i,j))) + & - 2.40 _d 0*min(20. _d 0,max(-3. _d 0,(temp_upper-temp_lower))) + +c ! Limit the depth of migration in polar winter. +c ! Use irr_mem since this is averaged over multiple days, dampening the diurnal cycle. +c ! Tapers Z_DVM to the minimum when surface irradince is below a given threshold (here 10 W/m2). if ( irr_mem(i,j,1,bi,bj) .lt. 10. ) then z_dvm_regr = 150. _d 0 + (z_dvm_regr - 150. _d 0) * @@ -362,7 +363,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 @@ -395,10 +396,6 @@ ! the bottom of each layer k. -C!! needed?? -C$TAF STORE dvm = comlev1, key = ikey_dynamics, kind=isbyte - - tmp = 0 DO k=1,Nr @@ -417,9 +414,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) @@ -445,11 +443,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