summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-08-22 15:28:48 (GMT)
committerGitHub <noreply@github.com>2022-08-22 15:28:48 (GMT)
commit801edb4f521763febbec876f786aeda7240a7893 (patch)
treecb44d61ad7620367eff3c6c15342d7d4170d8bee /hl
parentec3737ab696e76574edee53cd137bf73de69aa2c (diff)
downloadhdf5-801edb4f521763febbec876f786aeda7240a7893.zip
hdf5-801edb4f521763febbec876f786aeda7240a7893.tar.gz
hdf5-801edb4f521763febbec876f786aeda7240a7893.tar.bz2
Quiets Fortran warnings about large arrays (#2053)
Diffstat (limited to 'hl')
-rw-r--r--hl/fortran/test/tstimage.F9021
1 files changed, 17 insertions, 4 deletions
diff --git a/hl/fortran/test/tstimage.F90 b/hl/fortran/test/tstimage.F90
index 8e7c5e0..4749f92 100644
--- a/hl/fortran/test/tstimage.F90
+++ b/hl/fortran/test/tstimage.F90
@@ -64,10 +64,10 @@ integer(hid_t) :: file_id ! file identifier
integer(hsize_t), parameter :: width = 500 ! width of image
integer(hsize_t), parameter :: height = 270 ! height of image
integer, parameter :: pal_entries = 9 ! palette number of entries
-integer, dimension(width*height) :: buf1 ! data buffer
-integer, dimension(width*height) :: bufr1 ! data buffer
-integer, dimension(width*height*3) :: buf2 ! data buffer
-integer, dimension(width*height*3) :: bufr2 ! data buffer
+integer, dimension(:), allocatable :: buf1 ! data buffer
+integer, dimension(:), allocatable :: bufr1 ! data buffer
+integer, dimension(:), allocatable :: buf2 ! data buffer
+integer, dimension(:), allocatable :: bufr2 ! data buffer
integer(hsize_t) :: widthr ! width of image
integer(hsize_t) :: heightr ! height of image
integer(hsize_t) :: planesr ! color planes
@@ -99,6 +99,12 @@ integer, dimension(pal_entries*3) :: pal_data_in = (/&
252,168,0,& ! orange
252,0,0/) ! red
+! allocate arrays
+!
+allocate(buf1(width * height))
+allocate(bufr1(width * height))
+allocate(buf2(width * height * 3))
+allocate(bufr2(width * height * 3))
! create an 8bit image of 9 values divided evenly by the array
!
@@ -336,6 +342,13 @@ call h5fclose_f(file_id, errcode)
!
call h5close_f(errcode)
+! deallocate arrays
+!
+deallocate(buf1)
+deallocate(bufr1)
+deallocate(buf2)
+deallocate(bufr2)
+
!
! end function.
!