Skip to content

Fix data_override issue introduced by present(gas_fields_ocn)#845

Merged
Hallberg-NOAA merged 1 commit into
mom-ocean:dev/gfdlfrom
nikizadehgfdl:fix_data_override
Aug 30, 2018
Merged

Fix data_override issue introduced by present(gas_fields_ocn)#845
Hallberg-NOAA merged 1 commit into
mom-ocean:dev/gfdlfrom
nikizadehgfdl:fix_data_override

Conversation

@nikizadehgfdl
Copy link
Copy Markdown
Contributor

  • commit 515d9283 has introduced a new path that OMIP initialization takes before the data_override_init() is being called in ocean_model_MOM.F90.
    This leads to OMIP experiments (as well as many ocean-ice-biogeochemistry models) to crash because they call data_override before data_override_init is called :
Image              PC                Routine            Line        Source
fms_MOM6_SIS2_com  000000000177DD86  mpp_mod_mp_mpp_er          69  mpp_util_mpi.inc
fms_MOM6_SIS2_com  0000000001657BCC  data_override_mod         581  data_override.F90
fms_MOM6_SIS2_com  000000000165127F  data_override_mod         762  data_override.F90
fms_MOM6_SIS2_com  000000000165733F  data_override_mod         636  data_override.F90
fms_MOM6_SIS2_com  0000000000F673EF  generic_abiotic_m        1043  generic_abiotic.F90
fms_MOM6_SIS2_com  0000000000DF4A2F  generic_tracer_mp         718  generic_tracer.F90
fms_MOM6_SIS2_com  0000000000C6E1A7  mom_generic_trace         872  MOM_generic_tracer.F90
fms_MOM6_SIS2_com  0000000000DF6488  mom_tracer_flow_c         835  MOM_tracer_flow_control.F90
fms_MOM6_SIS2_com  000000000078EAE7  mom_mp_extract_su        2889  MOM.F90
fms_MOM6_SIS2_com  0000000000772E28  ocean_model_mod_m         372  ocean_model_MOM.F90
fms_MOM6_SIS2_com  000000000041385A  coupler_main_IP_c        1837  coupler_main.F90
fms_MOM6_SIS2_com  000000000040A7BB  MAIN__                    611  coupler_main.F90
  • To fix this issue we leverage an existing data_override_init call which is being done at
    the right place, but only if some parameters are set.

- commit 515d928 in ocean_model_MOM.F90 has introduced a new path
  that initialization takes before the data_override_init() is being called.
  This leads to some ocean-ice-biogeochemistry model to crash because they
  call data_override before init is called for it:
Image              PC                Routine            Line        Source
fms_MOM6_SIS2_com  000000000177DD86  mpp_mod_mp_mpp_er          69  mpp_util_mpi.inc
fms_MOM6_SIS2_com  0000000001657BCC  data_override_mod         581  data_override.F90
fms_MOM6_SIS2_com  000000000165127F  data_override_mod         762  data_override.F90
fms_MOM6_SIS2_com  000000000165733F  data_override_mod         636  data_override.F90
fms_MOM6_SIS2_com  0000000000F673EF  generic_abiotic_m        1043  generic_abiotic.F90
fms_MOM6_SIS2_com  0000000000DF4A2F  generic_tracer_mp         718  generic_tracer.F90
fms_MOM6_SIS2_com  0000000000C6E1A7  mom_generic_trace         872  MOM_generic_tracer.F90
fms_MOM6_SIS2_com  0000000000DF6488  mom_tracer_flow_c         835  MOM_tracer_flow_control.F90
fms_MOM6_SIS2_com  000000000078EAE7  mom_mp_extract_su        2889  MOM.F90
fms_MOM6_SIS2_com  0000000000772E28  ocean_model_mod_m         372  ocean_model_MOM.F90
fms_MOM6_SIS2_com  000000000041385A  coupler_main_IP_c        1837  coupler_main.F90
fms_MOM6_SIS2_com  000000000040A7BB  MAIN__                    611  coupler_main.F90

- To fix this issue we leverage an existing data_override_init call which is being done at
  the right place, but only if some parameters are set.
@Hallberg-NOAA
Copy link
Copy Markdown
Collaborator

This PR is being tested with https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/5536.

@Hallberg-NOAA Hallberg-NOAA merged commit f7e79b3 into mom-ocean:dev/gfdl Aug 30, 2018
nikizadehgfdl added a commit to nikizadehgfdl/MOM6 that referenced this pull request Mar 15, 2019
- The OMIP models when run within MOM6 ESM4/v1.0.2 tag
  crash with
  FATAL from PE   118: data_override: failure in get_domain

- This is due to an interface change in MOM6.
- The fix is the same that was merged to dev/gfdl in PR mom-ocean#845
  It is to be applied to ESM4/v1.0.2 tag.
  Since that tag is not on a separate branch I don't know how to make a PR for it.
marshallward pushed a commit to marshallward/MOM6 that referenced this pull request Mar 14, 2025
* Move some parts of btstep() into subroutines

The short description of each routine is:
btstep_ubt_from_layer: Calculate the zonal and meridional velocity from the 3-D velocity.
btstep_find_Cor: Find the Coriolis force terms _zon and _mer.
btloop_setup: Set ubt, vbt, eta, find face areas, and set valid array size at the beginning of each barotropic loop.
btloop_setup_eta: A routine to set eta_pred and the running time integral of uhbt and vhbt.
btloop_setup_OBCs: Setup old or previous ubt, vbt, vbt, and vhbt for different OBC options before the next step in the btstep loop.
btloop_update_v:  Update meridional velocity.
btloop_update_u: Update zonal velocity.
btstep_layer_accel:  Calculate the zonal and meridional acceleration of each layer due to the barotropic calculation.

* Address issues with modularize btstep

  This commit builds upon the recent refactoring of MOM_barotropic.F90 by
correcting the openMP directives, dealing with use_old_coriolis_bracket_bug via
an optional argument to to btloop_update_v, simplifying what is done in
btstep_ubt_from_layer, restoring parentheses to btstep_layer_accel that are
needed for rotational symmetry with FMAs enabled and adding doxygen comments
describing several arguments.  All answers are bitwise identical.

* Replace btloop_setup with truncate_velocities

  Replaced btloop_setup with truncate_velocities and moved the halo updates
that had been in btloop_setup out of this routine, making it more functionally
targeted.  Also replaced the index range arguments to btloop_update_u and
btloop_update_v to simply pass the ranges that are used rather than having to
reconstruct them inside these routines.

  Doxygen comments were added to describe several arguments to the newly added
routines, and several comments were also added describing what the various calls
within btstep do.  All answers are bitwise identical.

* Replace btloop_setup_OBCs with store_u_for_OBCs

  Replace btloop_setup_OBCs with store_u_for_OBCS and store_v_for_OBCs for more
functional targeting and simpler routines.  Also because ubt_old and ubt_prev
were copies of the same thing, ubt_old is no longer used in btstep while
ubt_prev is set over a slightly larger loop range in store_u_for_OBCs, and
similarly for vbt_old and vbt_prev.  All answers are bitwise identical.

* Add separate doxygen comments in MOM_barotropic

  Added doxygen comments to describe all individual arguments, rather than
documenting them in groups, which should correct the previous problems with
failing testing.  Also avoided using a separate variables wt_accel_n and
wt_accel2_n in btstep.  All answers are bitwise identical.

* Change name of btloop_setup_eta

Change name of new routine btloop_setup_eta to btloop_eta_predictor.

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov>
Co-authored-by: Robert Hallberg <Robert.Hallberg@noaa.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea61.ncrc.gov>
edoyango pushed a commit to edoyango/MOM6 that referenced this pull request Mar 24, 2025
* Move some parts of btstep() into subroutines

The short description of each routine is:
btstep_ubt_from_layer: Calculate the zonal and meridional velocity from the 3-D velocity.
btstep_find_Cor: Find the Coriolis force terms _zon and _mer.
btloop_setup: Set ubt, vbt, eta, find face areas, and set valid array size at the beginning of each barotropic loop.
btloop_setup_eta: A routine to set eta_pred and the running time integral of uhbt and vhbt.
btloop_setup_OBCs: Setup old or previous ubt, vbt, vbt, and vhbt for different OBC options before the next step in the btstep loop.
btloop_update_v:  Update meridional velocity.
btloop_update_u: Update zonal velocity.
btstep_layer_accel:  Calculate the zonal and meridional acceleration of each layer due to the barotropic calculation.

* Address issues with modularize btstep

  This commit builds upon the recent refactoring of MOM_barotropic.F90 by
correcting the openMP directives, dealing with use_old_coriolis_bracket_bug via
an optional argument to to btloop_update_v, simplifying what is done in
btstep_ubt_from_layer, restoring parentheses to btstep_layer_accel that are
needed for rotational symmetry with FMAs enabled and adding doxygen comments
describing several arguments.  All answers are bitwise identical.

* Replace btloop_setup with truncate_velocities

  Replaced btloop_setup with truncate_velocities and moved the halo updates
that had been in btloop_setup out of this routine, making it more functionally
targeted.  Also replaced the index range arguments to btloop_update_u and
btloop_update_v to simply pass the ranges that are used rather than having to
reconstruct them inside these routines.

  Doxygen comments were added to describe several arguments to the newly added
routines, and several comments were also added describing what the various calls
within btstep do.  All answers are bitwise identical.

* Replace btloop_setup_OBCs with store_u_for_OBCs

  Replace btloop_setup_OBCs with store_u_for_OBCS and store_v_for_OBCs for more
functional targeting and simpler routines.  Also because ubt_old and ubt_prev
were copies of the same thing, ubt_old is no longer used in btstep while
ubt_prev is set over a slightly larger loop range in store_u_for_OBCs, and
similarly for vbt_old and vbt_prev.  All answers are bitwise identical.

* Add separate doxygen comments in MOM_barotropic

  Added doxygen comments to describe all individual arguments, rather than
documenting them in groups, which should correct the previous problems with
failing testing.  Also avoided using a separate variables wt_accel_n and
wt_accel2_n in btstep.  All answers are bitwise identical.

* Change name of btloop_setup_eta

Change name of new routine btloop_setup_eta to btloop_eta_predictor.

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov>
Co-authored-by: Robert Hallberg <Robert.Hallberg@noaa.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea61.ncrc.gov>
herrwang0 pushed a commit to herrwang0/MOM6 that referenced this pull request Mar 29, 2025
* Move some parts of btstep() into subroutines

The short description of each routine is:
btstep_ubt_from_layer: Calculate the zonal and meridional velocity from the 3-D velocity.
btstep_find_Cor: Find the Coriolis force terms _zon and _mer.
btloop_setup: Set ubt, vbt, eta, find face areas, and set valid array size at the beginning of each barotropic loop.
btloop_setup_eta: A routine to set eta_pred and the running time integral of uhbt and vhbt.
btloop_setup_OBCs: Setup old or previous ubt, vbt, vbt, and vhbt for different OBC options before the next step in the btstep loop.
btloop_update_v:  Update meridional velocity.
btloop_update_u: Update zonal velocity.
btstep_layer_accel:  Calculate the zonal and meridional acceleration of each layer due to the barotropic calculation.

* Address issues with modularize btstep

  This commit builds upon the recent refactoring of MOM_barotropic.F90 by
correcting the openMP directives, dealing with use_old_coriolis_bracket_bug via
an optional argument to to btloop_update_v, simplifying what is done in
btstep_ubt_from_layer, restoring parentheses to btstep_layer_accel that are
needed for rotational symmetry with FMAs enabled and adding doxygen comments
describing several arguments.  All answers are bitwise identical.

* Replace btloop_setup with truncate_velocities

  Replaced btloop_setup with truncate_velocities and moved the halo updates
that had been in btloop_setup out of this routine, making it more functionally
targeted.  Also replaced the index range arguments to btloop_update_u and
btloop_update_v to simply pass the ranges that are used rather than having to
reconstruct them inside these routines.

  Doxygen comments were added to describe several arguments to the newly added
routines, and several comments were also added describing what the various calls
within btstep do.  All answers are bitwise identical.

* Replace btloop_setup_OBCs with store_u_for_OBCs

  Replace btloop_setup_OBCs with store_u_for_OBCS and store_v_for_OBCs for more
functional targeting and simpler routines.  Also because ubt_old and ubt_prev
were copies of the same thing, ubt_old is no longer used in btstep while
ubt_prev is set over a slightly larger loop range in store_u_for_OBCs, and
similarly for vbt_old and vbt_prev.  All answers are bitwise identical.

* Add separate doxygen comments in MOM_barotropic

  Added doxygen comments to describe all individual arguments, rather than
documenting them in groups, which should correct the previous problems with
failing testing.  Also avoided using a separate variables wt_accel_n and
wt_accel2_n in btstep.  All answers are bitwise identical.

* Change name of btloop_setup_eta

Change name of new routine btloop_setup_eta to btloop_eta_predictor.

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov>
Co-authored-by: Robert Hallberg <Robert.Hallberg@noaa.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea61.ncrc.gov>
Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this pull request Apr 6, 2025
  Restore the parentheses to the expressions for PFv in btloop_update_v so that
the model will once again respect rotational symmetry when fused-multiply-adds
are enabled.  These parentheses were in the corresponding expressions until PR
mom-ocean#845 to dev/gfdl when they were inadvertently omitted.   This commit changes
answers (and restores rotational symmetry) when fused-multiply-adds are enabled.
Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this pull request Apr 7, 2025
  Restore the parentheses to the expressions for PFv in btloop_update_v so that
the model will once again respect rotational symmetry when fused-multiply-adds
are enabled.  These parentheses were in the corresponding expressions until PR
mom-ocean#845 to dev/gfdl when they were inadvertently omitted.   This commit changes
answers (and restores rotational symmetry) when fused-multiply-adds are enabled.
Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this pull request Apr 7, 2025
  Restore the parentheses to the expressions for PFv in btloop_update_v so that
the model will once again respect rotational symmetry when fused-multiply-adds
are enabled.  These parentheses were in the corresponding expressions until PR
mom-ocean#845 to dev/gfdl when they were inadvertently omitted.   This commit changes
answers (and restores rotational symmetry) when fused-multiply-adds are enabled.
edoyango pushed a commit to edoyango/MOM6 that referenced this pull request Apr 11, 2025
* Move some parts of btstep() into subroutines

The short description of each routine is:
btstep_ubt_from_layer: Calculate the zonal and meridional velocity from the 3-D velocity.
btstep_find_Cor: Find the Coriolis force terms _zon and _mer.
btloop_setup: Set ubt, vbt, eta, find face areas, and set valid array size at the beginning of each barotropic loop.
btloop_setup_eta: A routine to set eta_pred and the running time integral of uhbt and vhbt.
btloop_setup_OBCs: Setup old or previous ubt, vbt, vbt, and vhbt for different OBC options before the next step in the btstep loop.
btloop_update_v:  Update meridional velocity.
btloop_update_u: Update zonal velocity.
btstep_layer_accel:  Calculate the zonal and meridional acceleration of each layer due to the barotropic calculation.

* Address issues with modularize btstep

  This commit builds upon the recent refactoring of MOM_barotropic.F90 by
correcting the openMP directives, dealing with use_old_coriolis_bracket_bug via
an optional argument to to btloop_update_v, simplifying what is done in
btstep_ubt_from_layer, restoring parentheses to btstep_layer_accel that are
needed for rotational symmetry with FMAs enabled and adding doxygen comments
describing several arguments.  All answers are bitwise identical.

* Replace btloop_setup with truncate_velocities

  Replaced btloop_setup with truncate_velocities and moved the halo updates
that had been in btloop_setup out of this routine, making it more functionally
targeted.  Also replaced the index range arguments to btloop_update_u and
btloop_update_v to simply pass the ranges that are used rather than having to
reconstruct them inside these routines.

  Doxygen comments were added to describe several arguments to the newly added
routines, and several comments were also added describing what the various calls
within btstep do.  All answers are bitwise identical.

* Replace btloop_setup_OBCs with store_u_for_OBCs

  Replace btloop_setup_OBCs with store_u_for_OBCS and store_v_for_OBCs for more
functional targeting and simpler routines.  Also because ubt_old and ubt_prev
were copies of the same thing, ubt_old is no longer used in btstep while
ubt_prev is set over a slightly larger loop range in store_u_for_OBCs, and
similarly for vbt_old and vbt_prev.  All answers are bitwise identical.

* Add separate doxygen comments in MOM_barotropic

  Added doxygen comments to describe all individual arguments, rather than
documenting them in groups, which should correct the previous problems with
failing testing.  Also avoided using a separate variables wt_accel_n and
wt_accel2_n in btstep.  All answers are bitwise identical.

* Change name of btloop_setup_eta

Change name of new routine btloop_setup_eta to btloop_eta_predictor.

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov>
Co-authored-by: Robert Hallberg <Robert.Hallberg@noaa.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea61.ncrc.gov>
Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this pull request Apr 18, 2025
  Restore the parentheses to the expressions for Cor_v in btloop_update_v so
that the model will once again respect rotational symmetry when
fused-multiply-adds are enabled.  These parentheses were in the corresponding
expressions until PR mom-ocean#845 to dev/gfdl when they were inadvertently omitted.
This commit changes answers (and restores rotational symmetry) when
fused-multiply-adds are enabled.
Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this pull request Apr 19, 2025
  Restore the parentheses to the expressions for Cor_v in btloop_update_v so
that the model will once again respect rotational symmetry when
fused-multiply-adds are enabled.  These parentheses were in the corresponding
expressions until PR mom-ocean#845 to dev/gfdl when they were inadvertently omitted.
This commit changes answers (and restores rotational symmetry) when
fused-multiply-adds are enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants