[249] | 1 | MODULE IFILE |
---|
| 2 | USE, INTRINSIC :: ISO_C_BINDING |
---|
| 3 | USE FILE_INTERFACE |
---|
| 4 | USE FILEGROUP_INTERFACE |
---|
| 5 | |
---|
| 6 | TYPE XFileHandle |
---|
| 7 | INTEGER(kind = C_INTPTR_T) :: daddr |
---|
| 8 | END TYPE XFileHandle |
---|
| 9 | |
---|
| 10 | TYPE XFileGroupHandle |
---|
| 11 | INTEGER(kind = C_INTPTR_T) :: daddr |
---|
| 12 | END TYPE XFileGroupHandle |
---|
| 13 | |
---|
| 14 | !---------------------------------------------------------------------------- |
---|
| 15 | INTERFACE set_file_attributes |
---|
| 16 | MODULE PROCEDURE set_file_attributes_id,set_file_attributes_hdl |
---|
| 17 | END INTERFACE |
---|
| 18 | |
---|
| 19 | INTERFACE set_file_group_attributes |
---|
| 20 | MODULE PROCEDURE set_filegroup_attributes_id,set_filegroup_attributes_hdl |
---|
| 21 | END INTERFACE |
---|
| 22 | !---------------------------------------------------------------------------- |
---|
| 23 | |
---|
| 24 | CONTAINS ! Fonctions disponibles pour les utilisateurs. |
---|
| 25 | |
---|
| 26 | SUBROUTINE set_file_attributes_id(file_id, name_ , description_, output_freq_, output_level_, enabled_) |
---|
| 27 | IMPLICIT NONE |
---|
| 28 | TYPE(XFileHandle) :: file_hdl |
---|
| 29 | CHARACTER(len = *) , INTENT(IN) :: file_id |
---|
| 30 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_ |
---|
| 31 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_ |
---|
| 32 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_ |
---|
| 33 | INTEGER , OPTIONAL, INTENT(IN) :: output_level_ |
---|
| 34 | LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ |
---|
| 35 | |
---|
| 36 | CALL file_handle_create(file_hdl, file_id) |
---|
| 37 | CALL set_file_attributes_hdl(file_hdl, name_ , description_, output_freq_, output_level_, enabled_) |
---|
| 38 | |
---|
| 39 | END SUBROUTINE set_file_attributes_id |
---|
| 40 | |
---|
| 41 | SUBROUTINE set_file_attributes_hdl(file_hdl, name_ , description_, output_freq_, output_level_, enabled_) |
---|
| 42 | TYPE(XFileHandle) , INTENT(IN) :: file_hdl |
---|
| 43 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_ |
---|
| 44 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_ |
---|
| 45 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_ |
---|
| 46 | INTEGER , OPTIONAL, INTENT(IN) :: output_level_ |
---|
| 47 | LOGICAL(kind = 1) :: enabled__ |
---|
| 48 | LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ |
---|
| 49 | |
---|
| 50 | enabled__ = enabled_ |
---|
| 51 | IF (PRESENT(name_)) THEN |
---|
| 52 | CALL xios_set_file_name(file_hdl%daddr, name_, len(name_)) |
---|
| 53 | END IF |
---|
| 54 | IF (PRESENT(description_)) THEN |
---|
| 55 | CALL xios_set_file_description(file_hdl%daddr, description_, len(description_)) |
---|
| 56 | END IF |
---|
| 57 | IF (PRESENT(output_freq_)) THEN |
---|
| 58 | CALL xios_set_file_output_freq(file_hdl%daddr, output_freq_, len(output_freq_)) |
---|
| 59 | END IF |
---|
| 60 | IF (PRESENT(output_level_)) THEN |
---|
| 61 | CALL xios_set_file_output_level(file_hdl%daddr, output_level_) |
---|
| 62 | END IF |
---|
| 63 | IF (PRESENT(enabled_)) THEN |
---|
| 64 | CALL xios_set_file_enabled(file_hdl%daddr, enabled__) |
---|
| 65 | END IF |
---|
| 66 | |
---|
| 67 | END SUBROUTINE set_file_attributes_hdl |
---|
| 68 | |
---|
| 69 | SUBROUTINE set_filegroup_attributes_id(filegroup_id, name_ , description_, output_freq_, output_level_, enabled_) |
---|
| 70 | IMPLICIT NONE |
---|
| 71 | TYPE(XFileGroupHandle) :: filegroup_hdl |
---|
| 72 | CHARACTER(len = *) , INTENT(IN) :: filegroup_id |
---|
| 73 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_ |
---|
| 74 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_ |
---|
| 75 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_ |
---|
| 76 | INTEGER , OPTIONAL, INTENT(IN) :: output_level_ |
---|
| 77 | LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ |
---|
| 78 | |
---|
| 79 | CALL filegroup_handle_create(filegroup_hdl, filegroup_id) |
---|
| 80 | CALL set_filegroup_attributes_hdl(filegroup_hdl, name_ , description_, output_freq_, output_level_, enabled_) |
---|
| 81 | |
---|
| 82 | END SUBROUTINE set_filegroup_attributes_id |
---|
| 83 | |
---|
| 84 | SUBROUTINE set_filegroup_attributes_hdl(filegroup_hdl, name_ , description_, output_freq_, output_level_, enabled_) |
---|
| 85 | IMPLICIT NONE |
---|
| 86 | TYPE(XFileGroupHandle) , INTENT(IN) :: filegroup_hdl |
---|
| 87 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_ |
---|
| 88 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_ |
---|
| 89 | CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_ |
---|
| 90 | INTEGER , OPTIONAL, INTENT(IN) :: output_level_ |
---|
| 91 | LOGICAL(kind = 1) :: enabled__ |
---|
| 92 | LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ |
---|
| 93 | |
---|
| 94 | enabled__ = enabled_ |
---|
| 95 | IF (PRESENT(name_)) THEN |
---|
| 96 | CALL xios_set_filegroup_name(filegroup_hdl%daddr, name_, len(name_)) |
---|
| 97 | END IF |
---|
| 98 | IF (PRESENT(description_)) THEN |
---|
| 99 | CALL xios_set_filegroup_description(filegroup_hdl%daddr, description_, len(description_)) |
---|
| 100 | END IF |
---|
| 101 | IF (PRESENT(output_freq_)) THEN |
---|
| 102 | CALL xios_set_filegroup_output_freq(filegroup_hdl%daddr, output_freq_, len(output_freq_)) |
---|
| 103 | END IF |
---|
| 104 | IF (PRESENT(output_level_)) THEN |
---|
| 105 | CALL xios_set_filegroup_output_level(filegroup_hdl%daddr, output_level_) |
---|
| 106 | END IF |
---|
| 107 | IF (PRESENT(enabled_)) THEN |
---|
| 108 | CALL xios_set_filegroup_enabled(filegroup_hdl%daddr, enabled__) |
---|
| 109 | END IF |
---|
| 110 | |
---|
| 111 | END SUBROUTINE set_filegroup_attributes_hdl |
---|
| 112 | |
---|
| 113 | SUBROUTINE file_handle_create(ret, idt) |
---|
| 114 | IMPLICIT NONE |
---|
| 115 | TYPE(XFileHandle) , INTENT(OUT):: ret |
---|
| 116 | CHARACTER(len = *), INTENT(IN) :: idt |
---|
| 117 | CALL xios_file_handle_create(ret%daddr, idt, len(idt)) |
---|
| 118 | END SUBROUTINE file_handle_create |
---|
| 119 | |
---|
| 120 | SUBROUTINE filegroup_handle_create(ret, idt) |
---|
| 121 | IMPLICIT NONE |
---|
| 122 | TYPE(XFileGroupHandle), INTENT(OUT):: ret |
---|
| 123 | CHARACTER(len = *) , INTENT(IN) :: idt |
---|
| 124 | CALL xios_filegroup_handle_create(ret%daddr, idt, len(idt)) |
---|
| 125 | END SUBROUTINE filegroup_handle_create |
---|
| 126 | |
---|
| 127 | END MODULE IFILE |
---|