Skip to content

Commit

Permalink
Merge branch 'develop' into feature/gdas_init.v16
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed May 19, 2021
2 parents 3f082ee + 42e39ae commit e7438e7
Show file tree
Hide file tree
Showing 9 changed files with 422 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/debug-docs-test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: test
run: |
cd ufs_utils/build/tests/chgres_cube/data
wget https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/ufs_utils/unit_tests/chgres_cube/gfs.v16.sfc.history.nc
wget -i files.txt
cd ../../..
ctest --rerun-failed --output-on-failure
export PATH="/home/runner/.local/bin:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
- name: test
run: |
cd ufs_utils/build/tests/chgres_cube/data
wget https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/ufs_utils/unit_tests/chgres_cube/gfs.v16.sfc.history.nc
wget -i files.txt
cd ../../..
ctest --rerun-failed --output-on-failure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-mac-nceplibs-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
- name: test
run: |
cd ufs_utils/build/tests/chgres_cube/data
wget https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/ufs_utils/unit_tests/chgres_cube/gfs.v16.sfc.history.nc
wget -i files.txt
cd ../../..
# Oversubscribe for OpenMPI to run more processes than CPUs
export OMPI_MCA_rmaps_base_oversubscribe=1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/netcdf-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ jobs:
- name: test
run: |
cd ufs_utils/build/tests/chgres_cube/data
wget https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/ufs_utils/unit_tests/chgres_cube/gfs.v16.sfc.history.nc
wget -i files.txt
cd ../../..
ctest --rerun-failed --output-on-failure
26 changes: 26 additions & 0 deletions sorc/chgres_cube.fd/input_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module input_data
type(esmf_field), public :: ps_input_grid !< surface pressure
type(esmf_field), public :: terrain_input_grid !< terrain height
type(esmf_field), public :: temp_input_grid !< temperature

type(esmf_field), public :: u_input_grid !< u/v wind at grid
type(esmf_field), public :: v_input_grid !< box center
type(esmf_field), public :: wind_input_grid !< 3-component wind
Expand Down Expand Up @@ -133,6 +134,7 @@ module input_data
public :: read_input_nst_data
public :: cleanup_input_nst_data
public :: check_soilt
public :: check_cnwat
public :: quicksort
public :: convert_winds

Expand Down Expand Up @@ -5239,6 +5241,7 @@ subroutine read_input_sfc_grib2_file(localpet)
dummy2d(:,:) = 0.0_esmf_kind_r4
endif
endif
call check_cnwat(dummy2d)
dummy2d_8= real(dummy2d,esmf_kind_r8)
print*,'cnwat ',maxval(dummy2d),minval(dummy2d)
endif
Expand Down Expand Up @@ -6639,4 +6642,27 @@ subroutine check_soilt(soilt, landmask, skint)
enddo
enddo
end subroutine check_soilt

!> When using GEFS data, some points on the target grid have
!> unreasonable canpy moisture content, so zero out any
!> locations with unrealistic canopy moisture values (>0.5).
!!
!! @param cnwat [input] 2-dimensional canopy moisture content
!! @author Larissa Reames CIMMS/NSSL

subroutine check_cnwat(cnwat)
implicit none
real(esmf_kind_r4), intent(inout) :: cnwat(i_input,j_input)

real(esmf_kind_r4) :: max_cnwat = 0.5

integer :: i, j

do i = 1,i_input
do j = 1,j_input
if (cnwat(i,j) .gt. max_cnwat) cnwat(i,j) = 0.0_esmf_kind_r4
enddo
enddo
end subroutine check_cnwat

end module input_data
11 changes: 11 additions & 0 deletions tests/chgres_cube/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ include_directories(${PROJECT_SOURCE_DIR})

# Copy necessary test files from the source data directory to the
# build data directory.
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/files.txt ${CMAKE_CURRENT_BINARY_DIR}/data/files.txt)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/config_fv3_tiled.nml ${CMAKE_CURRENT_BINARY_DIR}/data/config_fv3_tiled.nml)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
Expand Down Expand Up @@ -86,6 +88,15 @@ add_mpi_test(chgres_cube-ftst_convert_winds
NUMPROCS 3
TIMEOUT 60)

add_executable(ftst_read_sfc_netcdf ftst_read_sfc_netcdf.F90)
target_link_libraries(ftst_read_sfc_netcdf chgres_cube_lib)

# Cause test to be run with MPI.
add_mpi_test(chgres_cube-ftst_read_sfc_netcdf
EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/ftst_read_sfc_netcdf
NUMPROCS 1
TIMEOUT 60)

add_executable(ftst_read_nst_netcdf ftst_read_nst_netcdf.F90)
target_link_libraries(ftst_read_nst_netcdf chgres_cube_lib)

Expand Down
2 changes: 2 additions & 0 deletions tests/chgres_cube/data/files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/ufs_utils/unit_tests/chgres_cube/gfs.v16.sfc.history.nc
https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/ufs_utils/unit_tests/chgres_cube/gfs.v16.sfc2.history.nc
Loading

0 comments on commit e7438e7

Please sign in to comment.