New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Makefile in trunk/NVTK – NEMO

source: trunk/NVTK/Makefile @ 1560

Last change on this file since 1560 was 1560, checked in by rblod, 15 years ago

external: some additions to test IOSERVER with NVTK

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 8.8 KB
Line 
1# $Id$
2#####################################################################
3# Author : Claude Talandier for NEMO team
4# Contact : nemo_st@locean-ipsl.upmc.fr
5#
6# VARS TO SET: 6 + 1 (optional)
7#     - NAM_V      : name of the current test (associated to the same directory name)
8#     - LISTE_CONF : configurations name (ORCA2_LIM, GYRE ...)
9#     - JOBS_2LAUN : jobs to launch (nojob, all, long, short or gtime)
10#     - BUILD_MAKE : run type (mon, mpi ... )
11#     - MAK_TIME   : to perform a CPU time measure making a one year run
12#                    use key word 'timing' or 'notiming'
13#     - MAK_MEMO   : to perform a memory check
14#                    use key word 'memo' or 'nomemo'
15#     - REF_TAGV   : (optional) reference tag name. If specified,
16#                    current results will be compare to the results
17#                    of this tag (for a given configuration and run type)
18#
19# WORK: Allows to launch all the validation process, i.e.
20#     I.   to build dependencies use: > gmake -s dep
21#     II.  to launch compilation,simulation,final report use: > gmake
22#
23#####################################################################
24SHELL = /bin/ksh
25#####################################################################
26##### Begin Users modifications
27#####################################################################
28#-
29#- Name of the test
30NAM_V = 2TEST
31#-
32#- Configurations list which must be tested
33LISTE_CONF = GYRE GYRE_LOBSTER ORCA2_LIM ORCA2_LIM3 ORCA2_LIM_PISCES ORCA2_OFF_PISCES
34#-
35#- Jobs to launch use keyword: nojob, all, long, short or gtime
36JOBS_2LAUN = all
37#-
38#- Compilation list type to perform, mon (mono) &/or mpi &/or omp (Open-MP)
39BUILD_MAKE = mon mpi
40#-
41#- Do we use the new io interface (iom_put)? With the io_server? On how many procs?
42USE_IOMPUT = false
43USE_IOSERVER = false
44NB_PROCS_IOSERVER = 1
45#-
46#- Proceed to a timing, use key word 'timing' or 'notiming'
47MAK_TIME = notiming
48#-
49#- Proceed to a memory check, use key word 'memo' or 'nomemo'
50MAK_MEMO = memo
51#-
52#- Reference Tag version
53REF_TAGV = nemo_v2_3
54#-
55#####################################################################
56##### End Users modifications
57#####################################################################
58
59##
60all: $(LISTE_CONF)
61   @echo '      '
62   @echo '             ----->>>>>>>>>   Compilation process ended for configuration(s) :' $(LISTE_CONF)
63   @echo '      '
64
65#- Make good links & launch the compilation process
66$(LISTE_CONF):
67   @echo
68   @echo "CONFIGURATION :" $@
69   @( if [ ! -d ${NAM_V} ] ; then mkdir ${NAM_V} ;  fi ; )
70   @( cd ${NAM_V} ; MYREP_LIST=`( ls *.[Ffh]90 )` ; cd ../../$@/MY_SRC ; rm -rf *.[Ffh]90 ; \
71        if [ -n "$$MYREP_LIST" ] ; then ln -sf ../../NVTK/${NAM_V}/*.[Ffh]90 . ; fi ; )
72   @echo "test=" $(NAM_V) > ../$@/specifs.txt
73   @echo "runs=" $(BUILD_MAKE) >> ../$@/specifs.txt
74   @echo "time=" $(MAK_TIME) >> ../$@/specifs.txt
75   @echo "memo=" $(MAK_MEMO) >> ../$@/specifs.txt
76   @echo "tagname=" $(REF_TAGV) >> ../$@/specifs.txt
77   @echo `svn info ../../modeles/NEMO | grep URL` >> ../$@/specifs.txt
78   @echo `svn info ../../modeles/NEMO | grep Revision ` >> ../$@/specifs.txt
79   @( cd ${NAM_V} ; LSFILES=`( ls *.[Ffh]90 )` ; if [ -n "$$LSFILES" ] ; \
80     then echo $$LSFILES > ../../$@/f2test.txt ; else rm -f ../../$@/f2test.txt ; \
81          touch ../../$@/f2test.txt ; fi ; )
82   @echo
83   @echo '             ----->>>>>>>>>   Links from NVTK/'${NAM_V} ' to '$@/MY_SRC 'done'
84   @echo
85   @echo '                              Build the Makefile for' $@ 'configuration'
86   @../../util/ins_make -w $@
87ifeq ($(USE_IOMPUT),true)
88   @../../util/ins_make -w XMLF90
89   @../../util/ins_make -w XMLIO_SERVER
90endif
91   @echo
92   @echo
93   @gmake -C ../$@ RUN='$(BUILD_MAKE)' JOB=$(JOBS_2LAUN) RTG=$(REF_TAGV) MKTE=$(MAK_TIME) MKMO=$(MAK_MEMO) REXP=$(NAM_V) USE_IOMPUT=$(USE_IOMPUT) USE_IOSERVER=$(USE_IOSERVER) NB_PROCS_IOSERVER=$(NB_PROCS_IOSERVER) -j 2 > $@_step.txt
94
95#- Rebuild dependencies when new cpp key and/or new module used
96dep: clear
97   @for conf in ${LISTE_CONF}; do \
98       echo ; \
99       echo ; \
100       echo ; \
101       echo '             ----->>>>>>>>> Rebuild dependencies for the' $$conf 'configuration' ; \
102       echo ; \
103       echo '                          > Build links from NVTK/'${NAM_V} ' to '$$conf'/MY_SRC directory :' ; \
104       echo ; \
105       cd ${NAM_V} ; \
106       MYREP_LIST=`( ls *.[Ffh]90 )` ; \
107            cd ../../$$conf/MY_SRC ; rm -rf *.[Ffh]90 ; \
108            if [ -n "$$MYREP_LIST" ] ; \
109            then for F in $$MYREP_LIST; do \
110            echo "                             # link from NVTK/"${NAM_V} "to "$$conf"/MY_SRC/$$F" ; \
111                   ln -sf  ../../NVTK/${NAM_V}/$$F . ; \
112                done ; fi ; \
113       echo ; \
114       echo ; \
115       echo '                          > Rebuild links in the '$$conf'/WORK directory:' ; \
116       echo ; \
117            cd ../WORK ; \
118       rm -rf `ls | fgrep -v -f .patron` ; \
119       check=`grep OPA_SRC .config`              ; \
120       if [ -n "$$check" ] ; then                   \
121           echo "                             # use OPA_SRC component files"                ; \
122           ln -sf ../../../modeles/NEMO/OPA_SRC/*.[Ffh]90          . ; \
123           ln -sf ../../../modeles/NEMO/OPA_SRC/*/*.[Ffh]90      . ; \
124            fi ; \
125       check=`grep LIM_SRC_2 .config`              ; \
126       if [ -n "$$check" ] ; then                   \
127           echo "                             # use LIM_SRC_2 component files"                ; \
128                ln -sf ../../../modeles/NEMO/LIM_SRC_2/*.[Ffh]90          . ; \
129            fi ; \
130       check=`grep LIM_SRC_3 .config`              ; \
131       if [ -n "$$check" ] ; then                   \
132           echo "                             # use LIM_SRC_3 component files"                ; \
133                ln -sf ../../../modeles/NEMO/LIM_SRC_3/*.[Ffh]90          . ; \
134            fi ; \
135       check=`grep NST_SRC .config`              ; \
136       if [ -n "$$check" ] ; then                   \
137           echo "                             # use NST_SRC component files"                ; \
138                \rm -rf agrif_opa_interp.F90           ; \
139                \rm -rf agrif_opa_sponge.F90           ; \
140                \rm -rf agrif_opa_update.F90           ; \
141                \rm -rf agrif_top_interp.F90           ; \
142                \rm -rf agrif_top_sponge.F90           ; \
143                \rm -rf agrif_top_update.F90           ; \
144                ln -sf ../../../modeles/NEMO/NST_SRC/*.[Ffh]90      .     ; \
145            fi ; \
146       check=`grep C1D_SRC .config`              ; \
147       if [ -n "$$check" ] ; then                   \
148           echo "                             # use C1D_SRC component files"                ; \
149                ln -sf ../../../modeles/NEMO/C1D_SRC/*.[Ffh]90          . ; \
150            fi ; \
151       check=`grep TOP_SRC .config`              ; \
152       if [ -n "$$check" ] ; then  \
153           echo "                             # use TOP_SRC component files"                ; \
154                \rm -rf trcstp.F90                      ; \
155                \rm -rf sms.F90                         ; \
156                \rm -rf trcini.F90                      ; \
157                ln -sf ../../../modeles/NEMO/TOP_SRC/*.[Ffh]90          . ; \
158                ln -sf ../../../modeles/NEMO/TOP_SRC/*/*.[Ffh]90      . ; \
159            fi ; \
160       check=`grep OFF_SRC .config`              ; \
161       if [ -n "$$check" ] ; then                   \
162           echo "                             # use OFF_SRC component files"                ; \
163                ln -sf ../../../modeles/NEMO/OFF_SRC/*.[Ffh]90          . ; \
164                ln -sf ../../../modeles/NEMO/OFF_SRC/*/*.[Ffh]90        . ; \
165            fi ; \
166       mn=`awk '{ print $$1 }' .config `  ; \
167            myrep=../../../config/$$mn/MY_SRC ; \
168       echo "                             # use MY_SRC component files"                ; \
169            for i in `ls $$myrep` ; do \
170              [ -f $$i ] && \rm -rf $$i ;\
171            done ; \
172            cd $$myrep ; \
173            myrep_list=`( ls *.[Ffh]90 )` ; \
174            cd ../WORK ; \
175            if [ -n "$$myrep_list" ] ; then \
176                for F in $$myrep_list; do \
177                   ln -sf  $$myrep/$$F . ; \
178                done ; \
179            fi ; \
180            cd .. ; ../NVTK/fait_AA_make ; \
181            cd WORK ; \
182            ls -1 | fgrep -v -f .patron >tmplist ; \
183            cp tmplist SRC_FILE_LIST.temp ; \
184       echo ; \
185       echo "                             #################################" ;\
186       echo "                             Dependencies for" $$conf "ready" ;\
187       echo "                             #################################" ;\
188       echo ;\
189            cd ../../NVTK ; \
190        done 
191   @echo
192   @echo "                             ##################################################" 
193   @echo "                             Launch the compilation and job process using gmake" 
194   @echo "                             ##################################################"
195   @echo
196
197clear :
198   @echo
199   @echo
200   @clear
Note: See TracBrowser for help on using the repository browser.