Skip to content

Commit

Permalink
Replaced '.eq.' with '==' and '.ne.' with '/='
Browse files Browse the repository at this point in the history
  Replace the older Fortran syntax '.eq.', and '.ne.' with the clearer and more
succinct syntax '==' and '/='.  All answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed May 5, 2018
1 parent 562acf0 commit f02deae
Show file tree
Hide file tree
Showing 36 changed files with 480 additions and 480 deletions.
12 changes: 6 additions & 6 deletions config_src/solo_driver/coupler_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ subroutine coupler_type_copy_1d_2d(var_in, var_out, is, ie, js, je, &
if (var_in%num_bcs >= 0) &
call CT_spawn_1d_2d(var_in, var_out, (/ is, is, ie, ie /), (/ js, js, je, je /), suffix)

if ((var_out%num_bcs > 0) .and. (diag_name .ne. ' ')) &
if ((var_out%num_bcs > 0) .and. (diag_name /= ' ')) &
call CT_set_diags_2d(var_out, diag_name, axes, time)

end subroutine coupler_type_copy_1d_2d
Expand Down Expand Up @@ -365,7 +365,7 @@ subroutine coupler_type_copy_1d_3d(var_in, var_out, is, ie, js, je, kd, &
if (var_in%num_bcs >= 0) &
call CT_spawn_1d_3d(var_in, var_out, (/ is, is, ie, ie /), (/ js, js, je, je /), (/1, kd/), suffix)

if ((var_out%num_bcs > 0) .and. (diag_name .ne. ' ')) &
if ((var_out%num_bcs > 0) .and. (diag_name /= ' ')) &
call CT_set_diags_3d(var_out, diag_name, axes, time)

end subroutine coupler_type_copy_1d_3d
Expand Down Expand Up @@ -408,7 +408,7 @@ subroutine coupler_type_copy_2d_2d(var_in, var_out, is, ie, js, je, &
if (var_in%num_bcs >= 0) &
call CT_spawn_2d_2d(var_in, var_out, (/ is, is, ie, ie /), (/ js, js, je, je /), suffix)

if ((var_out%num_bcs > 0) .and. (diag_name .ne. ' ')) &
if ((var_out%num_bcs > 0) .and. (diag_name /= ' ')) &
call CT_set_diags_2d(var_out, diag_name, axes, time)

end subroutine coupler_type_copy_2d_2d
Expand Down Expand Up @@ -459,7 +459,7 @@ subroutine coupler_type_copy_2d_3d(var_in, var_out, is, ie, js, je, kd, &
if (var_in%num_bcs >= 0) &
call CT_spawn_2d_3d(var_in, var_out, (/ is, is, ie, ie /), (/ js, js, je, je /), (/1, kd/), suffix)

if ((var_out%num_bcs > 0) .and. (diag_name .ne. ' ')) &
if ((var_out%num_bcs > 0) .and. (diag_name /= ' ')) &
call CT_set_diags_3d(var_out, diag_name, axes, time)

end subroutine coupler_type_copy_2d_3d
Expand Down Expand Up @@ -502,7 +502,7 @@ subroutine coupler_type_copy_3d_2d(var_in, var_out, is, ie, js, je, &
if (var_in%num_bcs >= 0) &
call CT_spawn_3d_2d(var_in, var_out, (/ is, is, ie, ie /), (/ js, js, je, je /), suffix)

if ((var_out%num_bcs > 0) .and. (diag_name .ne. ' ')) &
if ((var_out%num_bcs > 0) .and. (diag_name /= ' ')) &
call CT_set_diags_2d(var_out, diag_name, axes, time)

end subroutine coupler_type_copy_3d_2d
Expand Down Expand Up @@ -553,7 +553,7 @@ subroutine coupler_type_copy_3d_3d(var_in, var_out, is, ie, js, je, kd, &
if (var_in%num_bcs >= 0) &
call CT_spawn_3d_3d(var_in, var_out, (/ is, is, ie, ie /), (/ js, js, je, je /), (/1, kd/), suffix)

if ((var_out%num_bcs > 0) .and. (diag_name .ne. ' ')) &
if ((var_out%num_bcs > 0) .and. (diag_name /= ' ')) &
call CT_set_diags_3d(var_out, diag_name, axes, time)

end subroutine coupler_type_copy_3d_3d
Expand Down
4 changes: 2 additions & 2 deletions src/ALE/P1M_functions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ subroutine P1M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_coefficients )

! Using the limited slope, the left edge value is reevaluated and
! the interpolant coefficients recomputed
if ( h0 .NE. 0.0 ) then
if ( h0 /= 0.0 ) then
ppoly_E(1,1) = u0 - 0.5 * slope
else
ppoly_E(1,1) = u0
Expand All @@ -177,7 +177,7 @@ subroutine P1M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_coefficients )
slope = 2.0 * ( u1 - ppoly_E(N-1,2) )
end if

if ( h1 .NE. 0.0 ) then
if ( h1 /= 0.0 ) then
ppoly_E(N,2) = u1 + 0.5 * slope
else
ppoly_E(N,2) = u1
Expand Down
18 changes: 9 additions & 9 deletions src/ALE/P3M_functions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ subroutine P3M_limiter( N, h, u, ppoly_E, ppoly_S, ppoly_coefficients, h_neglect
u_c = u(k)
h_c = h(k)

if ( k .EQ. 1 ) then
if ( k == 1 ) then
h_l = h(k)
u_l = u(k)
else
h_l = h(k-1)
u_l = u(k-1)
end if

if ( k .EQ. N ) then
if ( k == N ) then
h_r = h(k)
u_r = u(k)
else
Expand Down Expand Up @@ -190,7 +190,7 @@ subroutine P3M_limiter( N, h, u, ppoly_E, ppoly_S, ppoly_coefficients, h_neglect
! If cubic is not monotonic, monotonize it by modifiying the
! edge slopes, store the new edge slopes and recompute the
! cubic coefficients
if ( monotonic .EQ. 0 ) then
if ( monotonic == 0 ) then
call monotonize_cubic( h_c, u0_l, u0_r, sigma_l, sigma_r, slope, u1_l, u1_r )
end if

Expand Down Expand Up @@ -301,7 +301,7 @@ subroutine P3M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_S, ppoly_coeffici
call build_cubic_interpolant( h, i0, ppoly_E, ppoly_S, ppoly_coefficients )
monotonic = is_cubic_monotonic( ppoly_coefficients, i0 )

if ( monotonic .EQ. 0 ) then
if ( monotonic == 0 ) then
call monotonize_cubic( h0, u0_l, u0_r, 0.0, slope, slope, u1_l, u1_r )

! Rebuild cubic after monotonization
Expand Down Expand Up @@ -360,7 +360,7 @@ subroutine P3M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_S, ppoly_coeffici
call build_cubic_interpolant( h, i1, ppoly_E, ppoly_S, ppoly_coefficients )
monotonic = is_cubic_monotonic( ppoly_coefficients, i1 )

if ( monotonic .EQ. 0 ) then
if ( monotonic == 0 ) then
call monotonize_cubic( h1, u0_l, u0_r, slope, 0.0, slope, u1_l, u1_r )

! Rebuild cubic after monotonization
Expand Down Expand Up @@ -564,7 +564,7 @@ subroutine monotonize_cubic( h, u0_l, u0_r, sigma_l, sigma_r, slope, u1_l, u1_r
! There is a possible root (and inflexion point) only if a3 is nonzero.
! When a3 is zero, the second derivative of the cubic is constant (the
! cubic degenerates into a parabola) and no inflexion point exists.
if ( a3 .NE. 0.0 ) then
if ( a3 /= 0.0 ) then
! Location of inflexion point
xi_ip = - a2 / (3.0 * a3)

Expand All @@ -579,7 +579,7 @@ subroutine monotonize_cubic( h, u0_l, u0_r, sigma_l, sigma_r, slope, u1_l, u1_r
! decide on which side we want to collapse the inflexion point.
! If the inflexion point lies on one of the edges, the cubic is
! guaranteed to be monotonic
if ( found_ip .EQ. 1 ) then
if ( found_ip == 1 ) then
slope_ip = a1 + 2.0*a2*xi_ip + 3.0*a3*xi_ip*xi_ip

! Check whether slope is consistent
Expand All @@ -597,7 +597,7 @@ subroutine monotonize_cubic( h, u0_l, u0_r, sigma_l, sigma_r, slope, u1_l, u1_r
! 'inflexion_l' and 'inflexion_r' are set to 0 and nothing is to be done.

! Move inflexion point on the left
if ( inflexion_l .EQ. 1 ) then
if ( inflexion_l == 1 ) then

u1_l_tmp = 1.5*(u0_r-u0_l)/h - 0.5*u1_r
u1_r_tmp = 3.0*(u0_r-u0_l)/h - 2.0*u1_l
Expand Down Expand Up @@ -627,7 +627,7 @@ subroutine monotonize_cubic( h, u0_l, u0_r, sigma_l, sigma_r, slope, u1_l, u1_r
end if ! end treating case with inflexion point on the left

! Move inflexion point on the right
if ( inflexion_r .EQ. 1 ) then
if ( inflexion_r == 1 ) then

u1_l_tmp = 3.0*(u0_r-u0_l)/h - 2.0*u1_r
u1_r_tmp = 1.5*(u0_r-u0_l)/h - 0.5*u1_l
Expand Down
28 changes: 14 additions & 14 deletions src/ALE/PQM_functions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ subroutine PQM_limiter( N, h, u, ppoly_E, ppoly_S, h_neglect )
! monotonic, edge slopes are consistent and the cell is not an extremum.
! We now need to check and encorce the monotonicity of the quartic within
! the cell
if ( (inflexion_l .EQ. 0) .AND. (inflexion_r .EQ. 0) ) then
if ( (inflexion_l == 0) .AND. (inflexion_r == 0) ) then

a = u0_l
b = h_c * u1_l
Expand All @@ -208,7 +208,7 @@ subroutine PQM_limiter( N, h, u, ppoly_E, ppoly_S, h_neglect )
rho = alpha2 * alpha2 - 4.0 * alpha1 * alpha3

! Check whether inflexion points exist
if (( alpha1 .ne. 0.0 ) .and. ( rho >= 0.0 )) then
if (( alpha1 /= 0.0 ) .and. ( rho >= 0.0 )) then

sqrt_rho = sqrt( rho )

Expand Down Expand Up @@ -273,7 +273,7 @@ subroutine PQM_limiter( N, h, u, ppoly_E, ppoly_S, h_neglect )

! If alpha1 is zero, the second derivative of the quartic reduces
! to a straight line
if (( alpha1 .eq. 0.0 ) .and. ( alpha2 .ne. 0.0 )) then
if (( alpha1 == 0.0 ) .and. ( alpha2 /= 0.0 )) then

x1 = - alpha3 / alpha2
if ( (x1 >= 0.0) .AND. (x1 <= 1.0) ) then
Expand All @@ -298,7 +298,7 @@ subroutine PQM_limiter( N, h, u, ppoly_E, ppoly_S, h_neglect )
end if ! end checking whether to shift inflexion points

! At this point, we know onto which edge to shift inflexion points
if ( inflexion_l .EQ. 1 ) then
if ( inflexion_l == 1 ) then

! We modify the edge slopes so that both inflexion points
! collapse onto the left edge
Expand All @@ -323,7 +323,7 @@ subroutine PQM_limiter( N, h, u, ppoly_E, ppoly_S, h_neglect )

end if

else if ( inflexion_r .EQ. 1 ) then
else if ( inflexion_r == 1 ) then

! We modify the edge slopes so that both inflexion points
! collapse onto the right edge
Expand Down Expand Up @@ -608,7 +608,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

! Compute coefficient for rational function based on mean and right
! edge value and slope
if (u1_r.ne.0.) then ! HACK by AJA
if (u1_r /= 0.) then ! HACK by AJA
beta = 2.0 * ( u0_r - um ) / ( (h0 + hNeglect)*u1_r) - 1.0
else
beta = 0.
Expand Down Expand Up @@ -651,7 +651,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

! Check whether inflexion points exist. If so, transform the quartic
! so that both inflexion points coalesce on the left edge.
if (( alpha1 .ne. 0.0 ) .and. ( rho >= 0.0 )) then
if (( alpha1 /= 0.0 ) .and. ( rho >= 0.0 )) then

sqrt_rho = sqrt( rho )

Expand All @@ -673,7 +673,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

end if

if (( alpha1 .eq. 0.0 ) .and. ( alpha2 .ne. 0.0 )) then
if (( alpha1 == 0.0 ) .and. ( alpha2 /= 0.0 )) then

x1 = - alpha3 / alpha2
if ( (x1 >= 0.0) .and. (x1 <= 1.0) ) then
Expand All @@ -685,7 +685,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

end if

if ( inflexion_l .eq. 1 ) then
if ( inflexion_l == 1 ) then

! We modify the edge slopes so that both inflexion points
! collapse onto the left edge
Expand Down Expand Up @@ -757,7 +757,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

! Compute coefficient for rational function based on mean and left
! edge value and slope
if (um-u0_l.ne.0.) then ! HACK by AJA
if (um-u0_l /= 0.) then ! HACK by AJA
beta = 0.5*h1*u1_l / (um-u0_l) - 1.0
else
beta = 0.
Expand All @@ -766,7 +766,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff
ar = u0_l

! Right edge value estimate based on rational function
if (1+beta.ne.0.) then ! HACK by AJA
if (1+beta /= 0.) then ! HACK by AJA
u0_r = (ar + 2*br + beta*br ) / ((1+beta)*(1+beta))
else
u0_r = um + 0.5 * slope ! PLM
Expand Down Expand Up @@ -804,7 +804,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

! Check whether inflexion points exist. If so, transform the quartic
! so that both inflexion points coalesce on the right edge.
if (( alpha1 .ne. 0.0 ) .and. ( rho >= 0.0 )) then
if (( alpha1 /= 0.0 ) .and. ( rho >= 0.0 )) then

sqrt_rho = sqrt( rho )

Expand All @@ -826,7 +826,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

end if

if (( alpha1 .eq. 0.0 ) .and. ( alpha2 .ne. 0.0 )) then
if (( alpha1 == 0.0 ) .and. ( alpha2 /= 0.0 )) then

x1 = - alpha3 / alpha2
if ( (x1 >= 0.0) .and. (x1 <= 1.0) ) then
Expand All @@ -838,7 +838,7 @@ subroutine PQM_boundary_extrapolation_v1( N, h, u, ppoly_E, ppoly_S, ppoly_coeff

end if

if ( inflexion_r .eq. 1 ) then
if ( inflexion_r == 1 ) then

! We modify the edge slopes so that both inflexion points
! collapse onto the right edge
Expand Down
6 changes: 3 additions & 3 deletions src/ALE/regrid_edge_values.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ subroutine bound_edge_values( N, h, u, edge_values, h_neglect )
! boundary cell and the right neighbor of the right boundary cell
! is assumed to be the same as the right boundary cell. This
! effectively makes boundary cells look like extrema.
if ( k .EQ. 1 ) then
if ( k == 1 ) then
k0 = 1
k1 = 1
k2 = 2
else if ( k .EQ. N ) then
else if ( k == N ) then
k0 = N-1
k1 = N
k2 = N
Expand Down Expand Up @@ -179,7 +179,7 @@ subroutine average_discontinuous_edge_values( N, edge_values )
! Edge value on the right of the edge
u0_plus = edge_values(k+1,1)

if ( u0_minus .NE. u0_plus ) then
if ( u0_minus /= u0_plus ) then
u0_avg = 0.5 * ( u0_minus + u0_plus )
edge_values(k,2) = u0_avg
edge_values(k+1,1) = u0_avg
Expand Down
2 changes: 1 addition & 1 deletion src/ALE/regrid_solvers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ subroutine solve_linear_system( A, B, X, system_size )

! If the pivot is in a row that is different than row i, that is if
! k is different than i, we need to swap those two rows
if ( k .NE. i ) then
if ( k /= i ) then
do j = 1,system_size
swap_a = A(i,j)
A(i,j) = A(k,j)
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ subroutine step_offline(forces, fluxes, sfc_state, Time_start, time_interval, CS
! Note that for the layer mode case, the calls to tracer sources and sinks is embedded in
! main_offline_advection_layer. Warning: this may not be appropriate for tracers that
! exchange with the atmosphere
if (time_interval .NE. dt_offline) then
if (time_interval /= dt_offline) then
call MOM_error(FATAL, &
"For offline tracer mode in a non-ALE configuration, dt_offline must equal time_interval")
endif
Expand Down
6 changes: 3 additions & 3 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ subroutine gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, CS)


! Calculate KE (Kinetic energy for use in the -grad(KE) acceleration term).
if (CS%KE_Scheme.eq.KE_ARAKAWA) then
if (CS%KE_Scheme == KE_ARAKAWA) then
! The following calculation of Kinetic energy includes the metric terms
! identified in Arakawa & Lamb 1982 as important for KE conservation. It
! also includes the possibility of partially-blocked tracer cell faces.
Expand All @@ -871,7 +871,7 @@ subroutine gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, CS)
+G%areaCv(i,J-1)*(v(i,J-1,k)*v(i,J-1,k)) ) &
)*0.25*G%IareaT(i,j)
enddo ; enddo
elseif (CS%KE_Scheme.eq.KE_SIMPLE_GUDONOV) then
elseif (CS%KE_Scheme == KE_SIMPLE_GUDONOV) then
! The following discretization of KE is based on the one-dimensinal Gudonov
! scheme which does not take into account any geometric factors
do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1
Expand All @@ -881,7 +881,7 @@ subroutine gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, CS)
vm = 0.5*( v(i, J ,k) - ABS( v(i, J ,k) ) ) ; vm2 = vm*vm
KE(i,j) = ( max(up2,um2) + max(vp2,vm2) ) *0.5
enddo ; enddo
elseif (CS%KE_Scheme.eq.KE_GUDONOV) then
elseif (CS%KE_Scheme == KE_GUDONOV) then
! The following discretization of KE is based on the one-dimensinal Gudonov
! scheme but has been adapted to take horizontal grid factors into account
do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ subroutine open_boundary_config(G, param_file, OBC)
call get_param(param_file, mdl, "NK", OBC%ke, &
"The number of model layers", default=0, do_not_log=.true.)

if (config1 .ne. "none") OBC%user_BCs_set_globally = .true.
if (config1 /= "none") OBC%user_BCs_set_globally = .true.

if (OBC%number_of_segments > 0) then
call get_param(param_file, mdl, "OBC_ZERO_VORTICITY", OBC%zero_vorticity, &
Expand Down
Loading

0 comments on commit f02deae

Please sign in to comment.