Periodic solutions arising in ecology of mangroves