Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:41:58 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
1ac23013aa Ed H*0001 #
                0002 #
                0003 #  A Makefile for MNC templates and testing
                0004 #
d2129fb7fc Ed H*0005 
                0006 FC = f77
b11e5981be Ed H*0007 CPP = cpp
d2129fb7fc Ed H*0008 
                0009 .SUFFIXES:
b11e5981be Ed H*0010 .SUFFIXES: .T .t .F .f .h .o
d2129fb7fc Ed H*0011 
                0012 .t.h:
                0013         cat $< > $@
                0014 .T.F:
                0015         cat $< > $@
b11e5981be Ed H*0016 .F.f:
                0017         $(CPP) $(DEFINES) > $@
                0018 .f.o:
                0019         $(FC) -DMNC_TEST -c $<
d2129fb7fc Ed H*0020 
                0021 
                0022 TEST_LINKS =   EEPARAMS.h utils.F
3623ff8097 Ed H*0023 TEST_HEADERS = PACKAGES_CONFIG.h CPP_OPTIONS.h SIZE.h
d2129fb7fc Ed H*0024 TEST_FILES =   mnc_test_utils.F
b11e5981be Ed H*0025 TEST_DEFINES = -DMNC_DEBUG
d2129fb7fc Ed H*0026 
                0027 FILES = \
a27dc5c859 Ed H*0028   mnc_dim.F \
d2129fb7fc Ed H*0029   mnc_file.F \
                0030   mnc_grid.F \
                0031   mnc_init.F \
                0032   mnc_utils.F \
e9b72f2bd9 Ed H*0033   mnc_var.F \
                0034   mnc_cwrapper.F
d2129fb7fc Ed H*0035 
                0036 TEST_OBJECTS = $(TEST_FILES:.F=.o)
                0037 OBJECTS = $(FILES:.F=.o)
                0038 
907e360dab Ed H*0039 ALL_TEST = $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS)
                0040 
1ac23013aa Ed H*0041 all: templates
                0042 
d2129fb7fc Ed H*0043 noexe: $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(FILES) $(OBJECTS)
                0044         echo "compiled"
                0045 
                0046 EEPARAMS.h:
                0047         ln -s ../../eesupp/inc/EEPARAMS.h .
                0048 utils.F:
                0049         ln -s ../../eesupp/src/utils.F .
                0050 
9b84fd160b Ed H*0051 TEMPLATE_FILES = \
3ca071fc35 Ed H*0052   MNC_CW_READWRITE_RS.F \
                0053   MNC_CW_READWRITE_RL.F \
                0054   MNC_CW_READWRITE_I.F
b11e5981be Ed H*0055 TEMPLATE_OBJECTS = $(TEMPLATE_FILES:.F=.o)
                0056 
79a40b9044 Ed H*0057 mnc_netcdf_stubs.c: mnc_netcdf_stubs.h
fc0e9391e9 Ed H*0058         -./build_netcdf_stubs > tmp_mnc_netcdf_stubs.c
                0059         -cpp -P < tmp_mnc_netcdf_stubs.c > mnc_netcdf_stubs.c
                0060         -rm -f tmp_mnc_netcdf_stubs.c
79a40b9044 Ed H*0061 
                0062 mnc_netcdf_stubs.o: mnc_netcdf_stubs.c
                0063         -gcc -c mnc_netcdf_stubs.c
9b84fd160b Ed H*0064 
07155994b8 Mart*0065 templates: $(TEMPLATE_FILES) MNC_ID_HEADER.h
9b84fd160b Ed H*0066 
3ca071fc35 Ed H*0067 MNC_CW_READWRITE_RS.F: mnc_cw_readwrite.template
409155d7b6 Ed H*0068         cat mnc_cw_readwrite.template | sed -e 's/RX/RS/g' | sed -e 's/MNC2I/NINT/g' | sed -e 's/MNCI2//g' | sed -e 's/__V/_RS/g' > MNC_CW_READWRITE_RS.F
3ca071fc35 Ed H*0069 MNC_CW_READWRITE_RL.F: mnc_cw_readwrite.template
409155d7b6 Ed H*0070         cat mnc_cw_readwrite.template | sed -e 's/RX/RL/g' | sed -e 's/MNC2I/NINT/g' | sed -e 's/MNCI2//g' | sed -e 's/__V/_RL/g' > MNC_CW_READWRITE_RL.F
3ca071fc35 Ed H*0071 MNC_CW_READWRITE_I.F: mnc_cw_readwrite.template
409155d7b6 Ed H*0072         cat mnc_cw_readwrite.template | sed -e 's/RX/I/g' | sed -e 's/MNC2I//g' | sed -e 's/MNCI2/NINT/g' | sed -e 's/__V/INTEGER/g' > MNC_CW_READWRITE_I.F
9b84fd160b Ed H*0073 
1ac23013aa Ed H*0074 tag = ../../doc/tag-index
                0075 
07155994b8 Mart*0076 MNC_ID_HEADER.h:
1ac23013aa Ed H*0077         -./parse_local_info > $@
                0078 
b11e5981be Ed H*0079 test: all mnc_test_001 mnc_test_002 
d2129fb7fc Ed H*0080         echo "running mnc_test_001 ..."
e9b72f2bd9 Ed H*0081         ./mnc_test_001 > t_out_001 && ncdump test_001.nc | head -20
3623ff8097 Ed H*0082         ./mnc_test_002 > t_out_002 && tail -15 t_out_002
d2129fb7fc Ed H*0083 
907e360dab Ed H*0084 mnc_test_001: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_001.o
d2129fb7fc Ed H*0085         $(FC) -o mnc_test_001 mnc_test_001.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf
                0086 
e9b72f2bd9 Ed H*0087 mnc_test_002: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_002.o
                0088         $(FC) -o mnc_test_002 mnc_test_002.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf
                0089 
1ac23013aa Ed H*0090 CLEAN:
                0091         @make clean
79a40b9044 Ed H*0092         -rm -f mnc_netcdf_stubs.c
2f8c91a488 Ed H*0093 
1ac23013aa Ed H*0094 Clean:
                0095         @make clean
2f8c91a488 Ed H*0096 
                0097 testclean:
d2129fb7fc Ed H*0098         -rm -f *.o $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS)
e9b72f2bd9 Ed H*0099         -rm -f mnc_test_???.F mnc_test_??? test_???.nc t_out_???
2f8c91a488 Ed H*0100 
                0101 clean: testclean
cc1803b34a Jean*0102         -rm -f $(TEMPLATE_FILES) MNC_ID_HEADER.h mnc_id_header.h
79a40b9044 Ed H*0103         -rm -f mnc_netcdf_stubs.o
                0104