72 |
|
|
73 |
tmp1=`uname`"_"`uname -m` |
tmp1=`uname`"_"`uname -m` |
74 |
tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
75 |
PLATFORM=`echo $tmp2 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'` |
tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'` |
76 |
|
PLATFORM=`echo $tmp3 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'` |
77 |
OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")` |
OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")` |
78 |
echo " The platform appears to be: $PLATFORM" |
echo " The platform appears to be: $PLATFORM" |
79 |
# if test "x$OFLIST" = x ; then |
# if test "x$OFLIST" = x ; then |
105 |
fi |
fi |
106 |
|
|
107 |
# look for possible fortran compilers |
# look for possible fortran compilers |
108 |
tmp="$MITGCM_FC $FC g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95" |
tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95" |
109 |
p_FC= |
p_FC= |
110 |
for c in $tmp ; do |
for c in $tmp ; do |
111 |
rm -f ./hello.f ./hello |
rm -f ./hello.f ./hello |
1365 |
|
|
1366 |
cat >>$MAKEFILE <<EOF |
cat >>$MAKEFILE <<EOF |
1367 |
|
|
|
AD_CONFIG.h: |
|
|
cat AD_CONFIG.template > AD_CONFIG.h |
|
|
|
|
1368 |
# ... AD ... |
# ... AD ... |
1369 |
ad: ad_taf |
adall: ad_taf |
1370 |
ad_taf_f: ad_taf_output.f |
adtaf: ad_taf_output.f |
1371 |
ad_tamc_f: ad_tamc_output.f |
adtamc: ad_tamc_output.f |
1372 |
|
|
1373 |
ad_input_code.f: \$(SRCFILES) |
ad_input_code.f: \$(AD_FILES) \$(HEADERFILES) |
1374 |
cat ad_config.template > AD_CONFIG.h |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
1375 |
@make \$(F77FILES) |
@make \$(F77FILES) |
1376 |
@make \$(AD_FLOW_FILES) |
@make \$(AD_FLOW_FILES) |
1377 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f |
1392 |
|
|
1393 |
|
|
1394 |
# ... FTL ... |
# ... FTL ... |
1395 |
ftl: ftl_taf |
ftlall: ftl_taf |
1396 |
ftl_taf_f: ftl_taf_output.f |
ftltaf: ftl_taf_output.f |
1397 |
ftl_tamc_f: ftl_tamc_output.f |
ftltamc: ftl_tamc_output.f |
1398 |
|
|
1399 |
ftl_input_code.f: \$(SRCFILES) |
ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES) |
1400 |
cat ftl_config.template > AD_CONFIG.h |
cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h |
1401 |
|
@make \$(F77FILES) |
1402 |
@make \$(AD_FLOW_FILES) |
@make \$(AD_FLOW_FILES) |
1403 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f |
1404 |
|
|
1422 |
svd_taf_f: svd_taf_output.f |
svd_taf_f: svd_taf_output.f |
1423 |
|
|
1424 |
svd_input_code.f: \$(SRCFILES) |
svd_input_code.f: \$(SRCFILES) |
1425 |
cat svd_config.template > AD_CONFIG.h |
cmp svd_config.template AD_CONFIG.h || cat svd_config.template > AD_CONFIG.h |
1426 |
|
@make \$(F77FILES) |
1427 |
@make \$(AD_FLOW_FILES) |
@make \$(AD_FLOW_FILES) |
1428 |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > svd_input_code.f |
cat \$(AD_FLOW_FILES) \$(AD_FILES) > svd_input_code.f |
1429 |
|
|
1474 |
printf "\n=== Done ===\n" |
printf "\n=== Done ===\n" |
1475 |
|
|
1476 |
# Write the "template" files for the adjoint builds |
# Write the "template" files for the adjoint builds |
1477 |
cat >>AD_CONFIG.template <<EOF |
cat >AD_CONFIG.template <<EOF |
1478 |
C WARNING: This file is automatically generated by genmake2 and |
C WARNING: This file is automatically generated by genmake2 and |
1479 |
C used by the Makefile rules. Please DO NOT EDIT this file |
C used by the Makefile rules. Please DO NOT EDIT this file |
1480 |
C unless you are CERTAIN that you know what you're doing. |
C unless you are CERTAIN that you know what you are doing. |
1481 |
|
|
1482 |
#undef ALLOW_ADJOINT_RUN |
#undef ALLOW_ADJOINT_RUN |
1483 |
#undef ALLOW_TANGENTLINEAR_RUN |
#undef ALLOW_TANGENTLINEAR_RUN |
1484 |
#undef ALLOW_ECCO_OPTIMIZATION |
#undef ALLOW_ECCO_OPTIMIZATION |
1485 |
EOF |
EOF |
1486 |
cat >>ad_config.template <<EOF |
cat >ad_config.template <<EOF |
1487 |
C WARNING: This file is automatically generated by genmake2 and |
C WARNING: This file is automatically generated by genmake2 and |
1488 |
C used by the Makefile rules. Please DO NOT EDIT this file |
C used by the Makefile rules. Please DO NOT EDIT this file |
1489 |
C unless you are CERTAIN that you know what you're doing. |
C unless you are CERTAIN that you know what you are doing. |
1490 |
|
|
1491 |
#undef ALLOW_ADJOINT_RUN |
#define ALLOW_ADJOINT_RUN |
1492 |
#undef ALLOW_TANGENTLINEAR_RUN |
#undef ALLOW_TANGENTLINEAR_RUN |
1493 |
#undef ALLOW_ECCO_OPTIMIZATION |
#undef ALLOW_ECCO_OPTIMIZATION |
1494 |
EOF |
EOF |
1495 |
cat >>ftl_config.template <<EOF |
cat >ftl_config.template <<EOF |
1496 |
C WARNING: This file is automatically generated by genmake2 and |
C WARNING: This file is automatically generated by genmake2 and |
1497 |
C used by the Makefile rules. Please DO NOT EDIT this file |
C used by the Makefile rules. Please DO NOT EDIT this file |
1498 |
C unless you are CERTAIN that you know what you're doing. |
C unless you are CERTAIN that you know what you are doing. |
1499 |
|
|
1500 |
#undef ALLOW_ADJOINT_RUN |
#undef ALLOW_ADJOINT_RUN |
1501 |
#undef ALLOW_TANGENTLINEAR_RUN |
#define ALLOW_TANGENTLINEAR_RUN |
1502 |
#undef ALLOW_ECCO_OPTIMIZATION |
#undef ALLOW_ECCO_OPTIMIZATION |
1503 |
EOF |
EOF |
1504 |
cat >>svd_config.template <<EOF |
cat >svd_config.template <<EOF |
1505 |
C WARNING: This file is automatically generated by genmake2 and |
C WARNING: This file is automatically generated by genmake2 and |
1506 |
C used by the Makefile rules. Please DO NOT EDIT this file |
C used by the Makefile rules. Please DO NOT EDIT this file |
1507 |
C unless you are CERTAIN that you know what you're doing. |
C unless you are CERTAIN that you know what you are doing. |
1508 |
|
|
1509 |
#undef ALLOW_ADJOINT_RUN |
#undef ALLOW_ADJOINT_RUN |
1510 |
#undef ALLOW_TANGENTLINEAR_RUN |
#undef ALLOW_TANGENTLINEAR_RUN |