A semi-analytical model of barotropic and baroclinic flows for an open Panama Gateway