program MOP02_test IMPLICIT NONE include 'Toolkit.f' include 'hdfeos5.inc' include 'hdfeos5_64.inc' integer*8, parameter :: natime = 255555 integer :: fid, swid, sdid, ierr, chunkrank integer*8 :: dimsize, nprs2 integer*8 :: count(1), start(1), stride(1) integer*8 :: count2(2), start2(2), stride2(2) integer*8 :: count3(3), start3(3), stride3(3) real :: press(10) real :: matrix(10,10) double precision :: atime(natime) real :: amatrix(10,10,230000000) integer :: he5_swopen, he5_swcreate, he5_swdefdim, he5_swdefgfld, & he5_swdefdfld, he5_swdefdimscale, he5_swsetdimscale, he5_swwrfld, & he5_swdefchunk, he5_swdetach, he5_swclose DATA press/1000.,900.,800.,700.,600.,500.,400.,300.,200.,100./ atime(:) = -7777.0 matrix(:,:) = -8888.0 amatrix (:,:,:) = -9999.0 ierr = 0 fid = -1 swid = -1 sdid = -1 !----------create file & dimension--------------------------------- fid = he5_swopen("MOP02.test.he5", HE5F_ACC_TRUNC) swid = he5_swcreate(fid, "MOP02") ierr = he5_swdefdim(swid, 'Unlim', HE5S_UNLIMITED_F_64) dimsize = 1 ierr = he5_swdefdim(swid, 'nTime', dimsize) dimsize = 10 ierr = he5_swdefdim(swid, 'nPrs', dimsize) !------------geo-fields------------------------------------ chunkrank = 1 count(1) = 100 ierr = he5_swdefchunk(swid, chunkrank, count) ierr = he5_swdefgfld(swid, "Time", "nTime", "Unlim", HE5T_NATIVE_DOUBLE,0) ierr = he5_swdefgfld(swid, "Pressure", "nPrs", " ", HE5T_NATIVE_FLOAT,0) !-------------data fields----------------------------------- ierr = he5_swdefdfld(swid, "PressureGrid", "nPrs", " ", HE5T_NATIVE_FLOAT, 0) ierr = he5_swdefdfld(swid, "TestMatrix", "nPrs,nPrs", " ", HE5T_NATIVE_FLOAT, 0) chunkrank = 3 count3(1) = 10 count3(2) = 10 count3(3) = 100 ierr = he5_swdefchunk(swid, chunkrank, count3) ierr = he5_swdefdfld(swid, "AvkMatrix", "nPrs,nPrs,nTime", & "nPrs,nPrs,Unlim", HE5T_NATIVE_FLOAT, 0) !---------dim scale------------------------- nprs2 = 10 ierr = he5_swdefdimscale(swid, 'nPrs', nprs2, HE5T_NATIVE_FLOAT, press) ierr = he5_swdefdimscale(swid, 'nTime', natime, HE5T_NATIVE_FLOAT, atime) ! ---- write some const fields ----- start(1) = 0 stride(1) = 1 count(1) = nprs2 ierr = he5_swwrfld(swid, "PressureGrid", start, stride, count, press) ierr = he5_swwrfld(swid, "Pressure", start, stride, count, press) count(1) = natime ierr = he5_swwrfld(swid, "Time", start, stride, count, atime) start2(1) = 0 start2(2) = 0 stride2(:) = 1 count2(1) = 10 count2(2) = 10 ierr = he5_swwrfld(swid, "TestMatrix", start2, stride2, count2, matrix) start3(:) = 0 stride3(:) = 1 count3(1) = 10 count3(2) = 10 count3(3) = natime ierr = he5_swwrfld(swid, "AvkMatrix", start3, stride3, count3, amatrix) !---------close file------------------------- ierr = he5_swdetach(swid) ierr = he5_swclose(fid) end program MOP02_test