Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*.o
*.a
*.so
*~
.*.swp
*_out.nc
config_*.nam
*_sza.nc
Expand All @@ -11,3 +13,14 @@ mod
/bin/ecrad
/bin/ecrad_ifs
/bin/ecrad_ifs_blocked

# Python binding
/pyecrad/VERSION
/pyecrad/data
/tmp
/dist
/wheelhouse
__pycache__
pyecrad.egg-info
/test/pyecrad/control.nc
/test/pyecrad/experiment.nc
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export FCFLAGS = $(WARNFLAGS) $(BASICFLAGS) $(CPPFLAGS) -I../include \
$(OPTFLAGS) $(DEBUGFLAGS) $(NETCDF_INCLUDE) $(OMPFLAG)
export LIBS = $(LDFLAGS) -L../lib -lradiation -lutilities \
-lifsrrtm -lifsaux $(FCLIBS) $(NETCDF_LIB) $(OMPFLAG)
export SHAREDLIBFLAGS

# Do we include Dr Hook from ECMWF's fiat library?
ifdef FIATDIR
Expand Down Expand Up @@ -158,6 +159,11 @@ ifsdriver: libifsaux libifsrrtm libutilities libradiation libifs
test_programs: driver
cd driver && $(MAKE) test_programs

python: build
cd driver && $(MAKE) python
cp -f VERSION pyecrad/
rm -rf pyecrad/data; cp -r data pyecrad/

symlinks: clean-symlinks
cd practical && ln -s ../bin/ecrad
cd practical && ln -s ../data
Expand Down Expand Up @@ -197,6 +203,9 @@ clean-mods:
clean-symlinks:
rm -f practical/ecrad practical/data

clean-python:
rm -rf tmp dist wheelhouse

clean-autosaves:
rm -f *~ .gitignore~ */*~ */*/*~

Expand Down
4 changes: 3 additions & 1 deletion Makefile_include.gfortran
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ CPPFLAGS = -cpp
# flag "-fconvert=big-endian" here because the RRTM input files are
# big endian Fortran unformatted files, but now the file ordering has
# been specified at the OPEN command so no compiler flags are needed.
BASICFLAGS = -J../mod -fno-range-check
BASICFLAGS = -J../mod -fno-range-check -fPIC

SHAREDLIBFLAGS = --shared

# OpenMP flag; type "make OMPFLAG=-DNO_OPENMP" to compile with OpenMP
# disabled
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ optics, cloud optics and solver are completely separated (see
`radiation/radiation_interface.F90` where they are called in sequence),
thereby facilitating future changes where different gas models or
solvers may be switched in and out independently. The offline code is
parallelized using OpenMP.
parallelized using OpenMP. In addition, the offline code can be called
from the pyecrad python package.

Five solvers are currently available:

Expand Down Expand Up @@ -94,6 +95,8 @@ The subdirectories are as follows:

- `practical` - exercises to get started with ecRad

- `pyecrad` - python source code for the pyecrad package


## Compilation

Expand Down Expand Up @@ -138,6 +141,15 @@ Fortran compiler.
`$FIATDIR/module/fiat/yomhook.mod` can be found at build time.


## Python package

The python package can be installed by entering the command `pip install .`
in the root directory of ecrad.

Wheels are built and/or pushed on pypi using the `pyecrad_wheel.sh` script.
Help on this command can be obtained with `pyecrad_wheel.sh -h`.


## Testing

The offline driver is run via
Expand Down
12 changes: 9 additions & 3 deletions driver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ OBJECTS := $(SOURCES:.F90=.o)
EXECUTABLE = ../bin/ecrad
IFS_EXECUTABLE = ../bin/ecrad_ifs
IFS_BLOCKED_EXECUTABLE = ../bin/ecrad_ifs_blocked
PYSO = ../pyecrad/libecrad4py.so

all: driver ifs_driver test_programs
all: driver ifs_driver test_programs python

driver: $(EXECUTABLE)

ifs_driver: $(IFS_EXECUTABLE) $(IFS_BLOCKED_EXECUTABLE)

test_programs: $(TEST_PROGRAMS)

python: $(PYSO)

# Link ecrad executable; add "-lifs" if you want to use the "satur"
# routine in ecrad_driver.F90
$(EXECUTABLE): $(OBJECTS) ../lib/*.a ecrad_driver.o
Expand All @@ -36,18 +39,21 @@ test_%: test_%.F90 ../lib/*.a
#$(TEST): $(TEST).F90 ../lib/*.a
# $(FC) $(FCFLAGS) $(TEST).F90 $(LIBS) -o $(TEST)

$(PYSO): ../lib/*.a ecrad4py.o
$(FC) $(SHAREDLIBFLAGS) $(FCFLAGS) ecrad4py.o $(OBJECTS) -lifs $(LIBS) -o $(PYSO)

# Note that the dependence on mod files can mean that rerunning "make"
# recreates the executable
%.o: %.F90 ../lib/*.a
$(FC) $(FCFLAGS) -c $<

clean:
rm -f *.o $(EXECUTABLE) $(IFS_EXECUTABLE) $(IFS_BLOCKED_EXECUTABLE) \
$(TEST_PROGRAMS)
$(TEST_PROGRAMS) $(PYSO)

ecrad_driver.o: ecrad_driver_config.o ecrad_driver_read_input.o
ecrad_ifs_driver.o: ecrad_driver_config.o ecrad_driver_read_input.o
ecrad_ifs_driver_blocked.o: ecrad_driver_config.o ecrad_driver_read_input.o ifs_blocking.o
ecrad_driver_read_input.o ifs_blocking.o: ecrad_driver_config.o

.PHONY: driver ifs_driver test_programs all
.PHONY: driver ifs_driver test_programs python all
Loading