Fortran wrapper for GPC (General Polygon Clipper)


This is a Fortran wrapper interface for the fantastic General Polygon Clipper library ( This allows all you Fortran developers to (finally) use the GPC routines in your Fortran applications. The code is a complete Intel Visual Fortran solution of a program which demonstrates the functionality of the GPC routines when accessed from Fortran. This requires wide usage of the ISO_C_BINDING intrinsics for the proper passing of arguments between Fortran and C subroutines. This also shows the MODULES used to define the Data Structures as well as access to all the GPC routines. 

This Fortran wrapper was built by me in Sumer of 2016 with much help from users on the Intel Visual Fortran Users Forum (THANKS!) and the only portion of the GPC functionality not completely working is the processing of 'Holes'. My use of GPC did not involve hole processing so it was not a priority. Any improvement on this code toward complete GPC functionality is welcome.

GPC: General Polygon Clipping library (C) 1997-1999, Advanced Interfaces Group, University of Manchester.

Please refer to the GPC manual for more details on GPC.


Fortran GPC Wrapper Demo


Jeff Krob

WINGRIDDS System Developer