Skip to content

Commit

Permalink
Code changes to address reviewer's comments (#14)
Browse files Browse the repository at this point in the history
* Remove OVERLOAD_R8 directives regarding send_data_*d_r8 subroutines
* Add Doxygen comments to constants4.F90
  • Loading branch information
MinsukJi-NOAA authored Jan 14, 2022
1 parent 754f7e4 commit 740443d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 162 deletions.
8 changes: 4 additions & 4 deletions constants4/constants4.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ module constantsR4_mod
!! simulations (<13km) that will tax hardware resources.
#ifdef SMALL_EARTH
#if defined(DCMIP) || (defined(HIWPP) && defined(SUPER_K))
real(r4_kind), public, parameter :: small_fac = 1._r8_kind / 120._r8_kind ! only needed for supercell test
real(r4_kind), public, parameter :: small_fac = 1._r8_kind / 120._r8_kind !< Real(kind=4) variant of small_fac defined in constants/constants.F90
#elif defined(HIWPP)
real(r4_kind), public, parameter :: small_fac = 1._r8_kind / 166.7_r8_kind
real(r4_kind), public, parameter :: small_fac = 1._r8_kind / 166.7_r8_kind !< Real(kind=4) variant of small_fac defined in constants/constants.F90
#else
real(r4_kind), public, parameter :: small_fac = 1._r8_kind / 10._r8_kind
real(r4_kind), public, parameter :: small_fac = 1._r8_kind / 10._r8_kind !< Real(kind=4) variant of small_fac defined in constants/constants.F90
#endif
#else
real(r4_kind), public, parameter :: small_fac = 1._r8_kind
real(r4_kind), public, parameter :: small_fac = 1._r8_kind !< Real(kind=4) variant of small_fac defined in constants/constants.F90
#endif

#ifdef GFS_PHYS
Expand Down
158 changes: 0 additions & 158 deletions diag_manager/diag_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ MODULE diag_manager_mod
MODULE PROCEDURE send_data_1d
MODULE PROCEDURE send_data_2d
MODULE PROCEDURE send_data_3d
!#ifdef OVERLOAD_R8
! MODULE PROCEDURE send_data_0d_r8
! MODULE PROCEDURE send_data_1d_r8
! MODULE PROCEDURE send_data_2d_r8
! MODULE PROCEDURE send_data_3d_r8
!#endif
END INTERFACE

!> @brief Register a diagnostic field for a given module
Expand Down Expand Up @@ -1436,158 +1430,6 @@ LOGICAL FUNCTION send_data_2d(diag_field_id, field, time, is_in, js_in, &
END IF
END FUNCTION send_data_2d

!#ifdef OVERLOAD_R8
!
! !> @return true if send is successful
! LOGICAL FUNCTION send_data_0d_r8(diag_field_id, field, time, err_msg)
! INTEGER, INTENT(in) :: diag_field_id
! REAL(r8_kind), INTENT(in) :: field
! TYPE(time_type), INTENT(in), OPTIONAL :: time
! CHARACTER(len=*), INTENT(out), OPTIONAL :: err_msg
!
! REAL(r8_kind) :: field_out(1, 1, 1)
!
! ! If diag_field_id is < 0 it means that this field is not registered, simply return
! IF ( diag_field_id <= 0 ) THEN
! send_data_0d_r8 = .FALSE.
! RETURN
! END IF
! ! First copy the data to a three d array with last element 1
! field_out(1, 1, 1) = field
! send_data_0d_r8 = send_data_3d_r8(diag_field_id, field_out, time, err_msg=err_msg)
! END FUNCTION send_data_0d_r8
!
! !> @return true if send is successful
! LOGICAL FUNCTION send_data_1d_r8(diag_field_id, field, time, is_in, mask, rmask, ie_in, weight, err_msg)
! INTEGER, INTENT(in) :: diag_field_id
! REAL(r8_kind), DIMENSION(:), INTENT(in) :: field
! REAL, INTENT(in), OPTIONAL :: weight
! REAL, INTENT(in), DIMENSION(:), OPTIONAL :: rmask
! TYPE (time_type), INTENT(in), OPTIONAL :: time
! INTEGER, INTENT(in), OPTIONAL :: is_in, ie_in
! LOGICAL, INTENT(in), DIMENSION(:), OPTIONAL :: mask
! CHARACTER(len=*), INTENT(out), OPTIONAL :: err_msg
!
! REAL(r8_kind), DIMENSION(SIZE(field(:)), 1, 1) :: field_out
! LOGICAL, DIMENSION(SIZE(field(:)), 1, 1) :: mask_out
!
! ! If diag_field_id is < 0 it means that this field is not registered, simply return
! IF ( diag_field_id <= 0 ) THEN
! send_data_1d_r8 = .FALSE.
! RETURN
! END IF
!
! ! First copy the data to a three d array with last element 1
! field_out(:, 1, 1) = field
!
! ! Default values for mask
! IF ( PRESENT(mask) ) THEN
! mask_out(:, 1, 1) = mask
! ELSE
! mask_out = .TRUE.
! END IF
!
! IF ( PRESENT(rmask) ) WHERE (rmask < 0.5) mask_out(:, 1, 1) = .FALSE.
! IF ( PRESENT(mask) .OR. PRESENT(rmask) ) THEN
! IF ( PRESENT(is_in) .OR. PRESENT(ie_in) ) THEN
! send_data_1d_r8 = send_data_3d_r8(diag_field_id, field_out, time, is_in=is_in, js_in=1, ks_in=1,&
! & mask=mask_out, ie_in=ie_in, je_in=1, ke_in=1, weight=weight, err_msg=err_msg)
! ELSE
! send_data_1d_r8 = send_data_3d_r8(diag_field_id, field_out, time, mask=mask_out,&
! & weight=weight, err_msg=err_msg)
! END IF
! ELSE
! IF ( PRESENT(is_in) .OR. PRESENT(ie_in) ) THEN
! send_data_1d_r8 = send_data_3d_r8(diag_field_id, field_out, time, is_in=is_in, js_in=1, ks_in=1,&
! & ie_in=ie_in, je_in=1, ke_in=1, weight=weight, err_msg=err_msg)
! ELSE
! send_data_1d_r8 = send_data_3d_r8(diag_field_id, field_out, time, weight=weight, err_msg=err_msg)
! END IF
! END IF
! END FUNCTION send_data_1d_r8
! !> @return true if send is successful
! LOGICAL FUNCTION send_data_2d_r8(diag_field_id, field, time, is_in, js_in, &
! & mask, rmask, ie_in, je_in, weight, err_msg)
! INTEGER, INTENT(in) :: diag_field_id
! REAL(r8_kind), INTENT(in), DIMENSION(:,:) :: field
! REAL, INTENT(in), OPTIONAL :: weight
! TYPE (time_type), INTENT(in), OPTIONAL :: time
! INTEGER, INTENT(in), OPTIONAL :: is_in, js_in, ie_in, je_in
! LOGICAL, INTENT(in), DIMENSION(:,:), OPTIONAL :: mask
! REAL, INTENT(in), DIMENSION(:,:),OPTIONAL :: rmask
! CHARACTER(len=*), INTENT(out), OPTIONAL :: err_msg
!
! REAL, DIMENSION(SIZE(field,1),SIZE(field,2),1) :: field_out
! LOGICAL, DIMENSION(SIZE(field,1),SIZE(field,2),1) :: mask_out
!
! ! If diag_field_id is < 0 it means that this field is not registered, simply return
! IF ( diag_field_id <= 0 ) THEN
! send_data_2d_r8 = .FALSE.
! RETURN
! END IF
!
! ! First copy the data to a three d array with last element 1
! field_out(:, :, 1) = field
!
! ! Default values for mask
! IF ( PRESENT(mask) ) THEN
! mask_out(:, :, 1) = mask
! ELSE
! mask_out = .TRUE.
! END IF
!
! IF ( PRESENT(rmask) ) WHERE ( rmask < 0.5 ) mask_out(:, :, 1) = .FALSE.
! IF ( PRESENT(mask) .OR. PRESENT(rmask) ) THEN
! send_data_2d_r8 = send_data_3d(diag_field_id, field_out, time, is_in=is_in, js_in=js_in, ks_in=1, mask=mask_out,&
! & ie_in=ie_in, je_in=je_in, ke_in=1, weight=weight, err_msg=err_msg)
! ELSE
! send_data_2d_r8 = send_data_3d(diag_field_id, field_out, time, is_in=is_in, js_in=js_in, ks_in=1,&
! & ie_in=ie_in, je_in=je_in, ke_in=1, weight=weight, err_msg=err_msg)
! END IF
! END FUNCTION send_data_2d_r8
!
! !> @return true if send is successful
! LOGICAL FUNCTION send_data_3d_r8(diag_field_id, field, time, is_in, js_in, ks_in, &
! & mask, rmask, ie_in, je_in, ke_in, weight, err_msg)
! INTEGER, INTENT(in) :: diag_field_id
! REAL(r8_kind), INTENT(in), DIMENSION(:,:,:) :: field
! REAL, INTENT(in), OPTIONAL :: weight
! TYPE (time_type), INTENT(in), OPTIONAL :: time
! INTEGER, INTENT(in), OPTIONAL :: is_in, js_in, ks_in,ie_in,je_in, ke_in
! LOGICAL, INTENT(in), DIMENSION(:,:,:), OPTIONAL :: mask
! REAL, INTENT(in), DIMENSION(:,:,:),OPTIONAL :: rmask
! CHARACTER(len=*), INTENT(out), OPTIONAL :: err_msg
!
! REAL, DIMENSION(SIZE(field,1),SIZE(field,2),size(field,3)) :: field_out
! LOGICAL, DIMENSION(SIZE(field,1),SIZE(field,2),size(field,3)) :: mask_out
!
! ! If diag_field_id is < 0 it means that this field is not registered, simply return
! IF ( diag_field_id <= 0 ) THEN
! send_data_3d_r8 = .FALSE.
! RETURN
! END IF
!
! ! First copy the data to a three d array with last element 1
! field_out = field
!
! ! Default values for mask
! IF ( PRESENT(mask) ) THEN
! mask_out = mask
! ELSE
! mask_out = .TRUE.
! END IF
!
! IF ( PRESENT(rmask) ) WHERE ( rmask < 0.5 ) mask_out = .FALSE.
! IF ( PRESENT(mask) .OR. PRESENT(rmask) ) THEN
! send_data_3d_r8 = send_data_3d(diag_field_id, field_out, time, is_in=is_in, js_in=js_in, ks_in=ks_in, mask=mask_out,&
! & ie_in=ie_in, je_in=je_in, ke_in=ke_in, weight=weight, err_msg=err_msg)
! ELSE
! send_data_3d_r8 = send_data_3d(diag_field_id, field_out, time, is_in=is_in, js_in=js_in, ks_in=ks_in,&
! & ie_in=ie_in, je_in=je_in, ke_in=ke_in, weight=weight, err_msg=err_msg)
! END IF
! END FUNCTION send_data_3d_r8
!#endif

!> @return true if send is successful
LOGICAL FUNCTION send_data_3d(diag_field_id, field, time, is_in, js_in, ks_in, &
& mask, rmask, ie_in, je_in, ke_in, weight, err_msg)
Expand Down

0 comments on commit 740443d

Please sign in to comment.