Yet Another eXchange Tool 0.11.3
Loading...
Searching...
No Matches
test_initialized_finalized_f.f90
1!>
2!! @file test_initialized_finalized_f.f90
3!!
4!! @copyright Copyright (C) 2016 Jörg Behrens <behrens@dkrz.de>
5!! Moritz Hanke <hanke@dkrz.de>
6!! Thomas Jahns <jahns@dkrz.de>
7!!
8!! @author Jörg Behrens <behrens@dkrz.de>
9!! Moritz Hanke <hanke@dkrz.de>
10!! Thomas Jahns <jahns@dkrz.de>
11!!
12
13!
14! Keywords:
15! Maintainer: Jörg Behrens <behrens@dkrz.de>
16! Moritz Hanke <hanke@dkrz.de>
17! Thomas Jahns <jahns@dkrz.de>
18! URL: https://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
19!
20! Redistribution and use in source and binary forms, with or without
21! modification, are permitted provided that the following conditions are
22! met:
23!
24! Redistributions of source code must retain the above copyright notice,
25! this list of conditions and the following disclaimer.
26!
27! Redistributions in binary form must reproduce the above copyright
28! notice, this list of conditions and the following disclaimer in the
29! documentation and/or other materials provided with the distribution.
30!
31! Neither the name of the DKRZ GmbH nor the names of its contributors
32! may be used to endorse or promote products derived from this software
33! without specific prior written permission.
34!
35! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
36! IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
37! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
38! PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
39! OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46!
47#include "fc_feature_defs.inc"
48PROGRAM test_initialized_finalized_f
49 USE ftest_common, ONLY: init_mpi, finish_mpi, test_abort
50 USE iso_c_binding, ONLY: c_int
51 USE mpi
52 USE test_idxlist_utils, ONLY: test_err_count
53 USE yaxt, ONLY: xt_initialize, xt_finalize, &
55 IMPLICIT NONE
56 CHARACTER(len=*), PARAMETER :: filename = 'test_initialized_finalized_f.f90'
57
58 CALL init_mpi
59
60 IF (xt_initialized() .OR. xt_finalized()) &
61 CALL test_abort("ERROR: unexpected library state", filename, __line__)
62
63 CALL xt_initialize(mpi_comm_world)
64
65 IF (.NOT. xt_initialized() .OR. xt_finalized()) &
66 CALL test_abort("ERROR: unexpected library state", filename, __line__)
67
68 CALL xt_finalize
69
70 IF (.NOT. xt_initialized() .OR. .NOT. xt_finalized()) &
71 CALL test_abort("ERROR: unexpected library state", filename, __line__)
72
73 IF (test_err_count() /= 0_c_int) &
74 CALL test_abort("non-zero error count!", filename, __line__)
75 CALL finish_mpi
76
77END PROGRAM test_initialized_finalized_f
78!
79! Local Variables:
80! f90-continuation-indent: 5
81! coding: utf-8
82! indent-tabs-mode: nil
83! show-trailing-whitespace: t
84! require-trailing-newline: t
85! End:
86!
int xt_finalized(void)
void xt_initialize(MPI_Comm default_comm)
Definition xt_init.c:70
int xt_initialized(void)
void xt_finalize(void)
Definition xt_init.c:92