Skip to content

Commit

Permalink
revert: log_diag_field_info argument changes (#1136)
Browse files Browse the repository at this point in the history
Co-authored-by: rem1776 <Ryan.Mulhall@noaa.gov>
  • Loading branch information
rem1776 and rem1776 authored Feb 16, 2023
1 parent ec2020a commit 4526cc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 1 addition & 7 deletions diag_manager/diag_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,7 @@ INTEGER FUNCTION register_static_field(module_name, field_name, axes, long_name,
! only writes log if do_diag_field_log is true in the namelist (default false)
! if do_diag_field_log is true and do_not_log arg is present as well, it will only print if do_not_log = false
IF ( do_diag_field_log.AND.allow_log ) THEN
axes_list=''
DO i = 1, SIZE(axes)
CALL get_diag_axis_name(axes(i),axis_name)
IF ( TRIM(axes_list) /= '' ) axes_list = TRIM(axes_list)//','
axes_list = TRIM(axes_list)//TRIM(axis_name)
END DO
CALL log_diag_field_info (module_name, field_name, axes, axes_list, &
CALL log_diag_field_info (module_name, field_name, axes, &
& long_name, units, missing_value=missing_value, range=range, &
& DYNAMIC=dynamic1)
END IF
Expand Down
13 changes: 11 additions & 2 deletions diag_manager/diag_util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,11 @@ END FUNCTION get_index
!! 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 log_diag_field_info(module_name, field_name, axes, axes_list, long_name, units,&
SUBROUTINE log_diag_field_info(module_name, field_name, axes, long_name, units,&
& missing_value, range, dynamic )
CHARACTER(len=*), INTENT(in) :: module_name !< Module name
CHARACTER(len=*), INTENT(in) :: field_name !< Field name
INTEGER, DIMENSION(:), INTENT(in) :: axes !< Axis IDs
CHARACTER(len=*), INTENT(in) :: axes_list !< Comma seperated list of axes names
CHARACTER(len=*), OPTIONAL, INTENT(in) :: long_name !< Long name for field.
CHARACTER(len=*), OPTIONAL, INTENT(in) :: units !< Unit of field.
CLASS(*), OPTIONAL, INTENT(in) :: missing_value !< Missing value value.
Expand All @@ -643,6 +642,9 @@ SUBROUTINE log_diag_field_info(module_name, field_name, axes, axes_list, long_na
INTEGER :: i
REAL :: missing_value_use !< Local copy of missing_value
REAL, DIMENSION(2) :: range_use !< Local copy of range
CHARACTER(len=256) :: axis_name, axes_list

IF ( .NOT.do_diag_field_log ) RETURN
IF ( mpp_pe().NE.mpp_root_pe() ) RETURN

! Fatal error if range is present and its extent is not 2.
Expand Down Expand Up @@ -715,6 +717,13 @@ SUBROUTINE log_diag_field_info(module_name, field_name, axes, axes_list, long_na
timeaxis = ''
END IF

axes_list=''
DO i = 1, SIZE(axes)
CALL get_diag_axis_name(axes(i),axis_name)
IF ( TRIM(axes_list) /= '' ) axes_list = TRIM(axes_list)//','
axes_list = TRIM(axes_list)//TRIM(axis_name)
END DO

WRITE (diag_log_unit,'(777a)') &
& TRIM(lmodule), field_log_separator, TRIM(lfield), field_log_separator, TRIM(lname), field_log_separator,&
& TRIM(lunits), field_log_separator, TRIM(numaxis), field_log_separator, TRIM(timeaxis), field_log_separator,&
Expand Down

0 comments on commit 4526cc9

Please sign in to comment.