This commit is contained in:
Shahram Najm 2016-06-21 16:37:14 +01:00
parent bfcc2e150f
commit 836a0cd7c9
2 changed files with 8 additions and 9 deletions

View File

@ -27,19 +27,18 @@ program clone
call codes_open_file(infile,'../../data/constant_field.grib1','r')
call codes_open_file(outfile,'out.clone.grib1','w')
! a new grib message is loaded from file
! igrib is the grib id to be used in subsequent calls
! A new GRIB message is loaded from file.
! igrib is the GRIB id to be used in subsequent calls
call codes_grib_new_from_file(infile,igrib_in)
call codes_get(igrib_in,"Ni", nx)
call codes_get(igrib_in,"Nj",ny)
call codes_get(igrib_in,'Ni', nx)
call codes_get(igrib_in,'Nj', ny)
allocate(field2D(nx,ny),stat=err)
if (err .ne. 0) then
print*, 'Failed to allocate ', nx*ny, ' values'
STOP
print*, 'Failed to allocate ', nx*ny, ' values'
STOP
end if
! clone the constant field to create 4 new GRIB messages
do i=0,18,6

View File

@ -3,5 +3,5 @@
. ./include.sh
REDIRECT=/dev/null
$PYTHON $examples_src/grib_clone.py 2> $REDIRECT > $REDIRECT
rm -f out.clone.grib || true
$PYTHON $examples_src/grib_clone.py
rm -f out.clone.grib