I would not recommend it. I don't know about the Portsmouth YMCA but the Richmond YMCAs have a policy against it.
YMCA Richmond Member Code of Conduct
Even if it is not against policy in Portsmouth, I would recommend carrying concealed and not openly. Thefts from lockers at health clubs and YMCAs is very common. Having a lock does not matter as the thieves often have bolt cutters.Prohibited actions include, but are not necessarily limited to:
Carrying or concealing any weapons or devices or objects that may be used as weapons.