#dis   
#dis    Open Source License/Disclaimer, Forecast Systems Laboratory
#dis    NOAA/OAR/FSL, 325 Broadway Boulder, CO 80305
#dis    
#dis    This software is distributed under the Open Source Definition,
#dis    which may be found at http://www.opensource.org/osd.html.
#dis    
#dis    In particular, redistribution and use in source and binary forms,
#dis    with or without modification, are permitted provided that the
#dis    following conditions are met:
#dis    
#dis    - Redistributions of source code must retain this notice, this
#dis    list of conditions and the following disclaimer.
#dis    
#dis    - Redistributions in binary form must provide access to this
#dis    notice, this list of conditions and the following disclaimer, and
#dis    the underlying source code.
#dis    
#dis    - All modifications to this software must be clearly documented,
#dis    and are solely the responsibility of the agent making the
#dis    modifications.
#dis    
#dis    - If significant modifications or enhancements are made to this
#dis    software, the FSL Software Policy Manager
#dis    (softwaremgr@fsl.noaa.gov) should be notified.
#dis    
#dis    THIS SOFTWARE AND ITS DOCUMENTATION ARE IN THE PUBLIC DOMAIN
#dis    AND ARE FURNISHED "AS IS."  THE AUTHORS, THE UNITED STATES
#dis    GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES, AND
#dis    AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS
#dis    OF THE SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE.  THEY ASSUME
#dis    NO RESPONSIBILITY (1) FOR THE USE OF THE SOFTWARE AND
#dis    DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT TO USERS.
#dis   

SRCROOT=../..

include $(SRCROOT)/src/include/makefile.inc

RM=rm -f 

.SUFFIXES:              .f .F .o

LIB=libwrfmodules.a
DEBUGLIB=libwrfmodulesdebug.a
ARCHIVE = $(AR) rv

.F.o:
			$(RM) $@
			$(FC) -c $(FREE) $(FFLAGS) $(INC) $*.F
			$(ARCHIVE) $(LIB) $(<:.F=.o)


FSRC=  module_date_pack.F \
       module_wrfsi_maxdims.F \
       module_wrf_metadata.F  \
       module_grid_utils.F \
       module_map_utils.F    \
       module_wrfsi_static.F \
       module_horiz_interp.F \
       module_gribprep_io.F \
       module_wrfsi_io.F \
       module_vinterp_utils.F \
       module_physical_constants.F \
       module_diagnostic_vars.F \
       module_wrfsi_nl.F

  

FOBJS=$(FSRC:.F=.o)

all:	lib

lib:			$(LIB)

$(LIB):			$(FOBJS)
			$(RANLIB) $(LIB)
			$(RM) $(FOBJS)

module_wrf_metadata.o:	module_wrfsi_maxdims.o
 
module_wrfsi_io.o:	module_wrf_metadata.o module_map_utils.o module_date_pack.o

module_wrfsi_static.o:	module_date_pack.o

module_diagnostic_vars.o: 	module_physical_constants.o

module_vinterp_utils.o:	module_diagnostic_vars.o

module_wrfsi_nl.o:	module_wrfsi_maxdims.o

module_grid_utils.o:	module_wrfsi_io.o

debug:	
	($(RM) *.o *.exe *.mod *.M core) ; $(MAKE) lib LIB='$(DEBUGLIB)' \
	FFLAGS='$(DBFLAGS)' 

clean:
			$(RM) $(FOBJS) *.o *.a *.mod *.M
