digraph dataflow {
    graph [fontname=Arial fontsize=12 nodesep=0.5];
    node  [fontname=Arial fontsize=12 shape=box width=2.5];
    edge  [fontname=Arial fontsize=12];
    
    subgraph cluster_atmosphere {
	labeljust=l;
	label="Atmosphere [optional]";
	
	atm [label="Atmosphere model"];
	subgraph cluster_mod_a {
	    labeljust=l;
	    label="0 or more times";
	    style=dashed;
	    mod_a_node [label="Modifier"];
	}
	atm -> mod_a_node;
    }
    
    subgraph cluster_surface {
	labeljust=l;
	label="Surface layer";
	surf [label="Surface model"];
	subgraph cluster_mod_s {
	    labeljust=l;
	    label="0 or more times";
	    style=dashed;
	    mod_s_node [label="Modifier"];
	}
	surf->mod_s_node;
    }
    
    subgraph cluster_ocean {
	labeljust=l;
	label="Ocean";
	ocean [label="Ocean model"];
	subgraph cluster_mod_o {
	    labeljust=l;
	    label="0 or more times";
	    style=dashed;
	    mod_o_node [label="Modifier"];
	}
	ocean->mod_o_node;
    }
    
    subgraph cluster_pism {
	labeljust=l;
	label="PISM Core";
	ice [label="Ice dynamics model" rank=min];
 	bed [label="Bed deformation model" rank=max];
	ice -> bed;
	bed -> ice;
	
	mod_a_node -> surf [color="red"];
	/* there is a work-around at
         http://stackoverflow.com/questions/3450700/place-edge-label-on-the-other-side
       which might allow putting this label on the left side of the arrow,
       which would improve appearance; but mostly it makes me think we should
       switch to Tikz? */
	mod_s_node -> ice [color="green" label="ice temperature\nat its top surface and\nmass flux into the ice"];
	mod_o_node -> ice [color="blue" label="mass flux into the ocean"];
	
    }
}
