Skip to content

add log_diag_field_info to dmUpdate#1090

Merged
thomas-robinson merged 15 commits into
NOAA-GFDL:dmUpdatefrom
rem1776:log_field
Apr 21, 2023
Merged

add log_diag_field_info to dmUpdate#1090
thomas-robinson merged 15 commits into
NOAA-GFDL:dmUpdatefrom
rem1776:log_field

Conversation

@rem1776
Copy link
Copy Markdown
Contributor

@rem1776 rem1776 commented Dec 12, 2022

Description
adds the log_diag_field_info calls for the modern diag's register routines.

How Has This Been Tested?
intel and gnu on amd

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

@rem1776 rem1776 marked this pull request as ready for review December 13, 2022 19:39
Copy link
Copy Markdown
Member

@thomas-robinson thomas-robinson left a comment

Choose a reason for hiding this comment

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

By trying to make the code more easy to understand by renaming the variable, I think you added complexity that requires mental gymnastics and unnecessary code execution further down the call stack.

Comment thread diag_manager/diag_manager.F90 Outdated
& units=units, missing_value=missing_value, var_range=range, mask_variant=mask_variant, &
& standard_name=standard_name, verbose=verbose, do_not_log=do_not_log, err_msg=err_msg, &
& interp_method=interp_method, tile_count=tile_count, area=area, volume=volume, realm=realm)
& standard_name=standard_name, verbose=verbose, do_not_log=.not.(do_diag_field_log.AND.allow_log), &
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is adding unneeded complexity. do_not_log is optional, so if it's not present, then it won't be passed on because it's optional in the next routine (register_diag_field_array) as well.

You should move this logic to where it's actually used instead of now actually passing something to do_not_log.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The logic basically prints the log if either the nml flag or do_not_log is set to output , I added it here cause I needed the nml flag and this was the last place where it would be accessible.

I'm gonna change it around anyway so I might take out the do_not_log from the object's register routine if it ends up being useless (which seems likely)

Comment thread diag_manager/diag_manager.F90 Outdated
& long_name=long_name, units=units, missing_value=missing_value, range=range, mask_variant=mask_variant, &
& standard_name=standard_name, dynamic=DYNAMIC, do_not_log=do_not_log, interp_method=interp_method,&
& tile_count=tile_count, area=area, volume=volume, realm=realm)
& standard_name=standard_name, dynamic=DYNAMIC, do_not_log=.not.(do_diag_field_log.AND.allow_log), &
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is the same comment as above.

Comment thread diag_manager/diag_manager.F90 Outdated
INTEGER, OPTIONAL, INTENT(IN) :: diag_model_subset
INTEGER, DIMENSION(6), OPTIONAL, INTENT(IN) :: time_init !< Model time diag_manager initialized
CHARACTER(len=*), INTENT(out), OPTIONAL :: err_msg
CHARACTER(len=1), INTENT(in), OPTIONAL :: logfile_separator !< character to use as a csv-style data field separator
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could just as easily be a module or namelist variable. Then you don't need to change the interface at all

Comment thread diag_manager/fms_diag_object.F90 Outdated
!! code uses a do_not_log parameter in the registration calls,
!! and subsequently calls this subroutine to log field information
!! under a generic name.
SUBROUTINE fms_log_field_info(module_name, field_name, axes, long_name, units,&
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this routine used by both old and new? Do we need two?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This routine is only used by the new. Its pretty similar to the old but some info needed to come from the diag object, also it has the changes for the separator and writes the header instead of doing that in the init.

My thinking was that if theres a new register routine in a separate file it would make sense to add a new log routine too. I think I'll change it though, it will simplifiy the do_not_log logic as well if I just make some changes to the original and use that for both.

@rem1776 rem1776 mentioned this pull request Feb 16, 2023
8 tasks
@thomas-robinson
Copy link
Copy Markdown
Member

@rem1776 This kind of fell by the wayside. Is this PR needed anymore?

@rem1776
Copy link
Copy Markdown
Contributor Author

rem1776 commented Apr 6, 2023

@rem1776 This kind of fell by the wayside. Is this PR needed anymore?

Yeah we'll still need some changes to get the routine working with the objects, I'll update this.

@thomas-robinson thomas-robinson merged commit 659bc33 into NOAA-GFDL:dmUpdate Apr 21, 2023
rem1776 added a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 added a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 added a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 added a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 added 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