MOM6
MOM_unit_tests.F90
1 !> Invokes unit tests in all modules that have them
3 
4 ! This file is part of MOM6. See LICENSE.md for the license.
5 
6 use mom_error_handler, only : mom_error, fatal, is_root_pe
7 
8 use mom_string_functions, only : string_functions_unit_tests
9 use mom_remapping, only : remapping_unit_tests
10 use mom_neutral_diffusion, only : neutral_diffusion_unit_tests
11 use mom_diag_vkernels, only : diag_vkernels_unit_tests
12 
13 implicit none ; private
14 
15 public unit_tests
16 
17 contains
18 
19 !> Calls unit tests for other modules.
20 !! Note that if a unit test returns true, a FATAL error is triggered.
21 subroutine unit_tests(verbosity)
22  ! Arguments
23  integer, intent(in) :: verbosity !< The verbosity level
24  ! Local variables
25  logical :: verbose
26 
27  verbose = verbosity>=5
28 
29  if (is_root_pe()) then ! The following need only be tested on 1 PE
30  if (string_functions_unit_tests(verbose)) call mom_error(fatal, &
31  "MOM_unit_tests: string_functions_unit_tests FAILED")
32  if (remapping_unit_tests(verbose)) call mom_error(fatal, &
33  "MOM_unit_tests: remapping_unit_tests FAILED")
34  if (neutral_diffusion_unit_tests(verbose)) call mom_error(fatal, &
35  "MOM_unit_tests: neutralDiffusionUnitTests FAILED")
36  if (diag_vkernels_unit_tests(verbose)) call mom_error(fatal, &
37  "MOM_unit_tests: diag_vkernels_unit_tests FAILED")
38  endif
39 
40 end subroutine unit_tests
41 
42 end module mom_unit_tests
mom_diag_vkernels
Provides kernels for single-column interpolation, re-integration (re-mapping of integrated quantities...
Definition: MOM_diag_vkernels.F90:3
mom_string_functions
Handy functions for manipulating strings.
Definition: MOM_string_functions.F90:2
mom_remapping
Provides column-wise vertical remapping functions.
Definition: MOM_remapping.F90:2
mom_unit_tests
Invokes unit tests in all modules that have them.
Definition: MOM_unit_tests.F90:2
mom_error_handler
Routines for error handling and I/O management.
Definition: MOM_error_handler.F90:2
mom_neutral_diffusion
A column-wise toolbox for implementing neutral diffusion.
Definition: MOM_neutral_diffusion.F90:2