Skip to content

Commit

Permalink
Add calls to restart_registry_lock when using ODA in MOM_state_initia…
Browse files Browse the repository at this point in the history
…lization

To allow the ODA incremental counts (ncount) in the restart file, the restart registry is unlocked and then locked back again after the initialization of the ODA in MOM_state_initialization.
  • Loading branch information
abozec committed Mar 10, 2022
1 parent 6f6d4d6 commit ee5003c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module MOM_state_initialization
!use MOM_open_boundary, only : set_3D_OBC_data
use MOM_grid_initialize, only : initialize_masks, set_grid_metrics
use MOM_restart, only : restore_state, is_new_run, MOM_restart_CS
use MOM_restart, only : restart_registry_lock
use MOM_sponge, only : set_up_sponge_field, set_up_sponge_ML_density
use MOM_sponge, only : initialize_sponge, sponge_CS
use MOM_ALE_sponge, only : set_up_ALE_sponge_field, set_up_ALE_sponge_vel_field
Expand Down Expand Up @@ -515,7 +516,9 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, &
"If true, oda incremental updates will be applied "//&
"everywhere in the domain.", default=.false.)
if (use_oda_incupd) then
call restart_registry_lock(restart_CS, unlocked=.true.)
call initialize_oda_incupd_fixed(G, GV, US, oda_incupd_CSp, restart_CS)
call restart_registry_lock(restart_CS)
endif

! This is the end of the block of code that might have initialized fields
Expand Down

0 comments on commit ee5003c

Please sign in to comment.