Skip to content

Commit

Permalink
(*)Add parentheses to 4 EOS int_density routines
Browse files Browse the repository at this point in the history
  Added parentheses to 140 lines in 8 int_density_dz and int_spec_vol_dp
routines for the linear, Wright, Wright_full and Wright_red equations of state
so that they will be rotationally invariant when fused-multiply-adds are
enabled.  All answers are bitwise identical in cases without FMAs, but answers
could change with FMAs.
  • Loading branch information
Hallberg-NOAA committed Jul 29, 2024
1 parent 9172cd5 commit 24091cc
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 140 deletions.
72 changes: 36 additions & 36 deletions src/equation_of_state/MOM_EOS_Wright.F90
Original file line number Diff line number Diff line change
Expand Up @@ -568,24 +568,24 @@ subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, &
hL = (z_t(i,j) - z_b(i,j)) + dz_neglect
hR = (z_t(i+1,j) - z_b(i+1,j)) + dz_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intz(1) = dpa(i,j) ; intz(5) = dpa(i+1,j)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

al0 = wtT_L*al0_2d(i,j) + wtT_R*al0_2d(i+1,j)
p0 = wtT_L*p0_2d(i,j) + wtT_R*p0_2d(i+1,j)
lambda = wtT_L*lambda_2d(i,j) + wtT_R*lambda_2d(i+1,j)
al0 = (wtT_L*al0_2d(i,j)) + (wtT_R*al0_2d(i+1,j))
p0 = (wtT_L*p0_2d(i,j)) + (wtT_R*p0_2d(i+1,j))
lambda = (wtT_L*lambda_2d(i,j)) + (wtT_R*lambda_2d(i+1,j))

dz = wt_L*(z_t(i,j) - z_b(i,j)) + wt_R*(z_t(i+1,j) - z_b(i+1,j))
p_ave = -GxRho*(0.5*(wt_L*(z_t(i,j)+z_b(i,j)) + wt_R*(z_t(i+1,j)+z_b(i+1,j))) - z0pres)
dz = (wt_L*(z_t(i,j) - z_b(i,j))) + (wt_R*(z_t(i+1,j) - z_b(i+1,j)))
p_ave = -GxRho*(0.5*((wt_L*(z_t(i,j)+z_b(i,j))) + (wt_R*(z_t(i+1,j)+z_b(i+1,j)))) - z0pres)

I_al0 = 1.0 / al0
I_Lzz = 1.0 / (p0 + (lambda * I_al0) + p_ave)
Expand All @@ -609,24 +609,24 @@ subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, &
hL = (z_t(i,j) - z_b(i,j)) + dz_neglect
hR = (z_t(i,j+1) - z_b(i,j+1)) + dz_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intz(1) = dpa(i,j) ; intz(5) = dpa(i,j+1)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

al0 = wtT_L*al0_2d(i,j) + wtT_R*al0_2d(i,j+1)
p0 = wtT_L*p0_2d(i,j) + wtT_R*p0_2d(i,j+1)
lambda = wtT_L*lambda_2d(i,j) + wtT_R*lambda_2d(i,j+1)
al0 = (wtT_L*al0_2d(i,j)) + (wtT_R*al0_2d(i,j+1))
p0 = (wtT_L*p0_2d(i,j)) + (wtT_R*p0_2d(i,j+1))
lambda = (wtT_L*lambda_2d(i,j)) + (wtT_R*lambda_2d(i,j+1))

dz = wt_L*(z_t(i,j) - z_b(i,j)) + wt_R*(z_t(i,j+1) - z_b(i,j+1))
p_ave = -GxRho*(0.5*(wt_L*(z_t(i,j)+z_b(i,j)) + wt_R*(z_t(i,j+1)+z_b(i,j+1))) - z0pres)
dz = (wt_L*(z_t(i,j) - z_b(i,j))) + (wt_R*(z_t(i,j+1) - z_b(i,j+1)))
p_ave = -GxRho*(0.5*((wt_L*(z_t(i,j)+z_b(i,j))) + (wt_R*(z_t(i,j+1)+z_b(i,j+1)))) - z0pres)

I_al0 = 1.0 / al0
I_Lzz = 1.0 / (p0 + (lambda * I_al0) + p_ave)
Expand Down Expand Up @@ -808,26 +808,26 @@ subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, spv_ref, HI, dza, &
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect
hR = (p_b(i+1,j) - p_t(i+1,j)) + dP_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intp(1) = dza(i,j) ; intp(5) = dza(i+1,j)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

! T, S and p are interpolated in the horizontal. The p interpolation
! is linear, but for T and S it may be thickness weighted.
al0 = wtT_L*al0_2d(i,j) + wtT_R*al0_2d(i+1,j)
p0 = wtT_L*p0_2d(i,j) + wtT_R*p0_2d(i+1,j)
lambda = wtT_L*lambda_2d(i,j) + wtT_R*lambda_2d(i+1,j)
al0 = (wtT_L*al0_2d(i,j)) + (wtT_R*al0_2d(i+1,j))
p0 = (wtT_L*p0_2d(i,j)) + (wtT_R*p0_2d(i+1,j))
lambda = (wtT_L*lambda_2d(i,j)) + (wtT_R*lambda_2d(i+1,j))

dp = wt_L*(p_b(i,j) - p_t(i,j)) + wt_R*(p_b(i+1,j) - p_t(i+1,j))
p_ave = 0.5*(wt_L*(p_t(i,j)+p_b(i,j)) + wt_R*(p_t(i+1,j)+p_b(i+1,j)))
dp = (wt_L*(p_b(i,j) - p_t(i,j))) + (wt_R*(p_b(i+1,j) - p_t(i+1,j)))
p_ave = 0.5*((wt_L*(p_t(i,j)+p_b(i,j))) + (wt_R*(p_t(i+1,j)+p_b(i+1,j))))

eps = 0.5 * dp / (p0 + p_ave) ; eps2 = eps*eps
intp(m) = (al0 + lambda / (p0 + p_ave) - spv_ref)*dp + 2.0*eps* &
Expand All @@ -849,26 +849,26 @@ subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, spv_ref, HI, dza, &
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect
hR = (p_b(i,j+1) - p_t(i,j+1)) + dP_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intp(1) = dza(i,j) ; intp(5) = dza(i,j+1)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

! T, S and p are interpolated in the horizontal. The p interpolation
! is linear, but for T and S it may be thickness weighted.
al0 = wt_L*al0_2d(i,j) + wt_R*al0_2d(i,j+1)
p0 = wt_L*p0_2d(i,j) + wt_R*p0_2d(i,j+1)
lambda = wt_L*lambda_2d(i,j) + wt_R*lambda_2d(i,j+1)
al0 = (wt_L*al0_2d(i,j)) + (wt_R*al0_2d(i,j+1))
p0 = (wt_L*p0_2d(i,j)) + (wt_R*p0_2d(i,j+1))
lambda = (wt_L*lambda_2d(i,j)) + (wt_R*lambda_2d(i,j+1))

dp = wt_L*(p_b(i,j) - p_t(i,j)) + wt_R*(p_b(i,j+1) - p_t(i,j+1))
p_ave = 0.5*(wt_L*(p_t(i,j)+p_b(i,j)) + wt_R*(p_t(i,j+1)+p_b(i,j+1)))
dp = (wt_L*(p_b(i,j) - p_t(i,j))) + (wt_R*(p_b(i,j+1) - p_t(i,j+1)))
p_ave = 0.5*((wt_L*(p_t(i,j)+p_b(i,j))) + (wt_R*(p_t(i,j+1)+p_b(i,j+1))))

eps = 0.5 * dp / (p0 + p_ave) ; eps2 = eps*eps
intp(m) = (al0 + lambda / (p0 + p_ave) - spv_ref)*dp + 2.0*eps* &
Expand Down
72 changes: 36 additions & 36 deletions src/equation_of_state/MOM_EOS_Wright_full.F90
Original file line number Diff line number Diff line change
Expand Up @@ -573,24 +573,24 @@ subroutine int_density_dz_wright_full(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, &
hL = (z_t(i,j) - z_b(i,j)) + dz_neglect
hR = (z_t(i+1,j) - z_b(i+1,j)) + dz_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intz(1) = dpa(i,j) ; intz(5) = dpa(i+1,j)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

al0 = wtT_L*al0_2d(i,j) + wtT_R*al0_2d(i+1,j)
p0 = wtT_L*p0_2d(i,j) + wtT_R*p0_2d(i+1,j)
lambda = wtT_L*lambda_2d(i,j) + wtT_R*lambda_2d(i+1,j)
al0 = (wtT_L*al0_2d(i,j)) + (wtT_R*al0_2d(i+1,j))
p0 = (wtT_L*p0_2d(i,j)) + (wtT_R*p0_2d(i+1,j))
lambda = (wtT_L*lambda_2d(i,j)) + (wtT_R*lambda_2d(i+1,j))

dz = wt_L*(z_t(i,j) - z_b(i,j)) + wt_R*(z_t(i+1,j) - z_b(i+1,j))
p_ave = -GxRho*(0.5*(wt_L*(z_t(i,j)+z_b(i,j)) + wt_R*(z_t(i+1,j)+z_b(i+1,j))) - z0pres)
dz = (wt_L*(z_t(i,j) - z_b(i,j))) + (wt_R*(z_t(i+1,j) - z_b(i+1,j)))
p_ave = -GxRho*(0.5*((wt_L*(z_t(i,j)+z_b(i,j))) + (wt_R*(z_t(i+1,j)+z_b(i+1,j)))) - z0pres)

I_al0 = 1.0 / al0
I_Lzz = 1.0 / ((p0 + p_ave) + lambda * I_al0)
Expand All @@ -614,24 +614,24 @@ subroutine int_density_dz_wright_full(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, &
hL = (z_t(i,j) - z_b(i,j)) + dz_neglect
hR = (z_t(i,j+1) - z_b(i,j+1)) + dz_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intz(1) = dpa(i,j) ; intz(5) = dpa(i,j+1)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

al0 = wtT_L*al0_2d(i,j) + wtT_R*al0_2d(i,j+1)
p0 = wtT_L*p0_2d(i,j) + wtT_R*p0_2d(i,j+1)
lambda = wtT_L*lambda_2d(i,j) + wtT_R*lambda_2d(i,j+1)
al0 = (wtT_L*al0_2d(i,j)) + (wtT_R*al0_2d(i,j+1))
p0 = (wtT_L*p0_2d(i,j)) + (wtT_R*p0_2d(i,j+1))
lambda = (wtT_L*lambda_2d(i,j)) + (wtT_R*lambda_2d(i,j+1))

dz = wt_L*(z_t(i,j) - z_b(i,j)) + wt_R*(z_t(i,j+1) - z_b(i,j+1))
p_ave = -GxRho*(0.5*(wt_L*(z_t(i,j)+z_b(i,j)) + wt_R*(z_t(i,j+1)+z_b(i,j+1))) - z0pres)
dz = (wt_L*(z_t(i,j) - z_b(i,j))) + (wt_R*(z_t(i,j+1) - z_b(i,j+1)))
p_ave = -GxRho*(0.5*((wt_L*(z_t(i,j)+z_b(i,j))) + (wt_R*(z_t(i,j+1)+z_b(i,j+1)))) - z0pres)

I_al0 = 1.0 / al0
I_Lzz = 1.0 / ((p0 + p_ave) + lambda * I_al0)
Expand Down Expand Up @@ -815,26 +815,26 @@ subroutine int_spec_vol_dp_wright_full(T, S, p_t, p_b, spv_ref, HI, dza, &
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect
hR = (p_b(i+1,j) - p_t(i+1,j)) + dP_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intp(1) = dza(i,j) ; intp(5) = dza(i+1,j)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

! T, S, and p are interpolated in the horizontal. The p interpolation
! is linear, but for T and S it may be thickness weighted.
al0 = wtT_L*al0_2d(i,j) + wtT_R*al0_2d(i+1,j)
p0 = wtT_L*p0_2d(i,j) + wtT_R*p0_2d(i+1,j)
lambda = wtT_L*lambda_2d(i,j) + wtT_R*lambda_2d(i+1,j)
al0 = (wtT_L*al0_2d(i,j)) + (wtT_R*al0_2d(i+1,j))
p0 = (wtT_L*p0_2d(i,j)) + (wtT_R*p0_2d(i+1,j))
lambda = (wtT_L*lambda_2d(i,j)) + (wtT_R*lambda_2d(i+1,j))

dp = wt_L*(p_b(i,j) - p_t(i,j)) + wt_R*(p_b(i+1,j) - p_t(i+1,j))
p_ave = 0.5*(wt_L*(p_t(i,j)+p_b(i,j)) + wt_R*(p_t(i+1,j)+p_b(i+1,j)))
dp = (wt_L*(p_b(i,j) - p_t(i,j))) + (wt_R*(p_b(i+1,j) - p_t(i+1,j)))
p_ave = 0.5*((wt_L*(p_t(i,j)+p_b(i,j))) + (wt_R*(p_t(i+1,j)+p_b(i+1,j))))
I_pterm = 1.0 / (p0 + p_ave)

eps = 0.5 * dp * I_pterm ; eps2 = eps*eps
Expand All @@ -857,26 +857,26 @@ subroutine int_spec_vol_dp_wright_full(T, S, p_t, p_b, spv_ref, HI, dza, &
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect
hR = (p_b(i,j+1) - p_t(i,j+1)) + dP_neglect
hWght = hWght * ( (hL-hR)/(hL+hR) )**2
iDenom = 1.0 / ( hWght*(hR + hL) + hL*hR )
hWt_LL = (hWght*hL + hR*hL) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + hR*hL) * iDenom ; hWt_RL = (hWght*hL) * iDenom
iDenom = 1.0 / ( hWght*(hR + hL) + (hL*hR) )
hWt_LL = (hWght*hL + (hR*hL)) * iDenom ; hWt_LR = (hWght*hR) * iDenom
hWt_RR = (hWght*hR + (hR*hL)) * iDenom ; hWt_RL = (hWght*hL) * iDenom
else
hWt_LL = 1.0 ; hWt_LR = 0.0 ; hWt_RR = 1.0 ; hWt_RL = 0.0
endif

intp(1) = dza(i,j) ; intp(5) = dza(i,j+1)
do m=2,4
wt_L = 0.25*real(5-m) ; wt_R = 1.0-wt_L
wtT_L = wt_L*hWt_LL + wt_R*hWt_RL ; wtT_R = wt_L*hWt_LR + wt_R*hWt_RR
wtT_L = (wt_L*hWt_LL) + (wt_R*hWt_RL) ; wtT_R = (wt_L*hWt_LR) + (wt_R*hWt_RR)

! T, S, and p are interpolated in the horizontal. The p interpolation
! is linear, but for T and S it may be thickness weighted.
al0 = wt_L*al0_2d(i,j) + wt_R*al0_2d(i,j+1)
p0 = wt_L*p0_2d(i,j) + wt_R*p0_2d(i,j+1)
lambda = wt_L*lambda_2d(i,j) + wt_R*lambda_2d(i,j+1)
al0 = (wt_L*al0_2d(i,j)) + (wt_R*al0_2d(i,j+1))
p0 = (wt_L*p0_2d(i,j)) + (wt_R*p0_2d(i,j+1))
lambda = (wt_L*lambda_2d(i,j)) + (wt_R*lambda_2d(i,j+1))

dp = wt_L*(p_b(i,j) - p_t(i,j)) + wt_R*(p_b(i,j+1) - p_t(i,j+1))
p_ave = 0.5*(wt_L*(p_t(i,j)+p_b(i,j)) + wt_R*(p_t(i,j+1)+p_b(i,j+1)))
dp = (wt_L*(p_b(i,j) - p_t(i,j))) + (wt_R*(p_b(i,j+1) - p_t(i,j+1)))
p_ave = 0.5*((wt_L*(p_t(i,j)+p_b(i,j))) + (wt_R*(p_t(i,j+1)+p_b(i,j+1))))
I_pterm = 1.0 / (p0 + p_ave)

eps = 0.5 * dp * I_pterm ; eps2 = eps*eps
Expand Down
Loading

0 comments on commit 24091cc

Please sign in to comment.