Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c23c244
(*) Add option for minmod limiter for RayTracing (#948)
raphaeldussin Aug 6, 2025
e486f50
(*) Multiple fixes for the ray tracing (#947)
raphaeldussin Aug 6, 2025
c3e4f0f
Moved hchksum() with halos to after pass_var
adcroft Aug 1, 2025
c827f33
Adjust rate of adding mass source to BT solver
adcroft Jul 11, 2025
2245499
Disable adjustment of BT mass source in corrector step
adcroft Jul 11, 2025
b8c807b
Adds limiter for time-integrated BT transports
adcroft Aug 1, 2025
921a17c
Disable adjustment of BT mass source in RK2b corrector (#6)
Hallberg-NOAA Aug 7, 2025
cfff0e7
Avoid passing unallocated array to target dummy argument
adcroft Aug 7, 2025
45140df
Remove use of uninitialized string
adcroft Aug 7, 2025
d6d211f
minor modification in mom_cap_methods.F90 to fit for coding style req…
jiandewang Aug 18, 2025
90d426f
Merge branch 'main' into dev/gfdl
marshallward Aug 21, 2025
c926d7d
+Add OBC_REVERSE_SEGMENT_ORDER
Hallberg-NOAA Jul 22, 2025
a01cc39
+Use OBCs to set masks
Hallberg-NOAA Jul 24, 2025
f21e9ea
+Optionally avoid projecting data for OBCs
Hallberg-NOAA Jul 30, 2025
d68ff12
Merge pull request #1675 from jiandewang/DEV-EMC-candidate-20250813
jiandewang Aug 22, 2025
4d5bcea
+Restore open_boundary_setup_vert
Hallberg-NOAA Aug 29, 2025
5851a69
+Separate OBC_for_remap and OBC_for_bug arguments
Hallberg-NOAA Aug 22, 2025
539e494
+Add chksum_OBC_segment_data
Hallberg-NOAA Aug 24, 2025
cb4703e
+Call initialize_segment_data with rotated OBCs
Hallberg-NOAA Aug 24, 2025
6254333
*Call initialize_segment_data after call_tracer_register_obc_segments
Hallberg-NOAA Aug 31, 2025
eccd5bb
Eliminate rotate_OBC_segment_data
Hallberg-NOAA Aug 31, 2025
b0fa0c0
Added the WENO schemes to reconstruct PV in MOM_CoriolisAdv (#946)
Wendazhang33 Sep 5, 2025
bbfc208
Add ALE_COORDINATE_CONFIG HYBRID_3D and HYBRID_MAP
awallcraft Jun 12, 2025
134acfc
Set the halos of new 3D arrays
awallcraft Jun 15, 2025
5ace399
Add SHALLOW_ALE_RESOLUTION
awallcraft Jun 17, 2025
076d8ff
Non-integer HYBRID_MAP values
awallcraft Aug 27, 2025
e889b6a
indent continuations, source code <= 100 chars
awallcraft Sep 6, 2025
e06aeb5
+Add RESCALE_STRONG_DRAG
Hallberg-NOAA Aug 25, 2025
8b27cb2
Add option to horizontally homogenize the Stokes drift when used via …
breichl Sep 9, 2025
7a1eee1
Fix calculation of CAv_Stokes diagnostic
Hallberg-NOAA Sep 7, 2025
83a1048
makedep: Update interpreter directive to python3
marshallward Aug 4, 2025
6ac9c74
+Correct halo update sizes and reduce halo updates (#969)
Hallberg-NOAA Sep 18, 2025
c412f0e
Correct multi-PE velocity truncation counts (#955)
Hallberg-NOAA Sep 18, 2025
1cbebf2
ANN parameterization of horizontal momentum eddy fluxes (#944)
Pperezhogin Sep 19, 2025
60a0196
Part one of thickness reservoirs
kshedstrom Jul 16, 2025
2918a9d
Better Kelvin wave results in layer mode
kshedstrom Aug 1, 2025
8c97707
Response to comments on h_reservoirs PR.
kshedstrom Aug 16, 2025
a18ffc3
Inline Harmonic Analysis
c2xu Aug 25, 2025
67c1467
Inline Harmonic Analysis
c2xu Aug 25, 2025
5df73dc
Inline Harmonic Analysis
c2xu Aug 25, 2025
f5f90a6
Inline Harmonic Analysis
c2xu Aug 25, 2025
c072c29
Inline Harmonic Analysis
c2xu Aug 26, 2025
00fde81
Inline Harmonic Analysis
c2xu Aug 26, 2025
dcae198
Bug fix in MOM_open_boundary
c2xu Aug 27, 2025
3138f84
+Use I0 format to simplify integer output
Hallberg-NOAA Aug 24, 2025
ea359dd
Vert friction: Fix index errors
marshallward Sep 22, 2025
067ed5f
Vert friction: Column loops moved in layers
marshallward Sep 22, 2025
e2b8c52
Bug fix for linear wave drag in MOM_barotropic
herrwang0 Sep 23, 2025
e8f5fa6
Suppress warning message of negative eta in land
herrwang0 Sep 23, 2025
665c760
Flip the order of acceleration and velocity chksum
herrwang0 Sep 23, 2025
39ab7d5
+Add the new parameter RESOLN_FUNCTION_OBC_BUG
Hallberg-NOAA Jun 16, 2025
e6c7952
Fixes shelfwave failure in debug mode
kshedstrom Oct 10, 2025
757b2d8
Make sure reversed segments get rotated.
kshedstrom Oct 24, 2025
6b2ec5f
Vert friction: Force FMAs in tridiag solvers
marshallward Nov 25, 2025
f5ae5cf
Merge pull request #1680 from NOAA-GFDL/gfdl-to-main-2025-09-25
marshallward Jan 12, 2026
2860600
Merge remote-tracking branch 'MAIN/main' into feature/update-MOM6-202…
jiandewang Jan 13, 2026
c4a059e
Merge remote-tracking branch 'upstream/dev/emc' into feature/update-M…
jiandewang Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ac/makedep
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
18 changes: 9 additions & 9 deletions config_src/drivers/nuopc_cap/mom_cap_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -541,26 +541,26 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
do i = isc, iec
ig = i + ocean_grid%isc - isc
!rotate
if( set_missing_stks_to_zero ) then
if(set_missing_stks_to_zero) then
do ib = 1, nsc
if( (abs(stkx(i,j,ib)-9.99E20_ESMF_KIND_R8) <= 0.01_ESMF_KIND_R8) ) then
if((abs(stkx(i,j,ib)-9.99E20_ESMF_KIND_R8) <= 0.01_ESMF_KIND_R8)) then
ice_ocean_boundary%ustkb(i,j,ib) = 0.0
ice_ocean_boundary%vstkb(i,j,ib) = 0.0
else
ice_ocean_boundary%ustkb(i,j,ib) = ocean_grid%cos_rot(ig,jg)*stkx(i,j,ib) &
- ocean_grid%sin_rot(ig,jg)*stky(i,j,ib)
- ocean_grid%sin_rot(ig,jg)*stky(i,j,ib)
ice_ocean_boundary%vstkb(i,j,ib) = ocean_grid%cos_rot(ig,jg)*stky(i,j,ib) &
+ ocean_grid%sin_rot(ig,jg)*stkx(i,j,ib)
end if
end do
+ ocean_grid%sin_rot(ig,jg)*stkx(i,j,ib)
endif
enddo
else
do ib = 1, nsc
ice_ocean_boundary%ustkb(i,j,ib) = ocean_grid%cos_rot(ig,jg)*stkx(i,j,ib) &
- ocean_grid%sin_rot(ig,jg)*stky(i,j,ib)
- ocean_grid%sin_rot(ig,jg)*stky(i,j,ib)
ice_ocean_boundary%vstkb(i,j,ib) = ocean_grid%cos_rot(ig,jg)*stky(i,j,ib) &
+ ocean_grid%sin_rot(ig,jg)*stkx(i,j,ib)
+ ocean_grid%sin_rot(ig,jg)*stkx(i,j,ib)
enddo
end if
endif
! apply masks
ice_ocean_boundary%ustkb(i,j,:) = ice_ocean_boundary%ustkb(i,j,:) * ocean_grid%mask2dT(ig,jg)
ice_ocean_boundary%vstkb(i,j,:) = ice_ocean_boundary%vstkb(i,j,:) * ocean_grid%mask2dT(ig,jg)
Expand Down
189 changes: 189 additions & 0 deletions config_src/drivers/timing_tests/time_MOM_ANN.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
program time_MOM_ANN

! This file is part of MOM6. See LICENSE.md for the license.

use MOM_ANN, only : ANN_CS
use MOM_ANN, only : ANN_allocate, ANN_apply, ANN_end
use MOM_ANN, only : ANN_apply_vector_orig, ANN_apply_vector_oi
use MOM_ANN, only : ANN_apply_array_sio
use MOM_ANN, only : ANN_random

implicit none

! Command line options
integer :: nargs ! Number of command line arguments
character(len=12) :: cmd_ln_arg !< Command line argument (if any)

! ANN parameters
integer :: nlayers ! Number of layers
integer :: nin ! Number of inputs
integer :: layer_width ! Width of hidden layers
integer :: nout ! Number of outputs
! Timing parameters
integer :: nsamp ! Number of measurements
integer :: nits ! Number of calls to time
integer :: nxy ! Spatial dimension

nlayers = 7; nin = 4; layer_width = 16; nout = 1 ! Deep network
!nlayers = 4; nin = 4; layer_width = 48; nout = 1 ! Shallow-wide network
!nlayers = 3; nin = 4; layer_width = 20; nout = 1 ! Small network

nsamp = 100
nits = 20000
!nits = 300000 ! Needed for robust measurements on small networks
nxy = 100 ! larger array
!nxy = 10 ! small array

! Optionally grab ANN and timing parameters from the command line
nargs = command_argument_count()
if (nargs==7) then
call get_command_argument(1, cmd_ln_arg)
read(cmd_ln_arg,*) nlayers
call get_command_argument(2, cmd_ln_arg)
read(cmd_ln_arg,*) nin
call get_command_argument(3, cmd_ln_arg)
read(cmd_ln_arg,*) layer_width
call get_command_argument(4, cmd_ln_arg)
read(cmd_ln_arg,*) nout
call get_command_argument(5, cmd_ln_arg)
read(cmd_ln_arg,*) nsamp
call get_command_argument(6, cmd_ln_arg)
read(cmd_ln_arg,*) nits
call get_command_argument(7, cmd_ln_arg)
read(cmd_ln_arg,*) nxy
endif

! Fastest variants on Intel Xeon W-2223 CPU @ 3.60GHz (gfortran-13.2 -O3)
! | vector(nxy=1) | nxy = 10 | nxy = 100
! ----------------------------------------------------------------------------
! Small ANN | vector_oi | array_soi | array_sio
! Shallow-wide ANN | vector_oi | array_ois | array_sio
! Deep ANN | vector_oi | array_ois | array_sio

write(*,'(a)') "{"

call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
0, "MOM_ANN:ANN_apply(vector)")
write(*,"(',')")
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
1, "MOM_ANN:ANN_apply_vector_orig(array)")
write(*,"(',')")
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
2, "MOM_ANN:ANN_apply_vector_oi(array)")
write(*,"(',')")
call time_ANN(nlayers, nin, layer_width, nout, nsamp, nits, nxy, &
12, "MOM_ANN:ANN_apply_array_sio(array)")
write(*,"()")

write(*,'(a)') "}"

contains

!> Time ANN inference.
!!
!! Times are measured over the "nits effective calls" and appropriately scaled to the
!! time per call per single vector of input features. For array inputs, the number of
!! actual calls is reduced by the size of the array. The timing measurement is repeated
!! "nsamp" times, to check the statistics of the timing measurement.
subroutine time_ANN(nlayers, nin, width, nout, nsamp, nits, nxy, impl, label)
integer, intent(in) :: nlayers !< Number of layers
integer, intent(in) :: nin !< Number of inputs
integer, intent(in) :: width !< Width of hidden layers
integer, intent(in) :: nout !< Number of outputs
integer, intent(in) :: nsamp !< Number of measurements
integer, intent(in) :: nits !< Number of calls to time
integer, intent(in) :: nxy !< Spatial dimension
integer, intent(in) :: impl !< Implementation to time
character(len=*), intent(in) :: label !< Label for YAML output
! Local variables
type(ANN_CS) :: ANN ! ANN
integer :: widths(nlayers) ! Width of each layer
real :: x_s(nin) ! Inputs (just features) [nondim]
real :: y_s(nin) ! Outputs (just features) [nondim]
real :: x_fs(nin,nxy) ! Inputs (feature, space) [nondim]
real :: y_fs(nin,nxy) ! Outputs (feature, space) [nondim]
real :: x_sf(nin,nxy) ! Inputs (space, feature) [nondim]
real :: y_sf(nin,nxy) ! Outputs (space, feature) [nondim]
integer :: iter, samp ! Loop counters
integer :: ij ! Horizontal loop index
real :: start, finish, timing ! CPU times [s]
real :: tmin, tmax, tmean, tstd ! Min, max, mean, and standard deviation, of CPU times [s]
integer :: asamp ! Actual samples of timings
integer :: aits ! Actual iterations
real :: words_per_sec ! Operations per sec estimated from parameters [# s-1]

widths(:) = width
widths(1) = nin
widths(nlayers) = nout

call ANN_random(ANN, nlayers, widths)
call random_number(x_fs)
call random_number(x_sf)


tmin = 1e9
tmax = 0.
tmean = 0.
tstd = 0.
asamp = nits ! Most cases below use this
aits = nits / nxy ! Most cases below use this

do samp = 1, nsamp
select case (impl)
case (0)
aits = nits
call cpu_time(start)
do iter = 1, nits ! Make many passes to reduce sampling error
call ANN_apply(x_s, y_s, ANN)
enddo
call cpu_time(finish)
case (1)
call cpu_time(start)
do iter = 1, aits ! Make many passes to reduce sampling error
do ij = 1, nxy
call ANN_apply_vector_orig(x_fs(:,ij), y_fs(:,ij), ANN)
enddo
enddo
call cpu_time(finish)
case (2)
call cpu_time(start)
do iter = 1, aits ! Make many passes to reduce sampling error
do ij = 1, nxy
call ANN_apply_vector_oi(x_fs(:,ij), y_fs(:,ij), ANN)
enddo
enddo
call cpu_time(finish)
case (12)
call cpu_time(start)
do iter = 1, aits ! Make many passes to reduce sampling error
call ANN_apply_array_sio(nxy, x_sf(:,:), y_sf(:,:), ANN)
enddo
call cpu_time(finish)
asamp = nsamp * aits ! Account for working on whole arrays
end select

timing = ( finish - start ) / real(nits) ! Average time per call

tmin = min( tmin, timing )
tmax = max( tmax, timing )
tmean = tmean + timing
tstd = tstd + timing**2
enddo

tmean = tmean / real(nsamp)
tstd = tstd / real(nsamp) ! convert to mean of squares
tstd = tstd - tmean**2 ! convert to variance
tstd = sqrt( tstd * real(nsamp) / real(nsamp-1) ) ! convert to standard deviation
words_per_sec = ANN%parameters / ( tmean * 1024 * 1024 )

write(*,"(2x,3a)") '"', trim(label), '": {'
write(*,"(4x,a,1pe11.4,',')") '"min": ', tmin
write(*,"(4x,a,1pe11.4,',')") '"mean":', tmean
write(*,"(4x,a,1pe11.4,',')") '"std": ', tstd
write(*,"(4x,a,i0,',')") '"n_samples": ', asamp
write(*,"(4x,a,1pe11.4,',')") '"max": ', tmax
write(*,"(4x,a,1pe11.4,'}')", advance="no") '"MBps": ', words_per_sec

end subroutine time_ANN

end program time_MOM_ANN
10 changes: 10 additions & 0 deletions config_src/drivers/unit_tests/test_MOM_ANN.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
program test_MOM_ANN

use MOM_ANN, only : ANN_unit_tests
use MOM_error_handler, only : set_skip_mpi

call set_skip_mpi(.true.) ! This unit tests is not expecting MPI to be used

if ( ANN_unit_tests(.true.) ) stop 1

end program test_MOM_ANN
Loading
Loading