41 public :: file_put_axis
42 public :: file_write_axis
44 public :: file_put_associatedcoordinate
45 public :: file_write_associatedcoordinate
46 public :: file_add_variable
48 public :: file_get_shape
50 public :: file_get_commoninfo
51 public :: file_get_datainfo
52 public :: file_get_all_datainfo
55 public :: file_get_attribute
56 public :: file_set_attribute
69 interface file_get_commoninfo
70 module procedure file_get_commoninfo_fid
71 module procedure file_get_commoninfo_fname
72 end interface file_get_commoninfo
74 interface file_get_shape
75 module procedure file_get_shape_fid
76 module procedure file_get_shape_fname
77 end interface file_get_shape
79 interface file_get_datainfo
80 module procedure file_get_datainfo_fid
81 module procedure file_get_datainfo_fname
82 end interface file_get_datainfo
84 interface file_get_all_datainfo
85 module procedure file_get_all_datainfo_fid
86 module procedure file_get_all_datainfo_fname
87 end interface file_get_all_datainfo
89 interface file_put_axis
90 module procedure file_put_axis_realsp
91 module procedure file_put_axis_realdp
92 end interface file_put_axis
93 interface file_write_axis
94 module procedure file_write_axis_realsp
95 module procedure file_write_axis_realdp
96 end interface file_write_axis
97 interface file_put_associatedcoordinate
98 module procedure file_put_associatedcoordinate_realsp_1d
99 module procedure file_put_associatedcoordinate_realdp_1d
100 module procedure file_put_associatedcoordinate_realsp_2d
101 module procedure file_put_associatedcoordinate_realdp_2d
102 module procedure file_put_associatedcoordinate_realsp_3d
103 module procedure file_put_associatedcoordinate_realdp_3d
104 module procedure file_put_associatedcoordinate_realsp_4d
105 module procedure file_put_associatedcoordinate_realdp_4d
106 end interface file_put_associatedcoordinate
107 interface file_write_associatedcoordinate
108 module procedure file_write_associatedcoordinate_realsp_1d
109 module procedure file_write_associatedcoordinate_realdp_1d
110 module procedure file_write_associatedcoordinate_realsp_2d
111 module procedure file_write_associatedcoordinate_realdp_2d
112 module procedure file_write_associatedcoordinate_realsp_3d
113 module procedure file_write_associatedcoordinate_realdp_3d
114 module procedure file_write_associatedcoordinate_realsp_4d
115 module procedure file_write_associatedcoordinate_realdp_4d
116 end interface file_write_associatedcoordinate
117 interface file_add_variable
118 module procedure file_add_variable_no_time
119 module procedure file_add_variable_with_time
120 end interface file_add_variable
122 module procedure file_read_realsp_1d
123 module procedure file_read_realdp_1d
124 module procedure file_read_realsp_2d
125 module procedure file_read_realdp_2d
126 module procedure file_read_realsp_3d
127 module procedure file_read_realdp_3d
128 module procedure file_read_realsp_4d
129 module procedure file_read_realdp_4d
130 module procedure file_read_var_realsp_1d
131 module procedure file_read_var_realdp_1d
132 module procedure file_read_var_realsp_2d
133 module procedure file_read_var_realdp_2d
134 module procedure file_read_var_realsp_3d
135 module procedure file_read_var_realdp_3d
136 module procedure file_read_var_realsp_4d
137 module procedure file_read_var_realdp_4d
138 end interface file_read
140 module procedure file_write_realsp_1d
141 module procedure file_write_realdp_1d
142 module procedure file_write_realsp_2d
143 module procedure file_write_realdp_2d
144 module procedure file_write_realsp_3d
145 module procedure file_write_realdp_3d
146 module procedure file_write_realsp_4d
147 module procedure file_write_realdp_4d
148 end interface file_write
149 interface file_get_attribute
150 module procedure file_get_attribute_text_fname
151 module procedure file_get_attribute_logical_fname
152 module procedure file_get_attribute_int_fname_ary
153 module procedure file_get_attribute_int_fname
154 module procedure file_get_attribute_float_fname_ary
155 module procedure file_get_attribute_float_fname
156 module procedure file_get_attribute_double_fname_ary
157 module procedure file_get_attribute_double_fname
158 module procedure file_get_attribute_text_fid
159 module procedure file_get_attribute_logical_fid
160 module procedure file_get_attribute_int_fid_ary
161 module procedure file_get_attribute_int_fid
162 module procedure file_get_attribute_float_fid_ary
163 module procedure file_get_attribute_float_fid
164 module procedure file_get_attribute_double_fid_ary
165 module procedure file_get_attribute_double_fid
166 end interface file_get_attribute
167 interface file_set_attribute
168 module procedure file_set_attribute_text
169 module procedure file_set_attribute_logical
170 module procedure file_set_attribute_int_ary
171 module procedure file_set_attribute_int
172 module procedure file_set_attribute_float_ary
173 module procedure file_set_attribute_float
174 module procedure file_set_attribute_double_ary
175 module procedure file_set_attribute_double
176 end interface file_set_attribute
188 private :: file_get_fid
195 character(len=FILE_HLONG) :: name
199 integer :: buffer_size
202 integer :: file_nfiles = 0
205 character(len=FILE_HLONG) :: name
210 integer :: file_nvars = 0
212 integer :: mpi_myrank
225 integer,
intent(in) :: myrank
227 namelist / param_file / &
237 log_info(
"FILE_setup",*)
'Not found namelist. Default used.'
238 elseif( ierr > 0 )
then
239 log_error(
"FILE_setup",*)
'Not appropriate names in namelist PARAM_FILE. Check!'
249 file_files(fid)%fid = -1
250 file_files(fid)%name =
""
262 title, source, institution, &
264 rankid, single, aggregate, &
265 time_units, calendar, &
269 character(len=*),
intent(in) :: basename
270 character(len=*),
intent(in) :: title
271 character(len=*),
intent(in) :: source
272 character(len=*),
intent(in) :: institution
274 integer,
intent(out) :: fid
275 logical,
intent(out) :: existed
277 integer,
intent(in),
optional :: rankid
278 logical,
intent(in),
optional :: single
279 logical,
intent(in),
optional :: aggregate
280 character(len=*),
intent(in),
optional :: time_units
281 character(len=*),
intent(in),
optional :: calendar
282 logical,
intent(in),
optional :: append
284 character(len=FILE_HMID) :: time_units_
285 character(len=FILE_HSHORT) :: calendar_
294 if (
present(rankid) )
then
301 if (
present(single) )
then
305 if (
present(time_units) )
then
306 time_units_ = time_units
308 time_units_ =
'seconds'
311 if (
present(calendar) )
then
318 if (
present(append) )
then
322 if ( single_ .and. rankid_ /= 0 )
then
328 call file_get_fid( basename, mode, &
331 aggregate=aggregate )
336 call file_set_attribute( fid,
"global",
"title" , title )
337 call file_set_attribute( fid,
"global",
"source" , source )
338 call file_set_attribute( fid,
"global",
"institution", institution )
340 if ( ( .not.
present(aggregate) ) .or. .not. aggregate )
then
342 call file_set_attribute( fid,
"global",
"rankid" , (/rankid/) )
346 time_units_, calendar_, &
350 log_error(
"FILE_create",*)
'failed to set time units'
358 subroutine file_get_var_num( &
363 integer,
intent(in) :: fid
364 integer,
intent(in) :: nvars_limit
365 integer,
intent(out) :: nvars
371 log_error(
"FILE_get_var_num",*)
'File is not opened. fid = ', fid
379 log_error(
"FILE_get_var_num",*)
'failed to get varnum. fid = ', fid
383 if ( nvars > nvars_limit )
then
384 log_error(
"FILE_get_var_num",*)
'number of variables exceeds the requested size.', nvars, nvars_limit
389 end subroutine file_get_var_num
392 subroutine file_get_var_name( &
397 integer,
intent(in) :: fid
398 integer,
intent(in) :: cvid
399 character(len=*),
intent(out) :: varname
405 log_error(
"FILE_get_var_name",*)
'File is not opened. fid = ', fid
413 log_error(
"FILE_get_var_name",*)
'failed to get varname. cvid = ', cvid
418 end subroutine file_get_var_name
422 integer,
intent(in) :: fid
423 character(len=*),
intent(in) :: vname
424 logical,
optional,
intent(out) :: existed
429 log_error(
"FILE_add_associatedVariable",*)
'File is not opened. fid = ', fid
436 if (
present(existed) )
then
445 log_error(
"FILE_add_associatedvariable",*)
'failed to add associated variable: '//trim(vname)
456 integer,
intent(in) :: fid
457 character(len=*),
intent(in) :: filetype
458 character(len=*),
intent(in) :: key
459 character(len=*),
intent(in) :: val
464 log_error(
"FILE_set_option",*)
'File is not opened. fid = ', fid
471 log_error(
"FILE_set_option",*)
'failed to set option'
489 character(len=*),
intent( in) :: basename
490 integer,
intent(out) :: fid
491 integer,
intent( in),
optional :: mode
492 logical,
intent( in),
optional :: single
493 logical,
intent( in),
optional :: aggregate
494 integer,
intent( in),
optional :: rankid
495 character(len=*),
intent( in),
optional :: postfix
504 if (
present(mode) )
then
510 if (
present(single) ) single_ = single
511 if (
present(rankid) )
then
517 call file_get_fid( basename, mode_, rankid_, single_, &
519 aggregate=aggregate, postfix=postfix )
529 integer,
intent( in) :: fid
546 integer,
intent( in) :: fid
565 integer,
intent(in) :: fid
566 character(len=*),
intent(in) :: dimname
568 integer,
intent(out) :: len
570 logical,
intent(out),
optional :: error
576 log_error(
"FILE_get_dimLength",*)
'File is not opened. fid = ', fid
583 if (
present(error) )
then
586 log_error(
"FILE_get_dimLength",*)
'failed to get dimension length'
590 if (
present(error) ) error = .false.
599 subroutine file_put_axis_realsp( &
604 integer,
intent(in) :: fid
605 character(len=*),
intent(in) :: name
606 character(len=*),
intent(in) :: desc
607 character(len=*),
intent(in) :: units
608 character(len=*),
intent(in) :: dim_name
609 integer,
intent(in) :: dtype
610 real(
sp),
intent(in) :: val(:)
616 log_error(
"FILE_put_axis_real",*)
'File is not opened. fid = ', fid
621 name, desc, units, dim_name, dtype, val,
size(val),
sp, &
624 log_error(
"FILE_put_axis_realSP",*)
'failed to put axis'
629 end subroutine file_put_axis_realsp
630 subroutine file_put_axis_realdp( &
635 integer,
intent(in) :: fid
636 character(len=*),
intent(in) :: name
637 character(len=*),
intent(in) :: desc
638 character(len=*),
intent(in) :: units
639 character(len=*),
intent(in) :: dim_name
640 integer,
intent(in) :: dtype
641 real(
dp),
intent(in) :: val(:)
647 log_error(
"FILE_put_axis_real",*)
'File is not opened. fid = ', fid
652 name, desc, units, dim_name, dtype, val,
size(val),
dp, &
655 log_error(
"FILE_put_axis_realDP",*)
'failed to put axis'
660 end subroutine file_put_axis_realdp
665 dim_name, dtype, dim_size, &
667 integer,
intent(in) :: fid
668 character(len=*),
intent(in) :: name
669 character(len=*),
intent(in) :: desc
670 character(len=*),
intent(in) :: units
671 character(len=*),
intent(in) :: dim_name
672 integer,
intent(in) :: dtype
673 integer,
intent(in) :: dim_size
675 logical,
intent(in),
optional :: bounds
681 if (
present(bounds) )
then
682 if ( bounds ) bounds_ = 1
686 log_error(
"FILE_def_axis",*)
'File is not opened. fid = ', fid
691 name, desc, units, dim_name, dtype, dim_size, bounds_, &
694 log_error(
"FILE_def_axis",*)
'failed to define axis'
704 subroutine file_write_axis_realsp( &
709 integer,
intent(in) :: fid
710 character(len=*),
intent(in) :: name
711 real(
sp),
intent(in) :: val(:)
712 integer,
intent(in),
optional :: start(:)
718 log_error(
"FILE_write_axis_realSP",*)
'File is not opened. fid = ', fid
722 if (
present(start) )
then
724 name, val,
sp, start, shape(val), &
728 name, val,
sp, (/1/), shape(val), &
732 log_error(
"FILE_write_axis_realSP",*)
'failed to write axis: '//trim(name)
737 end subroutine file_write_axis_realsp
738 subroutine file_write_axis_realdp( &
743 integer,
intent(in) :: fid
744 character(len=*),
intent(in) :: name
745 real(
dp),
intent(in) :: val(:)
746 integer,
intent(in),
optional :: start(:)
752 log_error(
"FILE_write_axis_realDP",*)
'File is not opened. fid = ', fid
756 if (
present(start) )
then
758 name, val,
dp, start, shape(val), &
762 name, val,
dp, (/1/), shape(val), &
766 log_error(
"FILE_write_axis_realDP",*)
'failed to write axis: '//trim(name)
771 end subroutine file_write_axis_realdp
776 subroutine file_put_associatedcoordinate_realsp_1d( &
781 integer,
intent(in) :: fid
782 character(len=*),
intent(in) :: name
783 character(len=*),
intent(in) :: desc
784 character(len=*),
intent(in) :: units
785 character(len=*),
intent(in) :: dim_names(:)
786 integer,
intent(in) :: dtype
787 real(
sp),
intent(in) :: val(:)
793 log_error(
"FILE_put_associatedCoordinate_realSP_1D",*)
'File is not opened. fid = ', fid
798 name, desc, units, dim_names,
size(dim_names), dtype, &
802 log_error(
"FILE_put_associatedCoordinate_realSP_1D",*)
'failed to put associated coordinate: '//trim(name)
807 end subroutine file_put_associatedcoordinate_realsp_1d
808 subroutine file_put_associatedcoordinate_realdp_1d( &
813 integer,
intent(in) :: fid
814 character(len=*),
intent(in) :: name
815 character(len=*),
intent(in) :: desc
816 character(len=*),
intent(in) :: units
817 character(len=*),
intent(in) :: dim_names(:)
818 integer,
intent(in) :: dtype
819 real(
dp),
intent(in) :: val(:)
825 log_error(
"FILE_put_associatedCoordinate_realDP_1D",*)
'File is not opened. fid = ', fid
830 name, desc, units, dim_names,
size(dim_names), dtype, &
834 log_error(
"FILE_put_associatedCoordinate_realDP_1D",*)
'failed to put associated coordinate: '//trim(name)
839 end subroutine file_put_associatedcoordinate_realdp_1d
840 subroutine file_put_associatedcoordinate_realsp_2d( &
845 integer,
intent(in) :: fid
846 character(len=*),
intent(in) :: name
847 character(len=*),
intent(in) :: desc
848 character(len=*),
intent(in) :: units
849 character(len=*),
intent(in) :: dim_names(:)
850 integer,
intent(in) :: dtype
851 real(
sp),
intent(in) :: val(:,:)
857 log_error(
"FILE_put_associatedCoordinate_realSP_2D",*)
'File is not opened. fid = ', fid
862 name, desc, units, dim_names,
size(dim_names), dtype, &
866 log_error(
"FILE_put_associatedCoordinate_realSP_2D",*)
'failed to put associated coordinate: '//trim(name)
871 end subroutine file_put_associatedcoordinate_realsp_2d
872 subroutine file_put_associatedcoordinate_realdp_2d( &
877 integer,
intent(in) :: fid
878 character(len=*),
intent(in) :: name
879 character(len=*),
intent(in) :: desc
880 character(len=*),
intent(in) :: units
881 character(len=*),
intent(in) :: dim_names(:)
882 integer,
intent(in) :: dtype
883 real(
dp),
intent(in) :: val(:,:)
889 log_error(
"FILE_put_associatedCoordinate_realDP_2D",*)
'File is not opened. fid = ', fid
894 name, desc, units, dim_names,
size(dim_names), dtype, &
898 log_error(
"FILE_put_associatedCoordinate_realDP_2D",*)
'failed to put associated coordinate: '//trim(name)
903 end subroutine file_put_associatedcoordinate_realdp_2d
904 subroutine file_put_associatedcoordinate_realsp_3d( &
909 integer,
intent(in) :: fid
910 character(len=*),
intent(in) :: name
911 character(len=*),
intent(in) :: desc
912 character(len=*),
intent(in) :: units
913 character(len=*),
intent(in) :: dim_names(:)
914 integer,
intent(in) :: dtype
915 real(
sp),
intent(in) :: val(:,:,:)
921 log_error(
"FILE_put_associatedCoordinate_realSP_3D",*)
'File is not opened. fid = ', fid
926 name, desc, units, dim_names,
size(dim_names), dtype, &
930 log_error(
"FILE_put_associatedCoordinate_realSP_3D",*)
'failed to put associated coordinate: '//trim(name)
935 end subroutine file_put_associatedcoordinate_realsp_3d
936 subroutine file_put_associatedcoordinate_realdp_3d( &
941 integer,
intent(in) :: fid
942 character(len=*),
intent(in) :: name
943 character(len=*),
intent(in) :: desc
944 character(len=*),
intent(in) :: units
945 character(len=*),
intent(in) :: dim_names(:)
946 integer,
intent(in) :: dtype
947 real(
dp),
intent(in) :: val(:,:,:)
953 log_error(
"FILE_put_associatedCoordinate_realDP_3D",*)
'File is not opened. fid = ', fid
958 name, desc, units, dim_names,
size(dim_names), dtype, &
962 log_error(
"FILE_put_associatedCoordinate_realDP_3D",*)
'failed to put associated coordinate: '//trim(name)
967 end subroutine file_put_associatedcoordinate_realdp_3d
968 subroutine file_put_associatedcoordinate_realsp_4d( &
973 integer,
intent(in) :: fid
974 character(len=*),
intent(in) :: name
975 character(len=*),
intent(in) :: desc
976 character(len=*),
intent(in) :: units
977 character(len=*),
intent(in) :: dim_names(:)
978 integer,
intent(in) :: dtype
979 real(
sp),
intent(in) :: val(:,:,:,:)
985 log_error(
"FILE_put_associatedCoordinate_realSP_4D",*)
'File is not opened. fid = ', fid
990 name, desc, units, dim_names,
size(dim_names), dtype, &
994 log_error(
"FILE_put_associatedCoordinate_realSP_4D",*)
'failed to put associated coordinate: '//trim(name)
999 end subroutine file_put_associatedcoordinate_realsp_4d
1000 subroutine file_put_associatedcoordinate_realdp_4d( &
1002 name, desc, units, &
1005 integer,
intent(in) :: fid
1006 character(len=*),
intent(in) :: name
1007 character(len=*),
intent(in) :: desc
1008 character(len=*),
intent(in) :: units
1009 character(len=*),
intent(in) :: dim_names(:)
1010 integer,
intent(in) :: dtype
1011 real(
dp),
intent(in) :: val(:,:,:,:)
1017 log_error(
"FILE_put_associatedCoordinate_realDP_4D",*)
'File is not opened. fid = ', fid
1022 name, desc, units, dim_names,
size(dim_names), dtype, &
1026 log_error(
"FILE_put_associatedCoordinate_realDP_4D",*)
'failed to put associated coordinate: '//trim(name)
1031 end subroutine file_put_associatedcoordinate_realdp_4d
1035 name, desc, units, &
1037 integer,
intent(in) :: fid
1038 character(len=*),
intent(in) :: name
1039 character(len=*),
intent(in) :: desc
1040 character(len=*),
intent(in) :: units
1041 character(len=*),
intent(in) :: dim_names(:)
1042 integer,
intent(in) :: dtype
1048 log_error(
"FILE_def_associatedCoordinate",*)
'File is not opened. fid = ', fid
1053 name, desc, units, dim_names,
size(dim_names), dtype, &
1056 log_error(
"FILE_def_associatedCoordinate",*)
'failed to put associated coordinate: '//trim(name)
1066 subroutine file_write_associatedcoordinate_realsp_1d( &
1072 integer,
intent(in) :: fid
1073 character(len=*),
intent(in) :: name
1074 real(
sp),
intent(in) :: val(:)
1075 integer,
intent(in),
optional :: start(:)
1076 integer,
intent(in),
optional :: count(:)
1077 integer,
intent(in),
optional :: ndims
1083 log_error(
"FILE_write_associatedCoordinate_realSP_1D",*)
'File is not opened. fid = ', fid
1087 if (
present(ndims) )
then
1092 ndims, start, count, &
1094 else if (
present(start) )
then
1098 1, start, shape(val), &
1104 1, (/1/), shape(val), &
1108 log_error(
"FILE_write_associatedCoordinate_realSP_1D",*)
'failed to put associated coordinate: '//trim(name)
1113 end subroutine file_write_associatedcoordinate_realsp_1d
1114 subroutine file_write_associatedcoordinate_realdp_1d( &
1120 integer,
intent(in) :: fid
1121 character(len=*),
intent(in) :: name
1122 real(
dp),
intent(in) :: val(:)
1123 integer,
intent(in),
optional :: start(:)
1124 integer,
intent(in),
optional :: count(:)
1125 integer,
intent(in),
optional :: ndims
1131 log_error(
"FILE_write_associatedCoordinate_realDP_1D",*)
'File is not opened. fid = ', fid
1135 if (
present(ndims) )
then
1140 ndims, start, count, &
1142 else if (
present(start) )
then
1146 1, start, shape(val), &
1152 1, (/1/), shape(val), &
1156 log_error(
"FILE_write_associatedCoordinate_realDP_1D",*)
'failed to put associated coordinate: '//trim(name)
1161 end subroutine file_write_associatedcoordinate_realdp_1d
1162 subroutine file_write_associatedcoordinate_realsp_2d( &
1168 integer,
intent(in) :: fid
1169 character(len=*),
intent(in) :: name
1170 real(
sp),
intent(in) :: val(:,:)
1171 integer,
intent(in),
optional :: start(:)
1172 integer,
intent(in),
optional :: count(:)
1173 integer,
intent(in),
optional :: ndims
1179 log_error(
"FILE_write_associatedCoordinate_realSP_2D",*)
'File is not opened. fid = ', fid
1183 if (
present(ndims) )
then
1188 ndims, start, count, &
1190 else if (
present(start) )
then
1194 2, start, shape(val), &
1200 2, (/1,1/), shape(val), &
1204 log_error(
"FILE_write_associatedCoordinate_realSP_2D",*)
'failed to put associated coordinate: '//trim(name)
1209 end subroutine file_write_associatedcoordinate_realsp_2d
1210 subroutine file_write_associatedcoordinate_realdp_2d( &
1216 integer,
intent(in) :: fid
1217 character(len=*),
intent(in) :: name
1218 real(
dp),
intent(in) :: val(:,:)
1219 integer,
intent(in),
optional :: start(:)
1220 integer,
intent(in),
optional :: count(:)
1221 integer,
intent(in),
optional :: ndims
1227 log_error(
"FILE_write_associatedCoordinate_realDP_2D",*)
'File is not opened. fid = ', fid
1231 if (
present(ndims) )
then
1236 ndims, start, count, &
1238 else if (
present(start) )
then
1242 2, start, shape(val), &
1248 2, (/1,1/), shape(val), &
1252 log_error(
"FILE_write_associatedCoordinate_realDP_2D",*)
'failed to put associated coordinate: '//trim(name)
1257 end subroutine file_write_associatedcoordinate_realdp_2d
1258 subroutine file_write_associatedcoordinate_realsp_3d( &
1264 integer,
intent(in) :: fid
1265 character(len=*),
intent(in) :: name
1266 real(
sp),
intent(in) :: val(:,:,:)
1267 integer,
intent(in),
optional :: start(:)
1268 integer,
intent(in),
optional :: count(:)
1269 integer,
intent(in),
optional :: ndims
1275 log_error(
"FILE_write_associatedCoordinate_realSP_3D",*)
'File is not opened. fid = ', fid
1279 if (
present(ndims) )
then
1284 ndims, start, count, &
1286 else if (
present(start) )
then
1290 3, start, shape(val), &
1296 3, (/1,1,1/), shape(val), &
1300 log_error(
"FILE_write_associatedCoordinate_realSP_3D",*)
'failed to put associated coordinate: '//trim(name)
1305 end subroutine file_write_associatedcoordinate_realsp_3d
1306 subroutine file_write_associatedcoordinate_realdp_3d( &
1312 integer,
intent(in) :: fid
1313 character(len=*),
intent(in) :: name
1314 real(
dp),
intent(in) :: val(:,:,:)
1315 integer,
intent(in),
optional :: start(:)
1316 integer,
intent(in),
optional :: count(:)
1317 integer,
intent(in),
optional :: ndims
1323 log_error(
"FILE_write_associatedCoordinate_realDP_3D",*)
'File is not opened. fid = ', fid
1327 if (
present(ndims) )
then
1332 ndims, start, count, &
1334 else if (
present(start) )
then
1338 3, start, shape(val), &
1344 3, (/1,1,1/), shape(val), &
1348 log_error(
"FILE_write_associatedCoordinate_realDP_3D",*)
'failed to put associated coordinate: '//trim(name)
1353 end subroutine file_write_associatedcoordinate_realdp_3d
1354 subroutine file_write_associatedcoordinate_realsp_4d( &
1360 integer,
intent(in) :: fid
1361 character(len=*),
intent(in) :: name
1362 real(
sp),
intent(in) :: val(:,:,:,:)
1363 integer,
intent(in),
optional :: start(:)
1364 integer,
intent(in),
optional :: count(:)
1365 integer,
intent(in),
optional :: ndims
1371 log_error(
"FILE_write_associatedCoordinate_realSP_4D",*)
'File is not opened. fid = ', fid
1375 if (
present(ndims) )
then
1380 ndims, start, count, &
1382 else if (
present(start) )
then
1386 4, start, shape(val), &
1392 4, (/1,1,1,1/), shape(val), &
1396 log_error(
"FILE_write_associatedCoordinate_realSP_4D",*)
'failed to put associated coordinate: '//trim(name)
1401 end subroutine file_write_associatedcoordinate_realsp_4d
1402 subroutine file_write_associatedcoordinate_realdp_4d( &
1408 integer,
intent(in) :: fid
1409 character(len=*),
intent(in) :: name
1410 real(
dp),
intent(in) :: val(:,:,:,:)
1411 integer,
intent(in),
optional :: start(:)
1412 integer,
intent(in),
optional :: count(:)
1413 integer,
intent(in),
optional :: ndims
1419 log_error(
"FILE_write_associatedCoordinate_realDP_4D",*)
'File is not opened. fid = ', fid
1423 if (
present(ndims) )
then
1428 ndims, start, count, &
1430 else if (
present(start) )
then
1434 4, start, shape(val), &
1440 4, (/1,1,1,1/), shape(val), &
1444 log_error(
"FILE_write_associatedCoordinate_realDP_4D",*)
'failed to put associated coordinate: '//trim(name)
1449 end subroutine file_write_associatedcoordinate_realdp_4d
1454 subroutine file_add_variable_no_time( &
1456 varname, desc, units, &
1461 integer,
intent( in) :: fid
1462 character(len=*),
intent( in) :: varname
1463 character(len=*),
intent( in) :: desc
1464 character(len=*),
intent( in) :: units
1465 character(len=*),
intent( in) :: standard_name
1466 character(len=*),
intent( in) :: dims(:)
1467 integer,
intent( in) :: dtype
1468 integer,
intent(out) :: vid
1469 logical,
intent( in),
optional :: time_avg
1472 log_error(
"FILE_add_variable_no_time",*)
'File is not opened. fid = ', fid
1476 call file_add_variable_with_time( fid, &
1477 varname, desc, units, standard_name, &
1478 dims, dtype, -1.0_dp, &
1480 time_avg = time_avg )
1483 end subroutine file_add_variable_no_time
1486 subroutine file_add_variable_with_time( &
1488 varname, desc, units, &
1495 integer,
intent(in) :: fid
1496 character(len=*),
intent(in) :: varname
1497 character(len=*),
intent(in) :: desc
1498 character(len=*),
intent(in) :: units
1499 character(len=*),
intent(in) :: standard_name
1500 character(len=*),
intent(in) :: dims(:)
1501 integer,
intent(in) :: dtype
1502 real(
dp),
intent(in) :: time_int
1504 integer,
intent(out) :: vid
1506 logical,
intent(in),
optional :: time_avg
1518 log_error(
"FILE_add_variable_with_time",*)
'File is not opened. fid = ', fid
1523 do n = 1, file_nvars
1524 if ( file_vars(n)%fid == fid .and. file_vars(n)%name == varname )
then
1525 vid = file_vars(n)%vid
1535 if (
present(time_avg) )
then
1536 if( time_avg ) itavg = 1
1540 varname, desc, units, standard_name, &
1541 dims, ndims, dtype, time_int, itavg, &
1545 log_error(
"FILE_add_variable_with_time",*)
'failed to add variable: '//trim(varname)
1549 file_nvars = file_nvars + 1
1551 file_vars(vid)%name = varname
1552 file_vars(vid)%vid = cvid
1553 file_vars(vid)%fid = fid
1555 log_info(
"FILE_add_variable_with_time",
'(1x,A,I3.3,A,I4.4,2A)') &
1556 'Variable registration : NO.', fid,
', vid = ', vid,
', name = ', trim(varname)
1560 end subroutine file_add_variable_with_time
1564 varname, desc, units, &
1569 time_int, time_avg, &
1571 integer,
intent( in) :: fid
1572 character(len=*),
intent( in) :: varname
1573 character(len=*),
intent( in) :: desc
1574 character(len=*),
intent( in) :: units
1575 character(len=*),
intent( in) :: standard_name
1576 integer,
intent( in) :: ndims
1577 character(len=*),
intent( in) :: dims(:)
1578 integer,
intent( in) :: dtype
1579 integer,
intent(out) :: vid
1580 real(
dp),
intent( in),
optional :: time_int
1581 logical,
intent( in),
optional :: time_avg
1582 logical,
intent(out),
optional :: existed
1593 log_error(
"FILE_def_variable",*)
'File is not opened. fid = ', fid
1598 do n = 1, file_nvars
1599 if ( file_vars(n)%fid == fid .and. file_vars(n)%name == varname )
then
1606 if (
present(time_int) )
then
1612 if (
present(time_avg) )
then
1613 if ( time_avg )
then
1623 varname, desc, units, standard_name, &
1624 dims, ndims, dtype, &
1628 log_error(
"FILE_def_variable",*)
'failed to add variable: '//trim(varname)
1632 file_nvars = file_nvars + 1
1634 file_vars(vid)%name = varname
1635 file_vars(vid)%vid = cvid
1636 file_vars(vid)%fid = fid
1638 log_info(
"FILE_def_variable",
'(1x,A,I3.3,A,I4.4,2A)') &
1639 'Variable registration : NO.', fid,
', vid = ', vid,
', name = ', trim(varname)
1641 if (
present(existed) ) existed = .false.
1643 if (
present(existed) ) existed = .true.
1652 subroutine file_get_attribute_text_fid( &
1657 integer,
intent(in ) :: fid
1658 character(len=*),
intent(in ) :: vname
1659 character(len=*),
intent(in ) :: key
1660 character(len=*),
intent(out) :: val
1662 logical,
intent(out),
optional :: existed
1668 log_error(
"FILE_get_attribute_text_fid",*)
'File is not opened. fid = ', fid
1672 if (
present(existed) )
then
1678 file_files(fid)%fid, vname, &
1682 if (
present(existed) )
then
1685 log_error(
"FILE_get_attribute_text_fid",*)
'failed to get text attribute for '//trim(vname)//
': '//trim(key)
1689 if (
present(existed) ) existed = .true.
1693 end subroutine file_get_attribute_text_fid
1694 subroutine file_get_attribute_text_fname( &
1695 basename, vname, key, &
1697 single, aggregate, rankid, &
1701 character(len=*),
intent(in) :: basename
1702 character(len=*),
intent(in) :: vname
1703 character(len=*),
intent(in) :: key
1705 character(len=*),
intent(out) :: val
1707 logical,
intent(in),
optional :: single
1708 logical,
intent(in),
optional :: aggregate
1709 integer,
intent(in),
optional :: rankid
1711 logical,
intent(out),
optional :: existed
1717 aggregate=aggregate, &
1720 call file_get_attribute_text_fid( &
1726 end subroutine file_get_attribute_text_fname
1729 subroutine file_get_attribute_logical_fid( &
1734 integer,
intent(in ) :: fid
1735 character(len=*),
intent(in ) :: vname
1736 character(len=*),
intent(in ) :: key
1737 logical,
intent(out) :: val
1739 logical,
intent(out),
optional :: existed
1741 character(len=5) :: buf
1744 log_error(
"FILE_get_attribute_logical_fid",*)
'File is not opened. fid = ', fid
1748 call file_get_attribute_text_fid( fid, vname, key, &
1751 if (
present(existed) )
then
1752 if ( .not. existed )
return
1755 if ( buf ==
"true" )
then
1757 else if ( buf ==
"false" )
then
1760 log_error(
"FILE_get_attribute_logical_fid",*)
'value is not eigher true or false'
1765 end subroutine file_get_attribute_logical_fid
1766 subroutine file_get_attribute_logical_fname( &
1767 basename, vname, key, &
1769 single, aggregate, rankid, &
1773 character(len=*),
intent(in) :: basename
1774 character(len=*),
intent(in) :: vname
1775 character(len=*),
intent(in) :: key
1777 logical,
intent(out) :: val
1779 logical,
intent(in),
optional :: single
1780 logical,
intent(in),
optional :: aggregate
1781 integer,
intent(in),
optional :: rankid
1783 logical,
intent(out),
optional :: existed
1789 aggregate=aggregate, &
1792 call file_get_attribute_logical_fid( &
1798 end subroutine file_get_attribute_logical_fname
1801 subroutine file_get_attribute_int_fid_ary( &
1805 integer,
intent(in ) :: fid
1806 character(len=*),
intent(in ) :: vname
1807 character(len=*),
intent(in ) :: key
1808 integer,
intent(out) :: val(:)
1810 logical,
intent(out),
optional :: existed
1818 log_error(
"FILE_get_attribute_int_fid",*)
'File is not opened. fid = ', fid
1822 if (
present(existed) )
then
1828 file_files(fid)%fid, vname, &
1829 key,
size(val), suppress, &
1832 if (
present(existed) )
then
1835 log_error(
"FILE_get_attribute_int_fid",*)
'failed to get integer attribute for '//trim(vname)//
': '//trim(key)
1839 if (
present(existed) ) existed = .true.
1843 end subroutine file_get_attribute_int_fid_ary
1844 subroutine file_get_attribute_int_fid( &
1848 integer,
intent(in ) :: fid
1849 character(len=*),
intent(in ) :: vname
1850 character(len=*),
intent(in ) :: key
1851 integer,
intent(out) :: val
1852 logical,
intent(out),
optional :: existed
1855 call file_get_attribute_int_fid_ary( &
1859 if (
present(existed) )
then
1860 if ( .not. existed )
return
1865 end subroutine file_get_attribute_int_fid
1866 subroutine file_get_attribute_int_fname_ary( &
1867 basename, vname, key, &
1869 single, aggregate, rankid, &
1873 character(len=*),
intent(in) :: basename
1874 character(len=*),
intent(in) :: vname
1875 character(len=*),
intent(in) :: key
1877 integer,
intent(out) :: val(:)
1879 logical,
intent(in),
optional :: single
1880 logical,
intent(in),
optional :: aggregate
1881 integer,
intent(in),
optional :: rankid
1883 logical,
intent(out),
optional :: existed
1890 aggregate=aggregate, &
1893 call file_get_attribute_int_fid_ary( &
1899 end subroutine file_get_attribute_int_fname_ary
1900 subroutine file_get_attribute_int_fname( &
1901 basename, vname, key, &
1903 single, aggregate, rankid, &
1906 character(len=*),
intent(in) :: basename
1907 character(len=*),
intent(in) :: vname
1908 character(len=*),
intent(in) :: key
1909 integer,
intent(out) :: val
1910 logical,
intent(in),
optional :: single
1911 logical,
intent(in),
optional :: aggregate
1912 integer,
intent(in),
optional :: rankid
1913 logical,
intent(out),
optional :: existed
1916 call file_get_attribute_int_fname_ary( &
1917 basename, vname, key, &
1919 single, aggregate, rankid, &
1924 end subroutine file_get_attribute_int_fname
1927 subroutine file_get_attribute_float_fid_ary( &
1931 integer,
intent(in ) :: fid
1932 character(len=*),
intent(in ) :: vname
1933 character(len=*),
intent(in ) :: key
1934 real(
sp),
intent(out) :: val(:)
1936 logical,
intent(out),
optional :: existed
1944 log_error(
"FILE_get_attribute_float_fid",*)
'File is not opened. fid = ', fid
1948 if (
present(existed) )
then
1954 file_files(fid)%fid, vname, &
1955 key,
size(val), suppress, &
1958 if (
present(existed) )
then
1961 log_error(
"FILE_get_attribute_float_fid",*)
'failed to get float attribute for '//trim(vname)//
': '//trim(key)
1965 if (
present(existed) ) existed = .true.
1969 end subroutine file_get_attribute_float_fid_ary
1970 subroutine file_get_attribute_float_fid( &
1974 integer,
intent(in ) :: fid
1975 character(len=*),
intent(in ) :: vname
1976 character(len=*),
intent(in ) :: key
1977 real(
sp),
intent(out) :: val
1978 logical,
intent(out),
optional :: existed
1981 call file_get_attribute_float_fid_ary( &
1985 if (
present(existed) )
then
1986 if ( .not. existed )
return
1991 end subroutine file_get_attribute_float_fid
1992 subroutine file_get_attribute_float_fname_ary( &
1993 basename, vname, key, &
1995 single, aggregate, rankid, &
1999 character(len=*),
intent(in) :: basename
2000 character(len=*),
intent(in) :: vname
2001 character(len=*),
intent(in) :: key
2003 real(
sp),
intent(out) :: val(:)
2005 logical,
intent(in),
optional :: single
2006 logical,
intent(in),
optional :: aggregate
2007 integer,
intent(in),
optional :: rankid
2009 logical,
intent(out),
optional :: existed
2016 aggregate=aggregate, &
2019 call file_get_attribute_float_fid_ary( &
2025 end subroutine file_get_attribute_float_fname_ary
2026 subroutine file_get_attribute_float_fname( &
2027 basename, vname, key, &
2029 single, aggregate, rankid, &
2032 character(len=*),
intent(in) :: basename
2033 character(len=*),
intent(in) :: vname
2034 character(len=*),
intent(in) :: key
2035 real(
sp),
intent(out) :: val
2036 logical,
intent(in),
optional :: single
2037 logical,
intent(in),
optional :: aggregate
2038 integer,
intent(in),
optional :: rankid
2039 logical,
intent(out),
optional :: existed
2042 call file_get_attribute_float_fname_ary( &
2043 basename, vname, key, &
2045 single, aggregate, rankid, &
2050 end subroutine file_get_attribute_float_fname
2051 subroutine file_get_attribute_double_fid_ary( &
2055 integer,
intent(in ) :: fid
2056 character(len=*),
intent(in ) :: vname
2057 character(len=*),
intent(in ) :: key
2058 real(
dp),
intent(out) :: val(:)
2060 logical,
intent(out),
optional :: existed
2068 log_error(
"FILE_get_attribute_double_fid",*)
'File is not opened. fid = ', fid
2072 if (
present(existed) )
then
2078 file_files(fid)%fid, vname, &
2079 key,
size(val), suppress, &
2082 if (
present(existed) )
then
2085 log_error(
"FILE_get_attribute_double_fid",*)
'failed to get double attribute for '//trim(vname)//
': '//trim(key)
2089 if (
present(existed) ) existed = .true.
2093 end subroutine file_get_attribute_double_fid_ary
2094 subroutine file_get_attribute_double_fid( &
2098 integer,
intent(in ) :: fid
2099 character(len=*),
intent(in ) :: vname
2100 character(len=*),
intent(in ) :: key
2101 real(
dp),
intent(out) :: val
2102 logical,
intent(out),
optional :: existed
2105 call file_get_attribute_double_fid_ary( &
2109 if (
present(existed) )
then
2110 if ( .not. existed )
return
2115 end subroutine file_get_attribute_double_fid
2116 subroutine file_get_attribute_double_fname_ary( &
2117 basename, vname, key, &
2119 single, aggregate, rankid, &
2123 character(len=*),
intent(in) :: basename
2124 character(len=*),
intent(in) :: vname
2125 character(len=*),
intent(in) :: key
2127 real(
dp),
intent(out) :: val(:)
2129 logical,
intent(in),
optional :: single
2130 logical,
intent(in),
optional :: aggregate
2131 integer,
intent(in),
optional :: rankid
2133 logical,
intent(out),
optional :: existed
2140 aggregate=aggregate, &
2143 call file_get_attribute_double_fid_ary( &
2149 end subroutine file_get_attribute_double_fname_ary
2150 subroutine file_get_attribute_double_fname( &
2151 basename, vname, key, &
2153 single, aggregate, rankid, &
2156 character(len=*),
intent(in) :: basename
2157 character(len=*),
intent(in) :: vname
2158 character(len=*),
intent(in) :: key
2159 real(
dp),
intent(out) :: val
2160 logical,
intent(in),
optional :: single
2161 logical,
intent(in),
optional :: aggregate
2162 integer,
intent(in),
optional :: rankid
2163 logical,
intent(out),
optional :: existed
2166 call file_get_attribute_double_fname_ary( &
2167 basename, vname, key, &
2169 single, aggregate, rankid, &
2174 end subroutine file_get_attribute_double_fname
2179 subroutine file_set_attribute_text( &
2182 integer,
intent(in) :: fid
2183 character(len=*),
intent(in) :: vname
2184 character(len=*),
intent(in) :: key
2185 character(len=*),
intent(in) :: val
2190 log_error(
"FILE_set_attribute_text",*)
'File is not opened. fid = ', fid
2195 file_files(fid)%fid, vname, &
2199 log_error(
"FILE_set_attribute_text",*)
'failed to set text attribute for '//trim(vname)//
': '//trim(key)
2204 end subroutine file_set_attribute_text
2206 subroutine file_set_attribute_logical( &
2209 integer,
intent(in) :: fid
2210 character(len=*),
intent(in) :: vname
2211 character(len=*),
intent(in) :: key
2212 logical,
intent(in) :: val
2214 character(len=5) :: buf
2217 log_error(
"FILE_set_attribute_logical",*)
'File is not opened. fid = ', fid
2227 call file_set_attribute_text( fid, vname, key, buf )
2230 end subroutine file_set_attribute_logical
2233 subroutine file_set_attribute_int_ary( &
2236 integer,
intent(in) :: fid
2237 character(len=*),
intent(in) :: vname
2238 character(len=*),
intent(in) :: key
2239 integer,
intent(in) :: val(:)
2246 log_error(
"FILE_set_attribute_int",*)
'File is not opened. fid = ', fid
2251 file_files(fid)%fid, vname, &
2252 key, val(:),
size(val(:)), &
2255 log_error(
"FILE_set_attribute_int",*)
'failed to set integer attribute for '//trim(vname)//
': '//trim(key)
2260 end subroutine file_set_attribute_int_ary
2262 subroutine file_set_attribute_int( &
2265 integer,
intent(in) :: fid
2266 character(len=*),
intent(in) :: vname
2267 character(len=*),
intent(in) :: key
2268 integer,
intent(in) :: val
2273 call file_set_attribute_int_ary( fid, vname, &
2277 end subroutine file_set_attribute_int
2280 subroutine file_set_attribute_float_ary( &
2283 integer,
intent(in) :: fid
2284 character(len=*),
intent(in) :: vname
2285 character(len=*),
intent(in) :: key
2286 real(
sp),
intent(in) :: val(:)
2293 log_error(
"FILE_set_attributefloat",*)
'File is not opened. fid = ', fid
2298 file_files(fid)%fid, vname, &
2299 key, val(:),
size(val(:)), &
2302 log_error(
"FILE_set_attribute_float",*)
'failed to set float attribute for '//trim(vname)//
': '//trim(key)
2307 end subroutine file_set_attribute_float_ary
2309 subroutine file_set_attribute_float( &
2312 integer,
intent(in) :: fid
2313 character(len=*),
intent(in) :: vname
2314 character(len=*),
intent(in) :: key
2315 real(
sp),
intent(in) :: val
2320 call file_set_attribute_float_ary( fid, vname, &
2324 end subroutine file_set_attribute_float
2326 subroutine file_set_attribute_double_ary( &
2329 integer,
intent(in) :: fid
2330 character(len=*),
intent(in) :: vname
2331 character(len=*),
intent(in) :: key
2332 real(
dp),
intent(in) :: val(:)
2339 log_error(
"FILE_set_attributedouble",*)
'File is not opened. fid = ', fid
2344 file_files(fid)%fid, vname, &
2345 key, val(:),
size(val(:)), &
2348 log_error(
"FILE_set_attribute_double",*)
'failed to set double attribute for '//trim(vname)//
': '//trim(key)
2353 end subroutine file_set_attribute_double_ary
2355 subroutine file_set_attribute_double( &
2358 integer,
intent(in) :: fid
2359 character(len=*),
intent(in) :: vname
2360 character(len=*),
intent(in) :: key
2361 real(
dp),
intent(in) :: val
2366 call file_set_attribute_double_ary( fid, vname, &
2370 end subroutine file_set_attribute_double
2374 subroutine file_get_shape_fname( &
2375 basename, varname, &
2381 character(len=*),
intent( in) :: basename
2382 character(len=*),
intent( in) :: varname
2383 integer,
intent(out) :: dims(:)
2384 integer,
intent( in),
optional :: rankid
2385 logical,
intent( in),
optional :: single
2386 logical,
intent(out),
optional :: error
2394 rankid=rankid, single=single )
2396 call file_get_shape_fid( fid, varname, &
2401 end subroutine file_get_shape_fname
2403 subroutine file_get_shape_fid( &
2408 integer,
intent( in) :: fid
2409 character(len=*),
intent( in) :: varname
2411 integer,
intent(out) :: dims(:)
2413 logical,
intent(out),
optional :: error
2425 log_error(
"FILE_get_shape_id",*)
'File is not opened. fid = ', fid
2429 if (
present(error) )
then
2437 file_files(fid)%fid, varname, &
2443 if (
present(error) )
then
2447 log_error(
"FILE_get_shape_fid",*)
'failed to get data information : ', trim(varname)
2452 if ( dinfo%rank /=
size(dims) )
then
2453 log_error(
"FILE_get_shape_fid",*)
'rank is different, ', trim(varname),
size(dims), dinfo%rank
2456 do n = 1,
size(dims)
2457 dims(n) = dinfo%dim_size(n)
2460 if (
present(error) ) error = .false.
2463 end subroutine file_get_shape_fid
2472 integer,
intent(in) :: fid
2473 character(len=*),
intent(in) :: varname
2475 integer,
intent(out) :: len
2477 logical,
intent(out),
optional :: error
2482 log_error(
"FILE_get_stepSize",*)
'File is not opened. fid = ', fid
2489 if (
present(error) )
then
2492 log_error(
"FILE_get_stepSize",*)
'failed to get number of steps'
2496 if (
present(error) ) error = .false.
2505 subroutine file_get_commoninfo_fname( &
2516 character(len=*),
intent(in) :: basename
2517 integer,
intent(in) :: rankid
2518 integer,
intent(in) :: nvars_limit
2519 character(len=FILE_HMID),
intent(out) :: title
2520 character(len=FILE_HMID),
intent(out) :: source
2521 character(len=FILE_HMID),
intent(out) :: institution
2522 integer,
intent(out) :: nvars
2523 character(len=FILE_HSHORT),
intent(out) :: varname(nvars_limit)
2532 call file_get_commoninfo_fid( fid, &
2541 end subroutine file_get_commoninfo_fname
2543 subroutine file_get_commoninfo_fid( &
2553 integer,
intent(in) :: fid
2554 integer,
intent(in) :: nvars_limit
2555 character(len=FILE_HMID),
intent(out) :: title
2556 character(len=FILE_HMID),
intent(out) :: source
2557 character(len=FILE_HMID),
intent(out) :: institution
2558 integer,
intent(out) :: nvars
2559 character(len=FILE_HSHORT),
intent(out) :: varname(nvars_limit)
2565 log_error(
"FILE_get_commonInfo_fid",*)
'File is not opened. fid = ', fid
2569 call file_get_attribute( fid,
'global',
'title', title )
2570 call file_get_attribute( fid,
'global',
'source', source )
2571 call file_get_attribute( fid,
'global',
'institution', institution )
2573 call file_get_var_num( fid, nvars_limit, nvars )
2576 call file_get_var_name( fid, v, varname(v) )
2580 end subroutine file_get_commoninfo_fid
2585 subroutine file_get_datainfo_fname( &
2586 basename, varname, &
2587 rankid, istep, single, &
2589 description, units, standard_name, &
2591 dim_rank, dim_name, dim_size, &
2592 natts, att_name, att_type, att_len, &
2593 time_start, time_end, &
2594 time_units, calendar )
2597 character(len=*),
intent(in) :: basename
2598 character(len=*),
intent(in) :: varname
2600 integer,
intent(in),
optional :: rankid
2601 integer,
intent(in),
optional :: istep
2602 logical,
intent(in),
optional :: single
2603 logical,
intent(out),
optional :: existed
2604 character(len=FILE_HMID),
intent(out),
optional :: description
2605 character(len=FILE_HSHORT),
intent(out),
optional :: units
2606 character(len=FILE_HMID),
intent(out),
optional :: standard_name
2607 integer,
intent(out),
optional :: datatype
2608 integer,
intent(out),
optional :: dim_rank
2609 character(len=FILE_HSHORT),
intent(out),
optional :: dim_name(:)
2610 integer,
intent(out),
optional :: dim_size(:)
2611 integer,
intent(out),
optional :: natts
2612 character(len=FILE_HSHORT),
intent(out),
optional :: att_name(:)
2613 integer,
intent(out),
optional :: att_type(:)
2614 integer,
intent(out),
optional :: att_len (:)
2615 real(
dp),
intent(out),
optional :: time_start
2616 real(
dp),
intent(out),
optional :: time_end
2617 character(len=FILE_HMID),
intent(out),
optional :: time_units
2618 character(len=FILE_HSHORT),
intent(out),
optional :: calendar
2624 if (
present(single) )
then
2633 rankid=rankid, single=single_ )
2635 call file_get_datainfo_fid( fid, varname, &
2638 description, units, standard_name, &
2640 dim_rank, dim_name, dim_size, &
2641 natts, att_name, att_type, att_len, &
2642 time_start, time_end, time_units, calendar )
2645 end subroutine file_get_datainfo_fname
2647 subroutine file_get_datainfo_fid( &
2651 description, units, standard_name, &
2653 dim_rank, dim_name, dim_size, &
2654 natts, att_name, att_type, att_len, &
2655 time_start, time_end, &
2656 time_units, calendar )
2659 integer,
intent(in) :: fid
2660 character(len=*),
intent(in) :: varname
2662 integer,
intent(in),
optional :: istep
2663 logical,
intent(out),
optional :: existed
2664 character(len=FILE_HMID),
intent(out),
optional :: description
2665 character(len=FILE_HSHORT),
intent(out),
optional :: units
2666 character(len=FILE_HMID),
intent(out),
optional :: standard_name
2667 integer,
intent(out),
optional :: datatype
2668 integer,
intent(out),
optional :: dim_rank
2669 character(len=FILE_HSHORT),
intent(out),
optional :: dim_name(:)
2670 integer,
intent(out),
optional :: dim_size(:)
2671 integer,
intent(out),
optional :: natts
2672 character(len=FILE_HSHORT),
intent(out),
optional :: att_name(:)
2673 integer,
intent(out),
optional :: att_type(:)
2674 integer,
intent(out),
optional :: att_len (:)
2675 real(
dp),
intent(out),
optional :: time_start
2676 real(
dp),
intent(out),
optional :: time_end
2677 character(len=FILE_HMID),
intent(out),
optional :: time_units
2678 character(len=FILE_HSHORT),
intent(out),
optional :: calendar
2693 if (
present(istep) )
then
2699 if (
present(existed) )
then
2706 log_error(
"FILE_get_dataInfo_fid",*)
'File is not opened. fid = ', fid
2712 file_files(fid)%fid, &
2720 if (
present( existed ) )
then
2724 log_error(
"FILE_get_dataInfo_fid",*)
'data info not found'
2729 if (
present(existed) ) existed = .true.
2731 if (
present(description) ) description = dinfo%description
2732 if (
present(units) ) units = dinfo%units
2733 if (
present(standard_name) ) standard_name = dinfo%standard_name
2734 if (
present(datatype) ) datatype = dinfo%datatype
2735 if (
present(dim_rank) ) dim_rank = dinfo%rank
2737 if (
present(dim_name) )
then
2738 do i = 1, min( dinfo%rank,
size(dim_name) )
2739 dim_name(
i) = dinfo%dim_name(
i)
2743 if (
present(dim_size) )
then
2744 do i = 1, min( dinfo%rank,
size(dim_size) )
2745 dim_size(
i) = dinfo%dim_size(
i)
2749 if (
present(natts) ) natts = dinfo%natts
2750 if (
present(att_name) )
then
2751 do i = 1, min( dinfo%natts,
size(att_name) )
2752 att_name(
i) = dinfo%att_name(
i)
2755 if (
present(att_type) )
then
2756 do i = 1, min( dinfo%natts,
size(att_type) )
2757 att_type(
i) = dinfo%att_type(
i)
2760 if (
present(att_len) )
then
2761 do i = 1, min( dinfo%natts,
size(att_len) )
2762 att_len(
i) = dinfo%att_len(
i)
2766 if (
present(time_units) )
then
2767 if ( dinfo%time_units ==
"" )
then
2768 call file_get_attribute( fid,
"global",
"time_units", time_units )
2770 time_units = dinfo%time_units
2774 if (
present(calendar) )
then
2775 if ( dinfo%time_units ==
"" )
then
2776 call file_get_attribute( fid,
"global",
"calendar", calendar, existed2 )
2777 if ( .not. existed2 ) calendar =
""
2779 calendar = dinfo%calendar
2783 if (
present(time_start) )
then
2784 if ( dinfo%time_units ==
"" )
then
2785 call file_get_attribute( fid,
"global",
"time_start", time )
2786 time_start = time(1)
2788 time_start = dinfo%time_start
2792 if (
present(time_end) )
then
2793 if ( dinfo%time_units ==
"" )
then
2794 call file_get_attribute( fid,
"global",
"time_start", time )
2797 time_end = dinfo%time_end
2802 end subroutine file_get_datainfo_fid
2807 subroutine file_get_all_datainfo_fname( &
2808 basename, varname, &
2810 description, units, standard_name, &
2812 dim_rank, dim_name, dim_size, &
2813 natts, att_name, att_type, att_len, &
2814 time_start, time_end, &
2815 time_units, calendar, &
2818 character(len=*),
intent(in) :: basename
2819 character(len=*),
intent(in) :: varname
2820 integer,
intent(out) :: step_nmax
2821 character(len=FILE_HMID),
intent(out) :: description
2822 character(len=FILE_HSHORT),
intent(out) :: units
2823 character(len=FILE_HMID),
intent(out) :: standard_name
2824 integer,
intent(out) :: datatype
2825 integer,
intent(out) :: dim_rank
2826 character(len=FILE_HSHORT),
intent(out) :: dim_name (:)
2827 integer,
intent(out) :: dim_size (:)
2828 integer,
intent(out) :: natts
2829 character(len=FILE_HSHORT),
intent(out) :: att_name (:)
2830 integer,
intent(out) :: att_type (:)
2831 integer,
intent(out) :: att_len (:)
2832 real(
dp),
intent(out) :: time_start(:)
2833 real(
dp),
intent(out) :: time_end (:)
2834 character(len=FILE_HMID),
intent(out) :: time_units
2835 character(len=FILE_HSHORT),
intent(out) :: calendar
2837 integer,
intent(in),
optional :: rankid
2838 logical,
intent(in),
optional :: single
2844 if (
present(single) )
then
2853 rankid=rankid, single=single_ )
2855 call file_get_all_datainfo_fid( fid, varname, &
2857 description, units, standard_name, &
2859 dim_rank, dim_name(:), dim_size(:), &
2860 natts, att_name(:), att_type(:), att_len(:), &
2861 time_start(:), time_end(:), &
2862 time_units, calendar )
2865 end subroutine file_get_all_datainfo_fname
2867 subroutine file_get_all_datainfo_fid( &
2870 description, units, standard_name, &
2872 dim_rank, dim_name, dim_size, &
2873 natts, att_name, att_type, att_len, &
2874 time_start, time_end, &
2875 time_units, calendar )
2878 integer,
intent(in) :: fid
2879 character(len=*),
intent(in) :: varname
2880 integer,
intent(out) :: step_nmax
2881 character(len=FILE_HMID),
intent(out) :: description
2882 character(len=FILE_HSHORT),
intent(out) :: units
2883 character(len=FILE_HMID),
intent(out) :: standard_name
2884 integer,
intent(out) :: datatype
2885 integer,
intent(out) :: dim_rank
2886 character(len=FILE_HSHORT),
intent(out) :: dim_name (:)
2887 integer,
intent(out) :: dim_size (:)
2888 integer,
intent(out) :: natts
2889 character(len=FILE_HSHORT),
intent(out) :: att_name (:)
2890 integer,
intent(out) :: att_type (:)
2891 integer,
intent(out) :: att_len (:)
2892 real(
dp),
intent(out) :: time_start(:)
2893 real(
dp),
intent(out) :: time_end (:)
2894 character(len=FILE_HMID),
intent(out) :: time_units
2895 character(len=FILE_HSHORT),
intent(out) :: calendar
2910 log_error(
"FILE_get_all_dataInfo_fid",*)
'File is not opened. fid = ', fid
2925 do istep = 1, min(
size(time_start),
size(time_end) )
2928 file_files(fid)%fid, &
2936 step_nmax = istep - 1
2940 if ( istep == 1 )
then
2941 description = dinfo%description
2943 standard_name = dinfo%standard_name
2944 datatype = dinfo%datatype
2945 dim_rank = dinfo%rank
2948 do i = 1, min( dinfo%rank,
size(dim_name) )
2949 dim_name(
i) = dinfo%dim_name(
i)
2950 dim_size(
i) = dinfo%dim_size(
i)
2953 do i = 1, min( dinfo%natts,
size(att_name) )
2954 att_name(
i) = dinfo%att_name(
i)
2955 att_type(
i) = dinfo%att_type(
i)
2956 att_len(
i) = dinfo%att_len (
i)
2959 if ( dinfo%time_units ==
"" )
then
2960 call file_get_attribute( fid,
"global",
"time_units", time_units )
2961 call file_get_attribute( fid,
"global",
"calendar", calendar, existed )
2962 if ( .not. existed ) calendar =
""
2963 call file_get_attribute( fid,
"global",
"time_start", time )
2964 time_start(1) = time(1)
2965 time_end(1) = time(1)
2969 time_units = dinfo%time_units
2970 calendar = dinfo%calendar
2971 time_start(1) = dinfo%time_start
2972 time_end(1) = dinfo%time_end
2975 time_start(istep) = dinfo%time_start
2976 time_end(istep) = dinfo%time_end
2981 end subroutine file_get_all_datainfo_fid
2986 subroutine file_read_realsp_1d( &
2987 basename, varname, &
2989 step, rankid, single, postfix, &
2990 allow_missing, missing_value )
2993 character(len=*),
intent( in) :: basename
2994 character(len=*),
intent( in) :: varname
2995 real(
sp),
intent(out) :: var(:)
2996 integer,
intent( in),
optional :: step
2997 integer,
intent( in),
optional :: rankid
2998 logical,
intent( in),
optional :: single
2999 character(len=*),
intent( in),
optional :: postfix
3000 logical,
intent( in),
optional :: allow_missing
3001 real(
sp),
intent( in),
optional :: missing_value
3011 rankid=rankid, single=single, &
3014 call file_read_var_realsp_1d( &
3018 allow_missing=allow_missing, missing_value=missing_value )
3021 end subroutine file_read_realsp_1d
3022 subroutine file_read_realdp_1d( &
3023 basename, varname, &
3025 step, rankid, single, postfix, &
3026 allow_missing, missing_value )
3029 character(len=*),
intent( in) :: basename
3030 character(len=*),
intent( in) :: varname
3031 real(
dp),
intent(out) :: var(:)
3032 integer,
intent( in),
optional :: step
3033 integer,
intent( in),
optional :: rankid
3034 logical,
intent( in),
optional :: single
3035 character(len=*),
intent( in),
optional :: postfix
3036 logical,
intent( in),
optional :: allow_missing
3037 real(
dp),
intent( in),
optional :: missing_value
3047 rankid=rankid, single=single, &
3050 call file_read_var_realdp_1d( &
3054 allow_missing=allow_missing, missing_value=missing_value )
3057 end subroutine file_read_realdp_1d
3058 subroutine file_read_realsp_2d( &
3059 basename, varname, &
3061 step, rankid, single, postfix, &
3062 allow_missing, missing_value )
3065 character(len=*),
intent( in) :: basename
3066 character(len=*),
intent( in) :: varname
3067 real(
sp),
intent(out) :: var(:,:)
3068 integer,
intent( in),
optional :: step
3069 integer,
intent( in),
optional :: rankid
3070 logical,
intent( in),
optional :: single
3071 character(len=*),
intent( in),
optional :: postfix
3072 logical,
intent( in),
optional :: allow_missing
3073 real(
sp),
intent( in),
optional :: missing_value
3083 rankid=rankid, single=single, &
3086 call file_read_var_realsp_2d( &
3090 allow_missing=allow_missing, missing_value=missing_value )
3093 end subroutine file_read_realsp_2d
3094 subroutine file_read_realdp_2d( &
3095 basename, varname, &
3097 step, rankid, single, postfix, &
3098 allow_missing, missing_value )
3101 character(len=*),
intent( in) :: basename
3102 character(len=*),
intent( in) :: varname
3103 real(
dp),
intent(out) :: var(:,:)
3104 integer,
intent( in),
optional :: step
3105 integer,
intent( in),
optional :: rankid
3106 logical,
intent( in),
optional :: single
3107 character(len=*),
intent( in),
optional :: postfix
3108 logical,
intent( in),
optional :: allow_missing
3109 real(
dp),
intent( in),
optional :: missing_value
3119 rankid=rankid, single=single, &
3122 call file_read_var_realdp_2d( &
3126 allow_missing=allow_missing, missing_value=missing_value )
3129 end subroutine file_read_realdp_2d
3130 subroutine file_read_realsp_3d( &
3131 basename, varname, &
3133 step, rankid, single, postfix, &
3134 allow_missing, missing_value )
3137 character(len=*),
intent( in) :: basename
3138 character(len=*),
intent( in) :: varname
3139 real(
sp),
intent(out) :: var(:,:,:)
3140 integer,
intent( in),
optional :: step
3141 integer,
intent( in),
optional :: rankid
3142 logical,
intent( in),
optional :: single
3143 character(len=*),
intent( in),
optional :: postfix
3144 logical,
intent( in),
optional :: allow_missing
3145 real(
sp),
intent( in),
optional :: missing_value
3155 rankid=rankid, single=single, &
3158 call file_read_var_realsp_3d( &
3162 allow_missing=allow_missing, missing_value=missing_value )
3165 end subroutine file_read_realsp_3d
3166 subroutine file_read_realdp_3d( &
3167 basename, varname, &
3169 step, rankid, single, postfix, &
3170 allow_missing, missing_value )
3173 character(len=*),
intent( in) :: basename
3174 character(len=*),
intent( in) :: varname
3175 real(
dp),
intent(out) :: var(:,:,:)
3176 integer,
intent( in),
optional :: step
3177 integer,
intent( in),
optional :: rankid
3178 logical,
intent( in),
optional :: single
3179 character(len=*),
intent( in),
optional :: postfix
3180 logical,
intent( in),
optional :: allow_missing
3181 real(
dp),
intent( in),
optional :: missing_value
3191 rankid=rankid, single=single, &
3194 call file_read_var_realdp_3d( &
3198 allow_missing=allow_missing, missing_value=missing_value )
3201 end subroutine file_read_realdp_3d
3202 subroutine file_read_realsp_4d( &
3203 basename, varname, &
3205 step, rankid, single, postfix, &
3206 allow_missing, missing_value )
3209 character(len=*),
intent( in) :: basename
3210 character(len=*),
intent( in) :: varname
3211 real(
sp),
intent(out) :: var(:,:,:,:)
3212 integer,
intent( in),
optional :: step
3213 integer,
intent( in),
optional :: rankid
3214 logical,
intent( in),
optional :: single
3215 character(len=*),
intent( in),
optional :: postfix
3216 logical,
intent( in),
optional :: allow_missing
3217 real(
sp),
intent( in),
optional :: missing_value
3227 rankid=rankid, single=single, &
3230 call file_read_var_realsp_4d( &
3234 allow_missing=allow_missing, missing_value=missing_value )
3237 end subroutine file_read_realsp_4d
3238 subroutine file_read_realdp_4d( &
3239 basename, varname, &
3241 step, rankid, single, postfix, &
3242 allow_missing, missing_value )
3245 character(len=*),
intent( in) :: basename
3246 character(len=*),
intent( in) :: varname
3247 real(
dp),
intent(out) :: var(:,:,:,:)
3248 integer,
intent( in),
optional :: step
3249 integer,
intent( in),
optional :: rankid
3250 logical,
intent( in),
optional :: single
3251 character(len=*),
intent( in),
optional :: postfix
3252 logical,
intent( in),
optional :: allow_missing
3253 real(
dp),
intent( in),
optional :: missing_value
3263 rankid=rankid, single=single, &
3266 call file_read_var_realdp_4d( &
3270 allow_missing=allow_missing, missing_value=missing_value )
3273 end subroutine file_read_realdp_4d
3275 subroutine file_read_var_realsp_1d( &
3285 integer,
intent( in) :: fid
3286 character(len=*),
intent( in) :: varname
3287 real(
sp),
intent(out) :: var(:)
3288 integer,
intent( in),
optional :: step
3289 logical,
intent( in),
optional :: allow_missing
3290 real(
sp),
intent( in),
optional :: missing_value
3291 integer,
intent( in),
optional :: ntypes
3292 integer,
intent( in),
optional :: dtype
3293 integer,
intent( in),
optional :: start(:)
3294 integer,
intent( in),
optional :: count(:)
3297 logical :: allow_missing_
3298 real(
sp) :: missing_value_
3301 integer :: dim_size(1)
3305 intrinsic size, shape
3309 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3313 if (
present(step) )
then
3319 if (
present(allow_missing) )
then
3320 allow_missing_ = allow_missing
3322 allow_missing_ = .false.
3325 if (
present(missing_value) )
then
3326 missing_value_ = missing_value
3328 missing_value_ = 0.0_sp
3333 file_files(fid)%fid, varname, step_, allow_missing_, &
3338 if ( allow_missing_ )
then
3339 log_info(
"FILE_read_var_realSP_1D",*)
'[INPUT]/[FILE] data not found! : ', &
3340 'varname= ',trim(varname),
', step=',step_
3341 log_info(
"FILE_read_var_realSP_1D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3342 var(:) = missing_value_
3345 log_error(
"FILE_read_var_realSP_1D",*)
'failed to get data information :'//trim(varname)
3350 if ( dinfo%rank /= 1 )
then
3351 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
3352 log_error(
"FILE_read_var_realSP_1D",*)
'rank of '//trim(varname)//
' is not 1', dinfo%rank
3357 if (
present(ntypes) )
then
3359 dinfo,
sp, ntypes, dtype, start(:), count(:), &
3361 else if (
present(start) .and.
present(count) )
then
3363 dinfo,
sp, 0, 0, start(:), count(:), &
3366 dim_size(:) = shape(var)
3368 if ( dinfo%dim_size(n) /= dim_size(n) )
then
3369 log_error(
"FILE_read_var_realSP_1D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
3374 dinfo,
sp, 0, 0, -1, -1, &
3378 log_error(
"FILE_read_var_realSP_1D",*)
'failed to get data value: ', trim(varname)
3383 end subroutine file_read_var_realsp_1d
3384 subroutine file_read_var_realdp_1d( &
3394 integer,
intent( in) :: fid
3395 character(len=*),
intent( in) :: varname
3396 real(
dp),
intent(out) :: var(:)
3397 integer,
intent( in),
optional :: step
3398 logical,
intent( in),
optional :: allow_missing
3399 real(
dp),
intent( in),
optional :: missing_value
3400 integer,
intent( in),
optional :: ntypes
3401 integer,
intent( in),
optional :: dtype
3402 integer,
intent( in),
optional :: start(:)
3403 integer,
intent( in),
optional :: count(:)
3406 logical :: allow_missing_
3407 real(
dp) :: missing_value_
3410 integer :: dim_size(1)
3414 intrinsic size, shape
3418 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3422 if (
present(step) )
then
3428 if (
present(allow_missing) )
then
3429 allow_missing_ = allow_missing
3431 allow_missing_ = .false.
3434 if (
present(missing_value) )
then
3435 missing_value_ = missing_value
3437 missing_value_ = 0.0_dp
3442 file_files(fid)%fid, varname, step_, allow_missing_, &
3447 if ( allow_missing_ )
then
3448 log_info(
"FILE_read_var_realDP_1D",*)
'[INPUT]/[FILE] data not found! : ', &
3449 'varname= ',trim(varname),
', step=',step_
3450 log_info(
"FILE_read_var_realDP_1D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3451 var(:) = missing_value_
3454 log_error(
"FILE_read_var_realDP_1D",*)
'failed to get data information :'//trim(varname)
3459 if ( dinfo%rank /= 1 )
then
3460 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
3461 log_error(
"FILE_read_var_realDP_1D",*)
'rank of '//trim(varname)//
' is not 1', dinfo%rank
3466 if (
present(ntypes) )
then
3468 dinfo,
dp, ntypes, dtype, start(:), count(:), &
3470 else if (
present(start) .and.
present(count) )
then
3472 dinfo,
dp, 0, 0, start(:), count(:), &
3475 dim_size(:) = shape(var)
3477 if ( dinfo%dim_size(n) /= dim_size(n) )
then
3478 log_error(
"FILE_read_var_realDP_1D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
3483 dinfo,
dp, 0, 0, -1, -1, &
3487 log_error(
"FILE_read_var_realDP_1D",*)
'failed to get data value: ', trim(varname)
3492 end subroutine file_read_var_realdp_1d
3493 subroutine file_read_var_realsp_2d( &
3503 integer,
intent( in) :: fid
3504 character(len=*),
intent( in) :: varname
3505 real(
sp),
intent(out) :: var(:,:)
3506 integer,
intent( in),
optional :: step
3507 logical,
intent( in),
optional :: allow_missing
3508 real(
sp),
intent( in),
optional :: missing_value
3509 integer,
intent( in),
optional :: ntypes
3510 integer,
intent( in),
optional :: dtype
3511 integer,
intent( in),
optional :: start(:)
3512 integer,
intent( in),
optional :: count(:)
3515 logical :: allow_missing_
3516 real(
sp) :: missing_value_
3519 integer :: dim_size(2)
3523 intrinsic size, shape
3527 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3531 if (
present(step) )
then
3537 if (
present(allow_missing) )
then
3538 allow_missing_ = allow_missing
3540 allow_missing_ = .false.
3543 if (
present(missing_value) )
then
3544 missing_value_ = missing_value
3546 missing_value_ = 0.0_sp
3551 file_files(fid)%fid, varname, step_, allow_missing_, &
3556 if ( allow_missing_ )
then
3557 log_info(
"FILE_read_var_realSP_2D",*)
'[INPUT]/[FILE] data not found! : ', &
3558 'varname= ',trim(varname),
', step=',step_
3559 log_info(
"FILE_read_var_realSP_2D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3560 var(:,:) = missing_value_
3563 log_error(
"FILE_read_var_realSP_2D",*)
'failed to get data information :'//trim(varname)
3568 if ( dinfo%rank /= 2 )
then
3569 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
3570 log_error(
"FILE_read_var_realSP_2D",*)
'rank of '//trim(varname)//
' is not 2', dinfo%rank
3575 if (
present(ntypes) )
then
3577 dinfo,
sp, ntypes, dtype, start(:), count(:), &
3579 else if (
present(start) .and.
present(count) )
then
3581 dinfo,
sp, 0, 0, start(:), count(:), &
3584 dim_size(:) = shape(var)
3586 if ( dinfo%dim_size(n) /= dim_size(n) )
then
3587 log_error(
"FILE_read_var_realSP_2D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
3592 dinfo,
sp, 0, 0, -1, -1, &
3596 log_error(
"FILE_read_var_realSP_2D",*)
'failed to get data value: ', trim(varname)
3601 end subroutine file_read_var_realsp_2d
3602 subroutine file_read_var_realdp_2d( &
3612 integer,
intent( in) :: fid
3613 character(len=*),
intent( in) :: varname
3614 real(
dp),
intent(out) :: var(:,:)
3615 integer,
intent( in),
optional :: step
3616 logical,
intent( in),
optional :: allow_missing
3617 real(
dp),
intent( in),
optional :: missing_value
3618 integer,
intent( in),
optional :: ntypes
3619 integer,
intent( in),
optional :: dtype
3620 integer,
intent( in),
optional :: start(:)
3621 integer,
intent( in),
optional :: count(:)
3624 logical :: allow_missing_
3625 real(
dp) :: missing_value_
3628 integer :: dim_size(2)
3632 intrinsic size, shape
3636 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3640 if (
present(step) )
then
3646 if (
present(allow_missing) )
then
3647 allow_missing_ = allow_missing
3649 allow_missing_ = .false.
3652 if (
present(missing_value) )
then
3653 missing_value_ = missing_value
3655 missing_value_ = 0.0_dp
3660 file_files(fid)%fid, varname, step_, allow_missing_, &
3665 if ( allow_missing_ )
then
3666 log_info(
"FILE_read_var_realDP_2D",*)
'[INPUT]/[FILE] data not found! : ', &
3667 'varname= ',trim(varname),
', step=',step_
3668 log_info(
"FILE_read_var_realDP_2D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3669 var(:,:) = missing_value_
3672 log_error(
"FILE_read_var_realDP_2D",*)
'failed to get data information :'//trim(varname)
3677 if ( dinfo%rank /= 2 )
then
3678 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
3679 log_error(
"FILE_read_var_realDP_2D",*)
'rank of '//trim(varname)//
' is not 2', dinfo%rank
3684 if (
present(ntypes) )
then
3686 dinfo,
dp, ntypes, dtype, start(:), count(:), &
3688 else if (
present(start) .and.
present(count) )
then
3690 dinfo,
dp, 0, 0, start(:), count(:), &
3693 dim_size(:) = shape(var)
3695 if ( dinfo%dim_size(n) /= dim_size(n) )
then
3696 log_error(
"FILE_read_var_realDP_2D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
3701 dinfo,
dp, 0, 0, -1, -1, &
3705 log_error(
"FILE_read_var_realDP_2D",*)
'failed to get data value: ', trim(varname)
3710 end subroutine file_read_var_realdp_2d
3711 subroutine file_read_var_realsp_3d( &
3721 integer,
intent( in) :: fid
3722 character(len=*),
intent( in) :: varname
3723 real(
sp),
intent(out) :: var(:,:,:)
3724 integer,
intent( in),
optional :: step
3725 logical,
intent( in),
optional :: allow_missing
3726 real(
sp),
intent( in),
optional :: missing_value
3727 integer,
intent( in),
optional :: ntypes
3728 integer,
intent( in),
optional :: dtype
3729 integer,
intent( in),
optional :: start(:)
3730 integer,
intent( in),
optional :: count(:)
3733 logical :: allow_missing_
3734 real(
sp) :: missing_value_
3737 integer :: dim_size(3)
3741 intrinsic size, shape
3745 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3749 if (
present(step) )
then
3755 if (
present(allow_missing) )
then
3756 allow_missing_ = allow_missing
3758 allow_missing_ = .false.
3761 if (
present(missing_value) )
then
3762 missing_value_ = missing_value
3764 missing_value_ = 0.0_sp
3769 file_files(fid)%fid, varname, step_, allow_missing_, &
3774 if ( allow_missing_ )
then
3775 log_info(
"FILE_read_var_realSP_3D",*)
'[INPUT]/[FILE] data not found! : ', &
3776 'varname= ',trim(varname),
', step=',step_
3777 log_info(
"FILE_read_var_realSP_3D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3778 var(:,:,:) = missing_value_
3781 log_error(
"FILE_read_var_realSP_3D",*)
'failed to get data information :'//trim(varname)
3786 if ( dinfo%rank /= 3 )
then
3787 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
3788 log_error(
"FILE_read_var_realSP_3D",*)
'rank of '//trim(varname)//
' is not 3', dinfo%rank
3793 if (
present(ntypes) )
then
3795 dinfo,
sp, ntypes, dtype, start(:), count(:), &
3797 else if (
present(start) .and.
present(count) )
then
3799 dinfo,
sp, 0, 0, start(:), count(:), &
3802 dim_size(:) = shape(var)
3804 if ( dinfo%dim_size(n) /= dim_size(n) )
then
3805 log_error(
"FILE_read_var_realSP_3D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
3810 dinfo,
sp, 0, 0, -1, -1, &
3814 log_error(
"FILE_read_var_realSP_3D",*)
'failed to get data value: ', trim(varname)
3819 end subroutine file_read_var_realsp_3d
3820 subroutine file_read_var_realdp_3d( &
3830 integer,
intent( in) :: fid
3831 character(len=*),
intent( in) :: varname
3832 real(
dp),
intent(out) :: var(:,:,:)
3833 integer,
intent( in),
optional :: step
3834 logical,
intent( in),
optional :: allow_missing
3835 real(
dp),
intent( in),
optional :: missing_value
3836 integer,
intent( in),
optional :: ntypes
3837 integer,
intent( in),
optional :: dtype
3838 integer,
intent( in),
optional :: start(:)
3839 integer,
intent( in),
optional :: count(:)
3842 logical :: allow_missing_
3843 real(
dp) :: missing_value_
3846 integer :: dim_size(3)
3850 intrinsic size, shape
3854 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3858 if (
present(step) )
then
3864 if (
present(allow_missing) )
then
3865 allow_missing_ = allow_missing
3867 allow_missing_ = .false.
3870 if (
present(missing_value) )
then
3871 missing_value_ = missing_value
3873 missing_value_ = 0.0_dp
3878 file_files(fid)%fid, varname, step_, allow_missing_, &
3883 if ( allow_missing_ )
then
3884 log_info(
"FILE_read_var_realDP_3D",*)
'[INPUT]/[FILE] data not found! : ', &
3885 'varname= ',trim(varname),
', step=',step_
3886 log_info(
"FILE_read_var_realDP_3D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3887 var(:,:,:) = missing_value_
3890 log_error(
"FILE_read_var_realDP_3D",*)
'failed to get data information :'//trim(varname)
3895 if ( dinfo%rank /= 3 )
then
3896 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
3897 log_error(
"FILE_read_var_realDP_3D",*)
'rank of '//trim(varname)//
' is not 3', dinfo%rank
3902 if (
present(ntypes) )
then
3904 dinfo,
dp, ntypes, dtype, start(:), count(:), &
3906 else if (
present(start) .and.
present(count) )
then
3908 dinfo,
dp, 0, 0, start(:), count(:), &
3911 dim_size(:) = shape(var)
3913 if ( dinfo%dim_size(n) /= dim_size(n) )
then
3914 log_error(
"FILE_read_var_realDP_3D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
3919 dinfo,
dp, 0, 0, -1, -1, &
3923 log_error(
"FILE_read_var_realDP_3D",*)
'failed to get data value: ', trim(varname)
3928 end subroutine file_read_var_realdp_3d
3929 subroutine file_read_var_realsp_4d( &
3939 integer,
intent( in) :: fid
3940 character(len=*),
intent( in) :: varname
3941 real(
sp),
intent(out) :: var(:,:,:,:)
3942 integer,
intent( in),
optional :: step
3943 logical,
intent( in),
optional :: allow_missing
3944 real(
sp),
intent( in),
optional :: missing_value
3945 integer,
intent( in),
optional :: ntypes
3946 integer,
intent( in),
optional :: dtype
3947 integer,
intent( in),
optional :: start(:)
3948 integer,
intent( in),
optional :: count(:)
3951 logical :: allow_missing_
3952 real(
sp) :: missing_value_
3955 integer :: dim_size(4)
3959 intrinsic size, shape
3963 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
3967 if (
present(step) )
then
3973 if (
present(allow_missing) )
then
3974 allow_missing_ = allow_missing
3976 allow_missing_ = .false.
3979 if (
present(missing_value) )
then
3980 missing_value_ = missing_value
3982 missing_value_ = 0.0_sp
3987 file_files(fid)%fid, varname, step_, allow_missing_, &
3992 if ( allow_missing_ )
then
3993 log_info(
"FILE_read_var_realSP_4D",*)
'[INPUT]/[FILE] data not found! : ', &
3994 'varname= ',trim(varname),
', step=',step_
3995 log_info(
"FILE_read_var_realSP_4D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
3996 var(:,:,:,:) = missing_value_
3999 log_error(
"FILE_read_var_realSP_4D",*)
'failed to get data information :'//trim(varname)
4004 if ( dinfo%rank /= 4 )
then
4005 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
4006 log_error(
"FILE_read_var_realSP_4D",*)
'rank of '//trim(varname)//
' is not 4', dinfo%rank
4011 if (
present(ntypes) )
then
4013 dinfo,
sp, ntypes, dtype, start(:), count(:), &
4015 else if (
present(start) .and.
present(count) )
then
4017 dinfo,
sp, 0, 0, start(:), count(:), &
4020 dim_size(:) = shape(var)
4022 if ( dinfo%dim_size(n) /= dim_size(n) )
then
4023 log_error(
"FILE_read_var_realSP_4D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
4028 dinfo,
sp, 0, 0, -1, -1, &
4032 log_error(
"FILE_read_var_realSP_4D",*)
'failed to get data value: ', trim(varname)
4037 end subroutine file_read_var_realsp_4d
4038 subroutine file_read_var_realdp_4d( &
4048 integer,
intent( in) :: fid
4049 character(len=*),
intent( in) :: varname
4050 real(
dp),
intent(out) :: var(:,:,:,:)
4051 integer,
intent( in),
optional :: step
4052 logical,
intent( in),
optional :: allow_missing
4053 real(
dp),
intent( in),
optional :: missing_value
4054 integer,
intent( in),
optional :: ntypes
4055 integer,
intent( in),
optional :: dtype
4056 integer,
intent( in),
optional :: start(:)
4057 integer,
intent( in),
optional :: count(:)
4060 logical :: allow_missing_
4061 real(
dp) :: missing_value_
4064 integer :: dim_size(4)
4068 intrinsic size, shape
4072 log_error(
"FILE_",*)
'File is not opened. fid = ', fid
4076 if (
present(step) )
then
4082 if (
present(allow_missing) )
then
4083 allow_missing_ = allow_missing
4085 allow_missing_ = .false.
4088 if (
present(missing_value) )
then
4089 missing_value_ = missing_value
4091 missing_value_ = 0.0_dp
4096 file_files(fid)%fid, varname, step_, allow_missing_, &
4101 if ( allow_missing_ )
then
4102 log_info(
"FILE_read_var_realDP_4D",*)
'[INPUT]/[FILE] data not found! : ', &
4103 'varname= ',trim(varname),
', step=',step_
4104 log_info(
"FILE_read_var_realDP_4D",*)
'[INPUT]/[FILE] Value is set to ', missing_value_
4105 var(:,:,:,:) = missing_value_
4108 log_error(
"FILE_read_var_realDP_4D",*)
'failed to get data information :'//trim(varname)
4113 if ( dinfo%rank /= 4 )
then
4114 if ( (.not.
present(start)) .and. (.not.
present(count)) )
then
4115 log_error(
"FILE_read_var_realDP_4D",*)
'rank of '//trim(varname)//
' is not 4', dinfo%rank
4120 if (
present(ntypes) )
then
4122 dinfo,
dp, ntypes, dtype, start(:), count(:), &
4124 else if (
present(start) .and.
present(count) )
then
4126 dinfo,
dp, 0, 0, start(:), count(:), &
4129 dim_size(:) = shape(var)
4131 if ( dinfo%dim_size(n) /= dim_size(n) )
then
4132 log_error(
"FILE_read_var_realDP_4D",*)
'shape is different: ', trim(varname), n, dinfo%dim_size(n), dim_size(n)
4137 dinfo,
dp, 0, 0, -1, -1, &
4141 log_error(
"FILE_read_var_realDP_4D",*)
'failed to get data value: ', trim(varname)
4146 end subroutine file_read_var_realdp_4d
4151 subroutine file_write_realsp_1d( &
4159 integer,
intent(in) :: vid
4160 real(
sp),
intent(in) :: var(:)
4161 real(
dp),
intent(in) :: t_start
4162 real(
dp),
intent(in) :: t_end
4163 integer,
intent(in),
optional :: ndims
4164 integer,
intent(in),
optional :: count(:)
4165 integer,
intent(in),
optional :: start(:)
4168 integer :: start_(1)
4179 fid = file_vars(vid)%fid
4182 log_error(
"FILE_write_realSP_1D",*)
'File is not opened. fid = ', fid
4186 if (
present(ndims) )
then
4190 if ( .not.
present(start) )
then
4191 log_error(
"FILE_write_realSP_1D",*)
'start argument is neccessary when ndims is specified'
4194 if ( .not.
present(count) )
then
4195 log_error(
"FILE_write_realSP_1D",*)
'count argument is neccessary when ndims is specified'
4200 var(:), ts, te,
sp, &
4201 ndims, start, count, &
4205 if (
present(start) )
then
4206 start_(:) = start(:)
4211 var(:), ts, te,
sp, &
4212 1, start_, shape(var), &
4216 log_error(
"FILE_write_realSP_1D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4221 end subroutine file_write_realsp_1d
4222 subroutine file_write_realdp_1d( &
4230 integer,
intent(in) :: vid
4231 real(
dp),
intent(in) :: var(:)
4232 real(
dp),
intent(in) :: t_start
4233 real(
dp),
intent(in) :: t_end
4234 integer,
intent(in),
optional :: ndims
4235 integer,
intent(in),
optional :: count(:)
4236 integer,
intent(in),
optional :: start(:)
4239 integer :: start_(1)
4250 fid = file_vars(vid)%fid
4253 log_error(
"FILE_write_realDP_1D",*)
'File is not opened. fid = ', fid
4257 if (
present(ndims) )
then
4261 if ( .not.
present(start) )
then
4262 log_error(
"FILE_write_realDP_1D",*)
'start argument is neccessary when ndims is specified'
4265 if ( .not.
present(count) )
then
4266 log_error(
"FILE_write_realDP_1D",*)
'count argument is neccessary when ndims is specified'
4271 var(:), ts, te,
dp, &
4272 ndims, start, count, &
4276 if (
present(start) )
then
4277 start_(:) = start(:)
4282 var(:), ts, te,
dp, &
4283 1, start_, shape(var), &
4287 log_error(
"FILE_write_realDP_1D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4292 end subroutine file_write_realdp_1d
4293 subroutine file_write_realsp_2d( &
4299 integer,
intent(in) :: vid
4300 real(
sp),
intent(in) :: var(:,:)
4301 real(
dp),
intent(in) :: t_start
4302 real(
dp),
intent(in) :: t_end
4303 integer,
intent(in),
optional :: start(:)
4306 integer :: start_(2)
4317 fid = file_vars(vid)%fid
4320 log_error(
"FILE_write_realSP_2D",*)
'File is not opened. fid = ', fid
4325 if (
present(start) )
then
4326 start_(:) = start(:)
4331 var(:,:), ts, te,
sp, &
4332 2, start_, shape(var), &
4335 log_error(
"FILE_write_realSP_2D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4340 end subroutine file_write_realsp_2d
4341 subroutine file_write_realdp_2d( &
4347 integer,
intent(in) :: vid
4348 real(
dp),
intent(in) :: var(:,:)
4349 real(
dp),
intent(in) :: t_start
4350 real(
dp),
intent(in) :: t_end
4351 integer,
intent(in),
optional :: start(:)
4354 integer :: start_(2)
4365 fid = file_vars(vid)%fid
4368 log_error(
"FILE_write_realDP_2D",*)
'File is not opened. fid = ', fid
4373 if (
present(start) )
then
4374 start_(:) = start(:)
4379 var(:,:), ts, te,
dp, &
4380 2, start_, shape(var), &
4383 log_error(
"FILE_write_realDP_2D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4388 end subroutine file_write_realdp_2d
4389 subroutine file_write_realsp_3d( &
4395 integer,
intent(in) :: vid
4396 real(
sp),
intent(in) :: var(:,:,:)
4397 real(
dp),
intent(in) :: t_start
4398 real(
dp),
intent(in) :: t_end
4399 integer,
intent(in),
optional :: start(:)
4402 integer :: start_(3)
4413 fid = file_vars(vid)%fid
4416 log_error(
"FILE_write_realSP_3D",*)
'File is not opened. fid = ', fid
4421 if (
present(start) )
then
4422 start_(:) = start(:)
4427 var(:,:,:), ts, te,
sp, &
4428 3, start_, shape(var), &
4431 log_error(
"FILE_write_realSP_3D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4436 end subroutine file_write_realsp_3d
4437 subroutine file_write_realdp_3d( &
4443 integer,
intent(in) :: vid
4444 real(
dp),
intent(in) :: var(:,:,:)
4445 real(
dp),
intent(in) :: t_start
4446 real(
dp),
intent(in) :: t_end
4447 integer,
intent(in),
optional :: start(:)
4450 integer :: start_(3)
4461 fid = file_vars(vid)%fid
4464 log_error(
"FILE_write_realDP_3D",*)
'File is not opened. fid = ', fid
4469 if (
present(start) )
then
4470 start_(:) = start(:)
4475 var(:,:,:), ts, te,
dp, &
4476 3, start_, shape(var), &
4479 log_error(
"FILE_write_realDP_3D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4484 end subroutine file_write_realdp_3d
4485 subroutine file_write_realsp_4d( &
4491 integer,
intent(in) :: vid
4492 real(
sp),
intent(in) :: var(:,:,:,:)
4493 real(
dp),
intent(in) :: t_start
4494 real(
dp),
intent(in) :: t_end
4495 integer,
intent(in),
optional :: start(:)
4498 integer :: start_(4)
4509 fid = file_vars(vid)%fid
4512 log_error(
"FILE_write_realSP_4D",*)
'File is not opened. fid = ', fid
4517 if (
present(start) )
then
4518 start_(:) = start(:)
4523 var(:,:,:,:), ts, te,
sp, &
4524 4, start_, shape(var), &
4527 log_error(
"FILE_write_realSP_4D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4532 end subroutine file_write_realsp_4d
4533 subroutine file_write_realdp_4d( &
4539 integer,
intent(in) :: vid
4540 real(
dp),
intent(in) :: var(:,:,:,:)
4541 real(
dp),
intent(in) :: t_start
4542 real(
dp),
intent(in) :: t_end
4543 integer,
intent(in),
optional :: start(:)
4546 integer :: start_(4)
4557 fid = file_vars(vid)%fid
4560 log_error(
"FILE_write_realDP_4D",*)
'File is not opened. fid = ', fid
4565 if (
present(start) )
then
4566 start_(:) = start(:)
4571 var(:,:,:,:), ts, te,
dp, &
4572 4, start_, shape(var), &
4575 log_error(
"FILE_write_realDP_4D",*)
'failed to write data: ', trim(file_vars(vid)%name)
4580 end subroutine file_write_realdp_4d
4587 integer,
intent(in) :: fid
4599 log_info(
"FILE_enddef",
'(1x,A,I3.3,2A)') &
4600 'End define mode : No.', fid,
', name = ', trim(file_files(fid)%name)
4603 log_error(
"FILE_enddef",*)
'failed to exit define mode'
4615 integer,
intent(in) :: fid
4627 log_info(
"FILE_redef",
'(1x,A,I3.3,2A)') &
4628 'Enter to define mode : No.', fid,
', name = ', trim(file_files(fid)%name)
4631 log_error(
"FILE_redef",*)
'failed to enter to define mode'
4645 integer,
intent(in) :: fid
4646 integer(8),
intent(in) :: buf_amount
4653 if ( file_files(fid)%buffer_size > 0 )
then
4660 log_error(
"FILE_attach_buffer",*)
'failed to attach buffer in PnetCDF'
4665 log_info(
"FILE_attach_buffer",
'(1x,A,I3.3,3A,I10)') &
4666 'Attach buffer : No.', fid,
', name = ', trim(file_files(fid)%name), &
4667 ', size = ', buf_amount
4669 file_files(fid)%buffer_size = buf_amount
4679 integer,
intent(in) :: fid
4686 if ( file_files(fid)%fid < 0 )
return
4688 if ( file_files(fid)%buffer_size < 0 )
return
4693 log_error(
"FILE_detach_buffer",*)
'failed to detach buffer in PnetCDF'
4698 log_info(
"FILE_detach_buffer",
'(1x,A,I3.3,2A)') &
4699 'Detach buffer : No.', fid,
', name = ', trim(file_files(fid)%name)
4701 file_files(fid)%buffer_size = -1
4711 integer,
intent(in) :: fid
4718 if ( file_files(fid)%fid < 0 )
return
4729 log_error(
"FILE_flush",*)
'failed to flush PnetCDF pending requests'
4739 integer,
intent(in) :: fid
4740 logical,
intent(in),
optional :: abort
4749 if ( file_files(fid)%fid < 0 )
return
4751 if (
present(abort) )
then
4757 call file_close_c( file_files(fid)%fid, abort_, error )
4762 log_info(
"FILE_close",
'(1x,A,I3.3,2A)') &
4763 'Close : No.', fid,
', name = ', trim(file_files(fid)%name)
4766 log_error(
"FILE_close",*)
'failed to close file'
4770 file_files(fid)%fid = -1
4771 file_files(fid)%name =
''
4772 file_files(fid)%aggregate = .false.
4773 file_files(fid)%buffer_size = -1
4775 do n = 1, file_nvars
4776 if ( file_vars(n)%fid == fid )
then
4777 file_vars(n)%vid = -1
4778 file_vars(n)%name =
''
4788 logical,
intent(in),
optional :: skip_abort
4793 do fid = 1, file_nfiles
4806 character(len=*),
intent( in) :: basename
4807 character(len=*),
intent( in) :: prefix
4808 integer,
intent( in) :: rankid
4809 integer,
intent( in) :: len
4810 character(len=*),
intent(out) :: fname
4813 character(len=17) :: fmt =
"(A, '.', A, I*.*)"
4816 if ( len < 1 .or. len > 9 )
then
4817 log_error(
"FILE_make_fname",*)
'len is invalid'
4821 write(fmt(14:14),
'(I1)') len
4822 write(fmt(16:16),
'(I1)') len
4823 write(fname, fmt) trim(basename), trim(prefix), rankid
4834 integer,
intent(in) :: date(6)
4835 character(len=*),
intent(out) :: tunits
4838 write(tunits,
'(a,i4.4,"-",i2.2,"-",i2.2," ",i2.2,":",i2.2,":",i2.2)')
'seconds since ', date
4844 integer,
intent(in) :: fid
4861 subroutine file_get_fid( &
4875 character(len=*),
intent( in) :: basename
4876 integer,
intent( in) :: mode
4877 integer,
intent( in) :: rankid
4878 logical,
intent( in) :: single
4880 integer,
intent(out) :: fid
4881 logical,
intent(out) :: existed
4883 logical,
intent( in),
optional :: aggregate
4884 character(len=*),
intent( in),
optional :: postfix
4886 character(len=FILE_HSHORT) :: rwname(0:2)
4887 data rwname /
'READ',
'WRITE',
'APPEND' /
4889 character(len=FILE_HLONG) :: fname
4892 logical :: aggregate_
4901 if (
present(aggregate) )
then
4902 aggregate_ = aggregate
4907 if ( aggregate_ )
then
4913 if (
present(postfix) )
then
4914 fname = trim(basename)//trim(postfix)
4915 elseif ( aggregate_ )
then
4917 elseif ( single )
then
4918 fname = trim(basename)//
'.peall'
4925 do n = 1, file_nfiles
4926 if ( fname == file_files(n)%name )
then
4938 fname, mode, mpi_comm, &
4942 log_error(
"FILE_get_fid",*)
'failed to open file :'//trim(fname)//
'.nc'
4946 file_nfiles = file_nfiles + 1
4949 file_files(fid)%name = fname
4950 file_files(fid)%fid = cfid
4951 file_files(fid)%aggregate = aggregate_
4952 file_files(fid)%single = single
4953 file_files(fid)%buffer_size = -1
4956 log_info(
"FILE_get_fid",
'(1x,A,A6,A,I3.3,2A)') &
4957 'Registration (', trim(rwname(mode)),
') : No.', fid,
', name = ', trim(fname)
4962 end subroutine file_get_fid