1 ## If you have multiple mpi biulds on a single machine
2 ## this example may be relevant to you.
3 ## Ex: The hydro-c1 machine has mpi and netcdf built against portland
4 ## fortran in the PATH. However mpi and netcd built against intel
5 ## fortran is also available. Here's how I build WRF HYDRO against
7 ## Below, in this file, I make the changes:
8 ## COMPILER90 = $(ifortCompiler90)
9 ## LDFLAGS = $(ifortLdFlags)
10 ## NETCDFINC = $(ifortNetcdfInc)
11 ## NETCDFLIB = -L$(ifortNetcdfLib) -lnetcdff -lnetcdf
12 ## In my ~/.bashrc I have
14 ## export NETCDF=/opt/netcdf
17 ## ### manage ifort on hydro
18 ## export ifortNetcdfLib="/opt/netcdf-4.3.0+ifort-12.1/lib/"
19 ## export ifortNetcdfInc="/opt/netcdf-4.3.0+ifort-12.1/include/"
20 ## # RPATH for ifort (pgi is already default so no need)
21 ## ifortMpiLib="/opt/openmpi-1.10.0-intel/lib/"
22 ## export ifortLdFlags="-Wl,-rpath,${ifortNetcdfLib}:${ifortMpiLib} -L${ifortNetcdfLib} -L${ifortMpiLib}"
23 ## export ifortCompiler90='/opt/openmpi-1.10.0-intel/bin/mpif90'
24 ## # Aliases for invoking ifort
25 ## alias impirun='/opt/openmpi-1.10.0-intel/bin/mpirun'
26 ## alias iman='man -M/opt/openmpi+intel/man'
27 ## # Bonus: Check your wrf hydro environment - up you to maintain to your needs.
28 ## alias henv='printenv | egrep -i "(HYDRO|NUDG|PRECIP|CHAN_CONN|^NETCDF|^LDFLAGS|^ifort)" | egrep -v PWD'
32 ifeq ($(SPATIAL_SOIL),1)
33 SPATIAL_SOIL = -DSPATIAL_SOIL
38 ifeq ($(HYDRO_REALTIME),1)
39 HYDRO_REALTIME = -DHYDRO_REALTIME
45 WRF_HYDRO = -DWRF_HYDRO $(HYDRO_REALTIME)
50 ifeq ($(WRF_HYDRO_RAPID),1)
51 WRF_HYDRO = -DWRF_HYDRO -DWRF_HYDRO_RAPID $(HYDRO_REALTIME)
55 HYDRO_D = -DHYDRO_D $(WRF_HYDRO)
57 HYDRO_D = $(WRF_HYDRO)
61 ifeq ($(WRF_HYDRO_NUDGING),1)
62 WRF_HYDRO_NUDGING = -DWRF_HYDRO_NUDGING
67 ifeq ($(OUTPUT_CHAN_CONN),1)
68 OUTPUT_CHAN_CONN = -DOUTPUT_CHAN_CONN
73 ifeq ($(PRECIP_DOUBLE),1)
74 PRECIP_DOUBLE = -DPRECIP_DOUBLE
79 ifeq ($(NCEP_WCOSS),1)
80 NCEP_WCOSS = -DNCEP_WCOSS
94 BYTESWAPIO = -convert big_endian
95 F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO)
96 DEBUGFLAGS = -DHYDRO_D -g -traceback -debug all -check all
97 MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod
100 # module load dmapp/7.0.1-1.0502.11080.8.76.ari
101 #LDFLAGS = $(HDF5_LDFLAGS) -Wl,--whole-archive,-ldmapp,--no-whole-archive
102 LDFLAGS = $(HDF5_LDFLAGS)
104 CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(NWM_META) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS)
106 NETCDFINC = $(NETCDF_INC)
107 NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf