Skip to content

Commit

Permalink
Fix non-standard indentation
Browse files Browse the repository at this point in the history
  Fixed non-standard 5- and 7-point initial indentation on scattered lines
throughout the code in MOM6/src.  All answers are bitwise identical, and there
are only changes in white-space.
  • Loading branch information
Hallberg-NOAA committed Jan 8, 2021
1 parent e68d31a commit 1480fbe
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 181 deletions.
8 changes: 4 additions & 4 deletions src/ALE/coord_rho.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ subroutine build_rho_column(CS, nz, depth, h, T, S, eqn_of_state, z_interface, &
real, dimension(nz), intent(in) :: S !< Salinity for source column [ppt]
type(EOS_type), pointer :: eqn_of_state !< Equation of state structure
real, dimension(CS%nk+1), &
intent(inout) :: z_interface !< Absolute positions of interfaces
real, optional, intent(in) :: z_rigid_top !< The height of a rigid top (positive upward in the same
intent(inout) :: z_interface !< Absolute positions of interfaces
real, optional, intent(in) :: z_rigid_top !< The height of a rigid top (positive upward in the same
!! units as depth) [Z ~> m] or [H ~> m or kg m-2]
real, optional, intent(in) :: eta_orig !< The actual original height of the top in the same
real, optional, intent(in) :: eta_orig !< The actual original height of the top in the same
!! units as depth) [Z ~> m] or [H ~> m or kg m-2]
real, optional, intent(in) :: h_neglect !< A negligibly small width for the purpose
!! of cell reconstructions [H ~> m or kg m-2]
Expand All @@ -127,7 +127,7 @@ subroutine build_rho_column(CS, nz, depth, h, T, S, eqn_of_state, z_interface, &
z0_top = z_rigid_top
eta=z0_top
if (present(eta_orig)) then
eta=eta_orig
eta=eta_orig
endif
endif

Expand Down
12 changes: 6 additions & 6 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3280,13 +3280,13 @@ subroutine extract_surface_state(CS, sfc_state_in)
enddo ; enddo

do i=is,ie
! set melt_potential to zero to avoid passing previous values
sfc_state%melt_potential(i,j) = 0.0
! set melt_potential to zero to avoid passing previous values
sfc_state%melt_potential(i,j) = 0.0

if (G%mask2dT(i,j)>0.) then
! instantaneous melt_potential [Q R Z ~> J m-2]
sfc_state%melt_potential(i,j) = CS%tv%C_p * GV%Rho0 * delT(i)
endif
if (G%mask2dT(i,j)>0.) then
! instantaneous melt_potential [Q R Z ~> J m-2]
sfc_state%melt_potential(i,j) = CS%tv%C_p * GV%Rho0 * delT(i)
endif
enddo
enddo ! end of j loop
endif ! melt_potential
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, US, param
do j=js,je ; do i=is,ie ; CS%eta(i,j) = -GV%Z_to_H * G%bathyT(i,j) ; enddo ; enddo
endif
do k=1,nz ; do j=js,je ; do i=is,ie
CS%eta(i,j) = CS%eta(i,j) + h(i,j,k)
CS%eta(i,j) = CS%eta(i,j) + h(i,j,k)
enddo ; enddo ; enddo
elseif ((GV%m_to_H_restart /= 0.0) .and. (GV%m_to_H_restart /= GV%m_to_H)) then
H_rescale = GV%m_to_H / GV%m_to_H_restart
Expand Down
40 changes: 19 additions & 21 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4958,16 +4958,16 @@ subroutine open_boundary_register_restarts(HI, GV, OBC, Reg, param_file, restart
type(OBC_segment_type), pointer :: segment=>NULL()

if (.not. associated(OBC)) &
call MOM_error(FATAL, "open_boundary_register_restarts: Called with "//&
call MOM_error(FATAL, "open_boundary_register_restarts: Called with "//&
"uninitialized OBC control structure")

if (associated(OBC%rx_normal) .or. associated(OBC%ry_normal) .or. &
associated(OBC%rx_oblique) .or. associated(OBC%ry_oblique) .or. associated(OBC%cff_normal)) &
call MOM_error(FATAL, "open_boundary_register_restarts: Restart "//&
call MOM_error(FATAL, "open_boundary_register_restarts: Restart "//&
"arrays were previously allocated")

if (associated(OBC%tres_x) .or. associated(OBC%tres_y)) &
call MOM_error(FATAL, "open_boundary_register_restarts: Restart "//&
call MOM_error(FATAL, "open_boundary_register_restarts: Restart "//&
"arrays were previously allocated")

! *** This is a temporary work around for restarts with OBC segments.
Expand Down Expand Up @@ -5188,36 +5188,36 @@ subroutine adjustSegmentEtaToFitBathymetry(G, GV, US, segment,fld)
! previous call to open_boundary_impose_normal_slope
do k=nz+1,1,-1
if (-eta(i,j,k) > segment%Htot(i,j)*GV%H_to_Z + hTolerance) then
eta(i,j,k) = -segment%Htot(i,j)*GV%H_to_Z
contractions = contractions + 1
eta(i,j,k) = -segment%Htot(i,j)*GV%H_to_Z
contractions = contractions + 1
endif
enddo

do k=1,nz
! Collapse layers to thinnest possible if the thickness less than
! the thinnest possible (or negative).
if (eta(i,j,K) < (eta(i,j,K+1) + GV%Angstrom_Z)) then
eta(i,j,K) = eta(i,j,K+1) + GV%Angstrom_Z
segment%field(fld)%dz_src(i,j,k) = GV%Angstrom_Z
eta(i,j,K) = eta(i,j,K+1) + GV%Angstrom_Z
segment%field(fld)%dz_src(i,j,k) = GV%Angstrom_Z
else
segment%field(fld)%dz_src(i,j,k) = (eta(i,j,K) - eta(i,j,K+1))
segment%field(fld)%dz_src(i,j,k) = (eta(i,j,K) - eta(i,j,K+1))
endif
enddo

! The whole column is dilated to accommodate deeper topography than
! the bathymetry would indicate.
if (-eta(i,j,nz+1) < (segment%Htot(i,j) * GV%H_to_Z) - hTolerance) then
dilations = dilations + 1
! expand bottom-most cell only
eta(i,j,nz+1) = -(segment%Htot(i,j) * GV%H_to_Z)
segment%field(fld)%dz_src(i,j,nz)= eta(i,j,nz)-eta(i,j,nz+1)
! if (eta(i,j,1) <= eta(i,j,nz+1)) then
! do k=1,nz ; segment%field(fld)%dz_src(i,j,k) = (eta(i,j,1) + G%bathyT(i,j)) / real(nz) ; enddo
! else
! dilate = (eta(i,j,1) + G%bathyT(i,j)) / (eta(i,j,1) - eta(i,j,nz+1))
! do k=1,nz ; segment%field(fld)%dz_src(i,j,k) = segment%field(fld)%dz_src(i,j,k) * dilate ; enddo
! endif
!do k=nz,2,-1 ; eta(i,j,K) = eta(i,j,K+1) + segment%field(fld)%dz_src(i,j,k) ; enddo
dilations = dilations + 1
! expand bottom-most cell only
eta(i,j,nz+1) = -(segment%Htot(i,j) * GV%H_to_Z)
segment%field(fld)%dz_src(i,j,nz)= eta(i,j,nz)-eta(i,j,nz+1)
! if (eta(i,j,1) <= eta(i,j,nz+1)) then
! do k=1,nz ; segment%field(fld)%dz_src(i,j,k) = (eta(i,j,1) + G%bathyT(i,j)) / real(nz) ; enddo
! else
! dilate = (eta(i,j,1) + G%bathyT(i,j)) / (eta(i,j,1) - eta(i,j,nz+1))
! do k=1,nz ; segment%field(fld)%dz_src(i,j,k) = segment%field(fld)%dz_src(i,j,k) * dilate ; enddo
! endif
!do k=nz,2,-1 ; eta(i,j,K) = eta(i,j,K+1) + segment%field(fld)%dz_src(i,j,k) ; enddo
endif
! Now convert thicknesses to units of H.
do k=1,nz
Expand All @@ -5241,8 +5241,6 @@ subroutine adjustSegmentEtaToFitBathymetry(G, GV, US, segment,fld)
! endif
deallocate(eta)



end subroutine adjustSegmentEtaToFitBathymetry

!> This is more of a rotate initialization than an actual rotate
Expand Down
8 changes: 4 additions & 4 deletions src/diagnostics/MOM_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, &
! area mean SST
if (CS%id_tosga > 0) then
do j=js,je ; do i=is,ie
surface_field(i,j) = tv%T(i,j,1)
surface_field(i,j) = tv%T(i,j,1)
enddo ; enddo
tosga = global_area_mean(surface_field, G)
call post_data(CS%id_tosga, tosga, CS%diag)
Expand Down Expand Up @@ -1024,9 +1024,9 @@ subroutine calculate_energy_diagnostics(u, v, h, uh, vh, ADp, CDp, G, GV, US, CS

if (.not.G%symmetric) then
if (associated(CS%dKE_dt) .OR. associated(CS%PE_to_KE) .OR. associated(CS%KE_BT) .OR. &
associated(CS%KE_CorAdv) .OR. associated(CS%KE_adv) .OR. associated(CS%KE_visc) .OR. &
associated(CS%KE_horvisc) .OR. associated(CS%KE_dia) ) then
call create_group_pass(CS%pass_KE_uv, KE_u, KE_v, G%Domain, To_North+To_East)
associated(CS%KE_CorAdv) .OR. associated(CS%KE_adv) .OR. associated(CS%KE_visc) .OR. &
associated(CS%KE_horvisc) .OR. associated(CS%KE_dia) ) then
call create_group_pass(CS%pass_KE_uv, KE_u, KE_v, G%Domain, To_North+To_East)
endif
endif

Expand Down
4 changes: 2 additions & 2 deletions src/diagnostics/MOM_sum_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,8 @@ subroutine accumulate_net_input(fluxes, sfc_state, tv, dt, G, US, CS)
enddo ; enddo ; endif

if (associated(fluxes%seaice_melt_heat)) then ; do j=js,je ; do i=is,ie
heat_in(i,j) = heat_in(i,j) + dt * QRZL2_to_J * G%areaT(i,j) * &
fluxes%seaice_melt_heat(i,j)
heat_in(i,j) = heat_in(i,j) + dt * QRZL2_to_J * G%areaT(i,j) * &
fluxes%seaice_melt_heat(i,j)
enddo ; enddo ; endif

! smg: new code
Expand Down
144 changes: 72 additions & 72 deletions src/framework/MOM_horizontal_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -475,88 +475,88 @@ subroutine horiz_interp_and_extrap_tracer_record(filename, varnam, conversion,
write(laynum,'(I8)') k ; laynum = adjustl(laynum)
mask_in = 0.0
if (is_ongrid) then
start(1) = is+G%HI%idg_offset ; start(2) = js+G%HI%jdg_offset ; start(3) = k
count(1) = ie-is+1 ; count(2) = je-js+1; count(3) = 1
rcode = NF90_GET_VAR(ncid,varid, tr_in, start, count)
if (rcode /= 0) call MOM_error(FATAL,"hinterp_and_extract_from_Fie: "//&
"error reading level "//trim(laynum)//" of variable "//&
trim(varnam)//" in file "// trim(filename))

do j=js,je
do i=is,ie
if (abs(tr_in(i,j)-missing_value) > abs(roundoff*missing_value)) then
mask_in(i,j) = 1.0
tr_in(i,j) = (tr_in(i,j)*scale_factor+add_offset) * conversion
else
tr_in(i,j) = missing_value
endif
enddo
enddo
start(1) = is+G%HI%idg_offset ; start(2) = js+G%HI%jdg_offset ; start(3) = k
count(1) = ie-is+1 ; count(2) = je-js+1; count(3) = 1
rcode = NF90_GET_VAR(ncid,varid, tr_in, start, count)
if (rcode /= 0) call MOM_error(FATAL,"hinterp_and_extract_from_Fie: "//&
"error reading level "//trim(laynum)//" of variable "//&
trim(varnam)//" in file "// trim(filename))

do j=js,je
do i=is,ie
if (abs(tr_in(i,j)-missing_value) > abs(roundoff*missing_value)) then
mask_in(i,j) = 1.0
tr_in(i,j) = (tr_in(i,j)*scale_factor+add_offset) * conversion
else
tr_in(i,j) = missing_value
endif
enddo
enddo

else
if (is_root_pe()) then
start = 1 ; start(3) = k ; count(:) = 1 ; count(1) = id ; count(2) = jd
rcode = NF90_GET_VAR(ncid,varid, tr_in, start, count)
if (rcode /= 0) call MOM_error(FATAL,"hinterp_and_extract_from_Fie: "//&
"error reading level "//trim(laynum)//" of variable "//&
trim(varnam)//" in file "// trim(filename))

if (add_np) then
last_row(:)=tr_in(:,jd); pole=0.0;npole=0.0
do i=1,id
if (abs(tr_in(i,jd)-missing_value) > abs(roundoff*missing_value)) then
pole = pole+last_row(i)
npole = npole+1.0
endif
enddo
if (npole > 0) then
pole=pole/npole
else
pole=missing_value
endif
tr_inp(:,1:jd) = tr_in(:,:)
tr_inp(:,jdp) = pole
if (is_root_pe()) then
start = 1 ; start(3) = k ; count(:) = 1 ; count(1) = id ; count(2) = jd
rcode = NF90_GET_VAR(ncid,varid, tr_in, start, count)
if (rcode /= 0) call MOM_error(FATAL,"hinterp_and_extract_from_Fie: "//&
"error reading level "//trim(laynum)//" of variable "//&
trim(varnam)//" in file "// trim(filename))

if (add_np) then
last_row(:)=tr_in(:,jd); pole=0.0;npole=0.0
do i=1,id
if (abs(tr_in(i,jd)-missing_value) > abs(roundoff*missing_value)) then
pole = pole+last_row(i)
npole = npole+1.0
endif
enddo
if (npole > 0) then
pole=pole/npole
else
tr_inp(:,:) = tr_in(:,:)
pole=missing_value
endif
endif
tr_inp(:,1:jd) = tr_in(:,:)
tr_inp(:,jdp) = pole
else
tr_inp(:,:) = tr_in(:,:)
endif
endif

call mpp_sync()
call mpp_broadcast(tr_inp, id*jdp, root_PE())
call mpp_sync_self()
call mpp_sync()
call mpp_broadcast(tr_inp, id*jdp, root_PE())
call mpp_sync_self()

do j=1,jdp
do i=1,id
if (abs(tr_inp(i,j)-missing_value) > abs(roundoff*missing_value)) then
mask_in(i,j) = 1.0
tr_inp(i,j) = (tr_inp(i,j)*scale_factor+add_offset) * conversion
else
tr_inp(i,j) = missing_value
endif
enddo
enddo
do j=1,jdp
do i=1,id
if (abs(tr_inp(i,j)-missing_value) > abs(roundoff*missing_value)) then
mask_in(i,j) = 1.0
tr_inp(i,j) = (tr_inp(i,j)*scale_factor+add_offset) * conversion
else
tr_inp(i,j) = missing_value
endif
enddo
enddo

endif



! call fms routine horiz_interp to interpolate input level data to model horizontal grid
if (.not. is_ongrid) then
if (k == 1) then
call horiz_interp_new(Interp,x_in,y_in,lon_out(is:ie,js:je),lat_out(is:ie,js:je), &
interp_method='bilinear',src_modulo=.true.)
endif

if (debug) then
call myStats(tr_inp,missing_value, is,ie,js,je,k,'Tracer from file')
endif
if (k == 1) then
call horiz_interp_new(Interp,x_in,y_in,lon_out(is:ie,js:je),lat_out(is:ie,js:je), &
interp_method='bilinear',src_modulo=.true.)
endif

if (debug) then
call myStats(tr_inp,missing_value, is,ie,js,je,k,'Tracer from file')
endif
endif

tr_out(:,:) = 0.0
if (is_ongrid) then
tr_out(is:ie,js:je)=tr_in(is:ie,js:je)
tr_out(is:ie,js:je)=tr_in(is:ie,js:je)
else
call horiz_interp(Interp,tr_inp,tr_out(is:ie,js:je), missing_value=missing_value, new_missing_handle=.true.)
call horiz_interp(Interp,tr_inp,tr_out(is:ie,js:je), missing_value=missing_value, new_missing_handle=.true.)
endif

mask_out=1.0
Expand Down Expand Up @@ -591,14 +591,14 @@ subroutine horiz_interp_and_extrap_tracer_record(filename, varnam, conversion,

! Horizontally homogenize data to produce perfectly "flat" initial conditions
if (PRESENT(homogenize)) then
if (homogenize) then
call sum_across_PEs(nPoints)
call sum_across_PEs(varAvg)
if (nPoints>0) then
varAvg = varAvg/real(nPoints)
endif
tr_out(:,:) = varAvg
endif
if (homogenize) then
call sum_across_PEs(nPoints)
call sum_across_PEs(varAvg)
if (nPoints>0) then
varAvg = varAvg/real(nPoints)
endif
tr_out(:,:) = varAvg
endif
endif

! tr_out contains input z-space data on the model grid with missing values
Expand Down
4 changes: 2 additions & 2 deletions src/framework/MOM_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ subroutine create_file(unit, filename, vars, novars, fields, threading, timeunit
pack = 1

if (present(checksums)) then
call mpp_write_meta(unit, fields(k), axes(1:numaxes), vars(k)%name, vars(k)%units, &
call mpp_write_meta(unit, fields(k), axes(1:numaxes), vars(k)%name, vars(k)%units, &
vars(k)%longname, pack = pack, checksum=checksums(k,:))
else
call mpp_write_meta(unit, fields(k), axes(1:numaxes), vars(k)%name, vars(k)%units, &
call mpp_write_meta(unit, fields(k), axes(1:numaxes), vars(k)%name, vars(k)%units, &
vars(k)%longname, pack = pack)
endif
enddo
Expand Down
18 changes: 9 additions & 9 deletions src/framework/MOM_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1419,15 +1419,15 @@ function open_restart_units(filename, directory, G, CS, units, file_paths, &
do while (err == 0)
restartname = trim(CS%restartfile)

!query fms_io if there is a filename_appendix (for ensemble runs)
call get_filename_appendix(filename_appendix)
if (len_trim(filename_appendix) > 0) then
length = len_trim(restartname)
if (restartname(length-2:length) == '.nc') then
restartname = restartname(1:length-3)//'.'//trim(filename_appendix)//'.nc'
else
restartname = restartname(1:length) //'.'//trim(filename_appendix)
endif
! query fms_io if there is a filename_appendix (for ensemble runs)
call get_filename_appendix(filename_appendix)
if (len_trim(filename_appendix) > 0) then
length = len_trim(restartname)
if (restartname(length-2:length) == '.nc') then
restartname = restartname(1:length-3)//'.'//trim(filename_appendix)//'.nc'
else
restartname = restartname(1:length) //'.'//trim(filename_appendix)
endif
endif
filepath = trim(directory) // trim(restartname)

Expand Down
Loading

0 comments on commit 1480fbe

Please sign in to comment.