diff --git a/tests/orog/CMakeLists.txt b/tests/orog/CMakeLists.txt index 863a4d47d..97dbd4ec2 100644 --- a/tests/orog/CMakeLists.txt +++ b/tests/orog/CMakeLists.txt @@ -21,3 +21,7 @@ target_link_libraries(ftst_minmax orog_lib) add_executable(ftst_get_ll_angle ftst_get_ll_angle.F90) add_test(NAME orog-ftst_get_ll_angle COMMAND ftst_get_ll_angle) target_link_libraries(ftst_get_ll_angle orog_lib) + +add_executable(ftst_get_index ftst_get_index.F90) +add_test(NAME orog-ftst_get_index COMMAND ftst_get_index) +target_link_libraries(ftst_get_index orog_lib) diff --git a/tests/orog/ftst_get_index.F90 b/tests/orog/ftst_get_index.F90 new file mode 100644 index 000000000..d321192ff --- /dev/null +++ b/tests/orog/ftst_get_index.F90 @@ -0,0 +1,32 @@ + program test_get_index + + use orog_utils, only : get_index + + implicit none + + integer, parameter :: imn=360*120 + integer, parameter :: jmn=180*120 + integer, parameter :: npts=4 + + integer :: jst, jen, ilist(imn), numx + + real :: lono(npts), lato(npts) + real, parameter :: delxn=360.0/imn + + print*,'hello world' + + lato(1) = 0.0; lono(1) = 0.0 + lato(2) = 1.0; lono(2) = 0.5 + lato(3) = 0.0; lono(3) = 1.0 + lato(4) = -1.0; lono(4) = 0.5 + + ilist = -999 + + call get_index(imn,jmn,npts,lonO,latO,delxn,jst,jen,ilist,numx) + + print*,jst,jen,numx + + print*,ilist(1:numx) + + + end program test_get_index