1790 |
|
|
1791 |
printf "\n=== Setting defaults ===\n" |
printf "\n=== Setting defaults ===\n" |
1792 |
printf " Adding MODS directories: " |
printf " Adding MODS directories: " |
|
MPI_LNKF= |
|
1793 |
for d in $MODS ; do |
for d in $MODS ; do |
1794 |
if test ! -d $d ; then |
if test ! -d $d ; then |
1795 |
echo |
echo |
1799 |
printf "$d " |
printf "$d " |
1800 |
SOURCEDIRS="$SOURCEDIRS $d" |
SOURCEDIRS="$SOURCEDIRS $d" |
1801 |
INCLUDEDIRS="$INCLUDEDIRS $d" |
INCLUDEDIRS="$INCLUDEDIRS $d" |
|
#------------------------------------------------------- |
|
|
# Put special links so that MPI specific files are used |
|
|
MPI_FILES=`(cd $d ; find . -name "*_mpi" -print)` |
|
|
for i in $MPI_FILES ; do |
|
|
ii=`echo $i | sed 's:^\./::'` |
|
|
name=`echo $ii | sed 's:_mpi::' ` |
|
|
if test "x$MPI" = x ; then |
|
|
# NO: We undo an _mpi symbolically linked file |
|
|
if test -L $name ; then |
|
|
cmp $name "$d/$ii" > /dev/null 2>&1 |
|
|
RETVAL=$? |
|
|
if test "x$RETVAL" = x0 ; then |
|
|
printf "Un-linking $name ; " |
|
|
rm -f $name |
|
|
fi |
|
|
fi |
|
|
else |
|
|
# YES: We symbolically link this file (with conditions if already there) |
|
|
if test -L $name ; then |
|
|
cmp $d/$ii $name > /dev/null 2>&1 |
|
|
RETVAL=$? |
|
|
yy=0 ; |
|
|
for xx in $MPI_LNKF ; do if test $xx = $name ; then yy=1 ; fi ; done |
|
|
if test "x$RETVAL" != x0 -a $yy = 0 ; then |
|
|
# remove sym-link if different and has not just been linked |
|
|
printf "Un-link + " |
|
|
rm -f $name |
|
|
fi |
|
|
if test "x$RETVAL" = x0 ; then |
|
|
# if identical, keep sym-link and keep record of it |
|
|
MPI_LNKF="$MPI_LNKF $name" |
|
|
fi |
|
|
fi |
|
|
if ! test -f $name ; then |
|
|
# make sym-link and keep record of it |
|
|
printf "Linking $ii to $name ; " |
|
|
ln -sf $d/$ii $name |
|
|
MPI_LNKF="$MPI_LNKF $name" |
|
|
fi |
|
|
fi |
|
|
done |
|
|
#------------------------------------------------------- |
|
1802 |
fi |
fi |
1803 |
done |
done |
1804 |
echo |
echo |
|
#echo "MPI_LNKF='$MPI_LNKF'" |
|
1805 |
|
|
1806 |
if test "x${PLATFORM}" = x ; then |
if test "x${PLATFORM}" = x ; then |
1807 |
PLATFORM=$p_PLATFORM |
PLATFORM=$p_PLATFORM |
2781 |
adtaf: ad_taf_output.$FS |
adtaf: ad_taf_output.$FS |
2782 |
adtamc: ad_tamc_output.$FS |
adtamc: ad_tamc_output.$FS |
2783 |
|
|
2784 |
ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) |
ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES) |
2785 |
@$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 |
@$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 |
2786 |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h |
2787 |
-rm -f ad_config.template |
-rm -f ad_config.template |
3047 |
|
|
3048 |
# XAIF' -> WHIRL' |
# XAIF' -> WHIRL' |
3049 |
ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl |
ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl |
3050 |
./xaif2whirl --debug 1 -t OpenADTy_active --structured ad_input_code_sf.w2f.pre.B \$< |
./xaif2whirl --debug 1 --structured ad_input_code_sf.w2f.pre.B \$< |
3051 |
|
|
3052 |
# WHIRL' -> F' |
# WHIRL' -> F' |
3053 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.B whirl2f whirl2f_be |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.B whirl2f whirl2f_be |
3054 |
./whirl2f -FLIST:ftn_file=\$@ -openad -openadType OpenADTy_active \$< |
./whirl2f -FLIST:ftn_file=\$@ -openad \$< |
3055 |
|
|
3056 |
# insert template directives |
# insert template directives |
3057 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash |
3059 |
|
|
3060 |
PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F |
PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F |
3061 |
# postprocess F' |
# postprocess F' |
3062 |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 multi-pp.pl \$(PPEXTRAS:.F=.f) |
ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 postProcess.py \$(PPEXTRAS:.F=.f) |
3063 |
perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$< |
./postProcess.py -m r -i ../OAD_support/ad_inline.f -o \$@ \$< |
|
# the postprocessor still gets the name wrong |
|
|
cat \$<.pp | sed 's/RETURN//' > \$@ |
|
3064 |
|
|
3065 |
# extract all transformed modules |
# extract all transformed modules |
3066 |
all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90 |
3087 |
whirl2xaif xaif2whirl: |
whirl2xaif xaif2whirl: |
3088 |
\$(LN) \${OPENADFORTTK}/bin/\$@ . |
\$(LN) \${OPENADFORTTK}/bin/\$@ . |
3089 |
|
|
3090 |
%.pl: |
preProcess.py postProcess.py: |
|
\$(LN) \${OPENADFORTTK}/bin/\$@ . |
|
|
|
|
|
preProcess.py: |
|
3091 |
\$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ . |
\$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ . |
3092 |
|
|
3093 |
whirl2f whirl2f_be: |
whirl2f whirl2f_be: |