Skip to content

Commit

Permalink
Last commit cleaning up real(0.1,cvmix_r8) calls
Browse files Browse the repository at this point in the history
Most of these are just legibility changes... using cvmix_one instead of
real(1,cvmix_r8) over and over again.
  • Loading branch information
mnlevy1981 committed Oct 31, 2014
1 parent 9751d1f commit 47d0eb6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/shared/cvmix_convection.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ module cvmix_convection
private
! Convective diff
! diffusivity coefficient used in convective regime
real(cvmix_r8) :: convect_diff ! units: m^2/s
real(cvmix_r8) :: convect_diff ! units: m^2/s

! viscosity coefficient used in convective regime
real(cvmix_r8) :: convect_visc ! units: m^2/s
logical :: lBruntVaisala

! Threshold for squared buoyancy frequency needed to trigger
! Brunt-Vaisala parameterization
real(cvmix_r8) :: BVsqr_convect ! units: s^-2

! Flag for what to do with old values of CVmix_vars%[MTS]diff
integer :: handle_old_vals
end type cvmix_conv_params_type
Expand Down
4 changes: 2 additions & 2 deletions src/shared/cvmix_ddiff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ subroutine cvmix_coeffs_ddiff_low(Tdiff_out, Sdiff_out, strat_param_num, &
CVmix_ddiff_params_in%kappa_ddiff_param3* &
(cvmix_one/Rrho-cvmix_one)))
case ("K88")
ddiff = CVmix_ddiff_params_in%mol_diff * real(8.7,cvmix_r8) * &
(Rrho**real(1.1,cvmix_r8))
ddiff = CVmix_ddiff_params_in%mol_diff * 8.7_cvmix_r8 * &
(Rrho**1.1_cvmix_r8)
case DEFAULT
print*, "ERROR: ", trim(CVmix_ddiff_params_in%diff_conv_type), &
" is not a valid value for diff_conv_type"
Expand Down
4 changes: 2 additions & 2 deletions src/shared/cvmix_kinds_and_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ module cvmix_kinds_and_types
! Global parameters:
! The constant 1 is used repeatedly in PP and double-diff mixing.
! The value for pi is needed for Bryan-Lewis mixing.
real(cvmix_r8), parameter, public :: cvmix_zero = 0.0_cvmix_r8, &
cvmix_one = 1.0_cvmix_r8
real(cvmix_r8), parameter, public :: cvmix_zero = real(0,cvmix_r8), &
cvmix_one = real(1,cvmix_r8)
real(cvmix_r8), parameter, public :: cvmix_PI = &
3.14159265358979323846_cvmix_r8

Expand Down
10 changes: 5 additions & 5 deletions src/shared/cvmix_kpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ subroutine cvmix_kpp_compute_nonlocal(shape_fun, sigma, nonlocal, &
GatS = cvmix_math_evaluate_cubic(shape_fun, sigma)

nonlocal = GatS*(Cstar*vonkar*(vonkar*surf_layer_ext*c_s)** &
(real(1,cvmix_r8)/real(3,cvmix_r8)))
(cvmix_one/real(3,cvmix_r8)))
! EOC

end subroutine cvmix_kpp_compute_nonlocal
Expand Down Expand Up @@ -1831,7 +1831,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_sigma(sigma_coord, &
vonkar * surf_buoy_force
! w_m = vonkar * u* / phi_m
! = vonkar * ((u*/phi_m)^3)^1/3
w_m(kw) = vonkar*(w_m(kw)**(real(1,cvmix_r8)/real(3,cvmix_r8)))
w_m(kw) = vonkar*(w_m(kw)**(cvmix_one/real(3,cvmix_r8)))
end do
end if ! surf_buoy_force >= 0
end if ! compute_wm
Expand All @@ -1850,7 +1850,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_sigma(sigma_coord, &
vonkar * surf_buoy_force
! w_s = vonkar * u* / phi_s
! = vonkar * ((u*/phi_s)^3)^1/3
w_s(kw) = vonkar*(w_s(kw)**(real(1,cvmix_r8)/real(3,cvmix_r8)))
w_s(kw) = vonkar*(w_s(kw)**(cvmix_one/real(3,cvmix_r8)))
end do
end if ! surf_buoy_force >= 0
end if ! compute_ws
Expand Down Expand Up @@ -1962,7 +1962,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_OBL(sigma_coord, &
vonkar * surf_buoy_force(kw)
! w_m = vonkar * u* / phi_m
! = vonkar * ((u*/phi_m)^3)^1/3
w_m(kw) = vonkar*(w_m(kw)**(real(1,cvmix_r8)/real(3,cvmix_r8)))
w_m(kw) = vonkar*(w_m(kw)**(cvmix_one/real(3,cvmix_r8)))
endif
end do
end if ! compute_wm
Expand All @@ -1982,7 +1982,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_OBL(sigma_coord, &
vonkar * surf_buoy_force(kw)
! w_s = vonkar * u* / phi_s
! = vonkar * ((u*/phi_s)^3)^1/3
w_s(kw) = vonkar*(w_s(kw)**(real(1,cvmix_r8)/real(3,cvmix_r8)))
w_s(kw) = vonkar*(w_s(kw)**(cvmix_one/real(3,cvmix_r8)))
end if ! surf_buoy_force >= 0
end do
end if ! compute_ws
Expand Down
9 changes: 5 additions & 4 deletions src/shared/cvmix_math.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module cvmix_math

! !USES:

use cvmix_kinds_and_types, only : cvmix_r8
use cvmix_kinds_and_types, only : cvmix_r8, &
cvmix_one

!EOP

Expand Down Expand Up @@ -111,9 +112,9 @@ subroutine cvmix_math_poly_interp(coeffs, interp_type, x, y, x0, y0)
rhs(3) = 0.0_cvmix_r8
end if

Minv(1,1) = -real(1, cvmix_r8)/det
Minv(1,2) = real(1, cvmix_r8)/det
Minv(1,3) = -real(1, cvmix_r8)/(x(2)-x(1))
Minv(1,1) = -cvmix_one/det
Minv(1,2) = cvmix_one/det
Minv(1,3) = -cvmix_one/(x(2)-x(1))
Minv(2,1) = real(2, cvmix_r8)*x(1)/det
Minv(2,2) = -real(2, cvmix_r8)*x(1)/det
Minv(2,3) = (x(2)+x(1))/(x(2)-x(1))
Expand Down

0 comments on commit 47d0eb6

Please sign in to comment.