Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102796758
f90mkdepend
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 24, 06:56
Size
1 KB
Mime Type
text/x-shellscript
Expires
Wed, Feb 26, 06:56 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
24426836
Attached To
R2795 mitgcm_lac_leman_abirani
f90mkdepend
View Options
#!/bin/bash
# $Header: /u/gcmpack/MITgcm/tools/f90mkdepend,v 1.7 2013/12/11 21:53:02 jahn Exp $
# $Name: $
#
# Generate some make file dependency entries for a Fortran 90 file that employs "use".
#
# For every "use" statement, generate a dependency on lowercase(modulename).o
#
# Note: We assume that the name of a module and the same of source are the same.
# The name of the source file should be all lower case (except for the extension).
# don't complain if *.F90 doesn't match any files
shopt
-s nullglob
cat /dev/null > f90mkdepend.log
for
filename in *.F90 *.F *.h;
do
# quick check for "use" to speed up processing
if
grep -i
'^ *use '
$filename
> /dev/null;
then
# extract module name in lower case
modreflist
=
$(
grep -i
'^ *use '
$filename
| awk
'{print tolower($2)}'
| sed
's/,.*$//'
)
echo
"$filename => $modreflist"
>> f90mkdepend.log
# change .F90 into .f90, .F into .f for target
preprocessed
=
$(
echo
$filename
| sed -e
's/\.F$/.f/'
-e
's/\.F90$/.f90/'
)
depline
=
"$preprocessed:"
for
m in
$modreflist
;
do
# ignore modules that don't have an appropriately named source file
if
[
-f
$m
.F90
]
||
[
-f
$m
.F
]
;
then
depline
=
"$depline $m.o"
elif
[
-f
${
m
%_mod
}
.F90
]
||
[
-f
${
m
%_mod
}
.F
]
;
then
# source file name is module name without "_mod"
depline
=
"$depline ${m%_mod}.o"
else
echo
"WARNING: f90mkdepend: no source file found for module $m"
1>&2
fi
done
echo
$depline
fi
done
Event Timeline
Log In to Comment