sunset_prov_anomalies<-function(recipe,data,graph) {
#Graph definitions
graph_main<-graph$main_graph
parentnodenames<-graph$main_graph$parentnodename
graph_fcst<-graph$graph_fcst
graph_hcst<-graph$graph_hcst
graph_obs<-graph$graph_obs

#Hindcast climatology
clim_hcst<-metaclipR.Climatology(package = "Anomalies",
  version = "1.0", graph_hcst,
  fun = "modules/Anomalies/Anomalies.R", arg.list = list("Recipe"="recipe", "data"="data"), disable.command = TRUE,
  dc.description = NULL)

#Observations climatology
clim_obs<-metaclipR.Climatology(package = "Anomalies",
  version = "1.0", graph_obs,
  fun = "modules/Anomalies/Anomalies.R", arg.list = list("Recipe"="recipe", "data"="data"), disable.command = TRUE,
  dc.description = NULL)

#Forecast climatology
if (!is.null(graph_fcst)){
anom_fcst<-metaclipR.Anomaly(graph_fcst, package = "Anomalies",
  version = "1.0", fun = "modules/Anomalies/Anomalies.R", time.frame=tolower(recipe$Analysis$Horizon),
  arg.list = list("Recipe"="recipe", "data"="data", "base" = clim_obs$parentnodename),
  referenceGraph = clim_hcst, clim.cell.method = "mean", disable.command = TRUE)
}

#Hindcast anomaly calculations
anom_hcst<-metaclipR.Anomaly(graph_hcst, package = "Anomalies",
  version = "1.0", fun = "modules/Anomalies/Anomalies.R", time.frame=tolower(recipe$Analysis$Horizon),
  arg.list = list("Recipe"="recipe", "data"="data", "base" = clim_obs$parentnodename),
  referenceGraph = clim_hcst, clim.cell.method = "mean", disable.command = TRUE)

#Observations anomaly calculation
anom_obs<-metaclipR.Anomaly(graph_obs, package = "Anomalies",
  version = "1.0", fun = "modules/Anomalies/Anomalies.R", time.frame=tolower(recipe$Analysis$Horizon),
  arg.list =  list("Recipe"="recipe", "data"="data", "base" = clim_obs$parentnodename),
  referenceGraph = clim_obs, clim.cell.method = "mean", disable.command = TRUE)

#Union graph and parentnodename
if(!is.null(graph_fcst)) {
    graph<-my_union_graph(anom_fcst$graph,anom_hcst$graph,anom_obs$graph, clim_obs$graph, clim_hcst$graph, graph_main$graph)
    parentnodename<-list(anom_fcst$parentnodename,anom_hcst$parentnodename, anom_obs$parentnodename, clim_hcst$parentnodename, clim_obs$parentnodename)

}else{
    graph<-my_union_graph(anom_hcst$graph,anom_obs$graph, clim_obs$graph, clim_hcst$graph, graph_main$graph)
    parentnodename<-list(anom_hcst$parentnodename, anom_obs$parentnodename, clim_hcst$parentnodename, clim_obs$parentnodename)
}

#Common command call
graph <- metaclip.graph.Command(graph, "Anomalies", "2.0.0", "/modules/Anomalies/Anomalies.R", arg.list=list("Recipe"=recipe$Run$output_dir, "Data"),parentnodename)

graph=list("graph"=graph, "parentnodename"=parentnodename)

if(!is.null(graph_fcst)){
return(list("main_graph"=graph,"anom_fcst"=anom_fcst, "graph_fcst"=graph_fcst, "anom_hcst"=anom_hcst,"graph_hcst"=graph_hcst, "anom_obs"=anom_obs, "graph_obs"=graph_obs))
}else {
return(list("main_graph"=graph,"anom_hcst"=anom_hcst, "graph_hcst"=graph_hcst, "anom_obs"=anom_obs, "graph_obs"=graph_obs))
}

}
