|
|
|||
|
||||
Thanks for any insight. -Ken
p.s. I have Lahey-Fortran v6.20d and am using netcdf-4.0-snapshot2007052502
Since it is storing 10K int*4's, the file size should be ~40K. But the ver.4 unlimited-dimension file is 10x too big?haze:~/for/tests $ time ./test_unlimited ; lss Test_*
real 0m3.040s
user 0m2.640s
sys 0m0.370s
48K Test_Limited_v4.nc 40K Test_Unlimited_v3.nc 420K Test_Unlimited_v4.nc
Same issue: ver.4 w/ unlimited is 10x too big? And now it completed in 10x3sec=30sec. not bad since number of writes is 10x before.haze:~/for/tests $ time ./test_unlimited ; lss Test_*
real 0m30.478s
user 0m27.220s
sys 0m3.240s
404K Test_Limited_v4.nc 396K Test_Unlimited_v3.nc 4.0M Test_Unlimited_v4.nc
haze:~/for/tests $ time ./test_unlimited ; lss Test_*It never completed the write to Test_Unlimited_v4.nc, but the file sizes are roughly the right size. In fact, the memory goes through the roof and begins page swapping. Why?
real 20m22.557s
user 4m19.840s
sys 0m53.840s
3.9M Test_Limited_v4.nc 3.9M Test_Unlimited_v3.nc 40M Test_Unlimited_v4.nc
program unlimited use netcdf implicit none include 'netcdf4.inc' integer :: ncid, dim, vid, vid2, i integer :: nmax=1000000
!NetCDF3 file call check( nf90_create('Test_Unlimited_v3.nc',NF90_CLOBBER,ncid) ) call check( nf90_def_dim(ncid,"cell",NF90_UNLIMITED,dim) ) call check( nf90_def_var(ncid,"temp",NF90_INT,dim,vid) ) call check(nf90_enddef(ncid)) do i=1,nmax call check( nf90_put_var(ncid,vid,i,start=(/ i /) ) ) end do call check( nf90_close(ncid) )
call check( nf90_create('Test_Limited_v4.nc',NF_NETCDF4,ncid) ) call check( nf90_def_dim(ncid,"cell",nmax,dim) ) call check( nf90_def_var(ncid,"temp",NF90_INT,dim,vid) ) call check(nf90_enddef(ncid)) do i=1,nmax call check( nf90_put_var(ncid,vid,i,start=(/i /) ) ) end do call check( nf90_close(ncid) )
call check( nf90_create('Test_Unlimited_v4.nc',NF_NETCDF4,ncid) ) call check( nf90_def_dim(ncid,"cell",NF90_UNLIMITED,dim) ) call check( nf90_def_var(ncid,"temp",NF90_INT,dim,vid) ) call check(nf90_enddef(ncid)) do i=1,nmax call check( nf90_put_var(ncid,vid,i,start=(/i /) ) ) end do call check( nf90_close(ncid) )
contains
subroutine check(status)
integer, intent ( in) :: status
if(status /= nf90_noerr) then
print *, trim(nf90_strerror(status))
stop "Stopped"
end if
end subroutine check end program unlimited
-- Ken Knapp Remote Sensing and Applications Division National Climatic Data Center 151 Patton Ave Asheville, NC 28801 828-271-4339 (voice) 828-271-4328 (fax)
=============================================================================== To unsubscribe netcdfgroup, visit: http://www.unidata.ucar.edu/mailing-list-delete-form.html ===============================================================================
| Contact Us Site Map Search Terms and Conditions Privacy Policy Participation Policy | ||||||
|
||||||