<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 @@
         &quot;CFLAGS = -g&quot; \
         &quot;LDFLAGS = -g -C&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
  
 ftn:
         ( make all \
@@ -45,7 +42,7 @@
         &quot;CFLAGS = -fast&quot; \
         &quot;LDFLAGS = &quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi:
         ( make all \
@@ -57,7 +54,7 @@
         &quot;CFLAGS = -O3&quot; \
         &quot;LDFLAGS = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi-llnl:
         ( make all \
@@ -69,7 +66,7 @@
         &quot;CFLAGS = -fast&quot; \
         &quot;LDFLAGS = &quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 pgi-serial:
         ( make all \
@@ -81,7 +78,7 @@
         &quot;CFLAGS = -O0 -g&quot; \
         &quot;LDFLAGS = -O0 -g -Mbounds -Mchkptr&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 ifort:
         ( make all \
@@ -93,7 +90,7 @@
         &quot;CFLAGS = -O3 -m64&quot; \
         &quot;LDFLAGS = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 gfortran:
         ( make all \
@@ -105,7 +102,7 @@
         &quot;CFLAGS = -O3 -m64&quot; \
         &quot;LDFLAGS = -O3 -m64&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 gfortran-serial:
         ( make all \
@@ -117,7 +114,7 @@
         &quot;CFLAGS = -O3 -m64&quot; \
         &quot;LDFLAGS = -O3 -m64&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(PHYSICS) -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE -m64 $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 g95:
         ( make all \
@@ -129,7 +126,7 @@
         &quot;CFLAGS = -O3&quot; \
         &quot;LDFLAGS = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 g95-serial:
         ( make all \
@@ -141,7 +138,7 @@
         &quot;CFLAGS = -O3&quot; \
         &quot;LDFLAGS = -O3&quot; \
         &quot;CORE = $(CORE)&quot; \
-        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(PHYSICS) $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
+        &quot;CPPFLAGS = -DRKIND=8 $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE)&quot; )
 
 
 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=&quot;$(SCC)&quot; )
@@ -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) $&lt; &gt; $*.f90
+        $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $&lt; &gt; $*.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) $&lt; &gt; $*.f90
+        $(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $&lt; &gt; $*.f90
         $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I../core_physics -I../core_physics/physics_wrf

</font>
</pre>