[Dart-dev] DART/branches Revision: 12565

dart at ucar.edu dart at ucar.edu
Thu Apr 26 16:18:45 MDT 2018


nancy at ucar.edu
2018-04-26 16:18:45 -0600 (Thu, 26 Apr 2018)
263
update the makefile, add ftest_sendrecv.f90
which i had sitting in another branch.

this standalone makefile does include the mkmf.template
but it doesn't currently run fixsystem automatically,
so comment out the mpi system sections so these work
with gfortran.




Modified: DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/Makefile
===================================================================
--- DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/Makefile	2018-04-26 22:13:07 UTC (rev 12564)
+++ DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/Makefile	2018-04-26 22:18:45 UTC (rev 12565)
@@ -14,24 +14,24 @@
 include ../../../build_templates/mkmf.template
 
 # the include defines the following makefile variables:
-# MPIFC = 
-# MPILD =
-# FC =
-# LD =
-# NETCDF =
-# INCS = 
-# FFLAGS += -I$(INCS)  
-# LIBS =
-# LDFLAGS += -L$(NETCDF)/lib -lnetcdf
+# MPIFC =    # mpi fortran wrapper
+# MPILD =    # mpi loader wrapper
+# FC =       # fortran compiler
+# LD =       # loader
+# NETCDF =   # directory where include and lib for netcdf are located
+# INCS =     # any additional include dirs needed
+# FFLAGS += -I$(INCS)    # extra fortran compile flags
+# LIBS =     # any additional libraries needed
+# LDFLAGS += $(FFLAGS) -L$(NETCDF)/lib -lnetcdf  # loader flags
 
 # ----------------------------------------------------------------------------
 
-SRC = ftest_f90.f90 ftest_mpi.f90 ftest_nc.f90 \
+SRC = ftest_f90.f90 ftest_mpi.f90 ftest_sendrecv.f90 ftest_nc.f90 \
       ftest_stop.f90 ftest_go.f90 ctest.c ctest_mpi.c ctest_nc.c
 
 ALLSRC = $(SRC) Makefile README runme_*
 
-EXE = ftest_f90 ftest_mpi ftest_nc
+EXE = ftest_f90 ftest_mpi ftest_nc ftest_sendrecv
 ALLEXE = $(EXE) ftest_stop ftest_go ctest ctest_mpi ctest_nc
 
 # ----------------------------------------------------------------------------
@@ -74,6 +74,24 @@
 ftest_mpi: ftest_mpi.f90
 	$(MPIFC) ftest_mpi.f90 $(LDFLAGS) -o ftest_mpi
 
+# f90 test program that calls MPI functions
+ftest_sendrecv: ftest_sendrecv.f90 types_mod.o utilities_mod.o time_manager_mod.o mpi_utilities_mod.o
+	$(MPIFC) ftest_sendrecv.f90 types_mod.o utilities_mod.o time_manager_mod.o mpi_utilities_mod.o $(LDFLAGS) -o ftest_sendrecv
+
+UTILS_DIR = ../../../assimilation_code/modules/utilities
+
+types_mod.o: $(UTILS_DIR)/types_mod.f90
+	$(MPIFC) $(FFLAGS) -c $<
+
+utilities_mod.o: $(UTILS_DIR)/utilities_mod.f90
+	$(MPIFC) $(FFLAGS) -c $<
+
+time_manager_mod.o: $(UTILS_DIR)/time_manager_mod.f90
+	$(MPIFC) $(FFLAGS) -c $<
+
+mpi_utilities_mod.o: $(UTILS_DIR)/mpi_utilities_mod.f90
+	$(MPIFC) $(FFLAGS) -c $<
+
 # f90 test program that calls netCDF functions
 ftest_nc: ftest_nc.f90
 	$(FC) ftest_nc.f90 $(LDFLAGS) -o ftest_nc

Modified: DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest.c
===================================================================
--- DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest.c	2018-04-26 22:13:07 UTC (rev 12564)
+++ DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest.c	2018-04-26 22:18:45 UTC (rev 12565)
@@ -17,7 +17,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
    int i, j;
 

Modified: DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest_mpi.c
===================================================================
--- DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest_mpi.c	2018-04-26 22:13:07 UTC (rev 12564)
+++ DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest_mpi.c	2018-04-26 22:18:45 UTC (rev 12565)
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
    int i;
 

Modified: DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest_nc.c
===================================================================
--- DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest_nc.c	2018-04-26 22:13:07 UTC (rev 12564)
+++ DART/branches/rma_trunk/developer_tests/mpi_utilities/tests/ctest_nc.c	2018-04-26 22:18:45 UTC (rev 12565)
@@ -21,7 +21,7 @@
 
 void netcdf_error_exit(int istat);


More information about the Dart-dev mailing list