"From USCG COTP Sector Miami: At 0800, Sept 6, 2017, Set Port Condition WHISKEY for PortMiami/Miami River, Port Everglades, Port of Palm Beach, and Fort Pierce"
in the US the Coast Guard is the 'Captain of the Port' for all commercial ports and there is a 'template' for the hurricane plan. Without going into detail there are set milestones. When Gale Force winds (39 mph or more) are expected in 72 hours the port goes to condition W and preparations begin
Sustained Gale Force expected in 48 hours, condition X (X-ray), all ships of 500 tons or more must make preps to get out of port or convince the COTP that they have good reason and a good plan for staying.
Sustained Gale Force expected in 24 hours, Yankee, the port is closed to all arrivals and everything 500 tons and up without an approved plan leaves. typically local anchorages are also closed and 'cleared out'
12 hours = ZULU and the port is CLOSED, no ship movements unless approved by COTP.
Once closed ports remain closed until the storm is past and clear and damage and navigation assessments are conducted. Even with NO damage, ports typically remain closed for a day while this happens. If there is damage, closures remain until COTP determines it is safe for navigation.