# Last edited on 2011-04-15 09:51:02 by stolfi

TAGS := un1 un2 un3

FULL_PLOT_FILES := \
  ${addsuffix -full.png, \
    ${addprefix plot-,${TAGS}} \
    ${addprefix ptmp-0-,${TAGS}} \
    ${addprefix ptmp-1-,${TAGS}} \
    ${addprefix pcor-1-2-,${TAGS}} \
    ${addprefix pcor-0-1-,${TAGS}} \
  }

ICON_PLOT_FILES := ${subst -full,-icon,${FULL_PLOT_FILES}}

all: \
  ${FULL_PLOT_FILES} ${ICON_PLOT_FILES}

# ----------------------------------------------------------------------
# Reactor plots:

plot-un%-full.png: data-un%.txt heat-un%.txt cams-un%.txt flow-un%.txt plot-reactor.sh Makefile
	./plot-reactor.sh $*

# ----------------------------------------------------------------------
# Core/drywell and drywell/torus pressure-tracking plots:

UNIT1_EPOCHS := \
  140 242 290 320

pcor-0-1-un1-full.png: data-un1.txt plot-pressure-tracking.sh Makefile
	./plot-pressure-tracking.sh 1 0 1 'X' '1.56*(X - 85)' ${UNIT1_EPOCHS}

pcor-1-2-un1-full.png: data-un1.txt plot-pressure-tracking.sh Makefile
	./plot-pressure-tracking.sh 1 1 2 'X' 'X - 20'        ${UNIT1_EPOCHS}

ptmp-0-un1-full.png: data-un1.txt plot-pressure-temp.sh Makefile
	./plot-pressure-temp.sh 1 0 ${UNIT1_EPOCHS}

ptmp-1-un1-full.png: data-un1.txt plot-pressure-temp.sh Makefile
	./plot-pressure-temp.sh 1 1 ${UNIT1_EPOCHS}

UNIT2_EPOCHS := \
  135 230 242 260


pcor-0-1-un2-full.png: data-un2.txt plot-pressure-tracking.sh Makefile
	./plot-pressure-tracking.sh 2 0 1 'X' 'X + 60'        ${UNIT2_EPOCHS}

pcor-1-2-un2-full.png: data-un2.txt plot-pressure-tracking.sh Makefile
	./plot-pressure-tracking.sh 2 1 2 'X' 'X'             ${UNIT2_EPOCHS}

ptmp-0-un2-full.png: data-un2.txt plot-pressure-temp.sh Makefile
	./plot-pressure-temp.sh 2 0 ${UNIT2_EPOCHS}

ptmp-1-un2-full.png: data-un2.txt plot-pressure-temp.sh Makefile
	./plot-pressure-temp.sh 2 1 ${UNIT2_EPOCHS}


UNIT3_EPOCHS := \
  62 208 242 260

pcor-0-1-un3-full.png: data-un3.txt plot-pressure-tracking.sh Makefile
	./plot-pressure-tracking.sh 3 0 1 'X + 70' 'X + 20'   ${UNIT3_EPOCHS}

pcor-1-2-un3-full.png: data-un3.txt plot-pressure-tracking.sh Makefile
	./plot-pressure-tracking.sh 3 1 2 'X' 'X - 50'        ${UNIT3_EPOCHS}

ptmp-0-un3-full.png: data-un3.txt plot-pressure-temp.sh Makefile
	./plot-pressure-temp.sh 3 0 ${UNIT3_EPOCHS}

ptmp-1-un3-full.png: data-un3.txt plot-pressure-temp.sh Makefile
	./plot-pressure-temp.sh 3 1 ${UNIT3_EPOCHS}

# ----------------------------------------------------------------------
# Icons:
        
%-icon.png: %-full.png
	convert $*-full.png -resize 'x200' $*-icon.png
	-display $*-icon.png