Skip to content

Commit 31eefa9

Browse files
Update to latest MOM6
- update patch files for updated MOM6 version - Add new modules to MOM CMakeLists Co-authored-by: Dougie Squire <[email protected]>
1 parent 4f278cc commit 31eefa9

10 files changed

+65
-69
lines changed

MOM6/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ target_sources(OM3_mom6 PRIVATE
6262
MOM6/src/core/MOM_CoriolisAdv.F90
6363
MOM6/src/core/MOM_density_integrals.F90
6464
MOM6/src/core/MOM_dynamics_split_RK2.F90
65+
MOM6/src/core/MOM_dynamics_split_RK2b.F90
6566
MOM6/src/core/MOM_dynamics_unsplit.F90
6667
MOM6/src/core/MOM_dynamics_unsplit_RK2.F90
6768
MOM6/src/core/MOM.F90
@@ -80,7 +81,9 @@ target_sources(OM3_mom6 PRIVATE
8081
MOM6/src/core/MOM_verticalGrid.F90
8182

8283
MOM6/src/diagnostics/MOM_debugging.F90
84+
MOM6/src/diagnostics/MOM_diagnose_MLD.F90
8385
MOM6/src/diagnostics/MOM_diagnostics.F90
86+
MOM6/src/diagnostics/MOM_harmonic_analysis.F90
8487
MOM6/src/diagnostics/MOM_obsolete_diagnostics.F90
8588
MOM6/src/diagnostics/MOM_obsolete_params.F90
8689
MOM6/src/diagnostics/MOM_spatial_means.F90
@@ -97,6 +100,7 @@ target_sources(OM3_mom6 PRIVATE
97100
MOM6/src/equation_of_state/MOM_EOS_Wright.F90
98101
MOM6/src/equation_of_state/MOM_EOS_Wright_full.F90
99102
MOM6/src/equation_of_state/MOM_EOS_Wright_red.F90
103+
MOM6/src/equation_of_state/MOM_EOS_base_type.F90
100104
MOM6/src/equation_of_state/MOM_temperature_convert.F90
101105
MOM6/src/equation_of_state/MOM_TFreeze.F90
102106

@@ -201,7 +205,9 @@ target_sources(OM3_mom6 PRIVATE
201205
MOM6/src/parameterizations/lateral/MOM_MEKE.F90
202206
MOM6/src/parameterizations/lateral/MOM_MEKE_types.F90
203207
MOM6/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
208+
MOM6/src/parameterizations/lateral/MOM_self_attr_load.F90
204209
MOM6/src/parameterizations/lateral/MOM_spherical_harmonics.F90
210+
MOM6/src/parameterizations/lateral/MOM_streaming_filter.F90
205211
MOM6/src/parameterizations/lateral/MOM_thickness_diffuse.F90
206212
MOM6/src/parameterizations/lateral/MOM_tidal_forcing.F90
207213
MOM6/src/parameterizations/lateral/MOM_Zanna_Bolton.F90

MOM6/MOM6

Submodule MOM6 updated 259 files

MOM6/patches/MOM_PointAccel.F90.patch

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
--- ../MOM6/src/diagnostics/MOM_PointAccel.F90 2024-10-23 10:07:22.000000000 +1100
2-
+++ ../MOM6/src/diagnostics/MOM_PointAccel.F90.new 2024-10-23 10:15:54.000000000 +1100
3-
@@ -122,8 +122,8 @@
4-
if (CS%u_file < 0) then
1+
diff --git a/MOM6/src/diagnostics/MOM_PointAccel.F90 b/MOM6/src/diagnostics/MOM_PointAccel.F90.new
2+
index 30f0803..7f91f79 100644
3+
--- a/MOM6/src/diagnostics/MOM_PointAccel.F90
4+
+++ b/MOM6/src/diagnostics/MOM_PointAccel.F90.new
5+
@@ -124,7 +124,7 @@ subroutine write_u_accel(I, j, um, hin, ADp, CDp, dt, G, GV, US, CS, vel_rpt, st
6+
if (CS%u_file == -1) then
57
if (len_trim(CS%u_trunc_file) < 1) return
68
call open_ASCII_file(CS%u_file, trim(CS%u_trunc_file), action=APPEND_FILE, &
79
- threading=MULTIPLE, fileset=SINGLE_FILE)
8-
- if (CS%u_file < 0) then
910
+ threading=MULTIPLE, fileset=MULTIPLE)
10-
+ if (CS%u_file == -1) then
11+
if (CS%u_file == -1) then
1112
call MOM_error(NOTE, 'Unable to open file '//trim(CS%u_trunc_file)//'.')
1213
return
13-
endif
14-
@@ -461,8 +461,8 @@
15-
if (CS%v_file < 0) then
14+
@@ -465,7 +465,7 @@ subroutine write_v_accel(i, J, vm, hin, ADp, CDp, dt, G, GV, US, CS, vel_rpt, st
15+
if (CS%v_file == -1) then
1616
if (len_trim(CS%v_trunc_file) < 1) return
1717
call open_ASCII_file(CS%v_file, trim(CS%v_trunc_file), action=APPEND_FILE, &
1818
- threading=MULTIPLE, fileset=SINGLE_FILE)
19-
- if (CS%v_file < 0) then
2019
+ threading=MULTIPLE, fileset=MULTIPLE)
21-
+ if (CS%v_file == -1) then
20+
if (CS%v_file == -1) then
2221
call MOM_error(NOTE, 'Unable to open file '//trim(CS%v_trunc_file)//'.')
2322
return
24-
endif

MOM6/patches/MOM_coupler_types.F90.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/MOM6/src/framework/MOM_coupler_types.F90 b/MOM6/src/framework/MOM_coupler_types.F90.new
2-
index f87b409..124d786 100644
2+
index b931a2d..cac9309 100644
33
--- a/MOM6/src/framework/MOM_coupler_types.F90
44
+++ b/MOM6/src/framework/MOM_coupler_types.F90.new
5-
@@ -8,7 +8,10 @@ use MOM_couplertype_infra, only : CT_set_diags, CT_send_data, CT_write_chksums,
5+
@@ -9,7 +9,10 @@ use MOM_couplertype_infra, only : CT_set_diags, CT_send_data, CT_write_chksums,
66
use MOM_couplertype_infra, only : CT_copy_data, CT_increment_data, CT_rescale_data
77
use MOM_couplertype_infra, only : CT_set_data, CT_extract_data, CT_redistribute_data
88
use MOM_couplertype_infra, only : coupler_1d_bc_type, coupler_2d_bc_type, coupler_3d_bc_type
@@ -14,7 +14,7 @@ index f87b409..124d786 100644
1414
use MOM_domain_infra, only : domain2D
1515
use MOM_time_manager, only : time_type
1616

17-
@@ -22,7 +25,10 @@ public :: atmos_ocn_coupler_flux, coupler_type_data_override
17+
@@ -23,7 +26,10 @@ public :: atmos_ocn_coupler_flux, coupler_type_data_override
1818
public :: coupler_1d_bc_type, coupler_2d_bc_type, coupler_3d_bc_type
1919
! These are encoding constant parameters that indicate whether a flux, solubility or
2020
! surface ocean concentration are being set or accessed with an inquiry.

MOM6/patches/MOM_forcing_type.F90.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/MOM6/src/core/MOM_forcing_type.F90 b/MOM6/src/core/MOM_forcing_type.F90.new
2-
index 200bbd7..fca9187 100644
2+
index 998713d..a2efcaa 100644
33
--- a/MOM6/src/core/MOM_forcing_type.F90
44
+++ b/MOM6/src/core/MOM_forcing_type.F90.new
5-
@@ -2080,6 +2080,11 @@ subroutine fluxes_accumulate(flux_tmp, fluxes, G, wt2, forces)
5+
@@ -2280,6 +2280,11 @@ subroutine fluxes_accumulate(flux_tmp, fluxes, G, wt2, forces)
66

77
fluxes%salt_flux(i,j) = wt1*fluxes%salt_flux(i,j) + wt2*flux_tmp%salt_flux(i,j)
88
enddo ; enddo

MOM6/patches/MOM_generic_tracer.F90.patch

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/MOM6/src/tracer/MOM_generic_tracer.F90 b/MOM6/src/tracer/MOM_generic_tracer.F90.new
2-
index 131110e..ae75b2e 100644
2+
index 6b10d15..e092aa7 100644
33
--- a/MOM6/src/tracer/MOM_generic_tracer.F90
44
+++ b/MOM6/src/tracer/MOM_generic_tracer.F90.new
55
@@ -21,7 +21,7 @@ module MOM_generic_tracer
@@ -11,18 +11,7 @@ index 131110e..ae75b2e 100644
1111

1212
use g_tracer_utils, only: g_tracer_get_name,g_tracer_set_values,g_tracer_set_common,g_tracer_get_common
1313
use g_tracer_utils, only: g_tracer_get_next,g_tracer_type,g_tracer_is_prog,g_tracer_flux_init
14-
@@ -352,7 +352,9 @@ contains
15-
enddo ; enddo ; enddo
16-
17-
!jgj: Reset CASED to 0 below K=1
18-
- if ( (trim(g_tracer_name) == 'cased') .or. (trim(g_tracer_name) == 'ca13csed') ) then
19-
+ ! dts: also WOMBAT sediment tracers
20-
+ if ( (trim(g_tracer_name) == 'cased') .or. (trim(g_tracer_name) == 'ca13csed') .or. &
21-
+ (trim(g_tracer_name) == 'det_sediment') .or. (trim(g_tracer_name) == 'caco3_sediment')) then
22-
do k=2,nk ; do j=jsc,jec ; do i=isc,iec
23-
if (tr_ptr(i,j,k) /= CS%tracer_land_val) then
24-
tr_ptr(i,j,k) = 0.0
25-
@@ -507,6 +509,11 @@ contains
14+
@@ -527,6 +527,11 @@ contains
2615
! the fluxes without coming into this subroutine.
2716
! MOM5 has to modified to conform.
2817

MOM6/patches/MOM_io_infra.F90.patch

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
--- ../MOM6/config_src/infra/FMS2/MOM_io_infra.F90 2024-10-23 10:07:33.000000000 +1100
2-
+++ ../MOM6/config_src/infra/FMS2/MOM_io_infra.F90.new 2024-10-23 10:16:45.000000000 +1100
3-
@@ -376,8 +376,7 @@
1+
diff --git a/MOM6/config_src/infra/FMS2/MOM_io_infra.F90 b/MOM6/config_src/infra/FMS2/MOM_io_infra.F90.new
2+
index a43b4e9..169ed25 100644
3+
--- a/MOM6/config_src/infra/FMS2/MOM_io_infra.F90
4+
+++ b/MOM6/config_src/infra/FMS2/MOM_io_infra.F90.new
5+
@@ -376,8 +376,7 @@ subroutine open_ASCII_file(unit, file, action, threading, fileset)
46
logical :: exists
57
logical :: is_open
68
character(len=6) :: action_arg, position_arg
@@ -10,7 +12,7 @@
1012
! NOTE: This function is written to emulate the original behavior of mpp_open
1113
! from the FMS1 library, on which the MOM API is still based. Much of this
1214
! can be removed if we choose to drop this compatibility, but for now we
13-
@@ -433,12 +432,12 @@
15+
@@ -433,12 +432,12 @@ subroutine open_ASCII_file(unit, file, action, threading, fileset)
1416
endif
1517
endif
1618

MOM6/patches/mom_cap.F90.patch

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/MOM6/config_src/drivers/nuopc_cap/mom_cap.F90 b/MOM6/config_src/drivers/nuopc_cap/mom_cap.F90.new
2-
index 3574943..f948684 100644
2+
index fab6fe1..541d7f1 100644
33
--- a/MOM6/config_src/drivers/nuopc_cap/mom_cap.F90
44
+++ b/MOM6/config_src/drivers/nuopc_cap/mom_cap.F90.new
55
@@ -2,8 +2,9 @@
@@ -53,7 +53,7 @@ index 3574943..f948684 100644
5353
end type
5454

5555
!> Wrapper-derived type required to associate an internal state instance
56-
@@ -408,6 +422,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
56+
@@ -416,6 +430,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
5757
type (ocean_public_type), pointer :: ocean_public => NULL()
5858
type (ocean_state_type), pointer :: ocean_state => NULL()
5959
type(ice_ocean_boundary_type), pointer :: Ice_ocean_boundary => NULL()
@@ -64,15 +64,15 @@ index 3574943..f948684 100644
6464
type(ocean_internalstate_wrapper) :: ocean_internalstate
6565
type(ocean_grid_type), pointer :: ocean_grid => NULL()
6666
type(directories) :: dirs
67-
@@ -439,6 +457,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
67+
@@ -447,6 +465,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
6868
character(len=512) :: restartfile ! Path/Name of restart file
6969
character(len=2048) :: restartfiles ! Path/Name of restart files
7070
! (same as restartfile if single restart file)
7171
+ character(240) :: additional_restart_dir
7272
character(len=*), parameter :: subname='(MOM_cap:InitializeAdvertise)'
7373
character(len=32) :: calendar
7474
character(len=:), allocatable :: rpointer_filename
75-
@@ -517,6 +536,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
75+
@@ -525,6 +544,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
7676
if (chkerr(rc,__LINE__,u_FILE_u)) return
7777
call MOM_infra_init(mpi_comm_mom)
7878

@@ -81,7 +81,7 @@ index 3574943..f948684 100644
8181
! determine the calendar
8282
if (cesm_coupled) then
8383
call NUOPC_CompAttributeGet(gcomp, name="calendar", value=cvalue, &
84-
@@ -648,13 +669,44 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
84+
@@ -656,13 +677,44 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
8585

8686
endif
8787

@@ -126,7 +126,7 @@ index 3574943..f948684 100644
126126

127127
! GMM, this call is not needed in CESM. Check with EMC if it can be deleted.
128128
call ocean_model_flux_init(ocean_state)
129-
@@ -721,6 +773,31 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
129+
@@ -729,6 +781,31 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
130130
Ice_ocean_boundary%hcond = 0.0
131131
endif
132132

@@ -158,7 +158,7 @@ index 3574943..f948684 100644
158158
call query_ocean_state(ocean_state, use_waves=use_waves, wave_method=wave_method)
159159
if (use_waves) then
160160
if (wave_method == "EFACTOR") then
161-
@@ -789,6 +866,15 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
161+
@@ -797,6 +874,15 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
162162
endif
163163
endif
164164

@@ -174,7 +174,7 @@ index 3574943..f948684 100644
174174
!--------- export fields -------------
175175
call fld_list_add(fldsFrOcn_num, fldsFrOcn, "So_omask" , "will provide")
176176
call fld_list_add(fldsFrOcn_num, fldsFrOcn, "So_t" , "will provide")
177-
@@ -800,6 +886,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
177+
@@ -808,6 +894,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
178178
call fld_list_add(fldsFrOcn_num, fldsFrOcn, "Fioo_q" , "will provide")
179179
call fld_list_add(fldsFrOcn_num, fldsFrOcn, "So_bldepth" , "will provide")
180180

@@ -183,7 +183,7 @@ index 3574943..f948684 100644
183183
do n = 1,fldsToOcn_num
184184
call NUOPC_Advertise(importState, standardName=fldsToOcn(n)%stdname, name=fldsToOcn(n)%shortname, rc=rc)
185185
if (ChkErr(rc,__LINE__,u_FILE_u)) return
186-
@@ -1611,11 +1699,14 @@ subroutine ModelAdvance(gcomp, rc)
186+
@@ -1619,11 +1707,14 @@ subroutine ModelAdvance(gcomp, rc)
187187
type (ocean_public_type), pointer :: ocean_public => NULL()
188188
type (ocean_state_type), pointer :: ocean_state => NULL()
189189
type(ice_ocean_boundary_type), pointer :: Ice_ocean_boundary => NULL()
@@ -198,7 +198,7 @@ index 3574943..f948684 100644
198198
integer :: dth, dtm, dts
199199
integer :: nc
200200
type(ESMF_Time) :: MyTime
201-
@@ -1627,12 +1718,13 @@ subroutine ModelAdvance(gcomp, rc)
201+
@@ -1635,12 +1726,13 @@ subroutine ModelAdvance(gcomp, rc)
202202
integer :: writeunit
203203
integer :: localPet
204204
type(ESMF_VM) :: vm
@@ -213,15 +213,15 @@ index 3574943..f948684 100644
213213
integer :: num_rest_files
214214
real(8) :: MPI_Wtime, timers
215215
logical :: write_restart
216-
@@ -1673,6 +1765,7 @@ subroutine ModelAdvance(gcomp, rc)
216+
@@ -1683,6 +1775,7 @@ subroutine ModelAdvance(gcomp, rc)
217217

218218
Time_step_coupled = esmf2fms_time(timeStep)
219219
Time = esmf2fms_time(currTime)
220220
+ Time_import = Time
221221

222222
!---------------
223223
! Apply ocean lag for startup runs:
224-
@@ -1748,8 +1841,39 @@ subroutine ModelAdvance(gcomp, rc)
224+
@@ -1758,8 +1851,39 @@ subroutine ModelAdvance(gcomp, rc)
225225
! Import data
226226
!---------------
227227

@@ -261,7 +261,7 @@ index 3574943..f948684 100644
261261

262262
!---------------
263263
! Update MOM6
264-
@@ -1811,7 +1935,7 @@ subroutine ModelAdvance(gcomp, rc)
264+
@@ -1831,7 +1955,7 @@ subroutine ModelAdvance(gcomp, rc)
265265
! determine restart filename
266266
call ESMF_ClockGetNextTime(clock, MyTime, rc=rc)
267267
if (ChkErr(rc,__LINE__,u_FILE_u)) return
@@ -270,7 +270,7 @@ index 3574943..f948684 100644
270270
if (ChkErr(rc,__LINE__,u_FILE_u)) return
271271

272272
if (cesm_coupled) then
273-
@@ -1869,6 +1993,14 @@ subroutine ModelAdvance(gcomp, rc)
273+
@@ -1889,6 +2013,14 @@ subroutine ModelAdvance(gcomp, rc)
274274

275275
endif
276276

@@ -285,15 +285,15 @@ index 3574943..f948684 100644
285285
if (is_root_pe()) then
286286
write(stdout,*) subname//' writing restart file ',trim(restartname)
287287
endif
288-
@@ -2149,6 +2281,7 @@ subroutine ocean_model_finalize(gcomp, rc)
288+
@@ -2169,6 +2301,7 @@ subroutine ocean_model_finalize(gcomp, rc)
289289
integer :: alarmCount
290290
character(len=64) :: timestamp
291291
logical :: write_restart
292292
+ character(240) :: additional_restart_dir
293293
character(len=*),parameter :: subname='(MOM_cap:ocean_model_finalize)'
294294
real(8) :: MPI_Wtime, timefs
295295

296-
@@ -2182,6 +2315,18 @@ subroutine ocean_model_finalize(gcomp, rc)
296+
@@ -2202,6 +2335,18 @@ subroutine ocean_model_finalize(gcomp, rc)
297297

298298
call ocean_model_end(ocean_public, ocean_State, Time, write_restart=write_restart)
299299

MOM6/patches/mom_cap_methods.F90.patch

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/MOM6/config_src/drivers/nuopc_cap/mom_cap_methods.F90 b/MOM6/config_src/drivers/nuopc_cap/mom_cap_methods.F90.new
2-
index 125bae5..67f3314 100644
2+
index 125bae5..3f81f6a 100644
33
--- a/MOM6/config_src/drivers/nuopc_cap/mom_cap_methods.F90
44
+++ b/MOM6/config_src/drivers/nuopc_cap/mom_cap_methods.F90.new
55
@@ -20,8 +20,15 @@ use MOM_ocean_model_nuopc, only: ocean_public_type, ocean_state_type
@@ -18,25 +18,26 @@ index 125bae5..67f3314 100644
1818
! By default make data private
1919
implicit none; private
2020

21-
@@ -72,11 +79,16 @@ end subroutine mom_set_geomtype
21+
@@ -72,11 +79,17 @@ end subroutine mom_set_geomtype
2222
!> This function has a few purposes:
2323
!! (1) it imports surface fluxes using data from the mediator; and
2424
!! (2) it can apply restoring in SST and SSS.
2525
-subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, rc)
26-
+!! (3) optional: if atm_fields is provided, it imports and sets the fields in atm_fields required for the
27-
+!! calculation of coupled generic tracer fluxes
26+
+!! (3) optional: if atm_fields is provided, it imports and sets the fields in atm_fields required
27+
+!! for the calculation of coupled generic tracer fluxes
2828
+subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, atm_fields, rc)
2929
type(ocean_public_type) , intent(in) :: ocean_public !< Ocean surface state
3030
type(ocean_grid_type) , intent(in) :: ocean_grid !< Ocean model grid
3131
type(ESMF_State) , intent(inout) :: importState !< incoming data from mediator
3232
type(ice_ocean_boundary_type) , intent(inout) :: ice_ocean_boundary !< Ocean boundary forcing
33-
+ type(coupler_2d_bc_type), optional, intent(inout) :: atm_fields !< If present, this type describes the atmospheric
34-
+ !! tracer fields to be imported for the calculation
35-
+ !! of generic tracer fluxes.
33+
+ type(coupler_2d_bc_type), optional, intent(inout) :: atm_fields !< If present, this type
34+
+ !! describes the atmospheric tracer fields to
35+
+ !! be imported for the calculation of generic
36+
+ !! tracer fluxes.
3637
integer , intent(inout) :: rc !< Return code
3738

3839
! Local Variables
39-
@@ -88,7 +100,10 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
40+
@@ -88,7 +101,10 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
4041
real(ESMF_KIND_R8), allocatable :: tauy(:,:)
4142
real(ESMF_KIND_R8), allocatable :: stkx(:,:,:)
4243
real(ESMF_KIND_R8), allocatable :: stky(:,:,:)
@@ -47,7 +48,7 @@ index 125bae5..67f3314 100644
4748

4849
rc = ESMF_SUCCESS
4950

50-
@@ -364,6 +379,48 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
51+
@@ -364,6 +380,48 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
5152
deallocate(stkx,stky)
5253
endif
5354

0 commit comments

Comments
 (0)