! +-======-+ ! Copyright (c) 2003-2007 United States Government as represented by ! the Admistrator of the National Aeronautics and Space Administration. ! All Rights Reserved. ! ! THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, ! REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN ! COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS ! REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). ! THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN ! INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR ! REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, ! DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED ! HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE ! RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. ! ! Government Agency: National Aeronautics and Space Administration ! Government Agency Original Software Designation: GSC-15354-1 ! Government Agency Original Software Title: GEOS-5 GCM Modeling Software ! User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov ! Government Agency Point of Contact for Original Software: ! Dale Hithon, SRA Assistant, (301) 286-2691 ! ! +-======-+ program getgfiodim implicit none integer, parameter :: READ_ONLY = 1 character(len=255) fname, argv integer iarg, iargc, argc integer fid, err integer im, jm, km, lm, nvars, ngatts argc = iargc() if ( argc .lt. 1 ) then print * print *, "Usage: getgfiodim.x gfiofilename" print * call exit(1) endif iarg = 1 call GetArg ( iArg, argv ) fname = trim(argv) ! Open the file ! ------------- call GFIO_Open ( trim(fname), READ_ONLY, fid, err ) if ( err .ne. 0 ) then print *, 'cannot open file ' call exit (2) endif ! Get dimensions ! -------------- call GFIO_DimInquire ( fid, im, jm, km, lm, nvars, ngatts, err) if ( err .ne. 0 ) then print *, 'cannot extra dimensions ' call exit (3) end if ! Close GFIO file ! --------------- call GFIO_close ( fid, err ) write(6,'(i5,1x,i5,1x,i5)') im, jm, km end