From e6825a27707578a0f802b8f81f5976c77afa91a7 Mon Sep 17 00:00:00 2001 From: Ryan Cabell Date: Thu, 21 Nov 2019 14:24:00 -0700 Subject: [PATCH] Update Makefiles to use one-step preprocess/compile (#429) * Update Makefiles to use one-step preprocess/compile Updated the Makefiles and macros.* files to use single-step compilation in which the compiler drives the preprocessor directly. This simplifies the Makefiles (removing the need to clean up intermediate CPP files), and has the added side effect of making the build system no longer case- sensitive. --- .gitignore | 4 +--- trunk/NDHMS/CPL/CLM_cpl/Makefile | 6 ++--- trunk/NDHMS/CPL/LIS_cpl/Makefile | 6 ++--- trunk/NDHMS/CPL/NoahMP_cpl/Makefile | 7 ++---- trunk/NDHMS/CPL/Noah_cpl/Makefile | 7 ++---- trunk/NDHMS/CPL/WRF_cpl/Makefile | 6 ++--- trunk/NDHMS/Data_Rec/Makefile | 6 ++--- trunk/NDHMS/Debug_Utilities/Makefile | 6 ++--- trunk/NDHMS/HYDRO_drv/Makefile | 7 ++---- .../Land_models/Noah/GRAPHICS/HORIZ/Makefile | 5 +---- .../Noah/GRAPHICS/TIME_SERIES/Makefile | 5 +---- .../Noah/HRLDAS_COLLECT_DATA/Makefile | 5 +---- .../Noah/HRLDAS_COLLECT_DATA/lib/Makefile | 5 +---- trunk/NDHMS/Land_models/Noah/IO_code/Makefile | 17 ++++---------- trunk/NDHMS/Land_models/Noah/Noah/Makefile | 5 +---- .../Noah/Utility_programs/Makefile | 15 +++---------- .../Utility_programs/gcip_sw_to_grib/Makefile | 5 +---- .../Noah/Utility_routines/Makefile | 5 +---- .../NoahMP/HRLDAS_forcing/Makefile | 6 ++--- .../NoahMP/HRLDAS_forcing/lib/Makefile | 6 ++--- .../NDHMS/Land_models/NoahMP/IO_code/Makefile | 22 ++++++------------- .../NoahMP/Utility_routines/Makefile | 6 ++--- trunk/NDHMS/Land_models/NoahMP/phys/Makefile | 6 ++--- trunk/NDHMS/MPP/Makefile | 5 ++--- trunk/NDHMS/Routing/Makefile | 7 ++---- trunk/NDHMS/Routing/Overland/Makefile | 10 ++++----- trunk/NDHMS/arc/macros.gordon | 9 ++++++-- trunk/NDHMS/arc/macros.gordon.debug | 4 ++-- trunk/NDHMS/arc/macros.mpp.IBM.xlf90_r | 4 ++-- trunk/NDHMS/arc/macros.mpp.gfort | 4 ++-- trunk/NDHMS/arc/macros.mpp.ifort | 6 ++--- trunk/NDHMS/arc/macros.mpp.ifort.luna | 4 ++-- .../{macros.theia => macros.mpp.ifort.theia} | 4 ++-- trunk/NDHMS/arc/macros.mpp.linux | 4 ++-- trunk/NDHMS/arc/macros.mpp.mpiifort | 4 ++-- trunk/NDHMS/arc/macros.seq.gfort | 4 ++-- trunk/NDHMS/arc/macros.seq.ifort | 4 ++-- trunk/NDHMS/arc/macros.seq.linux | 5 ++--- trunk/NDHMS/arc/macros.theia.debug | 4 ++-- trunk/NDHMS/nudging/Makefile | 7 ++---- trunk/NDHMS/utils/Makefile | 5 ++--- 41 files changed, 91 insertions(+), 171 deletions(-) rename trunk/NDHMS/arc/{macros.theia => macros.mpp.ifort.theia} (97%) diff --git a/.gitignore b/.gitignore index ef0cab950..8e156c547 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ *.o -*.f -*.f90 -*.F90 *.mod *~ Makefile.comm @@ -23,3 +20,4 @@ README.md *pytest_cache* *.log compile_options.sh +.DS_Store diff --git a/trunk/NDHMS/CPL/CLM_cpl/Makefile b/trunk/NDHMS/CPL/CLM_cpl/Makefile index 6eee09754..241bbee14 100644 --- a/trunk/NDHMS/CPL/CLM_cpl/Makefile +++ b/trunk/NDHMS/CPL/CLM_cpl/Makefile @@ -18,9 +18,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) -I ../../mod $(CLM_MOD) $(*).f - $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -I$(NETCDFINC) -o $(@) $(F90FLAGS) $(MODFLAG) -I ../../mod $(CLM_MOD) $(*).F @echo "" ar -r ../../lib/libHYDRO.a $(@) @@ -29,5 +27,5 @@ all: $(OBJS) # clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ cd ../..; make -f Makefile.comm clean diff --git a/trunk/NDHMS/CPL/LIS_cpl/Makefile b/trunk/NDHMS/CPL/LIS_cpl/Makefile index c38f6c637..e048032c9 100644 --- a/trunk/NDHMS/CPL/LIS_cpl/Makefile +++ b/trunk/NDHMS/CPL/LIS_cpl/Makefile @@ -18,9 +18,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) -I../../mod $(LIS_MOD) -I$(MOD_ESMF) $(*).f - $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -I$(NETCDFINC) -o $(@) $(F90FLAGS) $(MODFLAG) -I../../mod $(LIS_MOD) -I$(MOD_ESMF) $(*).F @echo "" ar -r ../../lib/libHYDRO.a $(@) @@ -29,4 +27,4 @@ all: $(OBJS) # clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/CPL/NoahMP_cpl/Makefile b/trunk/NDHMS/CPL/NoahMP_cpl/Makefile index 8286d53d8..f70d27e29 100644 --- a/trunk/NDHMS/CPL/NoahMP_cpl/Makefile +++ b/trunk/NDHMS/CPL/NoahMP_cpl/Makefile @@ -16,10 +16,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f -# $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) $(*).f - $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) $(*).F @echo "" ar -r ../../lib/libHYDRO.a $(@) cp *.mod ../../mod @@ -33,4 +30,4 @@ hrldas_drv_HYDRO.o: module_hrldas_HYDRO.o ../../Data_Rec/module_namelist.o ../.. clean: - rm -f *.o *.mod *.stb *~ *.f Noah_hrldas_beta + rm -f *.o *.mod *.stb *~ Noah_hrldas_beta diff --git a/trunk/NDHMS/CPL/Noah_cpl/Makefile b/trunk/NDHMS/CPL/Noah_cpl/Makefile index a8e04f3b3..655405022 100644 --- a/trunk/NDHMS/CPL/Noah_cpl/Makefile +++ b/trunk/NDHMS/CPL/Noah_cpl/Makefile @@ -16,10 +16,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f -# $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) -I$(NETCDF_INC) $(*).f - $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(MODFLAG) -I$(NETCDF_INC) $(*).F @echo "" ar -r ../../lib/libHYDRO.a $(@) @@ -32,4 +29,4 @@ hrldas_drv_HYDRO.o: module_hrldas_HYDRO.o ../../Data_Rec/module_namelist.o ../.. clean: - rm -f *.o *.mod *.stb *~ *.f Noah_hrldas_beta + rm -f *.o *.mod *.stb *~ Noah_hrldas_beta diff --git a/trunk/NDHMS/CPL/WRF_cpl/Makefile b/trunk/NDHMS/CPL/WRF_cpl/Makefile index a37fbe0d7..fa196ae9d 100644 --- a/trunk/NDHMS/CPL/WRF_cpl/Makefile +++ b/trunk/NDHMS/CPL/WRF_cpl/Makefile @@ -17,9 +17,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) -I$(WRF_ROOT)/frame -I$(WRF_ROOT)/main -I$(WRF_ROOT)/external/esmf_time_f90 $(*).f - $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -I$(NETCDFINC) -o $(@) $(F90FLAGS) $(MODFLAG) -I$(WRF_ROOT)/frame -I$(WRF_ROOT)/main -I$(WRF_ROOT)/external/esmf_time_f90 $(*).F @echo "" ar -r ../../lib/libHYDRO.a $(@) @@ -31,4 +29,4 @@ module_wrf_HYDRO.o: ../../Data_Rec/module_RT_data.o ../../Data_Rec/module_nameli wrf_drv_HYDRO.o: module_wrf_HYDRO.o clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/Data_Rec/Makefile b/trunk/NDHMS/Data_Rec/Makefile index 49ac4e92e..2de17518d 100644 --- a/trunk/NDHMS/Data_Rec/Makefile +++ b/trunk/NDHMS/Data_Rec/Makefile @@ -14,9 +14,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I../mod $(*).f - $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -I$(NETCDFINC) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I../mod $(*).F @echo "" ar -r ../lib/libHYDRO.a $(@) cp *.mod ../mod @@ -25,4 +23,4 @@ all: $(OBJS) # clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/Debug_Utilities/Makefile b/trunk/NDHMS/Debug_Utilities/Makefile index 05a95c9b8..bbba71179 100644 --- a/trunk/NDHMS/Debug_Utilities/Makefile +++ b/trunk/NDHMS/Debug_Utilities/Makefile @@ -12,9 +12,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I../mod $(*).f - #$(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -I$(NETCDFINC) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I../mod $(*).F @echo "" ar -r ../lib/libHYDRO.a $(@) cp *.mod ../mod @@ -23,4 +21,4 @@ all: $(OBJS) # clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/HYDRO_drv/Makefile b/trunk/NDHMS/HYDRO_drv/Makefile index 0b92dda74..0bb462e09 100644 --- a/trunk/NDHMS/HYDRO_drv/Makefile +++ b/trunk/NDHMS/HYDRO_drv/Makefile @@ -11,10 +11,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f -# $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) -I../mod $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) -I../mod $(*).f -# $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) -I../mod $(*).F @echo "" ar -r ../lib/libHYDRO.a $(@) cp *.mod ../mod @@ -26,4 +23,4 @@ module_HYDRO_drv.o: ../Data_Rec/module_namelist.o ../Data_Rec/module_RT_data.o . ../Routing/module_GW_baseflow.o ../Routing/module_HYDRO_utils.o ../Routing/module_HYDRO_io.o ../Routing/module_RT.o clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/Land_models/Noah/GRAPHICS/HORIZ/Makefile b/trunk/NDHMS/Land_models/Noah/GRAPHICS/HORIZ/Makefile index 1e12d3fc5..6ec183f73 100644 --- a/trunk/NDHMS/Land_models/Noah/GRAPHICS/HORIZ/Makefile +++ b/trunk/NDHMS/Land_models/Noah/GRAPHICS/HORIZ/Makefile @@ -34,10 +34,7 @@ all: $(CMD) .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(*).F > $(*).f - $(F90) -c -I$(NETCDF)/include $(FFLAGS) $(MODDIR) $(*).f - $(RM) $(*).f + $(F90) $(CPPINVOKE) $(CPPFLAGS) -c -I$(NETCDF)/include $(FFLAGS) $(MODDIR) $(*).F $(CMD): $(OBJS) $(F90) -o $(@) -I$(NETCDF)/include $(FFLAGS) $(OBJS) \ diff --git a/trunk/NDHMS/Land_models/Noah/GRAPHICS/TIME_SERIES/Makefile b/trunk/NDHMS/Land_models/Noah/GRAPHICS/TIME_SERIES/Makefile index d8bbb6148..0bf9a76d4 100644 --- a/trunk/NDHMS/Land_models/Noah/GRAPHICS/TIME_SERIES/Makefile +++ b/trunk/NDHMS/Land_models/Noah/GRAPHICS/TIME_SERIES/Makefile @@ -32,10 +32,7 @@ all: $(CMD) .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(*).F > $(*).f - $(F90) -c -I$(NETCDF)/include $(FFLAGS) $(MODDIR) $(*).f - $(RM) $(*).f + $(F90) $(CPPINVOKE) $(CPPFLAGS) -c -I$(NETCDF)/include $(FFLAGS) $(MODDIR) $(*).F $(CMD): $(OBJS) $(F90) -o $(@) -I$(NETCDF)/include $(FFLAGS) $(OBJS) \ diff --git a/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/Makefile b/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/Makefile index 622e8b130..1d6547138 100644 --- a/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/Makefile +++ b/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/Makefile @@ -20,10 +20,7 @@ lib/libsmda.a: .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(*).F > $(*).f - $(COMPILERF90) $(FREESOURCE) $(F90FLAGS) -c $(NETCDFMOD) -I./lib $(MODFLAG)./lib $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(FREESOURCE) $(F90FLAGS) -c $(NETCDFMOD) -I./lib $(MODFLAG)./lib $(*).F $(CMD): lib/libsmda.a $(OBJS) (cd lib; make) diff --git a/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/lib/Makefile b/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/lib/Makefile index 7eb47aa7d..9f6100cbd 100644 --- a/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/lib/Makefile +++ b/trunk/NDHMS/Land_models/Noah/HRLDAS_COLLECT_DATA/lib/Makefile @@ -50,10 +50,7 @@ decode_jpeg2000.o: decode_jpeg2000.c .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(GRIBCODE_OPT) $(BZIP_CPP) $(*).F > $(*).f - $(COMPILERF90) -c $(FREESOURCE) $(F90FLAGS) $(NETCDFMOD) $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(GRIBCODE_OPT) $(BZIP_CPP) -c $(FREESOURCE) $(F90FLAGS) $(NETCDFMOD) $(*).F .c.o: $(CC) -c $(BZIP_CPP) $(<) diff --git a/trunk/NDHMS/Land_models/Noah/IO_code/Makefile b/trunk/NDHMS/Land_models/Noah/IO_code/Makefile index a33d23449..75c81b46d 100644 --- a/trunk/NDHMS/Land_models/Noah/IO_code/Makefile +++ b/trunk/NDHMS/Land_models/Noah/IO_code/Makefile @@ -15,27 +15,18 @@ all: $(OBJS) Noah_hrldas_driver.o: Noah_hrldas_driver.F @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG). \ - $(MODFLAG)../Noah $(MODFLAG)../Utility_routines $(NETCDFMOD) $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG). \ + $(MODFLAG)../Noah $(MODFLAG)../Utility_routines -I../../../MPP $(NETCDFMOD) $(*).F @echo "" module_hrldas_netcdf_io.o: module_hrldas_netcdf_io.F @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(NETCDFMOD) $(CPPHRLDAS) $(*).F > $(*).f - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG)../Utility_routines $(NETCDFMOD) $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG)../Utility_routines $(NETCDFMOD) $(*).F @echo "" .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).F @echo "" diff --git a/trunk/NDHMS/Land_models/Noah/Noah/Makefile b/trunk/NDHMS/Land_models/Noah/Noah/Makefile index c1161082e..1881cc273 100644 --- a/trunk/NDHMS/Land_models/Noah/Noah/Makefile +++ b/trunk/NDHMS/Land_models/Noah/Noah/Makefile @@ -15,10 +15,7 @@ all: $(OBJS) .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f - $(COMPILERF90) -o $(@) -c $(MODFLAG). $(MODFLAG)../Utility_routines $(F90FLAGS) $(FREESOURCE) $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(MODFLAG). $(MODFLAG)../Utility_routines $(F90FLAGS) $(FREESOURCE) $(*).F @echo "" # diff --git a/trunk/NDHMS/Land_models/Noah/Utility_programs/Makefile b/trunk/NDHMS/Land_models/Noah/Utility_programs/Makefile index b7a260903..95a02fd30 100644 --- a/trunk/NDHMS/Land_models/Noah/Utility_programs/Makefile +++ b/trunk/NDHMS/Land_models/Noah/Utility_programs/Makefile @@ -20,27 +20,18 @@ all: $(CMD) # module_date_utilities.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) ../Utility_routines/$(*).F > $(*).f - $(COMPILERF90) $(FREESOURCE) $(F90FLAGS) -c $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(FREESOURCE) $(F90FLAGS) -c ../Utility_routines/$(*).F # # Compile the arguments_module from the HRLDAS_COLLECT_DATA/lib directory # arguments_module.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) ../HRLDAS_COLLECT_DATA/lib/$(*).F > $(*).f - $(COMPILERF90) $(FREESOURCE) $(F90FLAGS) -c $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(FREESOURCE) $(F90FLAGS) -c ../HRLDAS_COLLECT_DATA/lib/$(*).F .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(*).F > $(*).f - $(COMPILERF90) $(FREESOURCE) $(F90FLAGS) -c $(NETCDFMOD) $(MODFLAG). $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(FREESOURCE) $(F90FLAGS) -c $(NETCDFMOD) $(MODFLAG). $(*).F hrldas_extract_point: hrldas_extract_point.o diff --git a/trunk/NDHMS/Land_models/Noah/Utility_programs/gcip_sw_to_grib/Makefile b/trunk/NDHMS/Land_models/Noah/Utility_programs/gcip_sw_to_grib/Makefile index ae8dba1bc..a94511513 100644 --- a/trunk/NDHMS/Land_models/Noah/Utility_programs/gcip_sw_to_grib/Makefile +++ b/trunk/NDHMS/Land_models/Noah/Utility_programs/gcip_sw_to_grib/Makefile @@ -37,10 +37,7 @@ module_date_utilities.o: ../../Utility_routines/module_date_utilities.F $(COMPILERF90) -c $(F90FLAGS) $(FREESOURCE) $(<) .F.o: - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(*).F > $(*).f - $(COMPILERF90) $(FREESOURCE) $(F90FLAGS) -c $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(FREESOURCE) $(F90FLAGS) -c $(*).F neat: diff --git a/trunk/NDHMS/Land_models/Noah/Utility_routines/Makefile b/trunk/NDHMS/Land_models/Noah/Utility_routines/Makefile index b58244e51..64255c539 100644 --- a/trunk/NDHMS/Land_models/Noah/Utility_routines/Makefile +++ b/trunk/NDHMS/Land_models/Noah/Utility_routines/Makefile @@ -19,10 +19,7 @@ all: $(OBJS) .F.o: @echo "" - $(RM) $(*).f - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).f - $(RM) $(*).f + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).F @echo "" # diff --git a/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/Makefile b/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/Makefile index e1da7a2c3..ed619ffff 100644 --- a/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/Makefile +++ b/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/Makefile @@ -20,9 +20,7 @@ lib/libsmda.a: .F.o: @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPP_NETCDF4_COMPRESS) $(*).F > $(*).f90 - $(COMPILERF90) $(FREESOURCE) $(F90FLAGS) $(LDFLAGS) -c $(NETCDFMOD) -I./lib -I./lib $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPP_NETCDF4_COMPRESS) $(FREESOURCE) $(F90FLAGS) $(LDFLAGS) -c $(NETCDFMOD) -I./lib -I./lib $(*).F $(CMD): lib/libsmda.a $(OBJS) (cd lib; make) @@ -30,7 +28,7 @@ $(CMD): lib/libsmda.a $(OBJS) -L./lib -lsmda $(NETCDFLIB) $(BZIP2_LIB) $(LIBJASPER) clean: - $(RM) *.o *~ *.exe *.mod *.f90 + $(RM) *.o *~ *.exe *.mod (cd lib; make clean) # diff --git a/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/lib/Makefile b/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/lib/Makefile index b2f383d89..d0d5f1191 100644 --- a/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/lib/Makefile +++ b/trunk/NDHMS/Land_models/NoahMP/HRLDAS_forcing/lib/Makefile @@ -49,15 +49,13 @@ decode_jpeg2000.o: decode_jpeg2000.c .F.o: @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(GRIBCODE_OPT) $(BZIP_CPP) $(*).F > $(*).f90 - $(COMPILERF90) -c $(FREESOURCE) $(F90FLAGS) $(LDFLAGS) $(NETCDFMOD) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(GRIBCODE_OPT) $(BZIP_CPP) -c $(FREESOURCE) $(F90FLAGS) $(LDFLAGS) $(NETCDFMOD) $(*).F .c.o: $(CC) -c $(BZIP_CPP) $(<) clean: - $(RM) $(OBJS) $(CMD) *.mod *.f90 *~ + $(RM) $(OBJS) $(CMD) *.mod *~ # module_grib2.o: module_grib2.F module_grib2_tables.o module_grib1.o module_mapinfo.o kwm_date_utilities.o module_grib_common.o module_grib1.o: module_grib1.F module_mapinfo.o kwm_date_utilities.o module_grib_common.o diff --git a/trunk/NDHMS/Land_models/NoahMP/IO_code/Makefile b/trunk/NDHMS/Land_models/NoahMP/IO_code/Makefile index f2aeb836d..009f1effc 100644 --- a/trunk/NDHMS/Land_models/NoahMP/IO_code/Makefile +++ b/trunk/NDHMS/Land_models/NoahMP/IO_code/Makefile @@ -19,34 +19,26 @@ NoahMP : $(OBJS_NoahMP) $(OBJS) module_NoahMP_hrldas_driver.o: module_NoahMP_hrldas_driver.F ../../../HYDRO_drv/module_HYDRO_drv.o ../../../Data_Rec/module_namelist.o ../../../Data_Rec/module_RT_data.o ../../../CPL/NoahMP_cpl/module_hrldas_HYDRO.o @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f90 - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG) -I. \ - -I../phys -I../Utility_routines -I../../../mod $(NETCDFMOD) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG) -I. \ + -I../phys -I../Utility_routines -I../../../mod $(NETCDFMOD) $(*).F @echo "" main_hrldas_driver.o: main_hrldas_driver.F @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f90 - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) -I ../MPP -I. \ - -I../phys -I../Utility_routines -I../../../mod -I../../../MPP $(NETCDFMOD) $(MODFLAG) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) -I ../MPP -I. \ + -I../phys -I../Utility_routines -I../../../mod -I../../../MPP $(NETCDFMOD) $(*).F # $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) -I ../MPP -I. \ # -I../phys -I../Utility_routines $(NETCDFMOD) $(*).f90 @echo "" module_hrldas_netcdf_io.o: module_hrldas_netcdf_io.F @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(NETCDFMOD) $(*).F > $(*).f90 - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) -I ../MPP -I../Utility_routines $(NETCDFMOD) $(MODFLAG) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) -I ../MPP -I../Utility_routines $(MODFLAG) $(NETCDFMOD) $(*).F @echo "" .F.o: @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f90 - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).F @echo "" # @@ -60,4 +52,4 @@ $(OBJS_NoahMP): module_hrldas_netcdf_io.o # This command cleans up object files, etc. clean: - $(RM) *.o *.mod *.stb *~ *.f90 + $(RM) *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/Land_models/NoahMP/Utility_routines/Makefile b/trunk/NDHMS/Land_models/NoahMP/Utility_routines/Makefile index 561efa1b6..d1fb97232 100644 --- a/trunk/NDHMS/Land_models/NoahMP/Utility_routines/Makefile +++ b/trunk/NDHMS/Land_models/NoahMP/Utility_routines/Makefile @@ -18,9 +18,7 @@ all: $(OBJS) .F.o: @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f90 - $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).F @echo "" # @@ -32,5 +30,5 @@ all: $(OBJS) # clean: - $(RM) *.o *.mod *.stb *~ *.f90 + $(RM) *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/Land_models/NoahMP/phys/Makefile b/trunk/NDHMS/Land_models/NoahMP/phys/Makefile index 5437fa1c3..3cdaf1097 100644 --- a/trunk/NDHMS/Land_models/NoahMP/phys/Makefile +++ b/trunk/NDHMS/Land_models/NoahMP/phys/Makefile @@ -17,9 +17,7 @@ all: $(OBJS) .F.o: @echo "" - $(RM) $(*).f90 - $(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F > $(*).f90 - $(COMPILERF90) -o $(@) -c -I../Utility_routines $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).f90 + $(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c -I../Utility_routines $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).F @echo "" # @@ -33,5 +31,5 @@ module_sf_noahmp_groundwater.o: module_sf_noahmplsm.o # clean: - $(RM) *.o *.mod *.stb *~ *.f90 + $(RM) *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/MPP/Makefile b/trunk/NDHMS/MPP/Makefile index 06333f586..0db500b02 100644 --- a/trunk/NDHMS/MPP/Makefile +++ b/trunk/NDHMS/MPP/Makefile @@ -16,9 +16,8 @@ mpp_land.o: mpp_land.F CPL_WRF.o: CPL_WRF.F @echo "" - $(RMD) $(*).o $(*).mod $(*).stb *~ *.f - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) $(*).f + $(RMD) $(*).o $(*).mod $(*).stb *~ + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -I$(NETCDFINC) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) $(*).F $(COMPILER90) $(F90FLAGS) $(LDFLAGS) -c $(*).F ar -r ../lib/libHYDRO.a $(@) diff --git a/trunk/NDHMS/Routing/Makefile b/trunk/NDHMS/Routing/Makefile index bfe77e2f5..6d933c58c 100644 --- a/trunk/NDHMS/Routing/Makefile +++ b/trunk/NDHMS/Routing/Makefile @@ -34,10 +34,7 @@ all: $(OBJS) .F.o: @echo "Routing Makefile:" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f -# $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) $(*).f -# $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) $(*).F @echo "" ar -r ../lib/libHYDRO.a $(@) cp *.mod ../mod @@ -111,4 +108,4 @@ module_channel_routing.o: module_UDMAP.o\ endif clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/Routing/Overland/Makefile b/trunk/NDHMS/Routing/Overland/Makefile index 8d8d905f2..519915515 100644 --- a/trunk/NDHMS/Routing/Overland/Makefile +++ b/trunk/NDHMS/Routing/Overland/Makefile @@ -18,11 +18,11 @@ all: mod mod: #Build each sub module then build the module that depends on all sub modules - $(COMPILER90) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_control.F - $(COMPILER90) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_streams_and_lakes.F - $(COMPILER90) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_routing_properties.F - $(COMPILER90) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_mass_balance.F - $(COMPILER90) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland.F + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_control.F + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_streams_and_lakes.F + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_routing_properties.F + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland_mass_balance.F + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) $(F90FLAGS) $(LDFLAGS) $(MODFLAGS) -I$(NETCDFINC) module_overland.F ar -r ../../lib/libHYDRO.a module_overland_control.o ar -r ../../lib/libHYDRO.a module_overland_streams_and_lakes.o ar -r ../../lib/libHYDRO.a module_overland_routing_properties.o diff --git a/trunk/NDHMS/arc/macros.gordon b/trunk/NDHMS/arc/macros.gordon index f65dd730c..5c5c1aa49 100644 --- a/trunk/NDHMS/arc/macros.gordon +++ b/trunk/NDHMS/arc/macros.gordon @@ -22,6 +22,11 @@ else HYDRO_D = $(WRF_HYDRO) endif +ifeq ($(WRFIO_NCD_LARGE_FILE_SUPPORT),1) +WRFIO_NCD_LARGE_FILE_SUPPORT = -DWRFIO_NCD_LARGE_FILE_SUPPORT +else +WRFIO_NCD_LARGE_FILE_SUPPORT = +endif RMD = rm -f @@ -31,8 +36,8 @@ BYTESWAPIO = -convert big_endian F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) MODFLAG = -I./ -I../../MPP -I../MPP -I../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(WRFIO_NCD_LARGE_FILE_SUPPORT) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.gordon.debug b/trunk/NDHMS/arc/macros.gordon.debug index e4cc00313..80940a957 100644 --- a/trunk/NDHMS/arc/macros.gordon.debug +++ b/trunk/NDHMS/arc/macros.gordon.debug @@ -32,8 +32,8 @@ F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FR F90FLAGS += -g -traceback MODFLAG = -I./ -I../../MPP -I../MPP -I../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -C -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(WRFIO_NCD_LARGE_FILE_SUPPORT) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.mpp.IBM.xlf90_r b/trunk/NDHMS/arc/macros.mpp.IBM.xlf90_r index f6d4ebb0f..b07e965da 100644 --- a/trunk/NDHMS/arc/macros.mpp.IBM.xlf90_r +++ b/trunk/NDHMS/arc/macros.mpp.IBM.xlf90_r @@ -30,9 +30,9 @@ F90FLAGS = -O2 -qfree=f90 -c -w -qspill=20000 -qmaxmem=64000 LDFLAGS = -O2 -qfree=f90 -w -qspill=20000 -qmaxmem=64000 MODFLAG = -I./ -I ../MPP -I../../MPP -I ../mod LDFLAGS = -CPP = cpp +CPPINVOKE = -qpreprocess LIBS = -CPPFLAGS = -C -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) +CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(WRFIO_NCD_LARGE_FILE_SUPPORT) NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.mpp.gfort b/trunk/NDHMS/arc/macros.mpp.gfort index 6f963f1c9..5802ef388 100644 --- a/trunk/NDHMS/arc/macros.mpp.gfort +++ b/trunk/NDHMS/arc/macros.mpp.gfort @@ -53,8 +53,8 @@ COMPILER90= mpif90 F90FLAGS = -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 MODFLAG = -I"./" -I"../../MPP" -I"../MPP" -I"../mod" LDFLAGS = -CPP = cpp -CPPFLAGS = -P -xassembler-with-cpp -traditional -DMPP_LAND -I"../Data_Rec" $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) +CPPINVOKE = -cpp +CPPFLAGS = -DMPP_LAND -I"../Data_Rec" $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) LIBS = NETCDFINC = $(NETCDF_INC) diff --git a/trunk/NDHMS/arc/macros.mpp.ifort b/trunk/NDHMS/arc/macros.mpp.ifort index f2ec797e1..8a69a1358 100644 --- a/trunk/NDHMS/arc/macros.mpp.ifort +++ b/trunk/NDHMS/arc/macros.mpp.ifort @@ -53,15 +53,15 @@ else NCEP_WCOSS = endif -RMD = rm -f +RMD = rm -f COMPILER90 = mpif90 FORMAT_FREE = -FR BYTESWAPIO = -convert big_endian F90FLAGS = -O2 -g -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -nostdinc -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.mpp.ifort.luna b/trunk/NDHMS/arc/macros.mpp.ifort.luna index bc37946cc..d4af6b5c3 100644 --- a/trunk/NDHMS/arc/macros.mpp.ifort.luna +++ b/trunk/NDHMS/arc/macros.mpp.ifort.luna @@ -90,8 +90,8 @@ BYTESWAPIO = -convert big_endian F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FREE) $(BYTESWAPIO) MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod LDFLAGS = $(HDF5_LDFLAGS) -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) $(NCEP_WCOSS) LIBS =$(Z_LIB) NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.theia b/trunk/NDHMS/arc/macros.mpp.ifort.theia similarity index 97% rename from trunk/NDHMS/arc/macros.theia rename to trunk/NDHMS/arc/macros.mpp.ifort.theia index 164057abd..96d6a0d79 100644 --- a/trunk/NDHMS/arc/macros.theia +++ b/trunk/NDHMS/arc/macros.mpp.ifort.theia @@ -79,8 +79,8 @@ F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise $(FORMAT_FR # byte units) MODFLAG = -I./ -I../../MPP -I../MPP -I../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(WRFIO_NCD_LARGE_FILE_SUPPORT) # -C: Do not discard comments. # -P: Inhibit generation of linemarkers in the output # from the preprocessor. diff --git a/trunk/NDHMS/arc/macros.mpp.linux b/trunk/NDHMS/arc/macros.mpp.linux index 5bce0844c..238356501 100644 --- a/trunk/NDHMS/arc/macros.mpp.linux +++ b/trunk/NDHMS/arc/macros.mpp.linux @@ -55,8 +55,8 @@ F90FLAGS = -Mfree -c -byteswapio -O2 -Kieee LDFLAGS = $(F90FLAGS) MODFLAG = -I./ -I ../../MPP -I ../MPP -I ../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) +CPPINVOKE = -Mpreprocess +CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) $(PRECIP_DOUBLE) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.mpp.mpiifort b/trunk/NDHMS/arc/macros.mpp.mpiifort index e1793aa67..54cb14175 100644 --- a/trunk/NDHMS/arc/macros.mpp.mpiifort +++ b/trunk/NDHMS/arc/macros.mpp.mpiifort @@ -43,8 +43,8 @@ F90FLAGS = -O2 -g -w -c -ftz -fno-alias -fp-model precise -FR # -ftz : enable flush denormal results to zero MODFLAG = -I./ -I../../MPP -I../MPP -I../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I ../Data_Rec $(HYDRO_D) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I ../Data_Rec $(HYDRO_D) $(WRFIO_NCD_LARGE_FILE_SUPPORT) LIBS = NETCDFINC = $(NETCDF)/include NETCDFLIB = -L$(NETCDF)/lib -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.seq.gfort b/trunk/NDHMS/arc/macros.seq.gfort index bafd3e7b6..952592ebd 100644 --- a/trunk/NDHMS/arc/macros.seq.gfort +++ b/trunk/NDHMS/arc/macros.seq.gfort @@ -35,8 +35,8 @@ COMPILER90= gfortran F90FLAGS = -w -c -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 MODFLAG = -I./ -I../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -C -P -xassembler-with-cpp -traditional -I"../Data_Rec" $(HYDRO_D) $(SPATIAL_SOIL) +CPPINVOKE = -cpp +CPPFLAGS = -I"../Data_Rec" $(HYDRO_D) $(SPATIAL_SOIL) $(WRFIO_NCD_LARGE_FILE_SUPPORT) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.seq.ifort b/trunk/NDHMS/arc/macros.seq.ifort index 7cd98111b..61ca7836f 100644 --- a/trunk/NDHMS/arc/macros.seq.ifort +++ b/trunk/NDHMS/arc/macros.seq.ifort @@ -48,8 +48,8 @@ F90FLAGS = -w -c -ftz -align all -fno-alias -fp-model precise -FR -conver MODFLAG = -I./ -I ../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -C -P -traditional -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) +CPPINVOKE = -fpp +CPPFLAGS = -I ../Data_Rec $(HYDRO_D) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.seq.linux b/trunk/NDHMS/arc/macros.seq.linux index 245c8d1ce..7f7ce1524 100644 --- a/trunk/NDHMS/arc/macros.seq.linux +++ b/trunk/NDHMS/arc/macros.seq.linux @@ -48,9 +48,8 @@ COMPILER90= pgf90 F90FLAGS = -Mfree -Mfptrap -c -byteswapio -Ktrap=fp -O2 -Kieee LDFLAGS = $(F90FLAGS) MODFLAG = -I./ -I ../mod -LDFLAGS = -CPP = cpp -CPPFLAGS = -C -P -traditional -I ../Data_Rec $(HYDRO_D) $(WRF_HYDRO) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) +CPPINVOKE = -Mpreprocess +CPPFLAGS = -I ../Data_Rec $(HYDRO_D) $(WRF_HYDRO) $(SPATIAL_SOIL) $(WRF_HYDRO_NUDGING) $(OUTPUT_CHAN_CONN) LIBS = NETCDFINC = $(NETCDF_INC) NETCDFLIB = -L$(NETCDF_LIB) -lnetcdff -lnetcdf diff --git a/trunk/NDHMS/arc/macros.theia.debug b/trunk/NDHMS/arc/macros.theia.debug index 6fecbffa6..adba9b1cc 100644 --- a/trunk/NDHMS/arc/macros.theia.debug +++ b/trunk/NDHMS/arc/macros.theia.debug @@ -80,8 +80,8 @@ F90FLAGS += -g -traceback # byte units) MODFLAG = -I./ -I../../MPP -I../MPP -I../mod LDFLAGS = -CPP = cpp -CPPFLAGS = -P -traditional -DMPP_LAND -I../Data_Rec $(HYDRO_D) +CPPINVOKE = -fpp +CPPFLAGS = -DMPP_LAND -I../Data_Rec $(HYDRO_D) $(WRFIO_NCD_LARGE_FILE_SUPPORT) # -C: Do not discard comments. # -P: Inhibit generation of linemarkers in the output # from the preprocessor. diff --git a/trunk/NDHMS/nudging/Makefile b/trunk/NDHMS/nudging/Makefile index e07f482fc..385001418 100644 --- a/trunk/NDHMS/nudging/Makefile +++ b/trunk/NDHMS/nudging/Makefile @@ -24,10 +24,7 @@ all: $(OBJS) .F.o: @echo "" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).f -# $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) $(*).f - $(COMPILER90) -o $(@) $(F90FLAGS) $(MODFLAG) -I$(NETCDF_INC) $(*).f -# $(RMD) $(*).f + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(MODFLAG) -I$(NETCDF_INC) $(*).F @echo "" ar -r ../lib/libHYDRO.a $(@) cp *.mod ../mod @@ -43,4 +40,4 @@ module_stream_nudging.o: module_nudging_utils.o \ clean: - rm -f *.o *.mod *.stb *~ *.f + rm -f *.o *.mod *.stb *~ diff --git a/trunk/NDHMS/utils/Makefile b/trunk/NDHMS/utils/Makefile index d30528642..313dd1bb0 100644 --- a/trunk/NDHMS/utils/Makefile +++ b/trunk/NDHMS/utils/Makefile @@ -20,8 +20,7 @@ all: $(OBJS) ## The insertion of compile-time constants strangely requires the capital F in the extension. .F.o: @echo "Utils Makefile:" - $(CPP) $(CPPFLAGS) -I$(NETCDFINC) $(*).F > $(*).F90 - $(COMPILER90) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) $(*).F90 + $(COMPILER90) $(CPPINVOKE) $(CPPFLAGS) -o $(@) $(F90FLAGS) $(LDFLAGS) $(MODFLAG) -I$(NETCDFINC) $(*).F @echo "" ar -r ../lib/libHYDRO.a $(@) cp *.mod ../mod @@ -31,4 +30,4 @@ all: $(OBJS) # clean: - rm -f *.o *.mod *.stb *~ *.F90 + rm -f *.o *.mod *.stb *~