#
# Included makefile for Intel ifort compiler on NCAR yellowstone:
#
F90      = ifort
MPIF90   = mpiifort
MPIRUN   = mpirun.lsf
FFLAGS   = -r8 -heap-arrays
DBGFLAGS = -debug full -traceback 
DBGFLAGS += -check bounds -check format -check output_conversion -check pointers -check uninit
#
# Makefile will use OPTIM = -g if set debug=TRUE in job script.
OPTIM    = -O3
LIBS     = -lcurl
HOST     = $(shell hostname)
#
# Make machines.ini file for MPI execution: 
#
prereq: machines.ini mpirun.command
machines.ini: export HN=$(HOST)
machines.ini: export NP=$(NPROC)
machines.ini: FORCE
	@echo "Making machines.ini.."
	@echo `hostname` > machines.ini
	@awk 'BEGIN{ for (i=2; i <= ENVIRON["NP"]; i++) print ENVIRON["HN"] }' >> machines.ini

mpirun.command: FORCE
	@echo "Making mpirun.command: MPIRUN=$(MPIRUN)"
	@echo $(MPIRUN) > mpirun.command

FORCE:
