907 |
program fgennc |
program fgennc |
908 |
#include "netcdf.inc" |
#include "netcdf.inc" |
909 |
EOF |
EOF |
910 |
if test ! "x$MPI" = x ; then |
#if test ! "x$MPI" = x ; then |
911 |
echo '#include "mpif.h"' >> genmake_tnc.F |
# echo '#include "mpif.h"' >> genmake_tnc.F |
912 |
fi |
#fi |
913 |
cat <<EOF >> genmake_tnc.F |
cat <<EOF >> genmake_tnc.F |
914 |
integer iret, ncid, xid |
integer iret, ncid, xid |
915 |
iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid) |
iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid) |
1092 |
echo " --> set HAVE_LAPACK='$HAVE_LAPACK'" >> $LOGFILE |
echo " --> set HAVE_LAPACK='$HAVE_LAPACK'" >> $LOGFILE |
1093 |
} |
} |
1094 |
|
|
1095 |
|
check_HAVE_FLUSH() { |
1096 |
|
if test ! "x$SKIP_CHECK_FLUSH" = x ; then |
1097 |
|
return |
1098 |
|
fi |
1099 |
|
echo >> $LOGFILE |
1100 |
|
echo "running: check_HAVE_FLUSH()" >> $LOGFILE |
1101 |
|
cat <<EOF > genmake_tflsh.$FS |
1102 |
|
program fgenflsh |
1103 |
|
integer iounit |
1104 |
|
character*9 fname |
1105 |
|
iounit = 26 |
1106 |
|
fname = 'tmp.tflsh' |
1107 |
|
open(iounit,FILE=fname,STATUS='unknown') |
1108 |
|
write(iounit,*) 'genmake_tflsh: hello' |
1109 |
|
call flush(iounit) |
1110 |
|
close(iounit) |
1111 |
|
end |
1112 |
|
EOF |
1113 |
|
echo "=== genmake_tflsh.$FS >>>" > genmake_tflsh.log |
1114 |
|
cat genmake_tflsh.$FS >> genmake_tflsh.log |
1115 |
|
echo "<<< genmake_tflsh.$FS ===" >> genmake_tflsh.log |
1116 |
|
|
1117 |
|
echo "$FC $FFLAGS $FOPTIM -c genmake_tflsh.$FS \ " >> genmake_tflsh.log |
1118 |
|
echo " && $LINK $FFLAGS $FOPTIM -o genmake_tflsh.o $LIBS" >> genmake_tflsh.log |
1119 |
|
$FC $FFLAGS $FOPTIM -c genmake_tflsh.$FS >> genmake_tflsh.log 2>&1 \ |
1120 |
|
&& $LINK $FFLAGS $FOPTIM -o genmake_tflsh genmake_tflsh.o $LIBS >> genmake_tflsh.log 2>&1 |
1121 |
|
RET_COMPILE=$? |
1122 |
|
|
1123 |
|
if test "x$RET_COMPILE" = x0 ; then |
1124 |
|
HAVE_FLUSH=t |
1125 |
|
#cat genmake_tflsh.log >> $LOGFILE |
1126 |
|
echo " check_HAVE_FLUSH: successful" >> $LOGFILE |
1127 |
|
else |
1128 |
|
HAVE_FLUSH=f |
1129 |
|
cat genmake_tflsh.log >> $LOGFILE |
1130 |
|
fi |
1131 |
|
rm -f genmake_tflsh* |
1132 |
|
echo " --> set HAVE_FLUSH='$HAVE_FLUSH'" >> $LOGFILE |
1133 |
|
} |
1134 |
|
|
1135 |
############################################################################### |
############################################################################### |
1136 |
# Sequential part of script starts here |
# Sequential part of script starts here |
1199 |
HAVE_ETIME= |
HAVE_ETIME= |
1200 |
IGNORE_TIME= |
IGNORE_TIME= |
1201 |
HAVE_LAPACK= |
HAVE_LAPACK= |
1202 |
|
HAVE_FLUSH= |
1203 |
|
|
1204 |
MODS= |
MODS= |
1205 |
TOOLSDIR= |
TOOLSDIR= |
1253 |
# The following state is not directly set by command-line switches |
# The following state is not directly set by command-line switches |
1254 |
gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM" |
gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM" |
1255 |
gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS" |
gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS" |
1256 |
gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK" |
gm_s6="PWD TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK" |
1257 |
gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE" |
gm_s7="THISHOST THISUSER THISDATE THISVER MACHINE FC_NAMEMANGLE" |
1258 |
gm_s8="FC_NAMEMANGLE HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK" |
gm_s8="HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK HAVE_FLUSH" |
1259 |
|
|
1260 |
# The following are all related to adjoint/tangent-linear stuff |
# The following are all related to adjoint/tangent-linear stuff |
1261 |
gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS" |
gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS" |
1923 |
else |
else |
1924 |
echo "no" |
echo "no" |
1925 |
fi |
fi |
|
DEFINES="$DEFINES $IGNORE_TIME" |
|
1926 |
|
|
1927 |
|
printf " Can we call FLUSH intrinsic subroutine... " |
1928 |
|
check_HAVE_FLUSH |
1929 |
|
if test "x$HAVE_FLUSH" = xt ; then |
1930 |
|
DEFINES="$DEFINES -DHAVE_FLUSH" |
1931 |
|
echo "yes" |
1932 |
|
else |
1933 |
|
echo "no" |
1934 |
|
fi |
1935 |
|
|
1936 |
|
DEFINES="$DEFINES $IGNORE_TIME" |
1937 |
if test "x$EMBED_SRC" = xt ; then |
if test "x$EMBED_SRC" = xt ; then |
1938 |
build_embed_encode |
build_embed_encode |
1939 |
fi |
fi |
2949 |
## This nullifies any default implicit rules concerning these two file types: |
## This nullifies any default implicit rules concerning these two file types: |
2950 |
## %.o : %.F |
## %.o : %.F |
2951 |
|
|
2952 |
# C preprocessing and replacing the _d in constants: |
# C preprocessing and replacing the _d in constants: |
2953 |
CPPCMD = cat \$< | ${CPP} \$(DEFINES) \$(INCLUDES) | ${S64} |
CPPCMD = cat \$< | ${CPP} \$(DEFINES) \$(INCLUDES) | ${S64} |
2954 |
|
|
2955 |
.F.$FS: |
.F.$FS: |