<p><b>duda</b> 2011-01-07 16:52:24 -0700 (Fri, 07 Jan 2011)</p><p>BRANCH COMMIT<br>
<br>
Make changes to atmos_physics branch so that none of the shared <br>
(i.e., core-independent) Makefiles have hard-wired references to <br>
atmosphere physics-related libraries or directories.<br>
<br>
The compilation of physics is triggered from within the hydrostatic and<br>
non-hydrostatic directories, and the resulting physics library is<br>
combined with the dynamics library before make returns from the dynamics<br>
directories.<br>
<br>
Now, the PHYSICS variable is set in the hyd_atmos and nhyd_atmos Makefiles.<br>
<br>
M src/core_hyd_atmos/Makefile<br>
M src/core_nhyd_atmos/Makefile<br>
M src/Makefile<br>
M Makefile<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/Makefile
===================================================================
--- branches/atmos_physics/Makefile        2011-01-07 00:00:09 UTC (rev 680)
+++ branches/atmos_physics/Makefile        2011-01-07 23:52:24 UTC (rev 681)
@@ -3,9 +3,6 @@
FILE_OFFSET = -DOFFSET64BIT
-#PHYSICS = -DDO_PHYSICS
-PHYSICS =
-
#########################
# Section for Zoltan TPL
#########################
@@ -33,7 +30,7 @@
        "CFLAGS = -g" \
        "LDFLAGS = -g -C" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
ftn:
        ( make all \
@@ -45,7 +42,7 @@
        "CFLAGS = -fast" \
        "LDFLAGS = " \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
pgi:
        ( make all \
@@ -57,7 +54,7 @@
        "CFLAGS = -O3" \
        "LDFLAGS = -O3" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
pgi-llnl:
        ( make all \
@@ -69,7 +66,7 @@
        "CFLAGS = -fast" \
        "LDFLAGS = " \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
pgi-serial:
        ( make all \
@@ -81,7 +78,7 @@
        "CFLAGS = -O0 -g" \
        "LDFLAGS = -O0 -g -Mbounds -Mchkptr" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
ifort:
        ( make all \
@@ -93,7 +90,7 @@
        "CFLAGS = -O3 -m64" \
        "LDFLAGS = -O3" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
gfortran:
        ( make all \
@@ -105,7 +102,7 @@
        "CFLAGS = -O3 -m64" \
        "LDFLAGS = -O3 -m64" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
gfortran-serial:
        ( make all \
@@ -117,7 +114,7 @@
        "CFLAGS = -O3 -m64" \
        "LDFLAGS = -O3 -m64" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(PHYSICS) -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
g95:
        ( make all \
@@ -129,7 +126,7 @@
        "CFLAGS = -O3" \
        "LDFLAGS = -O3" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
g95-serial:
        ( make all \
@@ -141,7 +138,7 @@
        "CFLAGS = -O3" \
        "LDFLAGS = -O3" \
        "CORE = $(CORE)" \
-        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
+        "CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)" )
CPPINCLUDES = -I../inc -I$(NETCDF)/include
Modified: branches/atmos_physics/src/Makefile
===================================================================
--- branches/atmos_physics/src/Makefile        2011-01-07 00:00:09 UTC (rev 680)
+++ branches/atmos_physics/src/Makefile        2011-01-07 23:52:24 UTC (rev 681)
@@ -2,8 +2,8 @@
all: mpas
-mpas: reg_includes externals frame ops physcore dycore drver
-        $(FC) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework -lphys $(LIBS)
+mpas: reg_includes externals frame ops dycore drver
+        $(FC) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS)
reg_includes:
        ( cd registry; make CC="$(SCC)" )
@@ -20,10 +20,6 @@
        ( cd operators; make all )
        ln -sf operators/libops.a libops.a
-physcore:
-        ( cd core_physics; make all )
-        ln -sf core_physics/libphys.a libphys.a
-
dycore:
        ( cd core_$(CORE); make all )
        ln -sf core_$(CORE)/libdycore.a libdycore.a
@@ -32,12 +28,11 @@
        ( cd driver; make all )
clean:
-        $(RM) $(CORE)_model.exe libframework.a libops.a libphys.a libdycore.a
+        $(RM) $(CORE)_model.exe libframework.a libops.a libdycore.a
        ( cd registry; make clean )
        ( cd external; make clean )
        ( cd framework; make clean )
        ( cd operators; make clean )
-        ( cd core_physics; make clean )
        ( cd inc; rm -f *.inc )
        if [ -d core_$(CORE) ] ; then \
         ( cd core_$(CORE); make clean ) \
Modified: branches/atmos_physics/src/core_hyd_atmos/Makefile
===================================================================
--- branches/atmos_physics/src/core_hyd_atmos/Makefile        2011-01-07 00:00:09 UTC (rev 680)
+++ branches/atmos_physics/src/core_hyd_atmos/Makefile        2011-01-07 23:52:24 UTC (rev 681)
@@ -1,14 +1,21 @@
.SUFFIXES: .F .o
+PHYSICS=-DDO_PHYSICS
+#PHYSICS=
+
OBJS = module_mpas_core.o \
module_test_cases.o \
module_time_integration.o \
module_advection.o
-all: core_hyd
+all: physcore core_hyd
+physcore:
+        ( cd ../core_physics; make all )
+        ( mkdir phys; cd phys; ar -x ../../core_physics/libphys.a )
+
core_hyd: $(OBJS)
-        ar -ru libdycore.a $(OBJS)
+        ar -ru libdycore.a $(OBJS) phys/*.o
module_test_cases.o:
@@ -19,9 +26,11 @@
module_mpas_core.o: module_advection.o module_test_cases.o module_time_integration.o
clean:
+        ( cd ../core_physics; make clean )
+        $(RM) -r phys
        $(RM) *.o *.mod *.f90 libdycore.a
.F.o:
        $(RM) $@ $*.mod
-        $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $< > $*.f90
+        $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $< > $*.f90
        $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I../core_physics -I../core_physics/physics_wrf
Modified: branches/atmos_physics/src/core_nhyd_atmos/Makefile
===================================================================
--- branches/atmos_physics/src/core_nhyd_atmos/Makefile        2011-01-07 00:00:09 UTC (rev 680)
+++ branches/atmos_physics/src/core_nhyd_atmos/Makefile        2011-01-07 23:52:24 UTC (rev 681)
@@ -1,14 +1,21 @@
.SUFFIXES: .F .o
+PHYSICS=-DDO_PHYSICS
+#PHYSICS=
+
OBJS = module_mpas_core.o \
module_test_cases.o \
module_time_integration.o \
module_advection.o
-all: core_hyd
+all: physcore core_hyd
+physcore:
+        ( cd ../core_physics; make all )
+        ( mkdir phys; cd phys; ar -x ../../core_physics/libphys.a )
+
core_hyd: $(OBJS)
-        ar -ru libdycore.a $(OBJS)
+        ar -ru libdycore.a $(OBJS) phys/*.o
module_test_cases.o: module_advection.o
@@ -19,9 +26,11 @@
module_mpas_core.o: module_advection.o module_test_cases.o module_time_integration.o
clean:
+        ( cd ../core_physics; make clean )
+        $(RM) -r phys
        $(RM) *.o *.mod *.f90 libdycore.a
.F.o:
        $(RM) $@ $*.mod
-        $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $< > $*.f90
+        $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $< > $*.f90
        $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I../core_physics -I../core_physics/physics_wrf
</font>
</pre>