-
Notifications
You must be signed in to change notification settings - Fork 82
Obc setup plus segment update period #198
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
Changes from 9 commits
c396956
b97954f
a544c7e
02a3d4e
6199f7c
8c112d7
6d239c0
e14cbf9
aaf3ab8
203fd4e
dd1624e
12ba409
6a08a45
e79d9b1
dba7cf8
96c46f0
7302599
6c486a4
be9be83
a7e608c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,7 +127,7 @@ module MOM | |
| use MOM_tracer_registry, only : lock_tracer_registry, tracer_registry_end | ||
| use MOM_tracer_flow_control, only : call_tracer_register, tracer_flow_control_CS | ||
| use MOM_tracer_flow_control, only : tracer_flow_control_init, call_tracer_surface_state | ||
| use MOM_tracer_flow_control, only : tracer_flow_control_end | ||
| use MOM_tracer_flow_control, only : tracer_flow_control_end, call_tracer_register_obc_segments | ||
| use MOM_transcribe_grid, only : copy_dyngrid_to_MOM_grid, copy_MOM_grid_to_dyngrid | ||
| use MOM_unit_scaling, only : unit_scale_type, unit_scaling_init | ||
| use MOM_unit_scaling, only : unit_scaling_end, fix_restart_unit_scaling | ||
|
|
@@ -289,7 +289,11 @@ module MOM | |
| !! barotropic time step [s]. If this is negative dtbt is never | ||
| !! 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. | ||
| 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 :: mass_shelf => NULL() !< Mass of ice shelf [R Z ~> kg m-2] | ||
|
|
@@ -1110,6 +1114,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, | ||
|
|
@@ -2071,6 +2086,13 @@ 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, & | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As written, this new parameter is being logged in every MOM_parameter_doc.all file, including in many where it is meaningless. Please add the argument |
||
| "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 | ||
|
|
@@ -2547,6 +2569,8 @@ 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, US, CS%OBC, CS%tracer_Reg, param_file) | ||
| !This is the equivalent call to register_temp_salt_segments for external tracers with OBC | ||
| call call_tracer_register_obc_segments(GV, param_file, CS%tracer_flow_CSp, CS%tracer_Reg, CS%OBC) | ||
|
|
||
| ! This needs the number of tracers and to have called any code that sets whether | ||
| ! reservoirs are used. | ||
|
|
@@ -2856,6 +2880,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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to test this, but I think setting this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess the reservoirs should also be initialized by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found a way to fix this issue with two comments that I've left below. |
||
| endif | ||
|
|
||
| call callTree_waypoint("dynamics initialized (initialize_MOM)") | ||
|
|
||
| CS%mixedlayer_restrat = mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, & | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.