MOM6
MOM_unit_tests.F90
Go to the documentation of this file.
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 
13 
14 implicit none ; private
15 
16 public unit_tests
17 
18 contains
19 
20 !> Calls unit tests for other modules.
21 !! Note that if a unit test returns true, a FATAL error is triggered.
22 subroutine unit_tests(verbosity)
23  ! Arguments
24  integer, intent(in) :: verbosity !< The verbosity level
25  ! Local variables
26  logical :: verbose
27 
28  verbose = verbosity>=5
29 
30  if (is_root_pe()) then ! The following need only be tested on 1 PE
31  if (string_functions_unit_tests(verbose)) call mom_error(fatal, &
32  "MOM_unit_tests: string_functions_unit_tests FAILED")
33  if (remapping_unit_tests(verbose)) call mom_error(fatal, &
34  "MOM_unit_tests: remapping_unit_tests FAILED")
35  if (neutral_diffusion_unit_tests(verbose)) call mom_error(fatal, &
36  "MOM_unit_tests: neutralDiffusionUnitTests FAILED")
37  if (diag_vkernels_unit_tests(verbose)) call mom_error(fatal, &
38  "MOM_unit_tests: diag_vkernels_unit_tests FAILED")
39  if (near_boundary_unit_tests(verbose)) call mom_error(fatal, &
40  "MOM_unit_tests: near_boundary_unit_tests FAILED")
41 
42  endif
43 
44 end subroutine unit_tests
45 
46 end module mom_unit_tests
mom_unit_tests::unit_tests
subroutine, public unit_tests(verbosity)
Calls unit tests for other modules. Note that if a unit test returns true, a FATAL error is triggered...
Definition: MOM_unit_tests.F90:23
mom_diag_vkernels
Provides kernels for single-column interpolation, re-integration (re-mapping of integrated quantities...
Definition: MOM_diag_vkernels.F90:3
mom_remapping::remapping_unit_tests
logical function, public remapping_unit_tests(verbose)
Runs unit tests on remapping functions. Should only be called from a single/root thread Returns True ...
Definition: MOM_remapping.F90:1613
mom_string_functions
Handy functions for manipulating strings.
Definition: MOM_string_functions.F90:2
mom_diag_vkernels::diag_vkernels_unit_tests
logical function, public diag_vkernels_unit_tests(verbose)
Returns true if any unit tests for module MOM_diag_vkernels fail.
Definition: MOM_diag_vkernels.F90:169
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_lateral_boundary_diffusion
Calculates and applies diffusive fluxes as a parameterization of lateral mixing (non-neutral) by meso...
Definition: MOM_lateral_boundary_diffusion.F90:4
mom_error_handler::is_root_pe
logical function, public is_root_pe()
This returns .true. if the current PE is the root PE.
Definition: MOM_error_handler.F90:44
mom_lateral_boundary_diffusion::near_boundary_unit_tests
logical function, public near_boundary_unit_tests(verbose)
Unit tests for near-boundary horizontal mixing.
Definition: MOM_lateral_boundary_diffusion.F90:714
mom_error_handler::mom_error
subroutine, public mom_error(level, message, all_print)
This provides a convenient interface for writing an mpp_error message with run-time filter based on a...
Definition: MOM_error_handler.F90:72
mom_string_functions::string_functions_unit_tests
logical function, public string_functions_unit_tests(verbose)
Returns true if a unit test of string_functions fails.
Definition: MOM_string_functions.F90:314
mom_error_handler
Routines for error handling and I/O management.
Definition: MOM_error_handler.F90:2
mom_neutral_diffusion::neutral_diffusion_unit_tests
logical function, public neutral_diffusion_unit_tests(verbose)
Returns true if unit tests of neutral_diffusion functions fail. Otherwise returns false.
Definition: MOM_neutral_diffusion.F90:2024
mom_neutral_diffusion
A column-wise toolbox for implementing neutral diffusion.
Definition: MOM_neutral_diffusion.F90:2