The calculated distance (air line) between Castro Marim and Portimão is approximately 61 miles respectively 97 kilometers.
By car or train, the actual journey to Portimão is certainly longer, as only the direct route (as the crow flies) between Castro Marim and Portimão has been calculated here.
Air line (approximately)
97 kilometers
53 nautical miles