1 |
cnh |
1.1 |
#!/bin/csh -f |
2 |
|
|
# |
3 |
|
|
# Script to build ESMF component libraries for MITgcm ocean 15L. |
4 |
|
|
# |
5 |
|
|
setenv BUILDROOT `pwd` |
6 |
|
|
#setenv COMP_PROF blackforest |
7 |
|
|
setenv COMP_PROF faulks |
8 |
|
|
source mytools/comp_profile.BASE |
9 |
|
|
source mytools/comp_profile.${COMP_PROF} |
10 |
|
|
setenv TCSH_PATH `which tcsh` |
11 |
|
|
setenv APPLIB_PATH ${BUILDROOT}/app/lib |
12 |
|
|
setenv APPF90MOD_PATH ${BUILDROOT}/app/f90mod |
13 |
|
|
setenv APPOBJ_PATH ${BUILDROOT}/app/obj |
14 |
|
|
setenv APPINC_PATH ${BUILDROOT}/app/inc |
15 |
|
|
setenv APPEXE_PATH ${BUILDROOT}/app/exe |
16 |
|
|
|
17 |
|
|
# |
18 |
|
|
# Build individual component core code |
19 |
|
|
# |
20 |
|
|
# MITgcm ocn |
21 |
|
|
# ========== |
22 |
|
|
cd run |
23 |
|
|
if ( -f Makefile ) then |
24 |
|
|
make Clean |
25 |
|
|
endif |
26 |
|
|
|
27 |
|
|
# ESMF component build. Creates an ESMF component that can be coupled through |
28 |
|
|
# the ESMF superstructure layer. |
29 |
|
|
${gm2command} ${gm2mods} ${gm2optfile} ${gm2adoptfile} |
30 |
|
|
make depend |
31 |
|
|
make small_f |
32 |
|
|
|
33 |
|
|
# Copy the scripts from the download directory making platform specific mods |
34 |
|
|
# along the way. |
35 |
|
|
foreach f ( ../mytools/* ) |
36 |
|
|
if ( -f $f ) then |
37 |
|
|
cp $f . |
38 |
|
|
cat $f | sed s'|<TCSH_PATH>|'${TCSH_PATH}'|g' > temp.$$ |
39 |
|
|
mv temp.$$ ${f:t} |
40 |
|
|
chmod +x ${f:t} |
41 |
|
|
endif |
42 |
|
|
end |
43 |
|
|
./mkmod.sh ocn |
44 |
|
|
|
45 |
|
|
# Copy products to application build library and include directories |
46 |
|
|
if ( ! -d ${APPLIB_PATH} ) then |
47 |
|
|
mkdir -p ${APPLIB_PATH} |
48 |
|
|
endif |
49 |
|
|
if ( ! -d ${APPF90MOD_PATH} ) then |
50 |
|
|
mkdir -p ${APPF90MOD_PATH} |
51 |
|
|
endif |
52 |
|
|
if ( ! -d ${APPOBJ_PATH} ) then |
53 |
|
|
mkdir -p ${APPOBJ_PATH} |
54 |
|
|
endif |
55 |
|
|
if ( ! -d ${APPINC_PATH} ) then |
56 |
|
|
mkdir -p ${APPINC_PATH} |
57 |
|
|
endif |
58 |
|
|
if ( ! -d ${APPEXE_PATH} ) then |
59 |
|
|
mkdir -p ${APPEXE_PATH} |
60 |
|
|
endif |
61 |
|
|
cp mmout/*.a ${APPLIB_PATH} |
62 |
|
|
cp mmout/*.mod ${APPF90MOD_PATH} |
63 |
|
|
cp mmout/*.o ${APPOBJ_PATH} |
64 |
|
|
cp mmout/*.h ${APPINC_PATH} |