/[MITgcm]/MITgcm/pkg/mnc/Makefile
ViewVC logotype

Contents of /MITgcm/pkg/mnc/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (show annotations) (download)
Wed Feb 4 05:45:09 2004 UTC (20 years, 4 months ago) by edhill
Branch: MAIN
Changes since 1.8: +29 -11 lines
 o working (though incomplete) version of the "wrapper":
   - 149 pre-defined grids:
     - all "meaningful" X,Y,Z,T combinations
     - X,Y with or without halos
     - Horiz: centered, U, V, and corner (vorticity) grids
     - Vert: centered or interface
   - just two function calls to write a variable using one of the
     pre-defined grids
 o tile numbering scheme for both cube and XY grids
 o read, write, and append NetCDF files
 o checks for (acceptable) re-definition of dims, grids, and vars
 o numerous small bug fixes
 o warning: the two mnc_model_* files are now broken/obsolete and
   will soon be removed

1 #
2 # $Header: /u/u3/gcmpack/MITgcm/pkg/mnc/Makefile,v 1.8 2004/01/31 04:13:09 edhill Exp $
3 #
4 # A Makefile for MNC templates and testing
5 #
6
7 FC = f77
8 CPP = cpp
9
10 .SUFFIXES:
11 .SUFFIXES: .T .t .F .f .h .o
12
13 .t.h:
14 cat $< > $@
15 .T.F:
16 cat $< > $@
17 .F.f:
18 $(CPP) $(DEFINES) > $@
19 .f.o:
20 $(FC) -DMNC_TEST -c $<
21
22
23 TEST_LINKS = EEPARAMS.h utils.F
24 TEST_HEADERS = PACKAGES_CONFIG.h CPP_OPTIONS.h SIZE.h
25 TEST_FILES = mnc_test_utils.F
26 TEST_DEFINES = -DMNC_DEBUG
27
28 FILES = \
29 mnc_dim.F \
30 mnc_file.F \
31 mnc_grid.F \
32 mnc_init.F \
33 mnc_utils.F \
34 mnc_var.F \
35 mnc_cwrapper.F
36
37 TEST_OBJECTS = $(TEST_FILES:.F=.o)
38 OBJECTS = $(FILES:.F=.o)
39
40 ALL_TEST = $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS)
41
42 all: templates
43
44 noexe: $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(FILES) $(OBJECTS)
45 echo "compiled"
46
47 EEPARAMS.h:
48 ln -s ../../eesupp/inc/EEPARAMS.h .
49 utils.F:
50 ln -s ../../eesupp/src/utils.F .
51
52 TEMPLATE_FILES = \
53 MNC_RESHAPE_RS_D.F MNC_RESHAPE_RL_D.F \
54 MNC_RESHAPE_RS_R.F MNC_RESHAPE_RL_R.F \
55 MNC_CW_READWRITE_RS_D.F MNC_CW_READWRITE_RL_D.F \
56 MNC_CW_READWRITE_RS_R.F MNC_CW_READWRITE_RL_R.F
57 TEMPLATE_OBJECTS = $(TEMPLATE_FILES:.F=.o)
58
59
60 templates: $(TEMPLATE_FILES) mnc_id_header.h
61
62 MNC_RESHAPE_RS_D.F: mnc_reshape.template
63 cat $< | sed -e 's/RX/RS/g' | sed -e 's/YY/D/g' > $@
64 MNC_RESHAPE_RL_D.F: mnc_reshape.template
65 cat $< | sed -e 's/RX/RL/g' | sed -e 's/YY/D/g' > $@
66 MNC_RESHAPE_RS_R.F: mnc_reshape.template
67 cat $< | sed -e 's/RX/RS/g' | sed -e 's/YY/R/g' > $@
68 MNC_RESHAPE_RL_R.F: mnc_reshape.template
69 cat $< | sed -e 's/RX/RL/g' | sed -e 's/YY/R/g' > $@
70
71 MNC_CW_READWRITE_RS_D.F: mnc_cw_readwrite.template
72 cat $< | sed -e 's/RX/RS/g' | sed -e 's/YY/D/g' > $@
73 MNC_CW_READWRITE_RL_D.F: mnc_cw_readwrite.template
74 cat $< | sed -e 's/RX/RL/g' | sed -e 's/YY/D/g' > $@
75 MNC_CW_READWRITE_RS_R.F: mnc_cw_readwrite.template
76 cat $< | sed -e 's/RX/RS/g' | sed -e 's/YY/R/g' > $@
77 MNC_CW_READWRITE_RL_R.F: mnc_cw_readwrite.template
78 cat $< | sed -e 's/RX/RL/g' | sed -e 's/YY/R/g' > $@
79
80
81 tag = ../../doc/tag-index
82
83 mnc_id_header.h:
84 -./parse_local_info > $@
85
86 test: all mnc_test_001 mnc_test_002
87 echo "running mnc_test_001 ..."
88 ./mnc_test_001 > t_out_001 && ncdump test_001.nc | head -20
89 ./mnc_test_002 > t_out_002 && tail -15 t_out_002
90
91 mnc_test_001: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_001.o
92 $(FC) -o mnc_test_001 mnc_test_001.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf
93
94 mnc_test_002: $(ALL_TEST) $(FILES) $(OBJECTS) mnc_test_002.o
95 $(FC) -o mnc_test_002 mnc_test_002.o $(OBJECTS) $(TEST_OBJECTS) -lnetcdf
96
97 CLEAN:
98 @make clean
99 Clean:
100 @make clean
101 clean:
102 -rm -f *.o $(TEST_LINKS) $(TEST_HEADERS) $(TEST_FILES) $(TEST_OBJECTS)
103 -rm -f mnc_test_???.F mnc_test_??? test_???.nc t_out_???
104 -rm -f $(TEMPLATE_FILES) mnc_id_header.h

  ViewVC Help
Powered by ViewVC 1.1.22