# # --- HYCOM 2.2 makefile # # --- Stand-alone HYCOM, or HYCOM ESMF component, or HYCOM+CICE. # # --- Tunable parameters in ../config/$(ARCH)_$(TYPE) # VPATH = ../src_2.2.12/:../src_2.2.12/nersc/:../src_2.2.12/nersc/EVP/:../src_2.2.12/nersc/ICESTATE/:../src_2.2.12/nersc/WAVES/:../src_2.2.12/nersc/NORWECOM/::../src_2.2.12/nersc/CALANUS/ .SUFFIXES: .SUFFIXES: .c .F .F90 .f .o .F: @echo "Must have an explicit rule for" $* .f: @echo "Must have an explicit rule for" $* .c: @echo "Must have an explicit rule for" $* include ./flags include ../config/$(ARCH)_$(TYPE) #KAL - redefine rules. Only difference from config file is that file from VPATH is used in stead of local CPPFLAGS := $(CPPFLAGS) $(CPPFLAGSNERSC) CPPFLAGS2 := $(CPPFLAGS) # AIX (xlf) peculiarities. NB: Only necessary for Fortran files ifneq (,$(findstring -DAIX,$(CPPFLAGS))) subs=-WF,- CPPFLAGS:=$(subst -,$(subs),$(CPPFLAGS)) endif FCFFLAGS := $(FCFFLAGS) $(FCFFLAGSNERSC) .c.o: $(CC) $(CPPFLAGS2) $(CCFLAGS) -c $< .f.o: $(FC) $(FCFFLAGS) -c $< .F.o: $(FC) $(CPPFLAGS) $(FCFFLAGS) -c $< .F90.o: $(FC) $(CPPFLAGS) $(F90FLAGS) -c $< MODS = mod_dimensions.o mod_xc.o mod_za.o mod_pipe.o mod_incupd.o mod_floats.o mod_tides.o mod_mean.o mod_hycom.o ifneq (,$(findstring -DARCHIVE_SELECT,$(CPPFLAGS))) MODS := $(MODS) m_archive_select.o endif OBJS = archiv.o barotp.o bigrid.o blkdat.o cnuity.o convec.o \ diapfl.o dpthuv.o dpudpv.o forfun.o geopar.o hybgen.o \ icloan.o inicon.o inigiss.o inikpp.o inimy.o latbdy.o \ matinv.o momtum.o mxkprf.o mxkrt.o mxkrtm.o mxpwp.o \ overtn.o poflat.o prtmsk.o psmoo.o restart.o \ thermf.o trcupd.o tsadvc.o \ machine.o wtime.o machi_c.o isnan.o \ $(OBJECTSNERSC) # Modules for "hycom_wavesonly": # TODO: could probably reduce this list (ditto for OBJS) MODS2= mod_dimensions.o mod_xc.o mod_za.o mod_pipe.o mod_incupd.o mod_floats.o mod_tides.o mod_mean.o mod_hycom_wavesonly.o # Compiling options: hycom: $(MODS) $(OBJS) hycom.o @echo "Using config file ../config/$(ARCH)_$(TYPE)" $(LD) $(LDFLAGS) -o hycom hycom.o $(MODS) $(OBJS) $(EXTRALIBS) esmf: $(MODS) $(OBJS) @echo "--- ESMF hycom component has been built ---" hycom_cice: $(MODS) $(OBJS) mod_OICPL.o hycom_cice.o $(LD) $(LDFLAGS) -o hycom_cice \ hycom_cice.o mod_OICPL.o \ $(MODS) $(OBJS) \ ${CICE_DIR}/esmf/compile/*.o \ $(EXTRALIBS) hycom_wavesonly: $(MODS2) $(OBJS) hycom_wavesonly.o $(LD) $(LDFLAGS) -o hycom hycom_wavesonly.o $(MODS2) $(OBJS) $(EXTRALIBS) # Dependencies: hycom.o: hycom.F mod_hycom.o hycom_cice.o: hycom_cice.F mod_hycom.o mod_OICPL.o hycom_wavesonly.o: hycom_wavesonly.F mod_hycom_wavesonly.o archiv.o: archiv.F mod_xc.o common_blocks.h mod_za.o ifneq (,$(findstring -DARCHIVE_SELECT,$(CPPFLAGS))) m_archive_select.o: m_archive_select.F common_blocks.h \ mod_xc.o mod_za.o \ mod_year_info.o mod_hycom_nersc.o \ mod_common_ice.o m_depthave.o \ mod_common_wavesice.o m_thermf_nersc.o endif barotp.o: barotp.f mod_xc.o common_blocks.h mod_pipe.o \ mod_tides.o bigrid.o: bigrid.f mod_xc.o blkdat.o: blkdat.F mod_xc.o common_blocks.h stmt_fns.h mod_incupd.o \ mod_floats.o \ mod_tides.o cnuity.o: cnuity.f mod_xc.o common_blocks.h mod_pipe.o convec.o: convec.f mod_xc.o common_blocks.h stmt_fns.h diapfl.o: diapfl.f mod_xc.o common_blocks.h stmt_fns.h dpthuv.o: dpthuv.f mod_xc.o common_blocks.h dpudpv.o: dpudpv.f mod_xc.o forfun.o: forfun.F mod_xc.o common_blocks.h mod_za.o geopar.o: geopar.F mod_xc.o common_blocks.h stmt_fns.h mod_za.o hybgen.o: hybgen.f mod_xc.o common_blocks.h stmt_fns.h mod_pipe.o icloan.o: icloan.f mod_xc.o common_blocks.h stmt_fns.h inicon.o: inicon.f mod_xc.o common_blocks.h stmt_fns.h mod_pipe.o inigiss.o: inigiss.f mod_xc.o common_blocks.h stmt_fns.h inikpp.o: inikpp.f mod_xc.o common_blocks.h stmt_fns.h inimy.o: inimy.f mod_xc.o common_blocks.h stmt_fns.h isnan.o: isnan.F latbdy.o: latbdy.F mod_xc.o common_blocks.h mod_tides.o machine.o: machine.F machi_c.o: machi_c.c matinv.o: matinv.f mod_xc.o common_blocks.h momtum.o: momtum.F mod_xc.o common_blocks.h stmt_fns.h mod_pipe.o \ mod_tides.o mxkprf.o: mxkprf.f mod_xc.o common_blocks.h stmt_fns.h mod_pipe.o mxkrt.o: mxkrt.f mod_xc.o common_blocks.h stmt_fns.h mxkrtm.o: mxkrtm.f mod_xc.o common_blocks.h stmt_fns.h mxpwp.o: mxpwp.f mod_xc.o common_blocks.h stmt_fns.h overtn.o: overtn.f mod_xc.o common_blocks.h poflat.o: poflat.f prtmsk.o: prtmsk.f psmoo.o: psmoo.f mod_xc.o restart.o: restart.f mod_xc.o common_blocks.h mod_za.o mod_tides.o thermf.o: thermf.F mod_xc.o common_blocks.h stmt_fns.h trcupd.o: trcupd.F mod_xc.o common_blocks.h mod_pipe.o tsadvc.o: tsadvc.f mod_xc.o common_blocks.h stmt_fns.h mod_pipe.o wtime.o: wtime.F mod_hycom.o: \ mod_hycom.F mod_xc.o common_blocks.h mod_za.o mod_pipe.o \ mod_incupd.o mod_mean.o mod_floats.o ifneq (,$(findstring -DARCHIVE_SELECT,$(CPPFLAGS))) mod_hycom.o: m_archive_select.o else mod_hycom.o: archiv.o endif mod_hycom_wavesonly.o: \ mod_hycom_wavesonly.F \ mod_xc.o common_blocks.h mod_za.o mod_pipe.o \ mod_incupd.o \ mod_mean.o \ mod_floats.o mod_incupd.o: \ mod_incupd.F mod_xc.o common_blocks.h mod_za.o mod_floats.o: \ mod_floats.F mod_xc.o common_blocks.h mod_za.o mod_pipe.o\ mod_hycom_nersc.o mod_pipe.o: \ mod_pipe.F mod_xc.o common_blocks.h mod_tides.o: \ mod_tides.F mod_xc.o common_blocks.h mod_za.o mod_mean.o: \ mod_mean.F mod_xc.o common_blocks.h mod_za.o mod_dimensions.o: mod_dimensions.F dimensions.h mod_xc.o: mod_xc.F mod_dimensions.o mod_xc_sm.h mod_xc_mp.h mod_za.o: mod_za.F mod_xc.o mod_za_sm.h mod_za_mp.h mod_za_mp1.h mod_za_zt.h mod_OICPL.o: mod_OICPL.F clean: rm *.o *.mod include ./dependencies