Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update MOM6 to its main repo 20231025 (NCAR candidate) and 20231031(GMAO FMS_cap) updating #122

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b7390f7
Makes set_u_at_v and set_v_at_u public
gustavo-marques Apr 27, 2022
9c103f1
First draft for fpmix
gustavo-marques Apr 27, 2022
cb65bdc
Change name of logical
gustavo-marques May 17, 2022
143d117
Updates to vertFPmix
gustavo-marques May 17, 2022
2e59987
Merge branch 'dev/ncar' into fpmix_draft_17may2022
gustavo-marques May 17, 2022
7624a83
Add missing use for vertFPmix
gustavo-marques May 24, 2022
864506e
Add omega_w2x to fluxes and forces
gustavo-marques May 24, 2022
9b4bd84
Add mssing call to get_param for FPMIX
gustavo-marques Jun 21, 2022
f666a67
Rename module to hor_bnd_diffusion
gustavo-marques Nov 12, 2022
c2a3083
Improve performance of hor_bnd_diffusion
gustavo-marques Nov 12, 2022
db06a54
add CFC_BC_year_offset, converts model time to time in CFC_BC_file
klindsay28 Mar 1, 2023
b85581e
read atm CFC hemispheric aveages from CFC_BC_FILE, instead of 2D fields
klindsay28 Mar 9, 2023
3a52e42
Merge branch 'dev/ncar' into cfc_cap_forcing_update
klindsay28 Mar 10, 2023
72e5535
Merge pull request #236 from klindsay28/cfc_cap_forcing_update
alperaltuntas Mar 16, 2023
e321244
Merge branch 'dev/ncar' into HBD_march2023
gustavo-marques Mar 22, 2023
eff5036
Unit tests and final cleaning
gustavo-marques Mar 23, 2023
a697159
Obsolete the USE_LATERAL_BOUNDARY_DIFFUSION option
gustavo-marques Mar 23, 2023
ebf11d7
migrate nearly all refs to CFC_cap into MOM_tracer_flow_control and M…
klindsay28 Mar 24, 2023
59cc9ed
Merge pull request #242 from klindsay28/cfc_cap_mv_code_out_of_cap
gustavo-marques Mar 28, 2023
61bfacd
Merge pull request #240 from gustavo-marques/HBD_march2023v2
alperaltuntas Mar 30, 2023
32b969e
Accommodate multi-instance runs in CESM (#241)
alperaltuntas Mar 30, 2023
2e77200
Merge branch 'mom-ocean:main' into dev/ncar
alperaltuntas Apr 4, 2023
8812ba9
Merge remote-tracking branch 'gustavo/fpmix_draft_17may2022' into fpm…
gustavo-marques Apr 18, 2023
61baca8
Option to taper neutral diffusion
gustavo-marques Jul 6, 2023
3c457c3
Merge branch 'dev/ncar' into merge_main_20230406
gustavo-marques Jul 7, 2023
aa58724
Merge pull request #249 from gustavo-marques/merge_main_20230406
alperaltuntas Jul 7, 2023
1e0b773
Merge branch 'dev/ncar' into neutral_diffusion_tapering
gustavo-marques Jul 10, 2023
b4bd223
Output relevant fields when diff or visc < 0
gustavo-marques Jul 19, 2023
47f737f
Merge pull request #252 from gustavo-marques/debug_legacy_langmuir_kpp
alperaltuntas Jul 20, 2023
8234e69
Add hbd to the control structure
gustavo-marques Jul 27, 2023
53ccbc3
Fix line length
gustavo-marques Jul 27, 2023
cf29f1b
Allocate hbl
gustavo-marques Jul 27, 2023
36c1e26
Make tracer diffusivities 3D
gustavo-marques Jul 31, 2023
a588033
Make HBD work with 3D diffusivities
gustavo-marques Jul 31, 2023
27518f7
Make neutral diffusion work with 3D diffusivities
gustavo-marques Jul 31, 2023
92756fe
Merge branch 'dev/ncar' into fpmix_draft_15August2023
gustavo-marques Aug 15, 2023
2f34d65
Merge latest mom-ocean main (#254)
alperaltuntas Aug 18, 2023
74b0bdb
Merge branch 'dev/ncar' into 3d_khtr
gustavo-marques Aug 22, 2023
c57789f
Rearrange do-loops and if statements
gustavo-marques Aug 22, 2023
d3e2647
Merge pull request #248 from gustavo-marques/neutral_diffusion_tapering
alperaltuntas Aug 23, 2023
700502d
Merge pull request #253 from gustavo-marques/3d_khtr
alperaltuntas Aug 24, 2023
d4aa108
Add Leith+E (#251)
iangrooms Aug 29, 2023
d741517
Merge branch 'dev/ncar' into fpmix_draft_15August2023
gustavo-marques Aug 30, 2023
7b7052e
Describe local variables and make code consistent
gustavo-marques Sep 6, 2023
65ac638
Merge branch 'fpmix_draft_15August2023_v2' into HEAD
gustavo-marques Sep 6, 2023
66fd876
Removed L_diag and moved variables in vertFPmix
gustavo-marques Sep 6, 2023
d9aa751
Revert order of variables in vertFPmix
gustavo-marques Sep 6, 2023
8fd5104
Merge pull request #256 from gustavo-marques/fpmix_draft_15August2023
alperaltuntas Sep 8, 2023
5bc0c5e
Pass wavebands from coupler to wave_parameters_CS (#255)
gustavo-marques Sep 8, 2023
d363034
Deprecate mct cap (#257)
alperaltuntas Sep 12, 2023
5d976e3
Merge branch 'main' into dev-ncar-main-candidate-2023-09-13
gustavo-marques Sep 13, 2023
a2c3ec7
add extracting c grid currents
zhaobin74 Sep 11, 2023
afb3a44
Merge pull request #1608 from jiandewang/DEV-EMC-addruntime-20230908-…
jiandewang Sep 13, 2023
12eae12
Merge branch 'main' into dev-ncar-main-candidate-2023-09-13
gustavo-marques Sep 13, 2023
de55fd6
fix multiinstance log filename correction and remove FMS1 io api calls.
alperaltuntas Sep 15, 2023
887b3f0
Merge pull request #8 from alperaltuntas/fix_multi_instance
gustavo-marques Sep 17, 2023
5e6e657
remove fms_io_mod import
alperaltuntas Sep 19, 2023
7fe2f17
Merge pull request #9 from alperaltuntas/fix_multi_instance
gustavo-marques Sep 19, 2023
e2bbb08
Set fpmix to false by default
gustavo-marques Oct 5, 2023
3720b99
Comment all omega_w2x entries
gustavo-marques Oct 13, 2023
3d07e5b
Comment omega_w2x entries in nuopc_cap
gustavo-marques Oct 13, 2023
f6b6b0b
Merge pull request #1610 from gustavo-marques/dev-ncar-main-candidate…
marshallward Oct 25, 2023
e41929e
Update .readthedocs.yml configuration
marshallward Oct 26, 2023
dbda49c
Merge pull request #1611 from GEOS-ESM/main
marshallward Oct 31, 2023
e2c322e
Merge remote-tracking branch 'MAIN/main' into feature/update-NCAR-GMA…
jiandewang Oct 31, 2023
314a626
Merge pull request #1613 from NOAA-GFDL/rtd_fix
marshallward Nov 6, 2023
80a93f6
Merge remote-tracking branch 'MAIN/main' into feature/update-NCAR-GMA…
jiandewang Nov 6, 2023
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
4 changes: 0 additions & 4 deletions .github/workflows/coupled-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ jobs:
- name: Compile MOM6 for the NUOPC driver
shell: bash
run: make check_mom6_api_nuopc -j

- name: Compile MOM6 for the MCT driver
shell: bash
run: make check_mom6_api_mct -j
11 changes: 9 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Extra formats
# PDF generation is failing for now; disabled on 2020-12-02
#formats:
Expand All @@ -10,7 +19,5 @@ sphinx:
configuration: docs/conf.py

python:
# make sure we're using Python 3
version: 3
install:
- requirements: docs/requirements.txt
7 changes: 0 additions & 7 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ build/opt/Makefile: MOM_ENV=$(PATH_FMS) $(OPT_FCFLAGS) $(MOM_LDFLAGS)
build/opt_target/Makefile: MOM_ENV=$(PATH_FMS) $(OPT_FCFLAGS) $(MOM_LDFLAGS)
build/coupled/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(MOM_LDFLAGS)
build/nuopc/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(MOM_LDFLAGS)
build/mct/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(MOM_LDFLAGS)
build/cov/Makefile: MOM_ENV=$(PATH_FMS) $(COV_FCFLAGS) $(COV_LDFLAGS)
build/unit/Makefile: MOM_ENV=$(PATH_FMS) $(COV_FCFLAGS) $(COV_LDFLAGS)

Expand All @@ -269,7 +268,6 @@ build/opt/Makefile: MOM_ACFLAGS=
build/opt_target/Makefile: MOM_ACFLAGS=
build/coupled/Makefile: MOM_ACFLAGS=--with-driver=FMS_cap
build/nuopc/Makefile: MOM_ACFLAGS=--with-driver=nuopc_cap
build/mct/Makefile: MOM_ACFLAGS=--with-driver=mct_cap
build/cov/Makefile: MOM_ACFLAGS=
build/unit/Makefile: MOM_ACFLAGS=--with-driver=unit_tests

Expand Down Expand Up @@ -370,11 +368,6 @@ build/coupled/ocean_model_MOM.o: build/coupled/Makefile
cd $(@D) && make $(@F)
check_mom6_api_coupled: build/coupled/ocean_model_MOM.o

# MCT driver
build/mct/mom_ocean_model_mct.o: build/mct/Makefile
cd $(@D) && make $(@F)
check_mom6_api_mct: build/mct/mom_ocean_model_mct.o


#---
# Testing
Expand Down
8 changes: 8 additions & 0 deletions config_src/drivers/FMS_cap/ocean_model_MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,14 @@ subroutine ocean_model_get_UV_surf(OS, Ocean, name, array2D, isc, jsc)
array2D(i,j) = G%mask2dBu(I+i0,J+j0) * &
0.5*(sfc_state%v(i+i0,J+j0)+sfc_state%v(i+i0+1,J+j0))
enddo ; enddo
case('uc')
do j=jsc_bnd,jec_bnd ; do i=isc_bnd,iec_bnd
array2D(i,j) = G%mask2dCu(I+i0,J+j0) * sfc_state%u(I+i0,j+j0)
enddo ; enddo
case('vc')
do j=jsc_bnd,jec_bnd ; do i=isc_bnd,iec_bnd
array2D(i,j) = G%mask2dCv(I+i0,J+j0) * sfc_state%v(i+i0,J+j0)
enddo ; enddo
case default
call MOM_error(FATAL,'ocean_model_get_UV_surf: unknown argument name='//name)
end select
Expand Down
65 changes: 46 additions & 19 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ module MOM_cap_mod
use MOM_cap_methods, only: mom_import, mom_export, mom_set_geomtype, mod2med_areacor
use MOM_cap_methods, only: med2mod_areacor, state_diagnose
use MOM_cap_methods, only: ChkErr
use MOM_ensemble_manager, only: ensemble_manager_init

#ifdef CESMCOUPLED
use shr_log_mod, only: shr_log_setLogUnit
use nuopc_shr_methods, only: get_component_instance
#endif
use time_utils_mod, only: esmf2fms_time

Expand Down Expand Up @@ -147,7 +149,8 @@ module MOM_cap_mod
logical :: cesm_coupled = .false.
type(ESMF_GeomType_Flag) :: geomtype
#endif
character(len=8) :: restart_mode = 'alarms'
character(len=8) :: restart_mode = 'alarms'
character(len=16) :: inst_suffix = ''
real(8) :: timere

contains
Expand Down Expand Up @@ -434,6 +437,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! (same as restartfile if single restart file)
character(len=*), parameter :: subname='(MOM_cap:InitializeAdvertise)'
character(len=32) :: calendar
character(len=:), allocatable :: rpointer_filename
integer :: inst_index
real(8) :: MPI_Wtime, timeiads
!--------------------------------

Expand Down Expand Up @@ -465,6 +470,13 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
CALL ESMF_TimeIntervalGet(TINT, S=DT_OCEAN, RC=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

#ifdef CESMCOUPLED
call get_component_instance(gcomp, inst_suffix, inst_index, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ensemble_manager_init(inst_suffix)
rpointer_filename = 'rpointer.ocn'//trim(inst_suffix)
#endif

! reset shr logging to my log file
if (localPet==0) then
call NUOPC_CompAttributeGet(gcomp, name="diro", &
Expand All @@ -474,11 +486,20 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
isPresent=isPresentLogfile, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresentDiro .and. isPresentLogfile) then
call NUOPC_CompAttributeGet(gcomp, name="diro", value=diro, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call NUOPC_CompAttributeGet(gcomp, name="logfile", value=logfile, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
open(newunit=stdout,file=trim(diro)//"/"//trim(logfile))
call NUOPC_CompAttributeGet(gcomp, name="diro", value=diro, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call NUOPC_CompAttributeGet(gcomp, name="logfile", value=logfile, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if (cesm_coupled) then
! Multiinstance logfile name needs a correction
if(len_trim(inst_suffix) > 0) then
n = index(logfile, '.')
logfile = logfile(1:n-1)//trim(inst_suffix)//logfile(n:)
endif
endif

open(newunit=stdout,file=trim(diro)//"/"//trim(logfile))
else
stdout = output_unit
endif
Expand Down Expand Up @@ -535,12 +556,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)

time0 = set_date (YEAR,MONTH,DAY,HOUR,MINUTE,SECOND)


! rsd need to figure out how to get this without share code
!call shr_nuopc_get_component_instance(gcomp, inst_suffix, inst_index)
!inst_name = "OCN"//trim(inst_suffix)


if (is_root_pe()) then
write(stdout,*) subname//'start time: y,m,d-',year,month,day,'h,m,s=',hour,minute,second
endif
Expand Down Expand Up @@ -595,9 +610,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)

if (localPet == 0) then
! this hard coded for rpointer.ocn right now
open(newunit=readunit, file='rpointer.ocn', form='formatted', status='old', iostat=iostat)
open(newunit=readunit, file=rpointer_filename, form='formatted', status='old', iostat=iostat)
if (iostat /= 0) then
call ESMF_LogSetError(ESMF_RC_FILE_OPEN, msg=subname//' ERROR opening rpointer.ocn', &
call ESMF_LogSetError(ESMF_RC_FILE_OPEN, msg=subname//' ERROR opening '//rpointer_filename, &
line=__LINE__, file=u_FILE_u, rcToReturn=rc)
return
endif
Expand All @@ -607,7 +622,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if (len(trim(restartfiles))>1 .and. iostat<0) then
exit ! done reading restart files list.
else
call ESMF_LogSetError(ESMF_RC_FILE_READ, msg=subname//' ERROR reading rpointer.ocn', &
call ESMF_LogSetError(ESMF_RC_FILE_READ, msg=subname//' ERROR reading '//rpointer_filename, &
line=__LINE__, file=u_FILE_u, rcToReturn=rc)
return
endif
Expand All @@ -630,7 +645,12 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
endif

ocean_public%is_ocean_pe = .true.
call ocean_model_init(ocean_public, ocean_state, time0, time_start, input_restart_file=trim(adjustl(restartfiles)))
if (cesm_coupled .and. len_trim(inst_suffix)>0) then
call ocean_model_init(ocean_public, ocean_state, time0, time_start, &
input_restart_file=trim(adjustl(restartfiles)), inst_index=inst_index)
else
call ocean_model_init(ocean_public, ocean_state, time0, time_start, input_restart_file=trim(adjustl(restartfiles)))
endif

! GMM, this call is not needed in CESM. Check with EMC if it can be deleted.
call ocean_model_flux_init(ocean_state)
Expand Down Expand Up @@ -1511,6 +1531,7 @@ subroutine ModelAdvance(gcomp, rc)
character(len=128) :: fldname
character(len=*),parameter :: subname='(MOM_cap:ModelAdvance)'
character(len=8) :: suffix
character(len=:), allocatable :: rpointer_filename
integer :: num_rest_files
real(8) :: MPI_Wtime, timers

Expand Down Expand Up @@ -1685,20 +1706,26 @@ subroutine ModelAdvance(gcomp, rc)
call ESMF_VMGet(vm, localPet=localPet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

rpointer_filename = 'rpointer.ocn'//trim(inst_suffix)

write(restartname,'(A,".mom6.r.",I4.4,"-",I2.2,"-",I2.2,"-",I5.5)') &
trim(casename), year, month, day, seconds
call ESMF_LogWrite("MOM_cap: Writing restart : "//trim(restartname), ESMF_LOGMSG_INFO)
! write restart file(s)
call ocean_model_restart(ocean_state, restartname=restartname, num_rest_files=num_rest_files)
if (localPet == 0) then
! Write name of restart file in the rpointer file - this is currently hard-coded for the ocean
open(newunit=writeunit, file='rpointer.ocn', form='formatted', status='unknown', iostat=iostat)
open(newunit=writeunit, file=rpointer_filename, form='formatted', status='unknown', iostat=iostat)
if (iostat /= 0) then
call ESMF_LogSetError(ESMF_RC_FILE_OPEN, &
msg=subname//' ERROR opening rpointer.ocn', line=__LINE__, file=u_FILE_u, rcToReturn=rc)
msg=subname//' ERROR opening '//rpointer_filename, line=__LINE__, file=u_FILE_u, rcToReturn=rc)
return
endif
write(writeunit,'(a)') trim(restartname)//'.nc'
if (len_trim(inst_suffix) == 0) then
write(writeunit,'(a)') trim(restartname)//'.nc'
else
write(writeunit,'(a)') trim(restartname)//'.'//trim(inst_suffix)//'.nc'
endif

if (num_rest_files > 1) then
! append i.th restart file name to rpointer
Expand Down
20 changes: 13 additions & 7 deletions config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module MOM_ocean_model_nuopc
use MOM_time_manager, only : operator(/=), operator(<=), operator(>=)
use MOM_time_manager, only : operator(<), real_to_time_type, time_type_to_real
use MOM_interpolate, only : time_interp_external_init
use MOM_tracer_flow_control, only : call_tracer_flux_init
use MOM_tracer_flow_control, only : tracer_flow_control_CS, call_tracer_flux_init, call_tracer_set_forcing
use MOM_unit_scaling, only : unit_scale_type
use MOM_variables, only : surface
use MOM_verticalGrid, only : verticalGrid_type
Expand Down Expand Up @@ -210,6 +210,8 @@ module MOM_ocean_model_nuopc
type(marine_ice_CS), pointer :: &
marine_ice_CSp => NULL() !< A pointer to the control structure for the
!! marine ice effects module.
type(tracer_flow_control_CS), pointer :: &
tracer_flow_CSp => NULL() !< A pointer to the tracer flow control structure
type(wave_parameters_CS), pointer, public :: &
Waves => NULL() !< A pointer to the surface wave control structure
type(surface_forcing_CS), pointer :: &
Expand All @@ -229,7 +231,7 @@ module MOM_ocean_model_nuopc
!! This subroutine initializes both the ocean state and the ocean surface type.
!! Because of the way that indicies and domains are handled, Ocean_sfc must have
!! been used in a previous call to initialize_ocean_type.
subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, input_restart_file)
subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, input_restart_file, inst_index)
type(ocean_public_type), target, &
intent(inout) :: Ocean_sfc !< A structure containing various publicly
!! visible ocean surface properties after initialization,
Expand All @@ -246,6 +248,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
!! tracer fluxes, and can be used to spawn related
!! internal variables in the ice model.
character(len=*), optional, intent(in) :: input_restart_file !< If present, name of restart file to read
integer, optional :: inst_index !< Ensemble index provided by the cap (instead of FMS ensemble manager)

! Local variables
real :: Rho0 ! The Boussinesq ocean density, in kg m-3.
Expand All @@ -255,7 +258,6 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
!! min(HFrz, OBLD), where OBLD is the boundary layer depth.
!! If HFrz <= 0 (default), melt potential will not be computed.
logical :: use_melt_pot !< If true, allocate melt_potential array
logical :: use_CFC !< If true, allocated arrays for surface CFCs.


! This include declares and sets the variable "version".
Expand Down Expand Up @@ -283,7 +285,8 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
call initialize_MOM(OS%Time, Time_init, param_file, OS%dirs, OS%MOM_CSp, &
OS%restart_CSp, Time_in, offline_tracer_mode=OS%offline_tracer_mode, &
input_restart_file=input_restart_file, &
diag_ptr=OS%diag, count_calls=.true., waves_CSp=OS%Waves)
diag_ptr=OS%diag, count_calls=.true., tracer_flow_CSp=OS%tracer_flow_CSp, &
waves_CSp=OS%Waves, ensemble_num=inst_index)
call get_MOM_state_elements(OS%MOM_CSp, G=OS%grid, GV=OS%GV, US=OS%US, C_p=OS%C_p, &
C_p_scaled=OS%fluxes%C_p, use_temp=use_temperature)

Expand Down Expand Up @@ -376,16 +379,14 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
use_melt_pot=.false.
endif

call get_param(param_file, mdl, "USE_CFC_CAP", use_CFC, &
default=.false., do_not_log=.true.)
call get_param(param_file, mdl, "USE_WAVES", OS%Use_Waves, &
"If true, enables surface wave modules.", default=.false.)

! Consider using a run-time flag to determine whether to do the diagnostic
! vertical integrals, since the related 3-d sums are not negligible in cost.
call allocate_surface_state(OS%sfc_state, OS%grid, use_temperature, &
do_integrals=.true., gas_fields_ocn=gas_fields_ocn, &
use_meltpot=use_melt_pot, use_cfcs=use_CFC)
use_meltpot=use_melt_pot)

call surface_forcing_init(Time_in, OS%grid, OS%US, param_file, OS%diag, &
OS%forcing_CSp, OS%restore_salinity, OS%restore_temp, OS%use_waves)
Expand Down Expand Up @@ -611,6 +612,11 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
call finish_MOM_initialization(OS%Time, OS%dirs, OS%MOM_CSp, OS%restart_CSp)
endif

if (do_thermo) &
call call_tracer_set_forcing(OS%sfc_state, OS%fluxes, OS%Time, &
real_to_time_type(dt_coupling), OS%grid, OS%US, OS%GV%Rho0, &
OS%tracer_flow_CSp)

call disable_averaging(OS%diag)
Master_time = OS%Time ; Time1 = OS%Time

Expand Down
Loading
Loading