Skip to content

Commit 367d9d4

Browse files
committed
Merge remote-tracking branch 'GFDL/gfdl-to-main-2025-09-25' into test/GFDL-20250925
2 parents fe9e7bf + 39ab7d5 commit 367d9d4

65 files changed

Lines changed: 6137 additions & 2599 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ac/makedep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
from __future__ import print_function
44

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
program time_MOM_ANN
2+
3+
! This file is part of MOM6. See LICENSE.md for the license.
4+
5+
use MOM_ANN, only : ANN_CS
6+
use MOM_ANN, only : ANN_allocate, ANN_apply, ANN_end
7+
use MOM_ANN, only : ANN_apply_vector_orig, ANN_apply_vector_oi
8+
use MOM_ANN, only : ANN_apply_array_sio
9+
use MOM_ANN, only : ANN_random
10+
11+
implicit none
12+
13+
! Command line options
14+
integer :: nargs ! Number of command line arguments
15+
character(len=12) :: cmd_ln_arg !< Command line argument (if any)
16+
17+
! ANN parameters
18+
integer :: nlayers ! Number of layers
19+
integer :: nin ! Number of inputs
20+
integer :: layer_width ! Width of hidden layers
21+
integer :: nout ! Number of outputs
22+
! Timing parameters
23+
integer :: nsamp ! Number of measurements
24+
integer :: nits ! Number of calls to time
25+
integer :: nxy ! Spatial dimension
26+
27+
nlayers = 7; nin = 4; layer_width = 16; nout = 1 ! Deep network
28+
!nlayers = 4; nin = 4; layer_width = 48; nout = 1 ! Shallow-wide network
29+
!nlayers = 3; nin = 4; layer_width = 20; nout = 1 ! Small network
30+
31+
nsamp = 100
32+
nits = 20000
33+
!nits = 300000 ! Needed for robust measurements on small networks
34+
nxy = 100 ! larger array
35+
!nxy = 10 ! small array
36+
37+
! Optionally grab ANN and timing parameters from the command line
38+
nargs = command_argument_count()
39+
if (nargs==7) then
40+
call get_command_argument(1, cmd_ln_arg)
41+
read(cmd_ln_arg,*) nlayers
42+
call get_command_argument(2, cmd_ln_arg)
43+
read(cmd_ln_arg,*) nin
44+
call get_command_argument(3, cmd_ln_arg)
45+
read(cmd_ln_arg,*) layer_width
46+
call get_command_argument(4, cmd_ln_arg)
47+
read(cmd_ln_arg,*) nout
48+
call get_command_argument(5, cmd_ln_arg)
49+
read(cmd_ln_arg,*) nsamp
50+
call get_command_argument(6, cmd_ln_arg)
51+
read(cmd_ln_arg,*) nits
52+
call get_command_argument(7, cmd_ln_arg)
53+
read(cmd_ln_arg,*) nxy
54+
endif
55+
56+
! Fastest variants on Intel Xeon W-2223 CPU @ 3.60GHz (gfortran-13.2 -O3)
57+
! | vector(nxy=1) | nxy = 10 | nxy = 100
58+
! ----------------------------------------------------------------------------
59+
! Small ANN | vector_oi | array_soi | array_sio
60+
! Shallow-wide ANN | vector_oi | array_ois | array_sio
61+
! Deep ANN | vector_oi | array_ois | array_sio
62+
63+
write(*,'(a)') "{"
64+
65+
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
66+
0, "MOM_ANN:ANN_apply(vector)")
67+
write(*,"(',')")
68+
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
69+
1, "MOM_ANN:ANN_apply_vector_orig(array)")
70+
write(*,"(',')")
71+
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
72+
2, "MOM_ANN:ANN_apply_vector_oi(array)")
73+
write(*,"(',')")
74+
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
75+
12, "MOM_ANN:ANN_apply_array_sio(array)")
76+
write(*,"()")
77+
78+
write(*,'(a)') "}"
79+
80+
contains
81+
82+
!> Time ANN inference.
83+
!!
84+
!! Times are measured over the "nits effective calls" and appropriately scaled to the
85+
!! time per call per single vector of input features. For array inputs, the number of
86+
!! actual calls is reduced by the size of the array. The timing measurement is repeated
87+
!! "nsamp" times, to check the statistics of the timing measurement.
88+
subroutine time_ANN(nlayers, nin, width, nout, nsamp, nits, nxy, impl, label)
89+
integer, intent(in) :: nlayers !< Number of layers
90+
integer, intent(in) :: nin !< Number of inputs
91+
integer, intent(in) :: width !< Width of hidden layers
92+
integer, intent(in) :: nout !< Number of outputs
93+
integer, intent(in) :: nsamp !< Number of measurements
94+
integer, intent(in) :: nits !< Number of calls to time
95+
integer, intent(in) :: nxy !< Spatial dimension
96+
integer, intent(in) :: impl !< Implementation to time
97+
character(len=*), intent(in) :: label !< Label for YAML output
98+
! Local variables
99+
type(ANN_CS) :: ANN ! ANN
100+
integer :: widths(nlayers) ! Width of each layer
101+
real :: x_s(nin) ! Inputs (just features) [nondim]
102+
real :: y_s(nin) ! Outputs (just features) [nondim]
103+
real :: x_fs(nin,nxy) ! Inputs (feature, space) [nondim]
104+
real :: y_fs(nin,nxy) ! Outputs (feature, space) [nondim]
105+
real :: x_sf(nin,nxy) ! Inputs (space, feature) [nondim]
106+
real :: y_sf(nin,nxy) ! Outputs (space, feature) [nondim]
107+
integer :: iter, samp ! Loop counters
108+
integer :: ij ! Horizontal loop index
109+
real :: start, finish, timing ! CPU times [s]
110+
real :: tmin, tmax, tmean, tstd ! Min, max, mean, and standard deviation, of CPU times [s]
111+
integer :: asamp ! Actual samples of timings
112+
integer :: aits ! Actual iterations
113+
real :: words_per_sec ! Operations per sec estimated from parameters [# s-1]
114+
115+
widths(:) = width
116+
widths(1) = nin
117+
widths(nlayers) = nout
118+
119+
call ANN_random(ANN, nlayers, widths)
120+
call random_number(x_fs)
121+
call random_number(x_sf)
122+
123+
124+
tmin = 1e9
125+
tmax = 0.
126+
tmean = 0.
127+
tstd = 0.
128+
asamp = nits ! Most cases below use this
129+
aits = nits / nxy ! Most cases below use this
130+
131+
do samp = 1, nsamp
132+
select case (impl)
133+
case (0)
134+
aits = nits
135+
call cpu_time(start)
136+
do iter = 1, nits ! Make many passes to reduce sampling error
137+
call ANN_apply(x_s, y_s, ANN)
138+
enddo
139+
call cpu_time(finish)
140+
case (1)
141+
call cpu_time(start)
142+
do iter = 1, aits ! Make many passes to reduce sampling error
143+
do ij = 1, nxy
144+
call ANN_apply_vector_orig(x_fs(:,ij), y_fs(:,ij), ANN)
145+
enddo
146+
enddo
147+
call cpu_time(finish)
148+
case (2)
149+
call cpu_time(start)
150+
do iter = 1, aits ! Make many passes to reduce sampling error
151+
do ij = 1, nxy
152+
call ANN_apply_vector_oi(x_fs(:,ij), y_fs(:,ij), ANN)
153+
enddo
154+
enddo
155+
call cpu_time(finish)
156+
case (12)
157+
call cpu_time(start)
158+
do iter = 1, aits ! Make many passes to reduce sampling error
159+
call ANN_apply_array_sio(nxy, x_sf(:,:), y_sf(:,:), ANN)
160+
enddo
161+
call cpu_time(finish)
162+
asamp = nsamp * aits ! Account for working on whole arrays
163+
end select
164+
165+
timing = ( finish - start ) / real(nits) ! Average time per call
166+
167+
tmin = min( tmin, timing )
168+
tmax = max( tmax, timing )
169+
tmean = tmean + timing
170+
tstd = tstd + timing**2
171+
enddo
172+
173+
tmean = tmean / real(nsamp)
174+
tstd = tstd / real(nsamp) ! convert to mean of squares
175+
tstd = tstd - tmean**2 ! convert to variance
176+
tstd = sqrt( tstd * real(nsamp) / real(nsamp-1) ) ! convert to standard deviation
177+
words_per_sec = ANN%parameters / ( tmean * 1024 * 1024 )
178+
179+
write(*,"(2x,3a)") '"', trim(label), '": {'
180+
write(*,"(4x,a,1pe11.4,',')") '"min": ', tmin
181+
write(*,"(4x,a,1pe11.4,',')") '"mean":', tmean
182+
write(*,"(4x,a,1pe11.4,',')") '"std": ', tstd
183+
write(*,"(4x,a,i0,',')") '"n_samples": ', asamp
184+
write(*,"(4x,a,1pe11.4,',')") '"max": ', tmax
185+
write(*,"(4x,a,1pe11.4,'}')", advance="no") '"MBps": ', words_per_sec
186+
187+
end subroutine time_ANN
188+
189+
end program time_MOM_ANN
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
program test_MOM_ANN
2+
3+
use MOM_ANN, only : ANN_unit_tests
4+
use MOM_error_handler, only : set_skip_mpi
5+
6+
call set_skip_mpi(.true.) ! This unit tests is not expecting MPI to be used
7+
8+
if ( ANN_unit_tests(.true.) ) stop 1
9+
10+
end program test_MOM_ANN

src/ALE/MOM_ALE.F90

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ module MOM_ALE
165165
!! before the main time integration loop to initialize the regridding stuff.
166166
!! We read the MOM_input file to register the values of different
167167
!! regridding/remapping parameters.
168-
subroutine ALE_init( param_file, GV, US, max_depth, CS)
168+
subroutine ALE_init( param_file, G, GV, US, max_depth, CS)
169169
type(param_file_type), intent(in) :: param_file !< Parameter file
170+
type(ocean_grid_type), intent(in) :: G !< Grid structure
170171
type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure
171172
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
172173
real, intent(in) :: max_depth !< The maximum depth of the ocean [Z ~> m].
@@ -205,8 +206,9 @@ subroutine ALE_init( param_file, GV, US, max_depth, CS)
205206
default=.false.)
206207

207208
! Initialize and configure regridding
208-
call ALE_initRegridding(GV, US, max_depth, param_file, mdl, CS%regridCS)
209-
call regridding_preadjust_reqs(CS%regridCS, CS%do_conv_adj, CS%use_hybgen_unmix, hybgen_CS=hybgen_regridCS)
209+
call ALE_initRegridding(G, GV, US, max_depth, param_file, mdl, CS%regridCS)
210+
call regridding_preadjust_reqs(CS%regridCS, CS%do_conv_adj, CS%use_hybgen_unmix, &
211+
hybgen_CS=hybgen_regridCS)
210212

211213
! Initialize and configure remapping that is orchestrated by ALE.
212214
call get_param(param_file, mdl, "REMAPPING_SCHEME", string, &
@@ -321,12 +323,12 @@ subroutine ALE_init( param_file, GV, US, max_depth, CS)
321323
default=-0.001, units="m", scale=GV%m_to_H)
322324
call get_param(param_file, mdl, "REMAP_VEL_MASK_H_THIN", CS%h_vel_mask, &
323325
"A thickness at velocity points below which near-bottom layers are zeroed out "//&
324-
"after remapping, following practice with Hybgen remapping, or a negative value "//&
325-
"to avoid such filtering altogether.", &
326+
"after remapping, following practice with Hybgen remapping, "//&
327+
"or a negative value to avoid such filtering altogether.", &
326328
default=1.0e-6, units="m", scale=GV%m_to_H, do_not_log=(CS%BBL_h_vel_mask<=0.0))
327329

328330
if (CS%use_hybgen_unmix) &
329-
call init_hybgen_unmix(CS%hybgen_unmixCS, GV, US, param_file, hybgen_regridCS)
331+
call init_hybgen_unmix(CS%hybgen_unmixCS, GV, US, param_file, hybgen_regridCS)
330332

331333
call get_param(param_file, mdl, "REMAP_VEL_CONSERVE_KE", CS%conserve_ke, &
332334
"If true, a correction is applied to the baroclinic component of velocity "//&
@@ -640,7 +642,8 @@ end subroutine ALE_offline_inputs
640642

641643
!> For a state-based coordinate, accelerate the process of regridding by
642644
!! repeatedly applying the grid calculation algorithm
643-
subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, dt, dzRegrid, initial)
645+
subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, dt, &
646+
dzRegrid, initial)
644647
type(ALE_CS), pointer :: CS !< ALE control structure
645648
type(ocean_grid_type), intent(inout) :: G !< Ocean grid
646649
type(verticalGrid_type), intent(in) :: GV !< Vertical grid
@@ -689,7 +692,7 @@ subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, d
689692

690693
! initial total interface displacement due to successive regridding
691694
if (CS%remap_uv_using_old_alg) &
692-
dzIntTotal(:,:,:) = 0.
695+
dzIntTotal(:,:,:) = 0.
693696

694697
call create_group_pass(pass_T_S_h, T, G%domain)
695698
call create_group_pass(pass_T_S_h, S, G%domain)
@@ -708,7 +711,7 @@ subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, d
708711

709712
! Apply timescale to regridding (for e.g. filtered_grid_motion)
710713
if (present(dt)) &
711-
call ALE_update_regrid_weights(dt, CS)
714+
call ALE_update_regrid_weights(dt, CS)
712715

713716
do itt = 1, n_itt
714717

@@ -722,12 +725,14 @@ subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, d
722725

723726
call regridding_main(CS%remapCS, CS%regridCS, G, GV, US, h_loc, tv_local, h, dzInterface)
724727
if (CS%remap_uv_using_old_alg) &
725-
dzIntTotal(:,:,:) = dzIntTotal(:,:,:) + dzInterface(:,:,:)
728+
dzIntTotal(:,:,:) = dzIntTotal(:,:,:) + dzInterface(:,:,:)
726729

727730
! remap from original grid onto new grid
728731
do j = G%jsc-1,G%jec+1 ; do i = G%isc-1,G%iec+1
729-
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%S(i,j,:), nz, h(i,j,:), tv_local%S(i,j,:))
730-
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%T(i,j,:), nz, h(i,j,:), tv_local%T(i,j,:))
732+
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%S(i,j,:), nz, h(i,j,:), &
733+
tv_local%S(i,j,:))
734+
call remapping_core_h(CS%remapCS, nz, h_orig(i,j,:), tv%T(i,j,:), nz, h(i,j,:), &
735+
tv_local%T(i,j,:))
731736
enddo ; enddo
732737

733738
! starting grid for next iteration
@@ -1146,7 +1151,7 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
11461151
if (CS%id_remap_delta_integ_v2>0) dv2h_tot(:,:) = 0.
11471152

11481153
if (((CS%id_remap_delta_integ_u2>0) .or. (CS%id_remap_delta_integ_v2>0)) .and. .not.present(dt))&
1149-
call MOM_error(FATAL, "ALE KE diagnostics requires passing dt into ALE_remap_velocities")
1154+
call MOM_error(FATAL, "ALE KE diagnostics requires passing dt into ALE_remap_velocities")
11501155

11511156
nz = GV%ke
11521157

@@ -1212,7 +1217,7 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
12121217
endif
12131218

12141219
if ((CS%BBL_h_vel_mask > 0.0) .and. (CS%h_vel_mask > 0.0)) &
1215-
call mask_near_bottom_vel(u_tgt, h2, CS%BBL_h_vel_mask, CS%h_vel_mask, nz)
1220+
call mask_near_bottom_vel(u_tgt, h2, CS%BBL_h_vel_mask, CS%h_vel_mask, nz)
12161221

12171222
! Copy the column of new velocities back to the 3-d array
12181223
do k=1,nz
@@ -1361,13 +1366,14 @@ subroutine ALE_remap_vertex_vals(CS, G, GV, h_old, h_new, vert_val)
13611366

13621367
do J=G%JscB,G%JecB ; do I=G%IscB,G%IecB
13631368
if ((G%mask2dT(i,j) + G%mask2dT(i+1,j+1)) + (G%mask2dT(i+1,j) + G%mask2dT(i,j+1)) > 0.0 ) then
1364-
I_mask_sum = 1.0 / ((G%mask2dT(i,j) + G%mask2dT(i+1,j+1)) + (G%mask2dT(i+1,j) + G%mask2dT(i,j+1)))
1369+
I_mask_sum = 1.0 / ((G%mask2dT(i,j) + G%mask2dT(i+1,j+1)) + &
1370+
(G%mask2dT(i+1,j) + G%mask2dT(i,j+1)))
13651371

13661372
do k=1,nz
13671373
h_src(k) = ((G%mask2dT(i,j) * h_old(i,j,k) + G%mask2dT(i+1,j+1) * h_old(i+1,j+1,k)) + &
1368-
(G%mask2dT(i+1,j) * h_old(i+1,j,k) + G%mask2dT(i,j+1) * h_old(i,j+1,k)) ) * I_mask_sum
1374+
(G%mask2dT(i+1,j) * h_old(i+1,j,k) + G%mask2dT(i,j+1) * h_old(i,j+1,k)) ) * I_mask_sum
13691375
h_tgt(k) = ((G%mask2dT(i,j) * h_new(i,j,k) + G%mask2dT(i+1,j+1) * h_new(i+1,j+1,k)) + &
1370-
(G%mask2dT(i+1,j) * h_new(i+1,j,k) + G%mask2dT(i,j+1) * h_new(i,j+1,k)) ) * I_mask_sum
1376+
(G%mask2dT(i+1,j) * h_new(i+1,j,k) + G%mask2dT(i,j+1) * h_new(i,j+1,k)) ) * I_mask_sum
13711377
enddo
13721378

13731379
do K=1,nz+1
@@ -1549,7 +1555,8 @@ subroutine ALE_PLM_edge_values( CS, G, GV, h, Q, bdry_extrap, Q_t, Q_b )
15491555
do j = G%jsc-1,G%jec+1 ; do i = G%isc-1,G%iec+1
15501556
slp(1) = 0.
15511557
do k = 2, GV%ke-1
1552-
slp(k) = PLM_slope_wa(h(i,j,k-1), h(i,j,k), h(i,j,k+1), h_neglect, Q(i,j,k-1), Q(i,j,k), Q(i,j,k+1))
1558+
slp(k) = PLM_slope_wa(h(i,j,k-1), h(i,j,k), h(i,j,k+1), h_neglect, &
1559+
Q(i,j,k-1), Q(i,j,k), Q(i,j,k+1))
15531560
enddo
15541561
slp(GV%ke) = 0.
15551562

@@ -1562,7 +1569,8 @@ subroutine ALE_PLM_edge_values( CS, G, GV, h, Q, bdry_extrap, Q_t, Q_b )
15621569
mslp = - PLM_extrapolate_slope(h(i,j,2), h(i,j,1), h_neglect, Q(i,j,2), Q(i,j,1))
15631570
Q_t(i,j,1) = Q(i,j,1) - 0.5 * mslp
15641571
Q_b(i,j,1) = Q(i,j,1) + 0.5 * mslp
1565-
mslp = PLM_extrapolate_slope(h(i,j,GV%ke-1), h(i,j,GV%ke), h_neglect, Q(i,j,GV%ke-1), Q(i,j,GV%ke))
1572+
mslp = PLM_extrapolate_slope(h(i,j,GV%ke-1), h(i,j,GV%ke), h_neglect, &
1573+
Q(i,j,GV%ke-1), Q(i,j,GV%ke))
15661574
Q_t(i,j,GV%ke) = Q(i,j,GV%ke) - 0.5 * mslp
15671575
Q_b(i,j,GV%ke) = Q(i,j,GV%ke) + 0.5 * mslp
15681576
else
@@ -1630,7 +1638,7 @@ subroutine TS_PPM_edge_values( CS, S_t, S_b, T_t, T_b, G, GV, tv, h, bdry_extrap
16301638
call PPM_reconstruction( GV%ke, hTmp, tmp, ppol_E, ppol_coefs, h_neglect, &
16311639
answer_date=CS%answer_date )
16321640
if (bdry_extrap) &
1633-
call PPM_boundary_extrapolation( GV%ke, hTmp, tmp, ppol_E, ppol_coefs, h_neglect )
1641+
call PPM_boundary_extrapolation( GV%ke, hTmp, tmp, ppol_E, ppol_coefs, h_neglect )
16341642

16351643
do k = 1,GV%ke
16361644
S_t(i,j,k) = ppol_E(k,1)
@@ -1651,7 +1659,7 @@ subroutine TS_PPM_edge_values( CS, S_t, S_b, T_t, T_b, G, GV, tv, h, bdry_extrap
16511659
call PPM_reconstruction( GV%ke, hTmp, tmp, ppol_E, ppol_coefs, h_neglect, &
16521660
answer_date=CS%answer_date )
16531661
if (bdry_extrap) &
1654-
call PPM_boundary_extrapolation(GV%ke, hTmp, tmp, ppol_E, ppol_coefs, h_neglect )
1662+
call PPM_boundary_extrapolation(GV%ke, hTmp, tmp, ppol_E, ppol_coefs, h_neglect )
16551663

16561664
do k = 1,GV%ke
16571665
T_t(i,j,k) = ppol_E(k,1)
@@ -1664,7 +1672,8 @@ end subroutine TS_PPM_edge_values
16641672

16651673

16661674
!> Initializes regridding for the main ALE algorithm
1667-
subroutine ALE_initRegridding(GV, US, max_depth, param_file, mdl, regridCS)
1675+
subroutine ALE_initRegridding(G, GV, US, max_depth, param_file, mdl, regridCS)
1676+
type(ocean_grid_type), intent(in) :: G !< Grid structure
16681677
type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure
16691678
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
16701679
real, intent(in) :: max_depth !< The maximum depth of the ocean [Z ~> m].
@@ -1680,7 +1689,7 @@ subroutine ALE_initRegridding(GV, US, max_depth, param_file, mdl, regridCS)
16801689
trim(regriddingCoordinateModeDoc), &
16811690
default=DEFAULT_COORDINATE_MODE, fail_if_missing=.true.)
16821691

1683-
call initialize_regridding(regridCS, GV, US, max_depth, param_file, mdl, coord_mode, '', '')
1692+
call initialize_regridding(regridCS, G, GV, US, max_depth, param_file, mdl, coord_mode, '', '')
16841693

16851694
end subroutine ALE_initRegridding
16861695

src/ALE/MOM_hybgen_regrid.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,12 +988,12 @@ subroutine hybgen_column_regrid(CS, nk, thkbot, Rcv_tgt, &
988988
! Verify that everything is consistent.
989989
do k=1,nk
990990
if (abs((h_col(k) - h_in(k)) + (dp_int(K) - dp_int(K+1))) > 1.0e-13*max(p_int(nk+1), CS%onem)) then
991-
write(mesg, '("k ",i4," h ",es13.4," h_in ",es13.4, " dp ",2es13.4," err ",es13.4)') &
991+
write(mesg, '("k ",I0," h ",es13.4," h_in ",es13.4, " dp ",2es13.4," err ",es13.4)') &
992992
k, h_col(k), h_in(k), dp_int(K), dp_int(K+1), (h_col(k) - h_in(k)) + (dp_int(K) - dp_int(K+1))
993993
call MOM_error(FATAL, "Mismatched thickness changes in hybgen_regrid: "//trim(mesg))
994994
endif
995995
if (h_col(k) < 0.0) then ! Could instead do: -1.0e-15*max(p_int(nk+1), CS%onem)) then
996-
write(mesg, '("k ",i4," h ",es13.4," h_in ",es13.4, " dp ",2es13.4, " fixlay ",i4)') &
996+
write(mesg, '("k ",I0," h ",es13.4," h_in ",es13.4, " dp ",2es13.4, " fixlay ",I0)') &
997997
k, h_col(k), h_in(k), dp_int(K), dp_int(K+1), fixlay
998998
call MOM_error(FATAL, "Significantly negative final thickness in hybgen_regrid: "//trim(mesg))
999999
endif

0 commit comments

Comments
 (0)