VPATH = .:RCS:TMP .SUFFIXES: .SUFFIXES: .o .F90 .f90 .F .f .H .h LD = xlf90 CF90 = xlf90 CF77 = xlf90 FFLAGS = -b64 -q64 -qrealsize=8 -qarch=auto -qtune=auto -qcache=auto -qextname -O3 DEBUG_FLAGS= #DEBUG_FLAGS = -g DEBUG_FLAGS = -C -qflttrap=overflow:zerodivide:invalid:enable \ -qextchk -qinitauto=FF -g -qfullpath -qsigtrap #F90FLG = -qsuffix=f=f90 -qfree=f90 #F77FLG = -qfixed CPPARCH = -DIBM -DAIX CPPFLAGS = -P $(CPPARCH) LIBS= -lessl -L /home/parallab/nersc/knutali/lib -lnetcdf64 INCLUDE= -I/home/parallab/nersc/knutali/NetCDF/64bit/include F90FLG = -qsuffix=f=f90 -qfree=f90 $(DEBUG_FLAGS) $(INCLUDE) F77FLG = -qfixed $(DEBUG_FLAGS) $(INCLUDE) LINKFLAGS = -q64 -b64 -qrealsize=8 CPP = /usr/lib/cpp # Rules for running cpp and updating files in TMP directory .H.h: rm -f ./TMP/$*.h cat $*.H > ./TMP/$*.h .F90.o: rm -f ./TMP/$*.f90 cat $*.F90 > ./TMP/$*.f90 cd ./TMP ; $(CF90) -c -freeform $(FFLAGS) $(F90FLG) -o $*.o $*.f90 .F.o: rm -f ./TMP/$*.f cat $*.F > ./TMP/$*.f cd ./TMP ; $(CF77) -c -col72 $(FFLAGS) $(F77FLG) -o $*.o $*.f ######################################################################## # TARGET1 : fully fledged monster... Generates section plots from # section and infiles. The spaghetti code should be split up ... # # # TARGET2 : Finds section intersections, and dumps these to a datafile # which can be read by other programs. TARGET1 = tecsec3 TARGET2 = section_intersect TARGET3 = section_plot TARGET4 = section_transport TARGET5 = section_transport2 include source.files INC2 =$(INC1:.H=.h) OMOD = $(MODULES:.F90=.o) $(MODULES77:.F=.o) all: $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) ############################################################################# #F90FILES3=$(F90FILES) p_section_plot.F90 #OBJECTS3= $(F90FILES3:.F90=.o) $(F77FILES:.F=.o) $(OMOD) #$(TARGET3): $(INC3) $(OMOD) $(OBJECTS3) # cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET3) $(OMOD) $(OBJECTS3) $(LIBS) # OBJECTS3= mod_sections.o mod_fieldtypes.o mod_sphere_tools.o m_invfldh.o \ m_dpmask.o m_getfield.o m_read_section_intersect.o m_section_interpol.o \ m_section_write.o m_get_sections.o m_get_grid.o m_rotate.o \ p_section_plot.o pakk.o m_get_header_info.o m_intpol_weights.o \ m_NetCDF_recdim.o m_is2d.o $(TARGET3): $(INC2) $(OBJECTS3) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET3) $(OBJECTS3) $(LIBS) ############################################################################# #F90FILES2=$(F90FILES) p_section_intersect.F90 #OBJECTS2= $(F90FILES2:.F90=.o) $(F77FILES:.F=.o) $(OMOD) #$(TARGET2): $(INC2) $(OMOD) $(OBJECTS2) # cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET2) $(OMOD) $(OBJECTS2) $(LIBS) OBJECTS2= mod_sections.o mod_sphere_tools.o m_section_init.o m_transport_init.o \ m_get_sections.o m_section_join.o m_save_section_intersect.o \ m_get_grid.o p_section_intersect.o m_spherdist.o $(TARGET2): $(INC2) $(OBJECTS2) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET2) $(OBJECTS2) $(LIBS) ############################################################################# #F90FILES4=$(F90FILES) p_section_transport.F90 #OBJECTS4= $(F90FILES4:.F90=.o) $(F77FILES:.F=.o) $(OMOD) #$(TARGET4): $(INC2) $(OMOD) $(OBJECTS4) # cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET4) $(OMOD) $(OBJECTS4) $(LIBS) OBJECTS4= mod_sections.o mod_fieldtypes.o m_read_section_intersect.o \ m_get_grid.o p_section_transport.o m_transport.o m_get_header_info.o \ m_invfldh.o pakk.o m_spherdist.o m_tice_f.o $(TARGET4): $(INC2) $(OBJECTS4) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET4) $(OBJECTS4) $(LIBS) ############################################################################# #F90FILES5=$(F90FILES) p_section_transport2.F90 #OBJECTS5= $(F90FILES5:.F90=.o) $(F77FILES:.F=.o) #$(TARGET5): $(INC2) $(OMOD) $(OBJECTS5) # cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET5) $(OMOD) $(OBJECTS5) $(LIBS) OBJECTS5= mod_sections.o mod_fieldtypes.o mod_transport.o \ m_read_section_intersect.o m_get_grid.o p_section_transport2.o \ m_transport2.o m_get_header_info.o m_invfldh.o pakk.o m_spherdist.o \ m_datetojulian.o m_depth_frac.o $(TARGET5): $(INC2) $(OBJECTS5) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET5) $(OBJECTS5) $(LIBS) ############################################################################# #F90FILES1=$(F90FILES) p_tecsec3.F90 #OBJECTS1= $(F90FILES1:.F90=.o) $(F77FILES:.F=.o) # #$(TARGET1): $(INC2) $(OMOD) $(OBJECTS1) # cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET1) $(OMOD) $(OBJECTS1) $(LIBS) clean: cd ./TMP ; rm *.f *.o *.f90 *.h *.mod new: source depend source: mksource.sh > source.files depend: mkdepend.pl | sort -u > depends.file include depends.file