forked from CSU-INCUS/RAMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude.mk
More file actions
151 lines (138 loc) · 8.09 KB
/
include.mk
File metadata and controls
151 lines (138 loc) · 8.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# NOTES:
# For doing parallel simulations, compile MPICH or OPENMPI with both FORTRAN
# and C bindings turned on like the following configure statement for
# compiling MPICH. Most of the time you enter the software package main
# directory, issue the "configure" command, run "make", and then "make install".
# For the configure statement to work, your ".bash_profile" needs to know "which"
# C and Fortran compilers you are using. After compiling MPICH in this example,
# it will create "mpif90" and "mpicc" that you can use in this include.mk file
# for "F_COMP" and "C_COMP" env variables below. Make sure the paths to these
# compilers and associated libraries are in your .bash_profile PATH and
# LD_LIBRARY_PATH as needed.
# ./configure --prefix=/file-path-here-for-mpi/mpich-3.3.2 \
# --enable-fast=O3 CPPFLAGS=-DNDEBUG CC=gcc FC=ifort
#############################################################################
# Define make (gnu make works best).
#############################################################################
MAKE=/usr/bin/make
#############################################################################
# Set your RAMS root path and version number.
#############################################################################
RAMS_ROOT=/home/gleung/rams-default
RAMS_VERSION=6.3.04
#############################################################################
# Set root locations for HDF5 I/O software.
# Choose parallel or serial processing option for your compile type.
# Typically can use "parallel" for either, but some supercomputers require
# use of the serial executable.
#############################################################################
HDF5_ROOT?=$(HDF5_ROOT)
H5Z_ZFP_ROOT?=$(H5Z_ZFP_ROOT)
#############################################################################
# Set root locations for parallel processing MPI software.
# You can comment out MPI_ROOT for serial processing compile.
#############################################################################
MPI_ROOT?=$(MPI_ROOT)
#############################################################################
# RTE+RRTMGP requires netcdf
#############################################################################
NETCDF_FORTRAN_ROOT ?= $(NETCDF_FORTRAN_ROOT)
NETCDF_C_ROOT ?= $(NETCDF_C_ROOT)
#############################################################################
# Do not change these 2. They point from RAMS_ROOT to the source code.
#############################################################################
MODEL=$(RAMS_ROOT)/src
UTILS_INCS=-I$(MODEL)/include
#############################################################################
# Set HDF libraries and include locations relative to HDF5_ROOT.
# Note that linking libraries below are in a particular order to work!
# You may not need to modify these 3 variables. Try this default.
# Everything after the "-Wl" identifies library location for shared objects.
# HDF5 requires libz (zip) and libsz (szip). These can be linked in LIBS
# in the compiler instead, but need to be on your computer system.
#############################################################################
#HDF5_LIBS=-L$(HDF5_ROOT)/lib -lhdf5_hl -lhdf5 \
# -Wl,-rpath,/home/smsaleeb/software/szip-2.1/lib \
# -Wl,-rpath,/home/smsaleeb/software/zlib-1.2.5/lib
HDF5_LIBS= -L$(HDF5_ROOT)/lib -L$(HDF5_ROOT)/lib64 -lhdf5_hl -lhdf5 -L$(H5Z_ZFP_ROOT)/lib -lh5zzfp -lzfp
HDF5_INCS=-I$(HDF5_ROOT)/include -I$(H5Z_ZFP_ROOT)/include
HDF5_DEFS=
#############################################################################
# TYPE OF COMPUTER SYSTEM (used for DEFINE statements for intrinsic calls).
# Do not change this variable.
#############################################################################
CMACH=PC_LINUX1 #Standard Linux (only option available now)
#############################################################################
# UNCOMMENT 1 LINUX FORTRAN COMPILER SET OF FLAGS BELOW
#############################################################################
# Note that some Fortran optimizations greater than -O1 will not necessarily
# produce identical results when running same executable multiple times.
# This is perhaps due to order of operations or unrolling loop order that
# changes solutions slightly. This is not ideal for research applications
# involving sensitivity studies that require exact duplication. As such,
# the Makefile is setup to allow different optimizations for different source
# files. The F_OPTS1 and F_OPTS2 variables below can hold different compiler
# flags as needed. Further, for duplication of results you may need to force
# IEEE standard which is done in examples below.
# Please coordinate variables below with the commands in the Makefile.
# Definitions of compiler flags below
# F_COMP = path to compiler executable
# F_OPTS1 = Uses of flags for lower optimization for some files
# F_OPTS2 = Uses of flags for higher optimization for some files
# LOADER_OPTS = Flags and optimaztion for LOADER
# LIBS = Extra system libraries for linking that some compilers need,
# where the need for such libraries will be indicated by error messages
# when compiling the code.
F_COMP=mpif90
F_BASE = -fallow-argument-mismatch -ffree-form -fno-sign-zero -march=native -DLZFP
F_OPTS1 = $(F_BASE) -O1
F_OPTS2 = $(F_BASE) -O2
F_OPTS3 = $(F_BASE) -O3
LOADER_OPTS = $(F_BASE) -O2
LIBS = -L/opt/spack-envs/rams-default/view/lib64 -L/opt/spack-envs/rams-default/view/lib \
-Wl,-rpath,/opt/spack-envs/rams-default/view/lib64 \
-Wl,-rpath,/opt/spack-envs/rams-default/view/lib \
-lnetcdff -lnetcdf -lrt -lpthread -lz -lsz
#############################################################################
# C compiler choice and flags (gcc) and (mpicc) are most common
# Add the "-DRAMS_DOUBLE_PREC" compiler flag to "C_OPTS" for turning on
# double precision rather than default single precision. Note that using
# double will make output and runtimes substantially longer but provide the
# extra precision needed in some highly sensitive simulations.
#
# Add the "-DENABLE_PARALLEL_COMPRESSION" flag to attempt doing parallel
# compression of HDF5 output. Sometime this works and sometimes it does not.
# But if it does work, it will make it past the first analysis file write.
# If it does not work, it will fail or hang on the first file write.
#
# Use -std=c99 if you need the c99 standard. Use -std=gnu99 potentially to
# stop unnecessary warnings related to "popen/pclose" in "dprep" code.
#
# "-w" turns off warnings, which in many cases are not a problem since our
# code has been well tested. New "gcc" versions sometime throw extra warnings
# that are not really as issue for us, but you can turn warnings back on by
# removing the "-w" if you wish to alter code to eliminate warnings.
#############################################################################
C_COMP=mpicc
C_OPTS=-O3 -DUNDERSCORE -DLITTLE -std=gnu99 -DENABLE_PARALLEL_COMPRESSION -DENABLE_ZFP_COMPRESSION -w
#-DRAMS_DOUBLE_PREC \
#############################################################################
# System archive command syntax
# This might need different arguments depending on your Linux system. More
# recent versions have needed the "U" argument to prevent full RAMS recompile
# when only changing perhaps one file that does not have lots of dependencies
#############################################################################
ARCH=ar rsU
#############################################################################
# MPI - (Message Passing Interface) parallel processing choices required for
# parallel enabled HDF5 and parallel processing on many-core systems.
# Libraries to add to the PAR_LIBS list depend on your version of MPI
# software and HDF5 software.
# Add or remove needed libraries to PAR_LIBS. Missing or needed libraries
# will be highlighted in compile time error messages. Typical library
# specs are: -lmpich, -lmpl, -lmpi, -lmpifort
# Comment out these "PAR_" lines for serial processing compile.
#############################################################################
PAR_INCS=-I$(MPI_ROOT)/include
PAR_LIBS=-L$(MPI_ROOT)/lib -L$(MPI_ROOT)/lib64 -lmpi
PAR_DEFS=-DRAMS_MPI