######################################################################
## SPECIAL MARINE WARNING TEMPLATE ##
## FOR CR IMPACT BASED WARNING INITIATIVE ##
## CREATED BY PHIL KURIMSKI - WFO GRB ##
## UPDATED PHIL KURIMSKI -- SEP 17 2013 OB13.5.2-4 ##
## EVAN BOOKBINDER -- SEP 18 2013 Implemented config.vm ##
## PHIL KURIMSKI -- JUN 26 2014 OB14.2.2-9 ADDED DSS EVENTS ##
## PHIL KURIMSKI -- FEB 18 2015 Implemented updated CTAs ##
## UPDATED PHIL KURIMSKI -- MAR 23 2015 Mixed Case ##
## Evan Bookbinder - 9/4/2015 Fixed line of storms grammar ##
######################################################################
#parse("config.vm")
################################################
## Set null variables used in the template
################################################
#set($marine = true)
#set($capable = "")
#set($ashfallPath = "")
#set($debrisflowPath = "")
#set($ashfallInfo = "")
#set($debrisflowInfo = "")
#set($ashfallCTA = "")
#set($spoutTag = "")
#set($source = "Radar indicated.")
#set($extraSource = "")
#set($spoutThreat = "")
################################################
## Set up override for ashfall warning
## This will change Special Marine Warning to
## Ashfall Warning Per the 10-313 Directive
################################################
#if(${list.contains(${bullets}, "ashfall")})
#set($ashfallHeadline = "Ashfall Warning for Volcanic Ash and Other Hazards for...")
#end
################################################
${WMOId} ${vtecOffice} 000000 ${BBBId}
${productId}${siteId}
${ugcline}
/${productClass}.${action}.${vtecOffice}.MA.W.${etn}.${dateUtil.format(${start}, ${timeFormat.ymdthmz})}-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
BULLETIN - IMMEDIATE BROADCAST REQUESTED
#if(${productClass}=="T")
TEST...Special Marine Warning...TEST
#else
Special Marine Warning
#end
National Weather Service ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#headline(${officeLoc}, ${backupSite})
* ##
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
##################################################
## Override for Ashfall Warning
##################################################
#if(${ashfallHeadline})
${ashfallHeadline}
#else
Special Marine Warning for...
#end
#######################################################################
## Coding to use the raw marine zone output from the shapefiles
## Comment this section out if you are combining your marine zones
#######################################################################
#foreach (${area} in ${areas})
##
${area.name}...
#end
#######################################################################
## End of code for raw marine zone output from the shapefiles
#######################################################################
#######################################################################
## The following code will create a string of marine zone fips codes
## which will be important in combining marine zones
#######################################################################
#######################################################################
## Set the fipsstring variable to null for marine zone combinations
#######################################################################
#set($fipsstring = "")
#foreach (${area} in ${areas})
#set($fipsstring = $fipsstring + $area.fips + "-")
#end
#######################################################################
## Parse in the marineCombo.vm file which contains marine zone combinations
## Uncomment the parse command if you are combining your marine zones
#######################################################################
##parse("marineCombo.vm")
#######################################################################
## End of the marine zone combination script
#######################################################################
* ##
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone})
#######################################################################
## List of Event Types. Added several events such as Shower...Cloud and Front.
## Removed Strong and Severe Thunderstorm selections and placed logic in the
## wind and hail selections that will change wording for Severe Thunderstorms.
#######################################################################
#set($eventType = "thunderstorm")
#if(${list.contains(${bullets}, "thunderstorm")})
#set($eventType = "thunderstorm")
#set($severeType = "strong")
#end
#if(${list.contains(${bullets}, "shower")})
#set($eventType = "shower")
#end
#if(${list.contains(${bullets}, "cloud")})
#set($eventType = "cloud")
#end
#if(${list.contains(${bullets}, "front")})
#set($eventType = "front")
#end
#if(${list.contains(${bullets}, "volcano")})
#set($eventType = "volcano")
#end
#######################################################################
## Added a Threat Section to the template that includes Wind...Hail
## and Waterspout selections.
## Strong Thunderstorm will change to Severe Thunderstorm automatically based on
## selections in Wind...Hail and Waterspout sections.
#######################################################################
#set($windTag = "<34")
#set($windCTA = "gusty winds")
#if(${list.contains(${bullets}, "34ktWind")})
#set($windTag = ">34")
#set($windType = "wind gusts 34 knots or greater")
#set($windCTA = "${windType}")
#end
#if(${list.contains(${bullets}, "40ktWind")})
#set($windTag = "40")
#set($windType = "wind gusts to 40 knots")
#set($windCTA = "${windType}")
#end
#if(${list.contains(${bullets}, "40ktplusWind")})
#set($windTag = "49")
#set($windType = "wind gusts to nearly 50 knots")
#set($windCTA = "${windType}")
#end
#if(${list.contains(${bullets}, "50ktWind")})
#set($windTag = "50")
#set($windType = "wind gusts in excess of 50 knots")
#set($severeType = "severe")
#set($windCTA = "${windType}")
#end
#if(${list.contains(${bullets}, "65ktWind")})
#set($windTag = "65")
#set($windType = "wind gusts in excess of 65 knots")
#set($severeType = "severe")
#set($windCTA = "${windType}")
#end
#set($hailTag = "0.00")
#set($hailCTA = "")
#if(${list.contains(${bullets}, "smallHail")})
#set($hailTag = "<.75")
#set($hailType = "small hail")
#set($hailCTA = "#commaOrEllipsis()${hailType}")
#end
#if(${list.contains(${bullets}, "largeHail")})
#set($hailTag = ">.75")
#set($hailType = "large hail")
#set($severeType = "severe")
#set($hailCTA = "#commaOrEllipsis()${hailType}")
#end
#if(${list.contains(${bullets}, "destructiveHail")})
#set($hailTag = ">2.0")
#set($hailType = "large destructive hail")
#set($severeType = "severe")
#set($hailCTA = "#commaOrEllipsis()${hailType}")
#end
#if(${list.contains(${bullets}, "sightedSpout")})
#set($spoutTag = "WATERSPOUT...OBSERVED")
#set($spoutType = "waterspouts")
#set($severeType = "severe")
#end
#if(${list.contains(${bullets}, "possibleSpout")})
#set($spoutTag = "WATERSPOUT...POSSIBLE")
#set($spoutType = "waterspouts")
#set($capable = "capable of ")
#set($severeType = "severe")
#end
################################################
## Threat section for Volcanic Situations
################################################
#if(${list.contains(${bullets}, "ashfall")})
#set($ashfallType = "ashfall")
#set($ashfallPath = "volcanic ash")
#set($ctaSelected = "YES")
#set($ashfallCTA = "Ash is an eye and respiratory irritant and is abrasive. Those with respiratory sensitivities should take extra precautions to minimize exposure. Protect electronics and cover air intakes if ashfall is expected or confirmed. Remove ash from surfaces with water if possible to prevent excessive accumulation.")
#set($ashfallInfo = "An ashfall warning means that the volcano is undergoing a major eruption. It is very likely that mariners will be affected by volcanic hazards in the warning areas such as significant debris#commaOrEllipsis()ashfall one quarter inch or greater#commaOrEllipsis()lava#commaOrEllipsis()or lahar and debris flows.")
#end
#if(${list.contains(${bullets}, "debrisFlow")})
#set($debrisflowType = "debris flow")
#set($debrisflowPath = "debris flow")
#set($debrisflowInfo = "The eruption of the volcano can cause a sudden melting of snow and ice on the mountain. This will result in a torrent of mud#commaOrEllipsis()ash#commaOrEllipsis()rock#commaOrEllipsis()and hot water to flow down the mountain and into the nearby waters.")
#end
##################################################################################
## Logic to put together the threats based on Wind...Hail and Waterspout sections.
##################################################################################
#if(${spoutType} && ${windType} && ${hailType})
#set($threat = "${spoutType}#commaOrEllipsis()${windType}#commaOrEllipsis()and ${hailType}")
#elseif(${spoutType} && ${hailType})
#set($threat = "${spoutType} and ${hailType}")
#elseif(${spoutType} && ${windType})
#set($threat = "${spoutType} and ${windType}")
#elseif(${windType} && ${hailType})
#set($threat = "${windType} and ${hailType}")
#elseif(${spoutType})
#set($threat = "${spoutType}")
#elseif(${windType})
#set($threat = "${windType}")
#elseif(${hailType})
#set($threat = "${hailType}")
#else
#set($threat = "!**YOU DID NOT SELECT ANY THREATS. PLEAST RE-GENERATE THIS WARNING!**!")
#end
#######################################################################
## Logic for Volcanic Threats. If selected this will override any
## other selections for wind/hail/spouts.
#######################################################################
#if(${ashfallType} && ${debrisflowType})
#set($threat = "${ashfallType} and ${debrisflowType}")
#set($volcanoPath = "${ashfallPath} and ${debrisflowPath}")
#elseif(${ashfallType})
#set($threat = "${ashfallType}")
#set($volcanoPath = "${ashfallPath}")
#elseif(${debrisflowType})
#set($threat = "${debrisflowType}")
#set($volcanoPath = "${debrisflowPath}")
#else
#end
#########################################################################
## Set the threat to the hazard variable for IBW Initiative and
## capitalize the first letter of the sentence for mixed case.
#########################################################################
#set($hazard = "${threat}.")
#set($hazard = "#capitalize(${hazard} 'FIRST')")
#########################################################################
## Section to determine Thunderstorm Severity based on Threat Selections.
#########################################################################
#if(${eventType} == "thunderstorm")
#set($thunderstormType = "${severeType} ${eventType}")
#set($eventType = "${thunderstormType}")
#end
#######################################################################
## Section to create line wording based on track type.
#######################################################################
#set($waswere="was")
#set($stormline = "a ${eventType}")
#set($pathheader = "The ${eventType}")
#set($specialEvent = "This ${eventType}")
#set($reportType2 = "The ${eventType} was")
#if(${stormType} == "line")
#set($waswere="were")
#set($stormline = "${eventType}s")
#set($pathheader = "${eventType}s")
#set($specialEvent = "These ${eventType}s")
#set($reportType2 = "The ${eventType}s were")
#end
###########################################################################
## Corrective coding to prevent the use of "Line of Fronts" in the Product.
###########################################################################
#if(${eventType} == "front")
#set($waswere="was")
#set($stormline = "a ${eventType}")
#set($pathheader = "The ${eventType}")
#set($specialEvent = "This ${eventType}")
#set($reportType2 = "The ${eventType} was")
## #set($stormType = "")
#end
#######################################################################
## Coding for volcanoes...this will override all other selections.
#######################################################################
#set($impacted = "Locations impacted include...")
#if(${eventType} == "volcano")
#set($waswere="was")
#set($stormline = "an eruption of !** NAME OF VOLCANO**! volcano")
#set($pathheader = "The ${volcanoPath}")
#set($reportType2 = "The ${volcanoPath} was")
#set($specialEvent = "The ${volcanoPath}")
## #set($stormType = "")
#set($impacted = "Locations impacted by ${volcanoPath} include...")
#end
##########################################################################
## Basis section that incorporates line phenomena...capable vs producing
## and threat based on selections above. Added Satellite Imagery to basis.
##########################################################################
#set($report = "!** YOU DIDN'T SELECT A REPORTER **! ${eventType}")
#if(${list.contains(${bullets}, "doppler")})
#set($source = "Radar indicated.")
#set($capable = "capable of ")
## #set($report = "Doppler radar indicated ${stormline}...${capable}producing ${threat}...")
#end
#if(${list.contains(${bullets}, "doppler")} && ${list.contains(${bullets}, "sightedSpout")})
## #set($report = "Doppler radar indicated ${stormline}...producing ${threat}...")
#end
#if(${list.contains(${bullets}, "marineSpotter")})
#set($source = "Marine weather spotter.")
## #set($report = "marine weather spotters reported ${stormline}...${capable}producing ${threat}...")
#end
#if(${list.contains(${bullets}, "mariner")})
#set($source = "Mariner.")
## #set($report = "a mariner reported ${stormline}...${capable}producing ${threat}...")
#end
#if(${list.contains(${bullets}, "public")})
#set($source = "Public.")
## #set($report = "the public reported ${stormline}...${capable}producing ${threat}...")
#end
#if(${list.contains(${bullets}, "pilot")})
#set($source = "Pilot.")
## #set($report = "a pilot reported ${stormline}...${capable}producing ${threat}...")
#end
#if(${list.contains(${bullets}, "satellite")})
#set($source = "Satellite imagery indicated.")
#set($capable = "capable of ")
## #set($report = "satellite imagery indicated ${stormline}...${capable}producing ${threat}...")
#end
#if(${list.contains(${bullets}, "satellite")} && ${list.contains(${bullets}, "sightedSpout")})
## #set($report = "satellite imagery indicated ${stormline}...producing ${threat}...")
#end
## If waterspouts are observed override the capable wording
#if(${list.contains(${bullets}, "sightedSpout")})
#set($capable = "")
#end
## If waterspouts are selected include them in the AT... section of the product
#if($spoutTag.length() > 0)
#set($spoutThreat = " ${capable}producing ${spoutType}")
#end
## Storm current location description
* ##
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#thirdBullet(${dateUtil},${event},${timeFormat},${localtimezone},${secondtimezone})
#commaOrEllipsis()${stormline}${spoutThreat} ${waswere} located ##
#if(${stormType} == "line")
#handleClosestPoints(${list}, ${closestPoints}, ${otherClosestPoints}, ${stormType}, ${nearPhrase} , ${maxMarineNearDistance}, ${overPhrase}, ${maxMarineOverDistance}, ${marineDistanceUnits}, ${useSecondReferenceLine})
#else
#handleClosestPoints(${list}, ${closestPoints}, ${otherClosestPoints}, ${stormType}, ${nearPhrase} , ${maxMarineNearDistance}, ${overPhrase}, ${maxMarineOverDistance}, ${marineDistanceUnits}, ${useSecondReferenceCell})
#end
#if(${eventType} == "volcano")
.
#elseif(${movementSpeed} < ${marineStationary} || ${stationary})
. ${reportType2} nearly stationary.
#else
#commaOrEllipsis()moving #direction(${movementDirectionRounded}) at ${mathUtil.roundTo5(${movementSpeed})} knots.
#end
#############################################
######## GENERATE ADDITIONAL REPORTS #######
#############################################
#if(${list.contains(${bullets}, "addlRpt")})
#set($extraSource = " At !**enter time#commaOrEllipsis()phenomena**! was reported !**enter location**!.")
#end
##########################################################################
## Command to parse the impact statements into the template
##########################################################################
#parse("impactStatements.vm")
###################################
## Section to include the hazard ##
###################################
#wrapText("HAZARD...${hazard}" 2 11)
#wrapText("SOURCE...${source}${extraSource}" 2 11)
#wrapText("IMPACT...${smwimpact}" 2 11)
${ashfallInfo}
${debrisflowInfo}
#set($eventType = "${pathheader}")
#set($warningType = "WARNING")
#if(${list.contains(${bullets}, "pathcast")})
* ##
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#pathCast("${eventType} will be near..." ${eventType} ${pathCast} ${otherPoints} ${areas} ${dateUtil} ${timeFormat} 1)
#elseif(${list.contains(${bullets}, "listoflocations")})
* ##
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#### THE THIRD ARGUMENT IS A NUMBER SPECIFYING THE NUMBER OF COLUMNS TO OUTPUT THE CITIES LIST IN
#### 0 IS A ... SEPARATED LIST, 1 IS ONE PER LINE, >1 IS A COLUMN FORMAT
#### IF YOU USE SOMETHING OTHER THAN "LOCATIONS IMPACTED INCLUDE" LEAD IN BELOW, MAKE SURE THE
#### ACCOMPANYING XML FILE PARSE STRING IS CHANGED TO MATCH!
#locationsList("${impacted}" "${eventType}" 0 ${locationList} ${otherPoints} ${areas} ${dateUtil} ${timeFormat} 1)
#end
##############################################
###### SPECIAL VENUE/EVENT CASE ##############
##############################################
#if(${list.contains(${bullets}, "specialEvent")})
Those attending !**event/venue name or location**! are in the path of ${specialEvent} and should prepare for IMMINENT DANGEROUS WEATHER CONDITIONS. SEEK SHELTER NOW!
#end
## Comment out #parse command below to pull in Dynamic DSS Event Info
## If this feature is utilized, the "specialEvent" bullet (output above) can
## likely be commented out from the impactSpecialMarineWarning.xml file
#parse("dssEvents.vm")
#####################
## CALL TO ACTIONS ##
#####################
#######################################################################
## Check to see if we've selected any calls to action. In our .xml file
## we ended each CTA bullet ID with "CTA" for this reason as a 'trip'
#######################################################################
#foreach (${bullet} in ${bullets})
#if(${bullet.endsWith("CTA")})
#set($ctaSelected = "YES")
#end
#end
#if(${ctaSelected} == "YES")
PRECAUTIONARY/PREPAREDNESS ACTIONS...
#end
##
${ashfallCTA}
#if(${list.contains(${bullets}, "genericCTA")})
Move to safe harbor until hazardous weather passes.
#end
#if(${list.contains(${bullets}, "gustyWindsCTA")})
Move to safe harbor immediately as gusty winds and high waves are expected.
#end
#if(${list.contains(${bullets}, "hailWindsCTA")})
#if(${stormType} == "line")
Boaters should seek safe harbor immediately until these storms pass. ${windCTA}${hailCTA}#commaOrEllipsis()high waves#commaOrEllipsis()dangerous lightning#commaOrEllipsis()and heavy rain are possible with these storms.
#else
Boaters should seek safe harbor immediately until this storm passes. ${windCTA}${hailCTA}#commaOrEllipsis()high waves#commaOrEllipsis()dangerous lightning#commaOrEllipsis()and heavy rain are possible with this storm.
#end
#end
#if(${list.contains(${bullets}, "nonThunderstormCTA")})
Seek safe shelter#commaOrEllipsis()mariners can expect gusty winds and increasing waves.
#end
#if(${list.contains(${bullets}, "waterspoutCTA")})
#if(${list.contains(${bullets}, "thunderstorm")})
Thunderstorms can produce sudden waterspouts. Waterspouts can easily overturn boats and create locally hazardous seas. Seek safe harbor immediately.
#else
Waterspouts can easily overturn boats and create locally hazardous seas. Seek safe harbor immediately.
#end
#end
#if(${list.contains(${bullets}, "lightningCTA")})
#if(${stormType} == "line")
Frequent lightning is occurring with these storms. If caught on the open water stay below deck if possible#commaOrEllipsis()keep away from ungrounded metal objects.
#else
Frequent lightning is occurring with this storm. If caught on the open water stay below deck if possible#commaOrEllipsis()keep away from ungrounded metal objects.
#end
#end
#if(${list.contains(${bullets}, "reportCTA")})
Report severe weather to the Coast Guard or the National Weather Service.
#end
#if(${ctaSelected} == "YES")
&&
#end
#############
## WATCHES ##
#############
#if(${list.contains(${includedWatches}, "TO.A")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains(${includedWatches}, "SV.A")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.
#end
#printcoords(${areaPoly}, ${list})
#tml(${TMLtime}, ${timeFormat}, ${movementDirection}, ${movementInKnots}, ${eventLocation})
##################################################################
## Waterspout/Hail/Wind Tags used by CR for IBW
##################################################################
#if($spoutTag.length() > 0)
${spoutTag}
#end
HAIL...${hailTag}IN
WIND...${windTag}KTS
$$
#parse("forecasterName.vm")