mam  v1.0
A Modal Aerosol Model
species.F90
Go to the documentation of this file.
1! Copyright (C) 2021 National Center for Atmospheric Research
2! SPDX-License-Identifier: Apache-2.0
3!
4!> \file
5!> Tests for the mam_species module
6
7!> Test module for the species_t type and related functions
9
10 implicit none
11
12 call test_species_t( )
13
14contains
15
16!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17
18 !> Tests for the \c species_t type
19 subroutine test_species_t( )
20
21 use mam_species, only : species_t
22 use musica_assert, onlY : assert, almost_equal
23 use musica_config, only : config_t
24 use musica_constants, only : dk => musica_dk
25
26 type(species_t) :: species
27 type(config_t) :: config
28
29 call config%from_file( "species_config.json" )
30 species = species_t( config )
31
32 call assert( 925498072, species%name( ) .eq. "foo" )
33
34 call assert( 297444708, species%volume__m3( 100.0_dk ) &
35 .eq. 100.0_dk / 814.0_dk )
36
37 call assert( 180314351, &
38 almost_equal( species%shortwave_refractive_index( 1 ), &
39 cmplx( 0.2_dk, 12.3_dk, kind = dk ) ) )
40 call assert( 712754854, &
41 almost_equal( species%shortwave_refractive_index( 3 ), &
42 cmplx( 1.0_dk, 3.2_dk, kind = dk ) ) )
43 call assert( 825073199, &
44 almost_equal( species%shortwave_refractive_index( 4 ), &
45 cmplx( 4.0_dk, 4.8_dk, kind = dk ) ) )
46 call assert( 654916295, &
47 almost_equal( species%longwave_refractive_index( 1 ), &
48 cmplx( 4.2_dk, 3.2_dk, kind = dk ) ) )
49 call assert( 149709890, &
50 almost_equal( species%longwave_refractive_index( 3 ), &
51 cmplx( -3.6_dk, 6.5_dk, kind = dk ) ) )
52 call assert( 879552985, &
53 almost_equal( species%longwave_refractive_index( 6 ), &
54 cmplx( 12.3_dk, 102.4_dk, kind = dk ) ) )
55
56 end subroutine test_species_t
57
58!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
59
60end program test_species
The species_t type and related functions.
Definition: species.F90:8
program test_species
Test module for the species_t type and related functions.
Definition: species.F90:8
subroutine test_species_t()
Tests for the species_t type.
Definition: species.F90:20