[flextra] 02/03: Build against eccodes instead of grib_api

Alastair McKinstry mckinstry at moszumanska.debian.org
Sat Jul 29 12:56:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository flextra.

commit 7971aa0fb147a7088f588aa90cc022377c9566a3
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Dec 7 09:23:39 2016 +0000

    Build against eccodes instead of grib_api
---
 debian/changelog             |   1 +
 debian/control               |   2 +-
 debian/makefile              |   2 +-
 debian/patches/eccodes.patch | 362 +++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |   1 +
 5 files changed, 366 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c3b6d6c..07977ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 flextra (5.0-6) UNRELEASED; urgency=medium
 
   * Move to debhelper 10
+  * Build against eccodes instead of grib_api
 
  -- Alastair McKinstry <mckinstry at debian.org>  Wed, 07 Dec 2016 08:02:52 +0000
 
diff --git a/debian/control b/debian/control
index 3e6ce1a..95ed017 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Alastair McKinstry <mckinstry at debian.org>
 Build-Depends: debhelper (>= 10), 
   gfortran (>= 4:5.2.1), 
-  libgrib-api-dev (>= 1.13.1-3)
+  libeccodes-dev
 Standards-Version: 3.9.8
 Homepage: http://flexpart.eu/
 Vcs-Git: git://anonscm.debian.org/debian-science/packages/flextra.git
diff --git a/debian/makefile b/debian/makefile
index 6f5ebef..0dcff6f 100644
--- a/debian/makefile
+++ b/debian/makefile
@@ -10,7 +10,7 @@ INCPATH = /usr/include
 #LIBPATH2 = /nilu2/home/flexpart/lib64/absoft/lib
 FFLAGS   =   -O2 -s -I$(INCPATH)  
 #FFLAGS   =  -g -Rb -Rc -Rs  -s  -I$(INCPATH) -p$(INCPATH) -m64 -mcmodel=medium
-LDFLAGS  = $(FFLAGS) -lgrib_api_f90 -lgrib_api
+LDFLAGS  = $(FFLAGS) -leccodes_f90 -leccodes
 #
 
 OBJECTS = caldate.o                openoutput.o \
diff --git a/debian/patches/eccodes.patch b/debian/patches/eccodes.patch
new file mode 100644
index 0000000..cbc7181
--- /dev/null
+++ b/debian/patches/eccodes.patch
@@ -0,0 +1,362 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Description: Use eccodes instead of grib_api
+Last-Updated: 2016-12-07
+Forwarded: no
+
+Index: flextra-5.0/makefile.ecmwf
+===================================================================
+--- flextra-5.0.orig/makefile.ecmwf
++++ flextra-5.0/makefile.ecmwf
+@@ -4,10 +4,8 @@ INCF	= incl*
+ #
+ 
+ INCPATH  = /usr/include
+-LIBPATH1 = /usr/lib
+-LIBPATH2 = /usr/lib
+ FFLAGS   = $(FCFLAGS) -fPIC  -fconvert=little-endian -frecord-marker=4  -I$(INCPATH) 
+-LFLAGS  = $(FFLAGS) $(LDFLAGS) -L$(LIBPATH2) -L$(LIBPATH1) -lgrib_api_f90 -lgrib_api -lm
++LFLAGS  = $(FFLAGS) $(LDFLAGS)  -leccodes_f90 -leccodes -lm
+ #
+ 
+ OBJECTS = caldate.o                openoutput.o \
+Index: flextra-5.0/makefile.gfs
+===================================================================
+--- flextra-5.0.orig/makefile.gfs
++++ flextra-5.0/makefile.gfs
+@@ -5,10 +5,8 @@ INCF	= incl*
+ 
+ FC       = gfortran
+ INCPATH  = /usr/include
+-LIBPATH1 = /usr/lib
+-LIBPATH2 = /usr/lib
+ FFLAGS   = $(FCFLAGS) -fPIC -fconvert=little-endian -frecord-marker=4  -I$(INCPATH)
+-LFLAGS  = $(FFLAGS) $(LDFLAGS) -L$(LIBPATH1) -L$(LIBPATH2) -lgrib_api_f77 -lgrib_api -lm
++LFLAGS  = $(FFLAGS) $(LDFLAGS)  -leccodes_f90 -leccodes -lm
+ #
+ 
+ OBJECTS = caldate.o                openoutput.o \
+Index: flextra-5.0/gridcheck_gfs.f
+===================================================================
+--- flextra-5.0.orig/gridcheck_gfs.f
++++ flextra-5.0/gridcheck_gfs.f
+@@ -51,9 +51,10 @@
+ *                                                                     *
+ ***********************************************************************
+ *
++      use grib_api
+       include 'includepar'
+       include 'includecom'
+-      include 'grib_api_f77.h'
++*     include 'grib_api_f77.h'
+ 
+ 
+ 
+@@ -101,11 +102,11 @@ C coordinate parameters
+ * OPENING OF DATA FILE (GRIB CODE)
+ *
+       ifile=5
+-5     iret=grib_open_file(ifile,path(3)(1:len(3))//
+-     >trim(wfname(ifn)),'r')
+-      call grib_check(iret)
++5     call grib_open_file(ifile,path(3)(1:len(3))//
++     >trim(wfname(ifn)),'r', iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
+ !     turn on support for multi fields messages */
+-      call grib_check(grib_multi_support_on())
++      call grib_multi_support_on()
+ !HSO 5    call pbopen(lunit,path(3)(1:len(3))//wfname(ifn),'r',ierr)
+ !     if(ierr.lt.0) goto 999
+ !HSO fin
+@@ -116,10 +117,10 @@ C coordinate parameters
+ *
+ * GET NEXT FIELDS
+ *
+-      iret = grib_new_from_file(ifile,igrib)
++      call grib_new_from_file(ifile,igrib, iret)
+       if (igrib .eq. -1 )  then         
+         if (iret .ne. -1) then
+-          call grib_check(iret)
++          call grib_check(iret,'flextra','grtibcheck_gfs.f')
+           goto 999   ! ERROR DETECTED
+         endif
+         goto 30    ! EOF DETECTED
+@@ -140,12 +141,14 @@ c     endif
+ 
+ 
+ !     first see if we read GRIB1 or GRIB2
+-      call grib_check(grib_get_int(  igrib,
+-     >'editionNumber',gribVer))
++      call grib_get_int(  igrib,
++     >     'editionNumber',gribVer, iret)
++      call grib_check(iret,'flextra','grtibcheck_gfs.f')
+ 
+ !     get the size and data of the values array
+-      call grib_check(grib_get_size(igrib,'values',isize))
+-      call grib_check(grib_get_real8_array(igrib,'values',zsecn4,isize))
++      call grib_get_size(igrib,'values',isize, iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
++      call grib_get_real8_array(igrib,'values',zsecn4,isize)
+       do  i=1,isize
+         zsec4(i)=zsecn4(i)
+       enddo
+@@ -153,24 +156,31 @@ c     endif
+       if (gribVer.eq.1) then ! GRIB Edition 1
+ 
+ !     read the grib1 identifiers
+-      call grib_check(grib_get_int(  igrib,
+-     >'indicatorOfParameter',isec1(6)))
+-      call grib_check(grib_get_int(  igrib,
+-     >'indicatorOfTypeOfLevel',isec1(7)))
+-      call grib_check(grib_get_int(  igrib,
+-     >'level',isec1(8)))
++      call grib_get_int(  igrib,
++     >        'indicatorOfParameter',isec1(6),iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
++      call grib_get_int(  igrib,
++     >     'indicatorOfTypeOfLevel',isec1(7), iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
++      call grib_get_int(  igrib,
++     >     'level',isec1(8), iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
+ 
+       else ! GRIB Edition 2
+ 
+ !     read the grib2 identifiers
+-      call grib_check(grib_get_int(  igrib,
+-     >'parameterCategory',parCat))
+-      call grib_check(grib_get_int(  igrib,
+-     >'parameterNumber',parNum))
+-      call grib_check(grib_get_int(  igrib,
+-     >'typeOfFirstFixedSurface',typSurf))
+-      call grib_check(grib_get_int(  igrib,
+-     >'scaledValueOfFirstFixedSurface',valSurf))
++      call grib_get_int(  igrib,
++     >        'parameterCategory',parCat, iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
++      call grib_get_int(  igrib,
++     >     'parameterNumber',parNum, iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
++      call grib_get_int(  igrib,
++     >     'typeOfFirstFixedSurface',typSurf, iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
++      call grib_get_int(  igrib,
++     >     'scaledValueOfFirstFixedSurface',valSurf, iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
+ 
+ !     convert to grib1 identifiers
+       isec1(6)=-1
+@@ -196,18 +206,24 @@ c     endif
+ 
+ !     get the required fields from section 2 
+ !     store compatible to gribex input
+-        call grib_check(grib_get_int(  igrib,
+-     >'numberOfPointsAlongAParallel',isec2(2)))
+-        call grib_check(grib_get_int(  igrib,
+-     >'numberOfPointsAlongAMeridian',isec2(3)))
+-        call grib_check(grib_get_real8(igrib,
+-     >'latitudeOfFirstGridPointInDegrees',yaux2in))
+-        call grib_check(grib_get_real8(igrib,
+-     >'longitudeOfFirstGridPointInDegrees',xaux1in))
+-        call grib_check(grib_get_real8(igrib,
+-     >'latitudeOfLastGridPointInDegrees',yaux1in))
+-        call grib_check(grib_get_real8(igrib,
+-     >'longitudeOfLastGridPointInDegrees',xaux2in))
++        call grib_get_int(  igrib,
++     >        'numberOfPointsAlongAParallel',isec2(2), iret)
++        call grib_check(iret,'flextra','gribcheck_gfs.f')
++        call grib_get_int(  igrib,
++     >'numberOfPointsAlongAMeridian',isec2(3), iret)
++        call grib_check(iret,'flextra','gribcheck_gfs.f')
++        call grib_get_real8(igrib,
++     >'latitudeOfFirstGridPointInDegrees',yaux2in, iret)
++        call grib_check(iret,'flextra','gribcheck_gfs.f')
++        call grib_get_real8(igrib,
++     >'longitudeOfFirstGridPointInDegrees',xaux1in, iret)
++        call grib_check(iret,'flextra','gribcheck_gfs.f')
++        call grib_get_real8(igrib,
++     >       'latitudeOfLastGridPointInDegrees',yaux1in, iret)
++        call grib_check(iret,'flextra','gribcheck_gfs.f')
++        call grib_get_real8(igrib,
++     >       'longitudeOfLastGridPointInDegrees',xaux2in, iret)
++        call grib_check(iret,'flextra','gribcheck_gfs.f')
+       xaux1=xaux1in
+       xaux2=xaux2in
+       yaux1=yaux1in
+@@ -305,7 +321,8 @@ C map scale
+       endif
+ 
+       if (igrib.ne.-1) then
+-        call grib_check(grib_release(igrib)) 
++         call grib_release(igrib, iret)
++         call grib_check(iret,'flextra','gribcheck_gfs.f')
+       endif
+ 
+       goto 10                      !! READ NEXT LEVEL OR PARAMETER
+@@ -315,7 +332,8 @@ C map scale
+ *
+ * CLOSING OF INPUT DATA FILE
+ *
+-      call grib_check(grib_close_file(ifile))
++      call grib_close_file(ifile, iret)
++      call grib_check(iret,'flextra','gribcheck_gfs.f')
+ 
+       nuvz=iumax
+       nwz =iumax
+Index: flextra-5.0/readwind_gfs.f
+===================================================================
+--- flextra-5.0.orig/readwind_gfs.f
++++ flextra-5.0/readwind_gfs.f
+@@ -33,10 +33,9 @@
+ * ps                 surface pressure                                 *
+ *                                                                     *
+ ***********************************************************************
+-
++      use grib_api
+       include 'includepar'
+       include 'includecom'
+-      include 'grib_api_f77.h'
+ 
+       integer ii,indj,i,j,k,n,ifield,iumax
+       integer ix,jy,induvz,indwz,numpt,numpu,numpv,numpw,numprh
+@@ -79,11 +78,12 @@ C coordinate parameters
+ !HSO
+ !     print*,'reading winds from ',path(3)(1:len(3))
+ !    >//trim(wfname(indj)),'|'
+-5     iret=grib_open_file(ifile,path(3)(1:len(3))
+-     >//trim(wfname(indj)),'r')
+-      call grib_check(iret)
++!5     iret=grib_open_file(ifile,path(3)(1:len(3))
++5     call grib_open_file(ifile,path(3)(1:len(3))
++     >//trim(wfname(indj)),'r',iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
+ !     turn on support for multi fields messages
+-      call grib_check(grib_multi_support_on())
++      call grib_multi_support_on()
+ 
+ 
+       numpt=0
+@@ -97,22 +97,22 @@ C coordinate parameters
+ * GET NEXT FIELDS
+ *
+ 
+-      iret=grib_new_from_file(ifile,igrib)      
++      call grib_new_from_file(ifile,igrib,iret)      
+       if (igrib .eq. -1 )  then         
+         if (iret .ne. -1) then
+-          call grib_check(iret)
++          call grib_check(iret,'flextra','readwind_gfs.f')
+           goto 888   ! ERROR DETECTED
+         endif
+         goto 50    ! EOF DETECTED
+       endif
+ 
+ !     first see if we read GRIB1 or GRIB2
+-      call grib_check(grib_get_int(  igrib,
+-     >'editionNumber',gribVer))
+-
++      call grib_get_int(  igrib,
++     >'editionNumber',gribVer, iret)
++      call grib_check(iret, 'flextra', 'readwind_gfs.f')
+ !     get the size and data of the values array
+-      call grib_check(grib_get_size(igrib,'values',isize))
+-      call grib_check(grib_get_real8_array(igrib,'values',zsecn4,isize))
++      call grib_get_size(igrib,'values',isize)
++      call grib_get_real8_array(igrib,'values',zsecn4,isize)
+       do  i=1,isize
+         zsec4(i)=zsecn4(i)
+       enddo
+@@ -120,24 +120,33 @@ C coordinate parameters
+       if (gribVer.eq.1) then ! GRIB Edition 1
+ 
+ !     read the grib1 identifiers
+-      call grib_check(grib_get_int(  igrib,
+-     >'indicatorOfParameter',isec1(6)))
+-      call grib_check(grib_get_int(  igrib,
+-     >'indicatorOfTypeOfLevel',isec1(7)))
+-      call grib_check(grib_get_int(  igrib,
+-     >'level',isec1(8)))
++      call grib_get_int(  igrib,
++     >        'indicatorOfParameter',isec1(6), iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_int(  igrib,
++     >'indicatorOfTypeOfLevel',isec1(7), iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_int(  igrib,
++     >     'level',isec1(8), iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++
+ 
+       else ! GRIB Edition 2
+ 
+ !     read the grib2 identifiers
+-      call grib_check(grib_get_int(  igrib,
+-     >'parameterCategory',parCat))
+-      call grib_check(grib_get_int(  igrib,
+-     >'parameterNumber',parNum))
+-      call grib_check(grib_get_int(  igrib,
+-     >'typeOfFirstFixedSurface',typSurf))
+-      call grib_check(grib_get_int(  igrib,
+-     >'scaledValueOfFirstFixedSurface',valSurf))
++      call grib_get_int(  igrib,
++     >'parameterCategory',parCat, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_int(  igrib,
++     >'parameterNumber',parNum, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_int(  igrib,
++     >     'typeOfFirstFixedSurface',typSurf, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_int(  igrib,
++     >     'scaledValueOfFirstFixedSurface',valSurf, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++
+ 
+ !     convert to grib1 identifiers
+       isec1(6)=-1
+@@ -244,14 +253,18 @@ c     if (ierr.ne.0) goto 10    ! ERROR
+ 
+ !     get the required fields from section 2 
+ !     store compatible to gribex input
+-      call grib_check(grib_get_int(  igrib,
+-     >'numberOfPointsAlongAParallel',isec2(2)))
+-      call grib_check(grib_get_int(  igrib,
+-     >'numberOfPointsAlongAMeridian',isec2(3)))
+-      call grib_check(grib_get_real8(igrib,
+-     >'longitudeOfFirstGridPointInDegrees',xauxin))
+-      call grib_check(grib_get_real8(igrib,
+-     >'latitudeOfLastGridPointInDegrees',yauxin))
++      call grib_get_int(  igrib,
++     >'numberOfPointsAlongAParallel',isec2(2), iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_int(  igrib,
++     >'numberOfPointsAlongAMeridian',isec2(3), iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_real8(igrib,
++     >'longitudeOfFirstGridPointInDegrees',xauxin, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
++      call grib_get_real8(igrib,
++     >'latitudeOfLastGridPointInDegrees',yauxin, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
+       xaux=xauxin
+       yaux=yauxin
+ 
+@@ -381,7 +394,8 @@ c     if (ierr.ne.0) goto 10    ! ERROR
+           if((isec1(6).eq.33).and.(isec1(7).eq.100)) iumax=iumax+1
+ 
+       if (igrib.ne.-1) then
+-        call grib_check(grib_release(igrib)) 
++         call grib_release(igrib, iret)
++         call grib_check(iret,'flextra','readwind_gfs.f')               
+       endif
+ 
+       goto 10                      !! READ NEXT LEVEL OR PARAMETER
+@@ -390,7 +404,8 @@ c     if (ierr.ne.0) goto 10    ! ERROR
+ *
+ * CLOSING OF INPUT DATA FILE
+ *
+-      call grib_check(grib_close_file(ifile))
++      call grib_close_file(ifile, iret)
++      call grib_check(iret,'flextra','readwind_gfs.f')
+ 
+ 
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 82374e5..19e2248 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 makefile.patch
+eccodes.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flextra.git



More information about the debian-science-commits mailing list