Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a9b4e97
Merge pull request #2 from NOAA-GFDL/dev/gfdl
nikizadehgfdl Jan 3, 2020
79e5797
First attempt to add a generic tracer to OBC scheme
nikizadehgfdl Jun 4, 2020
596b781
Merge remote-tracking branch 'MOM6origin/dev/gfdl' into dev/gfdl
nikizadehgfdl Jun 23, 2020
c85cea9
Merge branch 'dev/gfdl' into nikizadehgfdl/ESMG_BGC_OBC
nikizadehgfdl Jun 23, 2020
ff61dd1
Merge branch 'dev/gfdl' into nikizadehgfdl/ESMG_BGC_OBC
nikizadehgfdl Aug 13, 2020
1638c0b
Initialize OBC segments for OBGC tracers
nikizadehgfdl Aug 14, 2020
d0c431b
Add OBC reservoirs for ocean_BGC tracers
nikizadehgfdl Sep 1, 2020
cbf2d52
Increase length of segment data name
andrew-c-ross Jan 28, 2021
0387811
Check if tracer is prog
andrew-c-ross Jan 28, 2021
8080fb2
Fix restart bug due to setting up T&S reservoirs twice
andrew-c-ross Mar 4, 2021
6be6ffc
Merge branch 'dev/gfdl' of github.com:NOAA-GFDL/MOM6 into merge-bgc-obc
andrew-c-ross Mar 4, 2021
104201f
Cleanup missed merge
andrew-c-ross Mar 4, 2021
f57c8c7
Fix merge of MOM_generic_tracer.F90
andrew-c-ross Mar 4, 2021
528ccb6
Add null subroutine g_tracer_get_obc_segment_props
andrew-c-ross Mar 4, 2021
dd5edf7
Merge branch 'dev/gfdl' of github.com:NOAA-GFDL/MOM6 into merge-bgc-obc
andrew-c-ross Mar 19, 2021
43ba2bf
Merge branch 'dev/gfdl' of github.com:NOAA-GFDL/MOM6 into merge-bgc-obc
andrew-c-ross Mar 29, 2021
5d36c1c
Merge branch 'dev/gfdl' of github.com:NOAA-GFDL/MOM6 into merge-bgc-obc
andrew-c-ross Apr 1, 2021
32038a2
Merge branch 'dev/gfdl' of github.com:NOAA-GFDL/MOM6 into merge-bgc-obc
andrew-c-ross Apr 19, 2021
1e17178
Merge branch 'dev/gfdl' of https://github.com/NOAA-GFDL/MOM6 into mer…
andrew-c-ross Aug 3, 2021
dfcd0d4
Fix for array already allocated
Aug 4, 2021
b33c000
Allow OBC segment data to update with a different period for OBGC tra…
nikizadehgfdl Aug 4, 2021
e4bd8eb
Allow OBC segment data to update with a different period for OBGC tra…
nikizadehgfdl Aug 4, 2021
201288e
Place call call_tracer_register in the correct order to avoid having …
Aug 4, 2021
2616a34
Merge pull request #1 from nikizadehgfdl/obgc_obc_seg_data_update_period
andrew-c-ross Aug 5, 2021
a81f4f2
Merge branch 'merge-bgc-obc' of github.com:andrew-c-ross/MOM6 into me…
andrew-c-ross Aug 5, 2021
51b3acb
Merge branch 'dev/gfdl' of https://github.com/NOAA-GFDL/MOM6 into mer…
andrew-c-ross Aug 5, 2021
327b089
Merge branch 'main' of https://github.com/mom-ocean/MOM6 into merge-b…
andrew-c-ross Dec 27, 2021
abdcc22
Merge NOAA-GFDL dev/gfdl
andrew-c-ross Dec 27, 2021
d9fffc2
Attempt to fix errors from merge
andrew-c-ross Dec 27, 2021
1ec41d5
Stray typo
andrew-c-ross Dec 27, 2021
4ca2bcf
Remove duplicated tracer register from merge
andrew-c-ross Dec 27, 2021
11bfe14
Allow obgc tracers have different reservoir length scales
nikizadehgfdl Jan 7, 2022
7bac290
Allow obgc tracers have different reservoir length scales
nikizadehgfdl Jan 10, 2022
1902a8a
Merge pull request #2 from nikizadehgfdl/obgc_tracer_reservoir_length…
andrew-c-ross Jan 11, 2022
2dcc761
Fix restart issue for OBC, reservoir length scale zero
nikizadehgfdl Dec 23, 2021
159ba65
Fix restart issue step 1
nikizadehgfdl Apr 6, 2022
5ee87fc
Fix restart issue step 2
nikizadehgfdl Apr 12, 2022
e039d54
Merge pull request #3 from nikizadehgfdl/merge-bgc-obc-3_fix_restart
andrew-c-ross May 24, 2022
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
11 changes: 11 additions & 0 deletions config_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module g_tracer_utils
character(len=fm_string_len) :: src_var_name !< Tracer source variable name
character(len=fm_string_len) :: src_var_unit !< Tracer source variable units
character(len=fm_string_len) :: src_var_gridspec !< Tracer source grid file name
character(len=fm_string_len) :: obc_src_file_name !< Boundary condition tracer source filename
character(len=fm_string_len) :: obc_src_field_name !< Boundary condition tracer source fieldname
integer :: src_var_record !< Unknown
logical :: requires_src_info = .false. !< Unknown
real :: src_var_unit_conversion = 1.0 !< This factor depends on the tracer. Ask Jasmin
Expand Down Expand Up @@ -61,6 +63,7 @@ module g_tracer_utils
public :: g_tracer_get_next
public :: g_tracer_is_prog
public :: g_diag_type
public :: g_tracer_get_obc_segment_props

!> Set the values of various (array) members of the tracer node g_tracer_type
!!
Expand Down Expand Up @@ -286,6 +289,14 @@ subroutine g_tracer_get_next(g_tracer,g_tracer_next)
type(g_tracer_type), pointer :: g_tracer_next !< Pointer to the next tracer node in the list
end subroutine g_tracer_get_next

subroutine g_tracer_get_obc_segment_props(g_tracer_list, name, obc_has, src_file, src_var_name)
type(g_tracer_type), pointer :: g_tracer_list !< pointer to the head of the generic tracer list
type(g_tracer_type), pointer :: g_tracer !< Pointer to tracer node
character(len=*), intent(in) :: name
logical, intent(out):: obc_has !<.true. if This tracer has OBC
character(len=*),optional,intent(out):: src_file, src_var_name !<OBC source file and variable in file
end subroutine g_tracer_get_obc_segment_props

!>Vertical Diffusion of a tracer node
!!
!! This subroutine solves a tridiagonal equation to find and set values of vertically diffused field
Expand Down
44 changes: 38 additions & 6 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ module MOM
!! calculated, and if it is 0, dtbt is calculated every step.
type(time_type) :: dtbt_reset_interval !< A time_time representation of dtbt_reset_period.
type(time_type) :: dtbt_reset_time !< The next time DTBT should be calculated.
real :: dt_obc_seg_period!< The time interval between OBC segment updates for OBGC tracers
type(time_type) :: dt_obc_seg_interval !< A time_time representation of dt_obc_seg_period.
type(time_type) :: dt_obc_seg_time !< The next time OBC segment update is applied to OBGC tracers.

real, dimension(:,:), pointer :: frac_shelf_h => NULL() !< fraction of total area occupied
!! by ice shelf [nondim]
real, dimension(:,:,:), pointer :: &
Expand Down Expand Up @@ -1032,7 +1036,6 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &

integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB

real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)+1) :: eta_por ! layer interface heights
!! for porous topo. [Z ~> m or 1/eta_to_m]
G => CS%G ; GV => CS%GV ; US => CS%US ; IDs => CS%IDs
Expand Down Expand Up @@ -1078,6 +1081,17 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
call disable_averaging(CS%diag)
endif

!OBC segment data update for some fields can be less frequent than others
if(associated(CS%OBC)) then
CS%OBC%update_OBC_seg_data = .false.
if (CS%dt_obc_seg_period == 0.0) CS%OBC%update_OBC_seg_data = .true.
if (CS%dt_obc_seg_period > 0.0) then
if (Time_local >= CS%dt_obc_seg_time) then !### Change >= to > here.
CS%OBC%update_OBC_seg_data = .true.
CS%dt_obc_seg_time = CS%dt_obc_seg_time + CS%dt_obc_seg_interval
endif
endif
endif

if (CS%do_dynamics .and. CS%split) then !--------------------------- start SPLIT
! This section uses a split time stepping scheme for the dynamic equations,
Expand Down Expand Up @@ -1996,6 +2010,14 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
units="s", default=default_val, do_not_read=(dtbt > 0.0))
endif

CS%dt_obc_seg_period = -1.0
call get_param(param_file, "MOM", "DT_OBC_SEG_UPDATE_OBGC", CS%dt_obc_seg_period, &
"The time between OBC segment data updates for OBGC tracers. "//&
"This must be an integer multiple of DT and DT_THERM. "//&
"The default is set to DT.", &
units="s", default=CS%dt)


! This is here in case these values are used inappropriately.
use_frazil = .false. ; bound_salinity = .false.
CS%tv%P_Ref = 2.0e7*US%kg_m3_to_R*US%m_s_to_L_T**2
Expand Down Expand Up @@ -2400,11 +2422,6 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
CS%dyn_unsplit_CSp)
endif

! This subroutine calls user-specified tracer registration routines.
! Additional calls can be added to MOM_tracer_flow_control.F90.
call call_tracer_register(HI, GV, US, param_file, CS%tracer_flow_CSp, &
CS%tracer_Reg, restart_CSp)

call MEKE_alloc_register_restart(HI, param_file, CS%MEKE, restart_CSp)
call set_visc_register_restarts(HI, GV, param_file, CS%visc, restart_CSp)
call mixedlayer_restrat_register_restarts(HI, param_file, &
Expand Down Expand Up @@ -2433,7 +2450,16 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
! could occur with the call to update_OBC_data or after the main initialization.
if (use_temperature) &
call register_temp_salt_segments(GV, CS%OBC, CS%tracer_Reg, param_file)
endif

! This subroutine calls user-specified tracer registration routines.
! Additional calls can be added to MOM_tracer_flow_control.F90.
! Needs to be after registering temperature and salinity OBCs above,
! or else the user-specified tracers will be first.
call call_tracer_register(HI, GV, US, param_file, CS%tracer_flow_CSp, &
CS%tracer_Reg, restart_CSp, CS%OBC)

if (associated(CS%OBC)) then
! This needs the number of tracers and to have called any code that sets whether
! reservoirs are used.
call open_boundary_register_restarts(HI, GV, CS%OBC, CS%tracer_Reg, &
Expand Down Expand Up @@ -2728,6 +2754,12 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
CS%ntrunc, cont_stencil=CS%cont_stencil)
endif

!Set OBC segment data update period
if (associated(CS%OBC) .and. CS%dt_obc_seg_period > 0.0) then
CS%dt_obc_seg_interval = real_to_time(CS%dt_obc_seg_period)
CS%dt_obc_seg_time = Time + CS%dt_obc_seg_interval
endif

call callTree_waypoint("dynamics initialized (initialize_MOM)")

CS%mixedlayer_restrat = mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, &
Expand Down
Loading