CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
run_unit_tests.F90
1program run_unit_tests
2 !! runs tempo unit tests
3 use iso_fortran_env, only : error_unit
4 use testdrive, only : run_testsuite, new_testsuite, testsuite_type
5 use test_tempo_utils_suite, only : collect_tempo_utils_suite
6 use test_tempo_init_suite, only : collect_tempo_init_suite
7 use test_tempo_main_suite, only : collect_tempo_main_suite
8 implicit none
9 integer :: stat, is
10 type(testsuite_type), allocatable :: testsuites(:)
11 character(len=*), parameter :: fmt = '("#", *(1x, a))'
12
13 stat = 0
14
15 testsuites = [ &
16 new_testsuite("tempo_utils_suite", collect_tempo_utils_suite), &
17 new_testsuite("tempo_init_suite", collect_tempo_init_suite), &
18 new_testsuite("tempo_main_suite", collect_tempo_main_suite) &
19 ]
20
21 do is = 1, size(testsuites)
22 write(error_unit, fmt) "Testing:", testsuites(is)%name
23 call run_testsuite(testsuites(is)%collect, error_unit, stat)
24 end do
25
26 if (stat > 0) then
27 write(error_unit, '(i0, 1x, a)') stat, "test(s) failed!"
28 error stop
29 end if
30
31end program run_unit_tests
subroutine error(parameters, swdown,fsa,fsr,fira,fsh,fcev, fgev,fctr,ssoil,beg_wb,canliq,canice, sneqv,wa,smc,dzsnso,prcp,ecan, etran,edir,runsrf,runsub,dt,nsoil, nsnow,ist,errwat, iloc,jloc,fveg, sav,sag,fsrv,fsrg,zwt,pah, ifdef ccpp
check surface energy balance and water balance.