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