scan_3d_array_for_nans Subroutine

public subroutine scan_3d_array_for_nans(size_1, size_2, size_3, array, name)

Test if a double precision is a finite number

FT 11.02.2022


Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: size_1
integer, intent(in) :: size_2
integer, intent(in) :: size_3
double precision, intent(in), DIMENSION(:,:,:) :: array
character(len=*), intent(in) :: name

Calls

proc~~scan_3d_array_for_nans~~CallsGraph proc~scan_3d_array_for_nans scan_3d_array_for_nans proc~is_finite_number is_finite_number proc~scan_3d_array_for_nans->proc~is_finite_number

Called by

proc~~scan_3d_array_for_nans~~CalledByGraph proc~scan_3d_array_for_nans scan_3d_array_for_nans proc~read_boost_superimpose_tov_adm_id read_boost_superimpose_tov_adm_id proc~read_boost_superimpose_tov_adm_id->proc~scan_3d_array_for_nans proc~setup_standard_tpo_variables setup_standard_tpo_variables proc~setup_standard_tpo_variables->proc~scan_3d_array_for_nans interface~setup_standard_tpo_variables setup_standard_tpo_variables interface~setup_standard_tpo_variables->proc~setup_standard_tpo_variables program~construct_newtonian_binary construct_newtonian_binary program~construct_newtonian_binary->proc~read_boost_superimpose_tov_adm_id

Contents


Variables

Type Visibility Attributes Name Initial
integer, public :: i
integer, public :: j
integer, public :: k

Source Code

  SUBROUTINE scan_3d_array_for_nans( size_1, size_2, size_3, array, name )

    !***********************************************
    !
    !# Test if a double precision is a finite number
    !
    !  FT 11.02.2022
    !
    !***********************************************

    INTEGER,                            INTENT(IN):: size_1
    INTEGER,                            INTENT(IN):: size_2
    INTEGER,                            INTENT(IN):: size_3
    DOUBLE PRECISION, DIMENSION(:,:,:), INTENT(IN):: array
    CHARACTER(LEN=*),                   INTENT(IN):: name

    INTEGER:: i, j, k

    !$OMP PARALLEL DO DEFAULT( NONE ) &
    !$OMP             SHARED( array, size_1, size_2, size_3, name ) &
    !$OMP             PRIVATE( i, j, k )
    DO k= 1, size_3, 1
      DO j= 1, size_2, 1
        DO i= 1, size_1, 1

          IF(.NOT.is_finite_number(array(i,j,k)))THEN
            PRINT *, "** ERROR! The array ", name, "does not contain a ", &
                     "finite number at position ", "(", i, ",", j, ",", k, ")"
            PRINT *, " * ", name, "(", i, ",", j, ",", k, ")=", array(i,j,k)
            PRINT *
            STOP
          ENDIF

        ENDDO
      ENDDO
    ENDDO
    !$OMP END PARALLEL DO

  END SUBROUTINE scan_3d_array_for_nans