28 public file_tiledata_get_data
30 interface file_tiledata_get_data
31 module procedure file_tiledata_get_data_real
33 end interface file_tiledata_get_data
53 TILE_DLAT, TILE_DLON, &
54 DOMAIN_LATS, DOMAIN_LATE, DOMAIN_LONS, DOMAIN_LONE, &
58 TILE_fname, TILE_hit, &
59 TILE_JS, TILE_JE, TILE_IS, TILE_IE, &
60 nLATH, nLONH, jsh, jeh, ish, ieh, zonal, pole, &
61 single_fname, LATS, LATE, LONS, LONE )
66 integer,
intent(in) :: tile_nlim
67 real(
rp),
intent(in) :: tile_dlat, tile_dlon
68 real(
rp),
intent(in) :: domain_lats, domain_late, domain_lons, domain_lone
69 character(len=*),
intent(in) :: catalog_fname
70 integer,
intent(out) :: global_ia
71 integer,
intent(out) :: tile_nmax
72 logical,
intent(out) :: tile_hit(:)
73 character(len=*),
intent(out) :: tile_fname(:)
74 integer,
intent(out) :: tile_js(:), tile_je(:), tile_is(:), tile_ie(:)
75 integer,
intent(out) :: nlath, nlonh
76 integer,
intent(out) :: jsh, jeh, ish, ieh
77 logical,
intent(out) :: zonal, pole
79 character(len=*),
intent(in),
optional :: single_fname
80 real(
rp),
intent(in),
optional :: lats
81 real(
rp),
intent(in),
optional :: late
82 real(
rp),
intent(in),
optional :: lons
83 real(
rp),
intent(in),
optional :: lone
85 real(
rp) :: tile_lats(tile_nlim), tile_late(tile_nlim)
86 real(
rp) :: tile_lons(tile_nlim), tile_lone(tile_nlim)
87 real(
rp) :: lat_min, lat_max
89 integer :: domain_js, domain_je, domain_is, domain_ie
93 domain_lats, domain_late, domain_lons, domain_lone, &
94 domain_js, domain_je, domain_is, domain_ie, &
98 if ( catalog_fname /=
"" )
then
100 log_info(
"FILE_TILEDATA_get_info",*)
'Input catalogue file:', trim(catalog_fname)
104 tile_dlat, tile_dlon, &
105 domain_is, global_ia, &
108 tile_lats(:), tile_late(:), &
109 tile_lons(:), tile_lone(:) )
110 lat_min = minval( tile_lats(1:tile_nmax) )
111 lat_max = maxval( tile_late(1:tile_nmax) )
114 if ( .not.
present(single_fname) )
then
115 log_error(
"FILE_TILEDATA_get_info",*)
"single_fname is required if catalog_fname is empty"
118 if ( .not.
present(lats) )
then
119 log_error(
"FILE_TILEDATA_get_info",*)
"LATS is required if catalog_fname is empty"
122 if ( .not.
present(late) )
then
123 log_error(
"FILE_TILEDATA_get_info",*)
"LATE is required if catalog_fname is empty"
126 if ( .not.
present(lons) )
then
127 log_error(
"FILE_TILEDATA_get_info",*)
"LONS is required if catalog_fname is empty"
130 if ( .not.
present(lone) )
then
131 log_error(
"FILE_TILEDATA_get_info",*)
"LONE is required if catalog_fname is empty"
136 tile_fname(1) = single_fname
146 zonal = ( domain_lone - domain_lons ) / ( 2.0_rp * pi ) > 0.9_rp
148 pole = ( domain_lats < - pi * 0.5_rp + ( domain_late - domain_lats ) * 0.1_rp ) &
149 .or. ( domain_late > pi * 0.5_rp - ( domain_late - domain_lats ) * 0.1_rp )
151 zonal = zonal .or. pole
154 domain_js, domain_je, &
155 domain_is, domain_ie, &
157 tile_dlat, tile_dlon, &
158 tile_lats(:), tile_late(:), &
159 tile_lons(:), tile_lone(:), &
162 tile_js(:), tile_je(:), &
163 tile_is(:), tile_ie(:), &
164 jsh, jeh, ish, ieh, &
175 TILE_DLAT, TILE_DLON, &
178 integer,
intent(in) :: nlat, nlon
179 integer,
intent(in) :: jsh, ish
180 real(
rp),
intent(in) :: tile_dlat, tile_dlon
181 real(
rp),
intent(out) :: lat(nlat)
182 real(
rp),
intent(out) :: lon(nlon)
187 lat(j) = tile_dlat * ( jsh + j - 0.5_rp )
190 lon(i) = tile_dlon * ( ish + i - 0.5_rp )
198 subroutine file_tiledata_get_data_real( &
203 TILE_DLAT, TILE_DLON, &
204 TILE_fname, TILE_hit, &
207 jsh, jeh, ish, ieh, &
219 integer,
intent(in) :: nlat, nlon
220 character(len=*),
intent(in) :: dirname
221 integer,
intent(in) :: global_ia
222 integer,
intent(in) :: tile_nmax
223 real(
rp),
intent(in) :: tile_dlat, tile_dlon
224 character(len=*),
intent(in) :: tile_fname(:)
225 logical,
intent(in) :: tile_hit(:)
226 integer,
intent(in) :: tile_js(:)
227 integer,
intent(in) :: tile_je(:)
228 integer,
intent(in) :: tile_is(:)
229 integer,
intent(in) :: tile_ie(:)
230 integer,
intent(in) :: jsh
231 integer,
intent(in) :: jeh
232 integer,
intent(in) :: ish
233 integer,
intent(in) :: ieh
234 character(len=*),
intent(in) :: data_type
235 real(
rp),
intent(out) :: data(nlon,nlat)
236 real(
rp),
intent(in),
optional :: min_value
237 logical,
intent(in),
optional :: yrevers
238 integer,
intent(in),
optional :: step
248 integer,
intent(in) :: jsize
249 integer,
intent(in) :: isize
250 character(len=*),
intent(in) :: fname
251 real(
rp),
intent(out) :: tile_data(isize,jsize)
252 logical,
intent(in),
optional :: yrevers
253 integer,
intent(in),
optional :: step
257 procedure(rd),
pointer :: read_data
259 real(
rp) :: min_value_
261 character(len=H_LONG) :: fname
262 real(
rp),
allocatable :: tile_data(:,:)
263 integer :: jsize, isize
264 integer :: i, j, ii, jj, t
266 if (
present(min_value) )
then
267 min_value_ = min_value
269 min_value_ = - abs(undef)
272 select case( data_type )
273 case (
"int2",
"INT2" )
275 case (
"int4",
"INT4" )
277 case (
"real4",
"REAL4" )
279 case (
"real8",
"REAL8" )
282 log_error(
"FILE_TILEDATA_get_data_real",*)
'data_type is invalid: ', trim(data_type)
295 if ( .not. tile_hit(t) ) cycle
297 fname = trim(dirname) //
'/' // trim(tile_fname(t))
300 log_info(
"FILE_TILEDATA_get_data_real",*)
'Input data file :', trim(fname)
301 log_info_cont(*)
'Tile (LAT) :', tile_js(t)*tile_dlat/d2r, (tile_je(t)+1)*tile_dlat/d2r
302 log_info_cont(*)
' (LON) :', tile_is(t)*tile_dlon/d2r, (tile_ie(t)+1)*tile_dlon/d2r
304 isize = tile_ie(t) - tile_is(t) + 1
305 jsize = tile_je(t) - tile_js(t) + 1
307 allocate( tile_data(isize,jsize) )
309 call read_data( jsize, isize, &
318 j = tile_js(t) + jj - 1
319 if ( jsh <= j .and. j <= jeh )
then
321 i = tile_is(t) + ii - 1
322 if ( ish <= i .and. i <= ieh )
then
323 if ( tile_data(ii,jj) < min_value_ )
then
324 DATA(i-ish+1,j-jsh+1) = undef
326 DATA(i-ish+1,j-jsh+1) = tile_data(ii,jj)
330 if ( ish <= i .and. i <= ieh )
then
331 if ( tile_data(ii,jj) < min_value_ )
then
332 DATA(i-ish+1,j-jsh+1) = undef
334 DATA(i-ish+1,j-jsh+1) = tile_data(ii,jj)
341 deallocate( tile_data )
346 end subroutine file_tiledata_get_data_real
353 TILE_DLAT, TILE_DLON, &
354 TILE_fname, TILE_hit, &
357 jsh, jeh, ish, ieh, &
370 integer,
intent(in) :: nLAT, nLON
371 character(len=*),
intent(in) :: dirname
372 integer,
intent(in) :: GLOBAL_IA
373 integer,
intent(in) :: TILE_nmax
374 real(RP),
intent(in) :: TILE_DLAT, TILE_DLON
375 character(len=*),
intent(in) :: TILE_fname(:)
376 logical,
intent(in) :: TILE_hit(:)
377 integer,
intent(in) :: TILE_JS(:)
378 integer,
intent(in) :: TILE_JE(:)
379 integer,
intent(in) :: TILE_IS(:)
380 integer,
intent(in) :: TILE_IE(:)
381 integer,
intent(in) :: jsh
382 integer,
intent(in) :: jeh
383 integer,
intent(in) :: ish
384 integer,
intent(in) :: ieh
385 character(len=*),
intent(in) :: data_type
386 integer,
intent(out) :: DATA(nLON,nLAT)
388 integer,
intent(in),
optional :: min_value
389 logical,
intent(in),
optional :: yrevers
390 integer,
intent(in),
optional :: step
400 integer,
intent(in) :: jsize
401 integer,
intent(in) :: isize
402 character(len=*),
intent(in) :: fname
403 integer,
intent(out) :: TILE_DATA(isize,jsize)
404 logical,
intent(in),
optional :: yrevers
405 integer,
intent(in),
optional :: step
409 integer :: min_value_
411 procedure(rd),
pointer :: read_data
413 character(len=H_LONG) :: fname
414 integer,
allocatable :: TILE_DATA(:,:)
415 integer :: jsize, isize
416 integer :: i, j, ii, jj, t
418 if (
present(min_value) )
then
419 min_value_ = min_value
421 min_value_ = - abs(undef2)
424 select case( data_type )
425 case (
"int1",
"INT1" )
427 case (
"int2",
"INT2" )
429 case (
"int4",
"INT4" )
431 case (
"real4",
"REAL4" )
434 log_error(
"FILE_TILEDATA_get_data_int1",*)
'data_type is invalid: ', trim(data_type)
447 if ( .not. tile_hit(t) ) cycle
449 fname = trim(dirname) //
'/' // trim(tile_fname(t))
452 log_info(
"FILE_TILEDATA_get_data_int1",*)
'Input data file :', trim(fname)
453 log_info_cont(*)
'Tile (LAT) :', tile_js(t)*tile_dlat/d2r, (tile_je(t)+1)*tile_dlat/d2r
454 log_info_cont(*)
' (LON) :', tile_is(t)*tile_dlon/d2r, (tile_ie(t)+1)*tile_dlon/d2r
456 isize = tile_ie(t) - tile_is(t) + 1
457 jsize = tile_je(t) - tile_js(t) + 1
459 allocate( tile_data(isize,jsize) )
461 call read_data( jsize, isize, &
470 j = tile_js(t) + jj - 1
471 if ( jsh <= j .and. j <= jeh )
then
473 i = tile_is(t) + ii - 1
474 if ( ish <= i .and. i <= ieh )
then
475 if ( tile_data(ii,jj) < min_value_ )
then
476 DATA(i-ish+1,j-jsh+1) = undef2
478 DATA(i-ish+1,j-jsh+1) = tile_data(ii,jj)
482 if ( ish <= i .and. i <= ieh )
then
483 if ( tile_data(ii,jj) < min_value_ )
then
484 DATA(i-ish+1,j-jsh+1) = undef2
486 DATA(i-ish+1,j-jsh+1) = tile_data(ii,jj)
493 deallocate( tile_data )
509 TILE_DLAT, TILE_DLON, &
510 DOMAIN_IS, GLOBAL_IA, &
513 TILE_LATS, TILE_LATE, &
514 TILE_LONS, TILE_LONE )
519 integer,
intent(in) :: TILE_nlim
520 character(len=*),
intent(in) :: fname
521 real(RP),
intent(in) :: TILE_DLAT
522 real(RP),
intent(in) :: TILE_DLON
523 integer,
intent(in) :: DOMAIN_IS
524 integer,
intent(in) :: GLOBAL_IA
525 integer,
intent(out) :: TILE_nmax
526 character(len=*),
intent(out) :: TILE_fname(:)
527 real(RP),
intent(out) :: TILE_LATS(:)
528 real(RP),
intent(out) :: TILE_LATE(:)
529 real(RP),
intent(out) :: TILE_LONS(:)
530 real(RP),
intent(out) :: TILE_LONE(:)
532 character(len=H_LONG) :: name
541 form =
'formatted', &
545 if ( ierr /= 0 )
then
546 log_error(
"FILE_TILEDATA_read_catalog_file",*)
'catalogue file not found! ', trim(name)
552 do while ( ierr == 0 )
553 read(fid,*,iostat=ierr) index, tile_lats(1), tile_late(1), tile_lons(1), tile_lone(1), &
555 tile_nmax = tile_nmax + 1
558 if ( tile_nmax > tile_nlim )
then
559 log_error(
'FILE_TILEDATA_read_catalog_file',*)
'TILE_nmax must be >= ', tile_nmax
565 read(fid,*,iostat=ierr) index, tile_lats(t), tile_late(t), &
566 tile_lons(t), tile_lone(t), &
569 tile_lats(t) = tile_lats(t) * d2r
570 tile_late(t) = tile_late(t) * d2r
572 if ( tile_lons(t) > tile_lone(t) ) tile_lone(t) = tile_lone(t) + 360.0_rp
573 tile_lons(t) = tile_lons(t) * d2r
574 tile_lone(t) = tile_lone(t) * d2r
583 TILE_DLAT, TILE_DLON, &
584 DOMAIN_LATS, DOMAIN_LATE, DOMAIN_LONS, DOMAIN_LONE, &
585 DOMAIN_JS, DOMAIN_JE, DOMAIN_IS, DOMAIN_IE, &
589 real(RP),
intent(in) :: TILE_DLAT
590 real(RP),
intent(in) :: TILE_DLON
591 real(RP),
intent(in) :: DOMAIN_LATS
592 real(RP),
intent(in) :: DOMAIN_LATE
593 real(RP),
intent(in) :: DOMAIN_LONS
594 real(RP),
intent(in) :: DOMAIN_LONE
595 integer,
intent(out) :: DOMAIN_JS
596 integer,
intent(out) :: DOMAIN_JE
597 integer,
intent(out) :: DOMAIN_IS
598 integer,
intent(out) :: DOMAIN_IE
599 integer,
intent(out) :: GLOBAL_IA
601 domain_js = floor( domain_lats / tile_dlat )
602 domain_je = ceiling( domain_late / tile_dlat )
603 domain_is = floor( domain_lons / tile_dlon )
604 domain_ie = ceiling( domain_lone / tile_dlon )
606 global_ia = nint( 2.0_rp * pi / tile_dlon )
613 DOMAIN_JS, DOMAIN_JE, &
614 DOMAIN_IS, DOMAIN_IE, &
616 TILE_DLAT, TILE_DLON, &
617 TILE_LATS, TILE_LATE, &
618 TILE_LONS, TILE_LONE, &
623 jsh, jeh, ish, ieh, &
627 integer,
intent(in) :: TILE_nmax
628 integer,
intent(in) :: DOMAIN_JS, DOMAIN_JE, DOMAIN_IS, DOMAIN_IE
629 integer,
intent(in) :: GLOBAL_IA
630 real(RP),
intent(in) :: TILE_DLAT, TILE_DLON
631 real(RP),
intent(in) :: TILE_LATS(:), TILE_LATE(:), TILE_LONS(:), TILE_LONE(:)
632 logical,
intent(in) :: zonal
633 logical,
intent(out) :: TILE_hit(:)
634 integer,
intent(out) :: TILE_JS(:), TILE_JE(:), TILE_IS(:), TILE_IE(:)
635 integer,
intent(out) :: jsh, jeh, ish, ieh
636 integer,
intent(out) :: nLAT, nLON
638 logical :: hit_lat, hit_lon
644 jsh = max( domain_js - nhalo, -floor( 0.5_rp * pi / tile_dlat ) )
645 jeh = min( domain_je + nhalo, floor( 0.5_rp * pi / tile_dlat ) )
646 ish = domain_is - nhalo
647 ieh = domain_ie + nhalo
654 tile_js(t) = nint( tile_lats(t) / tile_dlat )
655 tile_je(t) = nint( tile_late(t) / tile_dlat ) - 1
657 tile_is(t) = nint( tile_lons(t) / tile_dlon )
658 tile_ie(t) = nint( tile_lone(t) / tile_dlon ) - 1
660 do while ( tile_ie(t) < ish )
661 tile_is(t) = tile_is(t) + global_ia
662 tile_ie(t) = tile_ie(t) + global_ia
664 do while ( tile_is(t) - ish >= global_ia )
665 tile_is(t) = tile_is(t) - global_ia
666 tile_ie(t) = tile_ie(t) - global_ia
669 if ( ( jsh <= tile_js(t) .AND. tile_js(t) <= jeh ) &
670 .OR. ( jsh <= tile_je(t) .AND. tile_je(t) <= jeh ) &
671 .OR. ( tile_js(t) <= jsh .AND. jsh <= tile_je(t) ) &
672 .OR. ( tile_js(t) <= jeh .AND. jeh <= tile_je(t) ) )
then
680 else if ( ( tile_is(t) <= ieh ) &
681 .OR. ( tile_ie(t) - global_ia >= ish ) )
then
687 tile_hit(t) = ( hit_lat .AND. hit_lon )
692 ish = minval(tile_is(1:tile_nmax))
693 ieh = maxval(tile_ie(1:tile_nmax))
694 jsh = max( jsh, minval(tile_js(1:tile_nmax)) )
695 jeh = min( jeh, maxval(tile_je(1:tile_nmax)) )
712 integer,
intent(in) :: jsize
713 integer,
intent(in) :: isize
714 character(len=*),
intent(in) :: fname
715 real(RP),
intent(out) :: TILE_DATA(isize,jsize)
717 logical,
intent(in),
optional :: yrevers
718 integer,
intent(in),
optional :: step
720 integer(2) :: buf(isize,jsize)
722 character(len=H_LONG) :: name
729 if (
present(yrevers) )
then
735 lstep =
present(step)
738 inquire( file = fname, number = fid )
749 form =
'unformatted', &
752 recl = isize*jsize*2, &
754 if ( ierr /= 0 )
then
755 log_error(
"FILE_TILEDATA_read_data_int2_real",*)
'data file not found!: ', trim(name)
761 read(fid,rec=step_) buf(:,:)
762 if ( .not. lstep )
close(fid)
769 tile_data(i,j) = buf(i,jsize-j+1)
777 tile_data(i,j) = buf(i,j)
793 integer,
intent(in) :: jsize
794 integer,
intent(in) :: isize
795 character(len=*),
intent(in) :: fname
796 real(RP),
intent(out) :: TILE_DATA(isize,jsize)
798 logical,
intent(in),
optional :: yrevers
799 integer,
intent(in),
optional :: step
801 integer(4) :: buf(isize,jsize)
803 character(len=H_LONG) :: name
810 if (
present(yrevers) )
then
816 lstep =
present(step)
819 inquire( file = fname, number = fid )
830 form =
'unformatted', &
833 recl = isize*jsize*4, &
835 if ( ierr /= 0 )
then
836 log_error(
"FILE_TILEDATA_read_data_int4_real",*)
'data file not found!: ', trim(name)
841 read(fid,rec=step_) buf(:,:)
842 if ( .not. lstep )
close(fid)
849 tile_data(i,j) = buf(i,jsize-j+1)
857 tile_data(i,j) = buf(i,j)
873 integer,
intent(in) :: jsize
874 integer,
intent(in) :: isize
875 character(len=*),
intent(in) :: fname
876 real(RP),
intent(out) :: TILE_DATA(isize,jsize)
878 logical,
intent(in),
optional :: yrevers
879 integer,
intent(in),
optional :: step
881 real(4) :: buf(isize,jsize)
883 character(len=H_LONG) :: name
890 if (
present(yrevers) )
then
896 lstep =
present(step)
899 inquire( file = fname, number = fid )
910 form =
'unformatted', &
913 recl = isize*jsize*4, &
915 if ( ierr /= 0 )
then
916 log_error(
"FILE_TILEDATA_read_data_real4_real",*)
'data file not found!: ', trim(name)
921 read(fid,rec=step_) buf(:,:)
922 if ( .not. lstep )
close(fid)
929 tile_data(i,j) = buf(i,jsize-j+1)
937 tile_data(i,j) = buf(i,j)
953 integer,
intent(in) :: jsize
954 integer,
intent(in) :: isize
955 character(len=*),
intent(in) :: fname
956 real(RP),
intent(out) :: TILE_DATA(isize,jsize)
958 logical,
intent(in),
optional :: yrevers
959 integer,
intent(in),
optional :: step
961 real(8) :: buf(isize,jsize)
963 character(len=H_LONG) :: name
970 if (
present(yrevers) )
then
976 lstep =
present(step)
979 inquire( file = fname, number = fid )
990 form =
'unformatted', &
993 recl = isize*jsize*8, &
995 if ( ierr /= 0 )
then
996 log_error(
"FILE_TILEDATA_read_data_real8_real",*)
'data file not found!: ', trim(name)
1001 read(fid,rec=step_) buf(:,:)
1002 if ( .not. lstep )
close(fid)
1004 if ( yrevers_ )
then
1009 tile_data(i,j) = buf(i,jsize-j+1)
1017 tile_data(i,j) = buf(i,j)
1033 integer,
intent(in) :: jsize
1034 integer,
intent(in) :: isize
1035 character(len=*),
intent(in) :: fname
1036 integer,
intent(out) :: TILE_DATA(isize,jsize)
1038 logical,
intent(in),
optional :: yrevers
1039 integer,
intent(in),
optional :: step
1041 integer(1) :: buf(isize,jsize)
1043 character(len=H_LONG) :: name
1044 integer :: fid, ierr
1050 if (
present(yrevers) )
then
1056 lstep =
present(step)
1059 inquire( file = fname, number = fid )
1070 form =
'unformatted', &
1071 access =
'direct', &
1073 recl = isize*jsize*1, &
1075 if ( ierr /= 0 )
then
1076 log_error(
"FILE_TILEDATA_read_data_int1_int",*)
'data file not found!: ', trim(name)
1081 read(fid,rec=step_) buf(:,:)
1082 if ( .not. lstep )
close(fid)
1084 if ( yrevers_ )
then
1089 tile_data(i,j) = buf(i,jsize-j+1)
1097 tile_data(i,j) = buf(i,j)
1113 integer,
intent(in) :: jsize
1114 integer,
intent(in) :: isize
1115 character(len=*),
intent(in) :: fname
1116 integer,
intent(out) :: TILE_DATA(isize,jsize)
1118 logical,
intent(in),
optional :: yrevers
1119 integer,
intent(in),
optional :: step
1121 integer(2) :: buf(isize,jsize)
1123 character(len=H_LONG) :: name
1124 integer :: fid, ierr
1130 if (
present(yrevers) )
then
1136 lstep =
present(step)
1139 inquire( file = fname, number = fid )
1150 form =
'unformatted', &
1151 access =
'direct', &
1153 recl = isize*jsize*2, &
1155 if ( ierr /= 0 )
then
1156 log_error(
"FILE_TILEDATA_read_data_int2_int",*)
'data file not found!: ', trim(name)
1161 read(fid,rec=step_) buf(:,:)
1162 if ( .not. lstep )
close(fid)
1164 if ( yrevers_ )
then
1169 tile_data(i,j) = buf(i,jsize-j+1)
1177 tile_data(i,j) = buf(i,j)
1193 integer,
intent(in) :: jsize
1194 integer,
intent(in) :: isize
1195 character(len=*),
intent(in) :: fname
1196 integer,
intent(out) :: TILE_DATA(isize,jsize)
1198 logical,
intent(in),
optional :: yrevers
1199 integer,
intent(in),
optional :: step
1201 integer(4) :: buf(isize,jsize)
1203 character(len=H_LONG) :: name
1204 integer :: fid, ierr
1210 if (
present(yrevers) )
then
1216 lstep =
present(step)
1219 inquire( file = fname, number = fid )
1230 form =
'unformatted', &
1231 access =
'direct', &
1233 recl = isize*jsize*4, &
1235 if ( ierr /= 0 )
then
1236 log_error(
"FILE_TILEDATA_read_data_int4_int",*)
'data file not found!: ', trim(name)
1241 read(fid,rec=step_) buf(:,:)
1242 if ( .not. lstep )
close(fid)
1244 if ( yrevers_ )
then
1249 tile_data(i,j) = buf(i,jsize-j+1)
1257 tile_data(i,j) = buf(i,j)
1273 integer,
intent(in) :: jsize
1274 integer,
intent(in) :: isize
1275 character(len=*),
intent(in) :: fname
1276 integer,
intent(out) :: TILE_DATA(isize,jsize)
1278 logical,
intent(in),
optional :: yrevers
1279 integer,
intent(in),
optional :: step
1281 real(4) :: buf(isize,jsize)
1283 character(len=H_LONG) :: name
1284 integer :: fid, ierr
1290 if (
present(yrevers) )
then
1296 lstep =
present(step)
1299 inquire( file = fname, number = fid )
1310 form =
'unformatted', &
1311 access =
'direct', &
1313 recl = isize*jsize*4, &
1315 if ( ierr /= 0 )
then
1316 log_error(
"FILE_TILEDATA_read_data_real4_int",*)
'data file not found!: ', trim(name)
1321 read(fid,rec=step_) buf(:,:)
1322 if ( .not. lstep )
close(fid)
1324 if ( yrevers_ )
then
1329 tile_data(i,j) = buf(i,jsize-j+1)
1337 tile_data(i,j) = buf(i,j)