Understand first that the dgels_ interface is a fortran interface. The dgels (no underscore) is a interface to the ACML style C wrappers
The dgels interface WILL do internal allocation for the work array, meaning that the calling C program does not need to. So this is not the interface you want to use.
The dgels_ is just the actual fortran routine, with the interface made visible to C programs. This must use Fortran calling interfaces, As documented in the ACML user guide, the integer trans length argument is just the length of the string passed for the trans argument. This is necessary since Fortran strings do not have a null terminator. Note that different fortran compilers expect these integer string length argument in different places in the parameter list, and you would see this if you looked at the acml.h file for all the different libraries we provide.
The fortran inter