Skip to content

Commit

Permalink
Merge pull request #216 from gustavo-marques/eval_main_03may2022
Browse files Browse the repository at this point in the history
Merge MOM6/main from 03 May 2022
  • Loading branch information
alperaltuntas authored May 19, 2022
2 parents 8f97b3d + 359cc90 commit b1eda27
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 12 deletions.
43 changes: 37 additions & 6 deletions config_src/infra/FMS1/MOM_diag_manager_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,15 @@ integer function register_static_field_infra(module_name, field_name, axes, long
integer, optional, intent(in) :: area !< Diagnostic ID of the field containing the area attribute
integer, optional, intent(in) :: volume !< Diagnostic ID of the field containing the volume attribute

register_static_field_infra = register_static_field_fms(module_name, field_name, axes, long_name, units,&
& missing_value, range, mask_variant, standard_name, dynamic=.false.,do_not_log=do_not_log, &
if(present(missing_value) .or. present(range)) then
register_static_field_infra = register_static_field_fms(module_name, field_name, axes, long_name, units,&
& missing_value, range, mask_variant=mask_variant, standard_name=standard_name, dynamic=.false.,&
do_not_log=do_not_log, interp_method=interp_method,tile_count=tile_count, area=area, volume=volume)
else
register_static_field_infra = register_static_field_fms(module_name, field_name, axes, long_name, units,&
& mask_variant=mask_variant, standard_name=standard_name, dynamic=.false.,do_not_log=do_not_log, &
interp_method=interp_method,tile_count=tile_count, area=area, volume=volume)
endif
end function register_static_field_infra

!> Returns true if the argument data are successfully passed to a diagnostic manager
Expand Down Expand Up @@ -267,7 +273,20 @@ logical function send_data_infra_1d(diag_field_id, field, is_in, ie_in, time, ma
character(len=*), optional, intent(out) :: err_msg !< A log indicating the status of the post upon
!! returning to the calling routine

send_data_infra_1d = send_data_fms(diag_field_id, field, time, is_in, mask, rmask, ie_in, weight, err_msg)
if(present(rmask) .or. present(weight)) then
if(present(rmask) .and. present(weight)) then
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, mask=mask, rmask=rmask, ie_in=ie_in,&
weight=weight, err_msg=err_msg)
elseif(present(rmask)) then
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, mask=mask, rmask=rmask, ie_in=ie_in,&
err_msg=err_msg)
elseif(present(weight)) then
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, ie_in=ie_in, weight=weight,&
err_msg=err_msg)
endif
else
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, ie_in=ie_in, err_msg=err_msg)
endif

end function send_data_infra_1d

Expand All @@ -289,9 +308,21 @@ logical function send_data_infra_2d(diag_field_id, field, is_in, ie_in, js_in, j
character(len=*), optional, intent(out) :: err_msg !< A log indicating the status of the post upon
!! returning to the calling routine

send_data_infra_2d = send_data_fms(diag_field_id, field, time, is_in, js_in, mask, &
rmask, ie_in, je_in, weight, err_msg)

if(present(rmask) .or. present(weight)) then
if(present(rmask) .and. present(weight)) then
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
rmask=rmask, ie_in=ie_in, je_in=je_in, weight=weight, err_msg=err_msg)
elseif(present(rmask)) then
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
rmask=rmask, ie_in=ie_in, je_in=je_in, err_msg=err_msg)
elseif(present(weight)) then
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
ie_in=ie_in, je_in=je_in, weight=weight, err_msg=err_msg)
endif
else
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
ie_in=ie_in, je_in=je_in, err_msg=err_msg)
endif
end function send_data_infra_2d

!> Returns true if the argument data are successfully passed to a diagnostic manager
Expand Down
43 changes: 37 additions & 6 deletions config_src/infra/FMS2/MOM_diag_manager_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,15 @@ integer function register_static_field_infra(module_name, field_name, axes, long
integer, optional, intent(in) :: area !< Diagnostic ID of the field containing the area attribute
integer, optional, intent(in) :: volume !< Diagnostic ID of the field containing the volume attribute

register_static_field_infra = register_static_field_fms(module_name, field_name, axes, long_name, units,&
& missing_value, range, mask_variant, standard_name, dynamic=.false.,do_not_log=do_not_log, &
if(present(missing_value) .or. present(range)) then
register_static_field_infra = register_static_field_fms(module_name, field_name, axes, long_name, units,&
& missing_value, range, mask_variant=mask_variant, standard_name=standard_name, dynamic=.false.,&
do_not_log=do_not_log, interp_method=interp_method,tile_count=tile_count, area=area, volume=volume)
else
register_static_field_infra = register_static_field_fms(module_name, field_name, axes, long_name, units,&
& mask_variant=mask_variant, standard_name=standard_name, dynamic=.false.,do_not_log=do_not_log, &
interp_method=interp_method,tile_count=tile_count, area=area, volume=volume)
endif
end function register_static_field_infra

!> Returns true if the argument data are successfully passed to a diagnostic manager
Expand Down Expand Up @@ -267,7 +273,20 @@ logical function send_data_infra_1d(diag_field_id, field, is_in, ie_in, time, ma
character(len=*), optional, intent(out) :: err_msg !< A log indicating the status of the post upon
!! returning to the calling routine

send_data_infra_1d = send_data_fms(diag_field_id, field, time, is_in, mask, rmask, ie_in, weight, err_msg)
if(present(rmask) .or. present(weight)) then
if(present(rmask) .and. present(weight)) then
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, mask=mask, rmask=rmask, ie_in=ie_in,&
weight=weight, err_msg=err_msg)
elseif(present(rmask)) then
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, mask=mask, rmask=rmask, ie_in=ie_in,&
err_msg=err_msg)
elseif(present(weight)) then
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, ie_in=ie_in, weight=weight,&
err_msg=err_msg)
endif
else
send_data_infra_1d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, ie_in=ie_in, err_msg=err_msg)
endif

end function send_data_infra_1d

Expand All @@ -289,9 +308,21 @@ logical function send_data_infra_2d(diag_field_id, field, is_in, ie_in, js_in, j
character(len=*), optional, intent(out) :: err_msg !< A log indicating the status of the post upon
!! returning to the calling routine

send_data_infra_2d = send_data_fms(diag_field_id, field, time, is_in, js_in, mask, &
rmask, ie_in, je_in, weight, err_msg)

if(present(rmask) .or. present(weight)) then
if(present(rmask) .and. present(weight)) then
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
rmask=rmask, ie_in=ie_in, je_in=je_in, weight=weight, err_msg=err_msg)
elseif(present(rmask)) then
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
rmask=rmask, ie_in=ie_in, je_in=je_in, err_msg=err_msg)
elseif(present(weight)) then
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
ie_in=ie_in, je_in=je_in, weight=weight, err_msg=err_msg)
endif
else
send_data_infra_2d = send_data_fms(diag_field_id, field, time=time, is_in=is_in, js_in=js_in, mask=mask, &
ie_in=ie_in, je_in=je_in, err_msg=err_msg)
endif
end function send_data_infra_2d

!> Returns true if the argument data are successfully passed to a diagnostic manager
Expand Down
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 b1eda27

Please sign in to comment.