Skip to content

Commit

Permalink
Merge pull request NOAA-EMC#267 from dkokron/hafs-rangeCheck3d
Browse files Browse the repository at this point in the history
Revert 2c8363e to allow compiler opt…
  • Loading branch information
laurenchilutti authored Jun 6, 2023
2 parents 4285e3f + b012ecf commit 49f15ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ add_library(FV3::fv3 ALIAS fv3)

set_property(SOURCE model/nh_utils.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}")
set_property(SOURCE model/fv_mapz.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "${FAST}")
set_property(SOURCE tools/fv_diagnostics.F90 APPEND_STRING PROPERTY COMPILE_FLAGS "-O0")

set_target_properties(fv3 PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/fv3)
target_include_directories(fv3 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include/fv3>
Expand Down
28 changes: 4 additions & 24 deletions tools/fv_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4270,20 +4270,9 @@ subroutine range_check_3d(qname, q, is, ie, js, je, n_g, km, pos, q_low, q_hi, b
integer year, month, day, hour, minute, second

if ( present(bad_range) ) bad_range = .false.
qmin = q(is,js,1)
qmax = qmin

do k=1,km
do j=js,je
do i=is,ie
if( q(i,j,k) < qmin ) then
qmin = q(i,j,k)
elseif( q(i,j,k) > qmax ) then
qmax = q(i,j,k)
endif
enddo
enddo
enddo
qmin=minval(q(is:ie,js:je,1:km))
qmax=maxval(q(is:ie,js:je,1:km))

call mp_reduce_min(qmin)
call mp_reduce_max(qmax)
Expand Down Expand Up @@ -4337,18 +4326,9 @@ subroutine range_check_2d(qname, q, is, ie, js, je, n_g, pos, q_low, q_hi, bad_r
integer year, month, day, hour, minute, second

if ( present(bad_range) ) bad_range = .false.
qmin = q(is,js)
qmax = qmin

do j=js,je
do i=is,ie
if( q(i,j) < qmin ) then
qmin = q(i,j)
elseif( q(i,j) > qmax ) then
qmax = q(i,j)
endif
enddo
enddo
qmin=minval(q(is:ie,js:je))
qmax=maxval(q(is:ie,js:je))

call mp_reduce_min(qmin)
call mp_reduce_max(qmax)
Expand Down

0 comments on commit 49f15ec

Please sign in to comment.