Yet Another eXchange Tool 0.11.3
Loading...
Searching...
No Matches
xt_xmap_dist_dir_bucket_gen_f.f90
Go to the documentation of this file.
1!>
2!! @file xt_xmap_dist_dir_bucket_gen_f.f90
3!! @brief Fortran interface to yaxt bucket generator declarations
4!!
5!! @copyright Copyright (C) 2024 Jörg Behrens <behrens@dkrz.de>
6!! Moritz Hanke <hanke@dkrz.de>
7!! Thomas Jahns <jahns@dkrz.de>
8!!
9!! @author Jörg Behrens <behrens@dkrz.de>
10!! Moritz Hanke <hanke@dkrz.de>
11!! Thomas Jahns <jahns@dkrz.de>
12!!
13
14!
15! Keywords:
16! Maintainer: Jörg Behrens <behrens@dkrz.de>
17! Moritz Hanke <hanke@dkrz.de>
18! Thomas Jahns <jahns@dkrz.de>
19! URL: https://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
20!
21! Redistribution and use in source and binary forms, with or without
22! modification, are permitted provided that the following conditions are
23! met:
24!
25! Redistributions of source code must retain the above copyright notice,
26! this list of conditions and the following disclaimer.
27!
28! Redistributions in binary form must reproduce the above copyright
29! notice, this list of conditions and the following disclaimer in the
30! documentation and/or other materials provided with the distribution.
31!
32! Neither the name of the DKRZ GmbH nor the names of its contributors
33! may be used to endorse or promote products derived from this software
34! without specific prior written permission.
35!
36! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
37! IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
38! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
39! PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
40! OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
41! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
42! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
43! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
44! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
45! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47!
48#include "fc_feature_defs.inc"
49MODULE xt_xmap_dist_dir_bucket_gen
50 USE iso_c_binding, ONLY: c_ptr, c_null_ptr, c_associated
51 IMPLICIT NONE
52 PRIVATE
53
54 TYPE, PUBLIC, BIND(c) :: xt_xmdd_bucket_gen
55#ifndef __G95__
56 PRIVATE
57#endif
58 TYPE(c_ptr) :: cptr = c_null_ptr
59 END TYPE xt_xmdd_bucket_gen
60
61 INTERFACE
62 ! this function must not be implemented in Fortran because
63 ! PGI 11.x chokes on that
64 FUNCTION xt_xmdd_bucket_gen_f2c(gen) &
65 bind(c, name='xt_xmdd_bucket_gen_f2c') result(p)
66 IMPORT :: c_ptr, xt_xmdd_bucket_gen
67 IMPLICIT NONE
68 TYPE(xt_xmdd_bucket_gen), INTENT(in) :: gen
69 TYPE(c_ptr) :: p
70 END FUNCTION xt_xmdd_bucket_gen_f2c
71 END INTERFACE
72
74 PUBLIC :: xt_xmdd_bucket_gen_c2f, xt_xmdd_bucket_gen_f2c
75
76 INTERFACE xt_is_null
77 MODULE PROCEDURE xt_xmdd_bucket_gen_is_null
78 END INTERFACE xt_is_null
79 PUBLIC :: xt_is_null
80
81CONTAINS
82
83 FUNCTION xt_xmdd_bucket_gen_new() RESULT(gen)
84 TYPE(xt_xmdd_bucket_gen) :: gen
85 INTERFACE
86 FUNCTION xt_xmdd_bucket_gen_new_c() RESULT(gen) &
87 bind(c, name='xt_xmdd_bucket_gen_new')
88 IMPORT :: c_ptr
89 IMPLICIT NONE
90 TYPE(c_ptr) :: gen
91 END FUNCTION xt_xmdd_bucket_gen_new_c
92 END INTERFACE
93 gen%cptr = xt_xmdd_bucket_gen_new_c()
94 END FUNCTION xt_xmdd_bucket_gen_new
95
96 SUBROUTINE xt_xmdd_bucket_gen_delete(gen)
97 TYPE(xt_xmdd_bucket_gen), INTENT(in) :: gen
98 INTERFACE
99 SUBROUTINE xt_xmdd_bucket_gen_delete_c(gen) &
100 bind(c, name='xt_xmdd_bucket_gen_delete')
101 IMPORT :: c_ptr
102 IMPLICIT NONE
103 TYPE(c_ptr), VALUE, INTENT(in) :: gen
104 END SUBROUTINE xt_xmdd_bucket_gen_delete_c
105 END INTERFACE
106 CALL xt_xmdd_bucket_gen_delete_c(gen%cptr)
107 END SUBROUTINE xt_xmdd_bucket_gen_delete
108
109 FUNCTION xt_xmdd_bucket_gen_c2f(gen) RESULT(p)
110 TYPE(c_ptr), INTENT(in) :: gen
111 TYPE(xt_xmdd_bucket_gen) :: p
112 p%cptr = gen
113 END FUNCTION xt_xmdd_bucket_gen_c2f
114
115 FUNCTION xt_xmdd_bucket_gen_is_null(bucket_gen) RESULT(p)
116 TYPE(xt_xmdd_bucket_gen), INTENT(in) :: bucket_gen
117 LOGICAL :: p
118 p = .NOT. c_associated(bucket_gen%cptr)
119 END FUNCTION xt_xmdd_bucket_gen_is_null
120
121END MODULE xt_xmap_dist_dir_bucket_gen
122!
123! Local Variables:
124! f90-continuation-indent: 5
125! coding: utf-8
126! indent-tabs-mode: nil
127! show-trailing-whitespace: t
128! require-trailing-newline: t
129! End:
130!
Xt_xmdd_bucket_gen xt_xmdd_bucket_gen_new(void)
void xt_xmdd_bucket_gen_delete(Xt_xmdd_bucket_gen gen)
Xt_xmdd_bucket_gen xt_xmdd_bucket_gen_f2c(struct xt_xmdd_bucket_gen_f *p)
Definition yaxt_f2c.c:205