1 | MODULE IDATA |
---|
2 | USE, INTRINSIC :: ISO_C_BINDING |
---|
3 | USE ICONTEXT |
---|
4 | |
---|
5 | INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 |
---|
6 | |
---|
7 | SUBROUTINE xios_dtreatment_start(context_hdl, filetype, comm_client_server, comm_server) BIND(C) |
---|
8 | USE ISO_C_BINDING |
---|
9 | INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl |
---|
10 | INTEGER (kind = C_INT) , VALUE :: filetype, comm_client_server, comm_server |
---|
11 | END SUBROUTINE xios_dtreatment_start |
---|
12 | |
---|
13 | SUBROUTINE xios_dtreatment_end() BIND(C) |
---|
14 | ! Sans argument |
---|
15 | END SUBROUTINE xios_dtreatment_end |
---|
16 | |
---|
17 | SUBROUTINE xios_write_data_k81(fieldid, fieldid_size, data_k8, data_Xsize) BIND(C) |
---|
18 | USE ISO_C_BINDING |
---|
19 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid |
---|
20 | REAL (kind = C_DOUBLE), DIMENSION(*) :: data_k8 |
---|
21 | INTEGER (kind = C_INT) , VALUE :: fieldid_size |
---|
22 | INTEGER (kind = C_INT) , VALUE :: data_Xsize |
---|
23 | END SUBROUTINE xios_write_data_k81 |
---|
24 | |
---|
25 | SUBROUTINE xios_write_data_k82(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize) BIND(C) |
---|
26 | USE ISO_C_BINDING |
---|
27 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid |
---|
28 | REAL (kind = C_DOUBLE), DIMENSION(*) :: data_k8 |
---|
29 | INTEGER (kind = C_INT) , VALUE :: fieldid_size |
---|
30 | INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize |
---|
31 | END SUBROUTINE xios_write_data_k82 |
---|
32 | |
---|
33 | SUBROUTINE xios_write_data_k83(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C) |
---|
34 | USE ISO_C_BINDING |
---|
35 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid |
---|
36 | REAL (kind = C_DOUBLE), DIMENSION(*) :: data_k8 |
---|
37 | INTEGER (kind = C_INT) , VALUE :: fieldid_size |
---|
38 | INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize, data_Zsize |
---|
39 | END SUBROUTINE xios_write_data_k83 |
---|
40 | |
---|
41 | SUBROUTINE xios_write_data_k41(fieldid, fieldid_size, data_k4, data_Xsize) BIND(C) |
---|
42 | USE ISO_C_BINDING |
---|
43 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid |
---|
44 | REAL (kind = C_FLOAT) , DIMENSION(*) :: data_k4 |
---|
45 | INTEGER (kind = C_INT) , VALUE :: fieldid_size |
---|
46 | INTEGER (kind = C_INT) , VALUE :: data_Xsize |
---|
47 | END SUBROUTINE xios_write_data_k41 |
---|
48 | |
---|
49 | SUBROUTINE xios_write_data_k42(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize) BIND(C) |
---|
50 | USE ISO_C_BINDING |
---|
51 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid |
---|
52 | REAL (kind = C_FLOAT) , DIMENSION(*) :: data_k4 |
---|
53 | INTEGER (kind = C_INT) , VALUE :: fieldid_size |
---|
54 | INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize |
---|
55 | END SUBROUTINE xios_write_data_k42 |
---|
56 | |
---|
57 | SUBROUTINE xios_write_data_k43(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize, data_Zsize) BIND(C) |
---|
58 | USE ISO_C_BINDING |
---|
59 | CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid |
---|
60 | REAL (kind = C_FLOAT) , DIMENSION(*) :: data_k4 |
---|
61 | INTEGER (kind = C_INT) , VALUE :: fieldid_size |
---|
62 | INTEGER (kind = C_INT) , VALUE :: data_Xsize, data_Ysize, data_Zsize |
---|
63 | END SUBROUTINE xios_write_data_k43 |
---|
64 | |
---|
65 | END INTERFACE |
---|
66 | |
---|
67 | CONTAINS ! Fonctions disponibles pour les utilisateurs. |
---|
68 | |
---|
69 | SUBROUTINE dtreatment_start(context_hdl, filetype, comm_client_server, comm_server) |
---|
70 | TYPE(XContextHandle), INTENT(IN), VALUE :: context_hdl |
---|
71 | INTEGER , INTENT(IN), OPTIONAL :: filetype , comm_client_server , comm_server |
---|
72 | INTEGER :: filetype_, comm_client_server_, comm_server_ |
---|
73 | IF (PRESENT(filetype)) THEN |
---|
74 | filetype_ = filetype |
---|
75 | ELSE |
---|
76 | filetype_ = NETCDF4 |
---|
77 | END IF |
---|
78 | IF (PRESENT(comm_client_server)) THEN |
---|
79 | comm_client_server_ = comm_client_server |
---|
80 | ELSE |
---|
81 | comm_client_server_ = -1 |
---|
82 | END IF |
---|
83 | IF (PRESENT(comm_server)) THEN |
---|
84 | comm_server_ = comm_server |
---|
85 | ELSE |
---|
86 | comm_server_ = -1 |
---|
87 | END IF |
---|
88 | CALL context_set_current(context_hdl) |
---|
89 | CALL xios_dtreatment_start(context_hdl%daddr, filetype_, comm_client_server_, comm_server_) |
---|
90 | END SUBROUTINE dtreatment_start |
---|
91 | |
---|
92 | SUBROUTINE dtreatment_end(context_hdl) |
---|
93 | TYPE(XContextHandle), INTENT(IN), VALUE :: context_hdl |
---|
94 | CALL context_set_current(context_hdl) |
---|
95 | CALL xios_dtreatment_end() |
---|
96 | END SUBROUTINE dtreatment_end |
---|
97 | |
---|
98 | SUBROUTINE write_data_k81(fieldid, data1d_k8) |
---|
99 | CHARACTER(len = *) , INTENT(IN) :: fieldid |
---|
100 | REAL (kind = 8), DIMENSION(*), INTENT(IN) :: data1d_k8(:) |
---|
101 | CALL xios_write_data_k81(fieldid, len(fieldid), data1d_k8, size(data1d_k8, 1)) |
---|
102 | END SUBROUTINE write_data_k81 |
---|
103 | |
---|
104 | SUBROUTINE write_data_k82(fieldid, data2d_k8) |
---|
105 | CHARACTER(len = *) , INTENT(IN) :: fieldid |
---|
106 | REAL (kind = 8), DIMENSION(*), INTENT(IN) :: data2d_k8(:,:) |
---|
107 | CALL xios_write_data_k82(fieldid, len(fieldid), data2d_k8, size(data2d_k8, 1), size(data2d_k8, 2)) |
---|
108 | END SUBROUTINE write_data_k82 |
---|
109 | |
---|
110 | SUBROUTINE write_data_k83(fieldid, data3d_k8) |
---|
111 | CHARACTER(len = *) , INTENT(IN) :: fieldid |
---|
112 | REAL (kind = 8), DIMENSION(*), INTENT(IN) :: data3d_k8(:,:,:) |
---|
113 | CALL xios_write_data_k83(fieldid, len(fieldid), data3d_k8, size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3)) |
---|
114 | END SUBROUTINE write_data_k83 |
---|
115 | |
---|
116 | SUBROUTINE write_data_k41(fieldid, data1d_k4) |
---|
117 | CHARACTER(len = *) , INTENT(IN) :: fieldid |
---|
118 | REAL (kind = 4), DIMENSION(*), INTENT(IN) :: data1d_k4(:) |
---|
119 | CALL xios_write_data_k41(fieldid, len(fieldid), data1d_k4, size(data1d_k4, 1)) |
---|
120 | END SUBROUTINE write_data_k41 |
---|
121 | |
---|
122 | SUBROUTINE write_data_k42(fieldid, data2d_k4) |
---|
123 | CHARACTER(len = *) , INTENT(IN) :: fieldid |
---|
124 | REAL (kind = 4), DIMENSION(*), INTENT(IN) :: data2d_k4(:,:) |
---|
125 | CALL xios_write_data_k42(fieldid, len(fieldid), data2d_k4, size(data2d_k4, 1), size(data2d_k4, 2)) |
---|
126 | END SUBROUTINE write_data_k42 |
---|
127 | |
---|
128 | SUBROUTINE write_data_k43(fieldid, data3d_k4) |
---|
129 | CHARACTER(len = *) , INTENT(IN) :: fieldid |
---|
130 | REAL (kind = 4), DIMENSION(*), INTENT(IN) :: data3d_k4(:,:,:) |
---|
131 | CALL xios_write_data_k43(fieldid, len(fieldid), data3d_k4, size(data3d_k4, 1), size(data3d_k4, 2), size(data3d_k4, 3)) |
---|
132 | END SUBROUTINE write_data_k43 |
---|
133 | |
---|
134 | END MODULE IDATA |
---|