Skip to content
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

Fix send_data race condition(?) + add send_data tests #1130

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

uramirez8707
Copy link
Contributor

Description

  • Fixes possible race condition in send_data where a local variable is declared with a variable (so it gets the save attribute added by default)
  • Fixes bug where a pointer was deallocated instead of nullifying it
  • Adds send_data calls to the tests
  • Adds a static file to the tests
  • Adds a debug option to unit tests for debugging specific diag_table features

Fixes # (issue)

How Has This Been Tested?
CI

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

@@ -1647,6 +1647,7 @@ LOGICAL FUNCTION send_data_3d(diag_field_id, field, time, is_in, js_in, ks_in, &
IF ( fms_error_handler('diag_manager_mod::send_data_3d', err_msg_local, err_msg) ) RETURN
END IF
if (use_modern_diag) then !> Set up array lengths for remapping
field_modern => null()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use nullify here I think...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think they do the same thing

if (id_y3 .ne. 4) call mpp_error(FATAL, "The y3 axis does not have the expected id")
if (id_ug .ne. 5) call mpp_error(FATAL, "The ug axis does not have the expected id")
if (id_z .ne. 6) call mpp_error(FATAL, "The z axis does not have the expected id")
if (.not. debug) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is debug supposed to do? Why are these checks in here if they are just being skipped? Are the test specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug is a namelist flag. when .true. it ignored the ids checks.

logical :: debug = .false. !< Flag used to ignore the axis/field_ids checks in the test.
!! Useful when using a portion or a different diag_table.yaml
namelist / test_modern_diag_nml / debug

This is going to be useful when debugging because I will be able to modify the diag_table.yaml to just include whatever feature I am debugging (like static fields, or diurnal fields, etc)

used = send_data(id_var6, var_data%var6, Time)
used = send_data(id_var7, var_data%var6, Time)

!TODO I don't know about this (scalar field) or how this is suppose to work #WUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll find out...

@thomas-robinson thomas-robinson merged commit 5b6ee81 into NOAA-GFDL:dmUpdate Feb 8, 2023
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
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