  In this paper we study a proposal of Nekrasov, Rosly and Shatashvili that
describes the effective twisted superpotential obtained from a class S theory
geometrically as a generating function in terms of certain complexified
length-twist coordinates, and extend it to higher rank. First, we introduce a
higher rank analogue of Fenchel-Nielsen type spectral networks in terms of a
generalized Strebel condition. We find new systems of spectral coordinates
through the abelianization method and argue that they are higher rank analogues
of the Nekrasov-Rosly-Shatashvili Darboux coordinates. Second, we give an
explicit parametrization of the locus of opers and determine the generating
functions of this Lagrangian subvariety in terms of the higher rank Darboux
coordinates in some specific examples. We find that the generating functions
indeed agree with the known effective twisted superpotentials. Last, we relate
the approach of Nekrasov, Rosly and Shatashvili to the approach using quantum
periods via the exact WKB method.
