Skip to content

Commit

Permalink
Merged keywords end do & end if to enddo & endif
Browse files Browse the repository at this point in the history
  Replaced 'end do' with 'enddo' and 'else if' with 'elseif', to follow typical
practice in MOM6.  Also adding spacing around the semicolons separating stacked
enddo statements in several places.  All answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed May 7, 2018
1 parent 4adbbe3 commit 0116078
Show file tree
Hide file tree
Showing 80 changed files with 547 additions and 547 deletions.
14 changes: 7 additions & 7 deletions config_src/coupled_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, &
do j=js-2,je+2 ; do i=is-2,ie+2
fluxes%TKE_tidal(i,j) = CS%TKE_tidal(i,j)
fluxes%ustar_tidal(i,j) = CS%ustar_tidal(i,j)
enddo; enddo
enddo ; enddo

if (restore_temp) call safe_alloc_ptr(fluxes%heat_added,isd,ied,jsd,jed)

Expand Down Expand Up @@ -353,15 +353,15 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, &
if (CS%mask_srestore_under_ice) then ! Do not restore under sea-ice
do j=js,je ; do i=is,ie
if (sfc_state%SST(i,j) <= -0.0539*sfc_state%SSS(i,j)) open_ocn_mask(i,j)=0.0
enddo; enddo
enddo ; enddo
endif
if (CS%salt_restore_as_sflux) then
do j=js,je ; do i=is,ie
delta_sss = data_restore(i,j)- sfc_state%SSS(i,j)
delta_sss = sign(1.0,delta_sss)*min(abs(delta_sss),CS%max_delta_srestore)
fluxes%salt_flux(i,j) = 1.e-3*G%mask2dT(i,j) * (CS%Rho0*CS%Flux_const)* &
(CS%basin_mask(i,j)*open_ocn_mask(i,j)*CS%srestore_mask(i,j)) *delta_sss ! kg Salt m-2 s-1
enddo; enddo
enddo ; enddo
if (CS%adjust_net_srestore_to_zero) then
if (CS%adjust_net_srestore_by_scaling) then
call adjust_area_mean_to_zero(fluxes%salt_flux, G, fluxes%saltFluxGlobalScl)
Expand All @@ -382,7 +382,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, &
(CS%Rho0*CS%Flux_const) * &
delta_sss / (0.5*(sfc_state%SSS(i,j) + data_restore(i,j)))
endif
enddo; enddo
enddo ; enddo
if (CS%adjust_net_srestore_to_zero) then
if (CS%adjust_net_srestore_by_scaling) then
call adjust_area_mean_to_zero(fluxes%vprec, G, fluxes%vPrecGlobalScl)
Expand All @@ -392,7 +392,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, &
fluxes%vPrecGlobalAdj = reproducing_sum(work_sum(:,:), isr, ier, jsr, jer) / CS%area_surf
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = ( fluxes%vprec(i,j) - fluxes%vPrecGlobalAdj ) * G%mask2dT(i,j)
enddo; enddo
enddo ; enddo
endif
endif
endif
Expand Down Expand Up @@ -536,12 +536,12 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, &
call adjust_area_mean_to_zero(net_FW2, G, fluxes%netFWGlobalScl)
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = fluxes%vprec(i,j) + (net_FW2(i,j) - net_FW(i,j)/G%areaT(i,j)) * G%mask2dT(i,j)
enddo; enddo
enddo ; enddo
else
fluxes%netFWGlobalAdj = reproducing_sum(net_FW(:,:), isr, ier, jsr, jer) / CS%area_surf
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = ( fluxes%vprec(i,j) - fluxes%netFWGlobalAdj ) * G%mask2dT(i,j)
enddo; enddo
enddo ; enddo
endif

endif
Expand Down
4 changes: 2 additions & 2 deletions config_src/coupled_driver/ocean_model_MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1079,9 +1079,9 @@ subroutine ocean_model_data2D_get(OS,Ocean, name, array2D,isc,jsc)
case('mask')
array2D(isc:,jsc:) = OS%grid%mask2dT(g_isc:g_iec,g_jsc:g_jec)
!OR same result
! do j=g_jsc,g_jec; do i=g_isc,g_iec
! do j=g_jsc,g_jec ; do i=g_isc,g_iec
! array2D(isc+i-g_isc,jsc+j-g_jsc) = OS%grid%mask2dT(i,j)
! enddo; enddo
! enddo ; enddo
case('t_surf')
array2D(isc:,jsc:) = Ocean%t_surf(isc:,jsc:)-CELSIUS_KELVIN_OFFSET
case('t_pme')
Expand Down
12 changes: 6 additions & 6 deletions config_src/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ program MOM_main
else
calendar = uppercase(calendar)
if (calendar(1:6) == 'JULIAN') then ; calendar_type = JULIAN
else if (calendar(1:9) == 'GREGORIAN') then ; calendar_type = GREGORIAN
else if (calendar(1:6) == 'NOLEAP') then ; calendar_type = NOLEAP
else if (calendar(1:10)=='THIRTY_DAY') then ; calendar_type = THIRTY_DAY_MONTHS
else if (calendar(1:11)=='NO_CALENDAR') then; calendar_type = NO_CALENDAR
else if (calendar(1:1) /= ' ') then
elseif (calendar(1:9) == 'GREGORIAN') then ; calendar_type = GREGORIAN
elseif (calendar(1:6) == 'NOLEAP') then ; calendar_type = NOLEAP
elseif (calendar(1:10)=='THIRTY_DAY') then ; calendar_type = THIRTY_DAY_MONTHS
elseif (calendar(1:11)=='NO_CALENDAR') then; calendar_type = NO_CALENDAR
elseif (calendar(1:1) /= ' ') then
call MOM_error(FATAL,'MOM_driver: Invalid namelist value '//trim(calendar)//' for calendar')
else
call MOM_error(FATAL,'MOM_driver: No namelist value for calendar')
Expand Down Expand Up @@ -641,7 +641,7 @@ program MOM_main
call get_date(Time, yr, mon, day, hr, mins, sec)
write(unit, '(6i6,8x,a)') yr, mon, day, hr, mins, sec, &
'Current model time: year, month, day, hour, minute, second'
end if
endif
call close_file(unit)
endif

Expand Down
44 changes: 22 additions & 22 deletions config_src/solo_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,16 @@ subroutine wind_forcing_from_file(sfc_state, forces, day, G, CS)
time_lev_daily = days - 365*floor(real(days) / 365.0)

if (time_lev_daily < 31) then ; time_lev_monthly = 0
else if (time_lev_daily < 59) then ; time_lev_monthly = 1
else if (time_lev_daily < 90) then ; time_lev_monthly = 2
else if (time_lev_daily < 120) then ; time_lev_monthly = 3
else if (time_lev_daily < 151) then ; time_lev_monthly = 4
else if (time_lev_daily < 181) then ; time_lev_monthly = 5
else if (time_lev_daily < 212) then ; time_lev_monthly = 6
else if (time_lev_daily < 243) then ; time_lev_monthly = 7
else if (time_lev_daily < 273) then ; time_lev_monthly = 8
else if (time_lev_daily < 304) then ; time_lev_monthly = 9
else if (time_lev_daily < 334) then ; time_lev_monthly = 10
elseif (time_lev_daily < 59) then ; time_lev_monthly = 1
elseif (time_lev_daily < 90) then ; time_lev_monthly = 2
elseif (time_lev_daily < 120) then ; time_lev_monthly = 3
elseif (time_lev_daily < 151) then ; time_lev_monthly = 4
elseif (time_lev_daily < 181) then ; time_lev_monthly = 5
elseif (time_lev_daily < 212) then ; time_lev_monthly = 6
elseif (time_lev_daily < 243) then ; time_lev_monthly = 7
elseif (time_lev_daily < 273) then ; time_lev_monthly = 8
elseif (time_lev_daily < 304) then ; time_lev_monthly = 9
elseif (time_lev_daily < 334) then ; time_lev_monthly = 10
else ; time_lev_monthly = 11
endif

Expand Down Expand Up @@ -847,16 +847,16 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, CS)
time_lev_daily = days - 365*floor(real(days) / 365.0)

if (time_lev_daily < 31) then ; time_lev_monthly = 0
else if (time_lev_daily < 59) then ; time_lev_monthly = 1
else if (time_lev_daily < 90) then ; time_lev_monthly = 2
else if (time_lev_daily < 120) then ; time_lev_monthly = 3
else if (time_lev_daily < 151) then ; time_lev_monthly = 4
else if (time_lev_daily < 181) then ; time_lev_monthly = 5
else if (time_lev_daily < 212) then ; time_lev_monthly = 6
else if (time_lev_daily < 243) then ; time_lev_monthly = 7
else if (time_lev_daily < 273) then ; time_lev_monthly = 8
else if (time_lev_daily < 304) then ; time_lev_monthly = 9
else if (time_lev_daily < 334) then ; time_lev_monthly = 10
elseif (time_lev_daily < 59) then ; time_lev_monthly = 1
elseif (time_lev_daily < 90) then ; time_lev_monthly = 2
elseif (time_lev_daily < 120) then ; time_lev_monthly = 3
elseif (time_lev_daily < 151) then ; time_lev_monthly = 4
elseif (time_lev_daily < 181) then ; time_lev_monthly = 5
elseif (time_lev_daily < 212) then ; time_lev_monthly = 6
elseif (time_lev_daily < 243) then ; time_lev_monthly = 7
elseif (time_lev_daily < 273) then ; time_lev_monthly = 8
elseif (time_lev_daily < 304) then ; time_lev_monthly = 9
elseif (time_lev_daily < 334) then ; time_lev_monthly = 10
else ; time_lev_monthly = 11
endif

Expand Down Expand Up @@ -1153,7 +1153,7 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, CS
! but evap is normally a positive quantity in the files
fluxes%latent(i,j) = CS%latent_heat_vapor*fluxes%evap(i,j)
fluxes%latent_evap_diag(i,j) = fluxes%latent(i,j)
enddo; enddo
enddo ; enddo

call data_override('OCN', 'sens', fluxes%sens(:,:), day, &
is_in=is_in, ie_in=ie_in, js_in=js_in, je_in=je_in)
Expand All @@ -1162,7 +1162,7 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, CS
do j=js,je ; do i=is,ie
fluxes%sens(i,j) = -fluxes%sens(i,j) ! Normal convention is positive into the ocean
! but sensible is normally a positive quantity in the files
enddo; enddo
enddo ; enddo

call data_override('OCN', 'sw', fluxes%sw(:,:), day, &
is_in=is_in, ie_in=ie_in, js_in=js_in, je_in=je_in)
Expand Down
2 changes: 1 addition & 1 deletion src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ subroutine ALE_initThicknessToCoord( CS, G, GV, h )

do j = G%jsd,G%jed ; do i = G%isd,G%ied
h(i,j,:) = GV%m_to_H * getStaticThickness( CS%regridCS, 0., G%bathyT(i,j) )
enddo; enddo
enddo ; enddo

end subroutine ALE_initThicknessToCoord

Expand Down
56 changes: 28 additions & 28 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ subroutine build_zstar_grid( CS, G, GV, h, dzInterface, frac_shelf_h)
totalThickness = 0.0
do k = 1,nz
totalThickness = totalThickness + h(i,j,k)
end do
enddo

zOld(nz+1) = - nominalDepth
do k = nz,1,-1
Expand Down Expand Up @@ -1190,8 +1190,8 @@ subroutine build_zstar_grid( CS, G, GV, h, dzInterface, frac_shelf_h)

call adjust_interface_motion( CS, nz, h(i,j,:), dzInterface(i,j,:) )

end do
end do
enddo
enddo

end subroutine build_zstar_grid

Expand Down Expand Up @@ -1236,15 +1236,15 @@ subroutine build_sigma_grid( CS, G, GV, h, dzInterface )
totalThickness = 0.0
do k = 1,nz
totalThickness = totalThickness + h(i,j,k)
end do
enddo

call build_sigma_column(CS%sigma_CS, nominalDepth, totalThickness, zNew)

! Calculate the final change in grid position after blending new and old grids
zOld(nz+1) = -nominalDepth
do k = nz,1,-1
zOld(k) = zOld(k+1) + h(i, j, k)
end do
enddo

call filtered_grid_motion( CS, nz, zOld, zNew, dzInterface(i,j,:) )

Expand All @@ -1267,8 +1267,8 @@ subroutine build_sigma_grid( CS, G, GV, h, dzInterface )
dzInterface(i,j,CS%nk+1) = 0.
#endif

end do
end do
enddo
enddo

end subroutine build_sigma_grid

Expand Down Expand Up @@ -1393,8 +1393,8 @@ subroutine build_rho_grid( G, GV, h, tv, dzInterface, remapCS, CS )
endif
#endif

end do ! end loop on i
end do ! end loop on j
enddo ! end loop on i
enddo ! end loop on j

end subroutine build_rho_grid

Expand Down Expand Up @@ -1466,7 +1466,7 @@ subroutine build_grid_HyCOM1( G, GV, h, tv, h_new, dzInterface, CS )
else ! on land
dzInterface(i,j,:) = 0.
endif ! mask2dT
enddo; enddo ! i,j
enddo ; enddo ! i,j

call calc_h_new_by_dz(CS, G, GV, h, dzInterface, h_new)

Expand Down Expand Up @@ -1597,7 +1597,7 @@ subroutine build_grid_SLight(G, GV, h, tv, dzInterface, CS)
else ! on land
dzInterface(i,j,:) = 0.
endif ! mask2dT
enddo; enddo ! i,j
enddo ; enddo ! i,j

end subroutine build_grid_SLight

Expand Down Expand Up @@ -1704,7 +1704,7 @@ subroutine build_grid_arbitrary( G, GV, h, dzInterface, h_new, CS )
total_height = 0.0
do k = 1,nz
total_height = total_height + h(i,j,k)
end do
enddo

eta = total_height - local_depth

Expand All @@ -1715,7 +1715,7 @@ subroutine build_grid_arbitrary( G, GV, h, dzInterface, h_new, CS )
z_inter(1) = eta
do k = 1,nz
z_inter(k+1) = z_inter(k) - delta_h
end do
enddo

! Refine grid in the middle
do k = 1,nz+1
Expand All @@ -1725,15 +1725,15 @@ subroutine build_grid_arbitrary( G, GV, h, dzInterface, h_new, CS )

if ( x <= x1 ) then
t = y1*x/x1
else if ( (x > x1 ) .and. ( x < x2 )) then
elseif ( (x > x1 ) .and. ( x < x2 )) then
t = y1 + (y2-y1) * (x-x1) / (x2-x1)
else
t = y2 + (1.0-y2) * (x-x2) / (1.0-x2)
end if
endif

z_inter(k) = -t * max_depth + eta

end do
enddo

! Modify interface heights to account for topography
z_inter(nz+1) = - local_depth
Expand All @@ -1742,20 +1742,20 @@ subroutine build_grid_arbitrary( G, GV, h, dzInterface, h_new, CS )
do k = nz,1,-1
if ( z_inter(k) < (z_inter(k+1) + min_thickness) ) then
z_inter(k) = z_inter(k+1) + min_thickness
end if
end do
endif
enddo

! Chnage in interface position
x = 0. ! Left boundary at x=0
dzInterface(i,j,1) = 0.
do k = 2,nz
x = x + h(i,j,k)
dzInterface(i,j,k) = z_inter(k) - x
end do
enddo
dzInterface(i,j,nz+1) = 0.

end do
end do
enddo
enddo

stop 'OOOOOOPS' ! For some reason the gnu compiler will not let me delete this
! routine????
Expand Down Expand Up @@ -1792,17 +1792,17 @@ subroutine inflate_vanished_layers_old( CS, G, GV, h )
! Build grid for current column
do k = 1,GV%ke
hTmp(k) = h(i,j,k)
end do
enddo

call old_inflate_layers_1d( CS%min_thickness, GV%ke, hTmp )

! Save modified grid
do k = 1,GV%ke
h(i,j,k) = hTmp(k)
end do
enddo

end do
end do
enddo
enddo

end subroutine inflate_vanished_layers_old

Expand Down Expand Up @@ -1859,7 +1859,7 @@ subroutine convective_adjustment(G, GV, h, tv)
call calculate_density( tv%T(i,j,k+1), tv%S(i,j,k+1), p_col(k+1), &
densities(k+1), tv%eqn_of_state )
stratified = .false.
end if
endif
enddo ! k

if ( stratified ) exit
Expand Down Expand Up @@ -1962,7 +1962,7 @@ subroutine set_target_densities_from_GV( GV, CS )
CS%target_density(nz+1) = GV%Rlay(nz)+0.5*(GV%Rlay(nz)-GV%Rlay(nz-1))
do k = 2,nz
CS%target_density(k) = CS%target_density(k-1) + CS%coordinateResolution(k)
end do
enddo
CS%target_density_set = .true.

end subroutine set_target_densities_from_GV
Expand Down Expand Up @@ -2080,7 +2080,7 @@ function getCoordinateInterfaces( CS )
! The following line has an "abs()" to allow ferret users to reference
! data by index. It is a temporary work around... :( -AJA
getCoordinateInterfaces(:) = abs( getCoordinateInterfaces(:) )
end if
endif

end function getCoordinateInterfaces

Expand Down
Loading

0 comments on commit 0116078

Please sign in to comment.