1 | #include "xios_fortran_prefix.hpp" |
---|
2 | |
---|
3 | MODULE ICALENDAR_WRAPPER |
---|
4 | USE, INTRINSIC :: ISO_C_BINDING |
---|
5 | USE CALENDAR_WRAPPER_INTERFACE |
---|
6 | USE IDATE |
---|
7 | USE IDURATION |
---|
8 | USE LOGICAL_BOOL_CONVERSION |
---|
9 | |
---|
10 | TYPE txios(calendar_wrapper) |
---|
11 | INTEGER(kind = C_INTPTR_T) :: daddr |
---|
12 | END TYPE txios(calendar_wrapper) |
---|
13 | |
---|
14 | CONTAINS ! Fonctions disponibles pour les utilisateurs. |
---|
15 | |
---|
16 | SUBROUTINE xios(get_calendar_wrapper_handle)(idt, ret) |
---|
17 | IMPLICIT NONE |
---|
18 | CHARACTER(len = *), INTENT(IN) :: idt |
---|
19 | TYPE(txios(calendar_wrapper)), INTENT(OUT) :: ret |
---|
20 | |
---|
21 | CALL cxios_calendar_wrapper_handle_create(ret%daddr, idt, len(idt)) |
---|
22 | END SUBROUTINE xios(get_calendar_wrapper_handle) |
---|
23 | |
---|
24 | SUBROUTINE xios(get_default_calendar_wrapper_handle)(ret) |
---|
25 | IMPLICIT NONE |
---|
26 | TYPE(txios(calendar_wrapper)), INTENT(OUT) :: ret |
---|
27 | |
---|
28 | CALL cxios_get_current_calendar_wrapper(ret%daddr) |
---|
29 | END SUBROUTINE xios(get_default_calendar_wrapper_handle) |
---|
30 | |
---|
31 | LOGICAL FUNCTION xios(is_valid_calendar_wrapper)(idt) |
---|
32 | IMPLICIT NONE |
---|
33 | CHARACTER(len = *), INTENT(IN) :: idt |
---|
34 | LOGICAL (kind = 1) :: val |
---|
35 | |
---|
36 | CALL cxios_calendar_wrapper_valid_id(val, idt, len(idt)); |
---|
37 | CALL xios_bool_to_logical_0d(val) |
---|
38 | xios(is_valid_calendar_wrapper) = val |
---|
39 | END FUNCTION xios(is_valid_calendar_wrapper) |
---|
40 | |
---|
41 | SUBROUTINE xios(create_calendar)(hdl) |
---|
42 | IMPLICIT NONE |
---|
43 | TYPE(txios(calendar_wrapper)), INTENT(IN) :: hdl |
---|
44 | |
---|
45 | CALL cxios_create_calendar(hdl%daddr) |
---|
46 | END SUBROUTINE xios(create_calendar) |
---|
47 | |
---|
48 | SUBROUTINE xios(update_calendar_timestep)(hdl) |
---|
49 | IMPLICIT NONE |
---|
50 | TYPE(txios(calendar_wrapper)), INTENT(IN) :: hdl |
---|
51 | |
---|
52 | CALL cxios_update_calendar_timestep(hdl%daddr) |
---|
53 | END SUBROUTINE xios(update_calendar_timestep) |
---|
54 | |
---|
55 | SUBROUTINE xios(set_start_date_hdl)(hdl, start_date) |
---|
56 | USE IDATE |
---|
57 | IMPLICIT NONE |
---|
58 | TYPE(txios(calendar_wrapper)), INTENT(IN) :: hdl |
---|
59 | TYPE(txios(date)), INTENT(IN) :: start_date |
---|
60 | |
---|
61 | CALL cxios_set_calendar_wrapper_date_start_date(hdl%daddr, start_date) |
---|
62 | END SUBROUTINE xios(set_start_date_hdl) |
---|
63 | |
---|
64 | SUBROUTINE xios(get_start_date_hdl)(hdl, start_date) |
---|
65 | USE IDATE |
---|
66 | IMPLICIT NONE |
---|
67 | TYPE(txios(calendar_wrapper)), INTENT(IN) :: hdl |
---|
68 | TYPE(txios(date)), INTENT(OUT) :: start_date |
---|
69 | |
---|
70 | CALL cxios_get_calendar_wrapper_date_start_date(hdl%daddr, start_date) |
---|
71 | END SUBROUTINE xios(get_start_date_hdl) |
---|
72 | |
---|
73 | SUBROUTINE xios(set_time_origin_hdl)(hdl, time_origin) |
---|
74 | USE IDATE |
---|
75 | IMPLICIT NONE |
---|
76 | TYPE(txios(calendar_wrapper)), INTENT(IN) :: hdl |
---|
77 | TYPE(txios(date)), INTENT(IN) :: time_origin |
---|
78 | |
---|
79 | CALL cxios_set_calendar_wrapper_date_time_origin(hdl%daddr, time_origin) |
---|
80 | END SUBROUTINE xios(set_time_origin_hdl) |
---|
81 | |
---|
82 | SUBROUTINE xios(get_time_origin_hdl)(hdl, time_origin) |
---|
83 | USE IDATE |
---|
84 | IMPLICIT NONE |
---|
85 | TYPE(txios(calendar_wrapper)), INTENT(IN) :: hdl |
---|
86 | TYPE(txios(date)), INTENT(OUT) :: time_origin |
---|
87 | |
---|
88 | CALL cxios_get_calendar_wrapper_date_time_origin(hdl%daddr, time_origin) |
---|
89 | END SUBROUTINE xios(get_time_origin_hdl) |
---|
90 | |
---|
91 | END MODULE ICALENDAR_WRAPPER |
---|