| 923 |
|
|
| 924 |
echo "=== Processing options files and arguments ===" |
echo "=== Processing options files and arguments ===" |
| 925 |
gm_local="genmake_local" |
gm_local="genmake_local" |
| 926 |
|
modsCount=0 |
| 927 |
for i in . $MODS ; do |
for i in . $MODS ; do |
| 928 |
if test -r $i/$gm_local ; then |
if test -r $i/$gm_local ; then |
| 929 |
. $i/$gm_local |
. $i/$gm_local |
| 930 |
break |
break |
| 931 |
fi |
fi |
| 932 |
|
let modsCount=modsCount+1 |
| 933 |
done |
done |
| 934 |
|
if test modsCount -gt 1 ; then |
| 935 |
|
echo "ERROR: some uses of MODS break with more than one directory specified" |
| 936 |
|
exit -1; |
| 937 |
|
fi |
| 938 |
printf " getting local config information: " |
printf " getting local config information: " |
| 939 |
if test -f $gm_local ; then |
if test -f $gm_local ; then |
| 940 |
echo "using $gm_local" |
echo "using $gm_local" |
| 2317 |
@./\$(EXE_AD) > \$@ |
@./\$(EXE_AD) > \$@ |
| 2318 |
|
|
| 2319 |
CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.ff90) |
CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.ff90) |
| 2320 |
ad_input_code.$FS: \$(CB2M_AD_FILES) |
ad_input_code.$FS: ${MODS}/maxMinDefs.f \$(CB2M_AD_FILES) |
| 2321 |
# @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template |
cat \$^ > \$@ |
|
# cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
|
|
# -rm -f ad_config.template |
|
|
cat ../code_ad/maxMinDefs.f \$(CB2M_AD_FILES) > ad_input_code.$FS |
|
| 2322 |
|
|
| 2323 |
\$(CB2MFILES): |
\$(CB2MFILES): |
| 2324 |
\$(LN) \$(addprefix ../code_ad/, \$(CB2MFILES)) . |
\$(LN) \$(addprefix ${MODS}/, \$(CB2MFILES)) . |
| 2325 |
|
|
| 2326 |
# strip all comments and blanks to reduce |
# strip all comments and blanks to reduce |
| 2327 |
# the file size in order to reduce perl's memory requirements |
# the file size in order to reduce perl's memory requirements |
| 2328 |
ad_input_code_sf.f : ad_input_code.f |
ad_input_code_sf.f : ad_input_code.f |
| 2329 |
cat \$^ | sed -f ../code_ad/strip.sed | sed -f ../code_ad/stop2print.sed > \$@ |
cat \$^ | sed -f ${MODS}/strip.sed | sed -f ${MODS}/stop2print.sed > \$@ |
| 2330 |
|
|
| 2331 |
# mfef90 preprocessing |
# mfef90 preprocessing |
| 2332 |
# expand statement functions |
# expand statement functions |
| 2369 |
|
|
| 2370 |
# undo slice hiding |
# undo slice hiding |
| 2371 |
# insert template directives |
# insert template directives |
| 2372 |
ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.f reslicer.py ../code_ad/insertTemplateDir.bash |
ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.f reslicer.py ${MODS}/insertTemplateDir.bash |
| 2373 |
python reslicer.py \$< > \$<.1 |
python reslicer.py \$< > \$<.1 |
| 2374 |
../code_ad/insertTemplateDir.bash \$<.1 \$@ |
${MODS}/insertTemplateDir.bash \$<.1 \$@ |
| 2375 |
rm \$<.1 |
rm \$<.1 |
| 2376 |
|
|
| 2377 |
# postprocess F' |
# postprocess F' |
| 2378 |
ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f multi-pp.pl ../code_ad/ad_inline.f ../code_ad/ad_template.checkpoint.f ../code_ad/ad_template.plain.f ../code_ad/ad_template.split.f |
ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f multi-pp.pl ${MODS}/ad_inline.f ${MODS}/ad_template.checkpoint.f ${MODS}/ad_template.plain.f ${MODS}/ad_template.split.f |
| 2379 |
perl multi-pp.pl -inline=../code_ad/ad_inline.f \$< |
perl multi-pp.pl -inline=${MODS}/ad_inline.f \$< |
| 2380 |
cat \$@ | sed 's/RETURN//' > \$@.1 |
cat \$@ | sed 's/RETURN//' > \$@.1 |
| 2381 |
mv \$@.1 \$@ |
mv \$@.1 \$@ |
| 2382 |
|
|
| 2399 |
|
|
| 2400 |
# link the support files: |
# link the support files: |
| 2401 |
\$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) : |
\$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) : |
| 2402 |
\$(LN) ../code_ad/\$@ . |
\$(LN) ${MODS}/\$@ . |
| 2403 |
|
|
| 2404 |
whirl2xaif xaif2whirl: |
whirl2xaif xaif2whirl: |
| 2405 |
\$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-i686-Linux/bin/\$@ . |
\$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-i686-Linux/bin/\$@ . |