Skip to content

Commit

Permalink
Deprecate serial_build and parallel_build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Dec 10, 2023
1 parent 958ec04 commit 51f54d2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
24 changes: 21 additions & 3 deletions src/offline/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# ==============================================================================
##########################################################################

.PHONY: serial mpi common

# these are all the files we are compiling
LSRC = \
cable_maths_constants_mod.F90 \
Expand Down Expand Up @@ -149,7 +151,8 @@ casa_sumcflux.F90


# this is the executable we are building
PROG = cable
PROG_SERIAL = cable
PROG_MPI = cable-mpi

# from the compiled object files
OBJS = ${LSRC:.F90=.o}
Expand All @@ -165,7 +168,22 @@ CINC = -I$(NCMOD)
$(FC) $(CFLAGS) $(CINC) -c $<

# default target by convention is ``all''
all :
all: serial

serial: supr = -warn nostderrors -diag-disable 10145
serial: FOBJS = $(shell ls *.o)
serial: cable_driver.F90 common
rm -f cable_driver.o
$(FC) $(supr) $(CFLAGS) $(LDFLAGS) $(LD) -o $(PROG_SERIAL) cable_driver.F90 $(FOBJS) $(CINC)

mpi: supr = -warn nostderrors -diag-disable 10145
mpi: FOBJS = $(shell ls *.o)
mpi: cable_mpidrv.F90 cable_mpicommon.F90 pop_mpi.F90 cable_mpiworker.F90 cable_mpimaster.F90 common
$(FC) $(supr) $(CFLAGS) $(LDFLAGS) -c cable_mpicommon.F90 $(FOBJS) $(CINC)
$(FC) $(supr) $(CFLAGS) $(LDFLAGS) -c pop_mpi.F90 cable_mpicommon.o $(FOBJS) $(CINC)
$(FC) $(supr) $(CFLAGS) $(LDFLAGS) -c cable_mpiworker.F90 cable_mpicommon.o pop_mpi.o $(FOBJS) $(CINC)
$(FC) $(supr) $(CFLAGS) $(LDFLAGS) -c cable_mpimaster.F90 cable_mpicommon.o cable_mpiworker.o pop_mpi.o $(FOBJS) $(CINC)
$(FC) $(supr) $(CFLAGS) $(LDFLAGS) -o $(PROG_MPI) cable_mpidrv.F90 cable_mpicommon.o cable_mpimaster.o cable_mpiworker.o pop_mpi.o $(FOBJS) $(CINC) $(LD)

# dependencies, compilation rules for ALL files needed for "all" (LSRC)
#================================================================
Expand Down Expand Up @@ -351,7 +369,7 @@ landuse3.o: landuse3.F90 cable_define_types.o casa_dimension.o landuse_constant.
landuse_inout.o: landuse_inout.F90 cable_define_types.o landuse_constant.o landuse3.o cable_common.o cable_iovars.o cable_abort.o

# these are all the files we are compiling
all : grid_constants_cbl.o \
common : grid_constants_cbl.o \
cable_maths_constants_mod.o \
cable_phys_constants_mod.o \
cable_other_constants_mod.o \
Expand Down
5 changes: 2 additions & 3 deletions src/offline/build3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ echo ''
echo 'Building drivers for either serial or MPI application'
echo ''

make -f Makefile #this makes elements of CABLE that are common to all apps
if [[ $1 = 'mpi' ]]; then
./parallel_cable "$FC" "$CFLAGS" "$LDFLAGS" "$LD" "$NCMOD"
make mpi
else
./serial_cable "$FC" "$CFLAGS" "$LDFLAGS" "$LD" "$NCMOD"
make
fi

}
Expand Down

0 comments on commit 51f54d2

Please sign in to comment.