# $Id$ ##################################################################### # Author : Claude Talandier for NEMO team # Contact : nemo_st@locean-ipsl.upmc.fr # # VARS TO SET: 6 + 1 (optional) # - NAM_V : name of the current test # - LISTE_CONF : configurations name (ORCA2_LIM, GYRE ...) # - JOBS_2LAUN : jobs to launch (nojob, all, long, short or gtime) # - BUILD_MAKE : run type (mon, mpi ... ) # - MAK_TIME : to perform a CPU time measure making a one year run # use key word 'timing' or 'notiming' # - MAK_MEMO : to perform a memory check # use key word 'memo' or 'nomemo' # - REF_TAGV : (optional) reference tag name. If specified, # current results will be compare to the results # of this tag (for a given configuration and run type) # # WORK: Allows to launch all the validation process, i.e. # I. to build dependencies use: > gmake -s dep # II. to launch compilation,simulation,final report use: > gmake # ##################################################################### SHELL = /bin/ksh ##################################################################### ##### Begin Users modifications ##################################################################### #- #- Name of the test NAM_V = MY_EXP1 #- #- Configurations list which must be tested LISTE_CONF = GYRE GYRE_LOBSTER ORCA2_LIM #- #- Jobs to launch use keyword: nojob, all, long, short or gtime JOBS_2LAUN = all #- #- Compilation list type to perform, mon (mono) &/or mpi &/or omp (Open-MP) BUILD_MAKE = mon mpi #- #- Proceed to a timing, use key word 'timing' or 'notiming' MAK_TIME = notiming #- #- Proceed to a memory check, use key word 'memo' or 'nomemo' MAK_MEMO = memo #- #- Reference Tag version REF_TAGV = nemo_v2_3 #- ##################################################################### ##### End Users modifications ##################################################################### ## all: $(LISTE_CONF) @echo ' ' @echo ' ----->>>>>>>>> Compilation process ended for configuration(s) :' $(LISTE_CONF) @echo ' ' #- Make good links & launch the compilation process $(LISTE_CONF): @echo @echo "CONFIGURATION :" $@ @( MYREP_LIST=`(cd 2TEST ; ls *.[Ffh]90 )` ; \ cd ../$@/MY_SRC ; rm -rf *.[Ffh]90 ; if [ -n "$$MYREP_LIST" ] ; \ then ln -sf ../../NVTK/2TEST/*.[Ffh]90 . ; fi ; ) @echo "test=" $(NAM_V) > ../$@/specifs.txt @echo "runs=" $(BUILD_MAKE) >> ../$@/specifs.txt @echo "time=" $(MAK_TIME) >> ../$@/specifs.txt @echo "memo=" $(MAK_MEMO) >> ../$@/specifs.txt @echo "tagname=" $(REF_TAGV) >> ../$@/specifs.txt @echo `svn info ../../modeles/NEMO | grep URL` >> ../$@/specifs.txt @echo `svn info ../../modeles/NEMO | grep Revision ` >> ../$@/specifs.txt @( LSFILES=`(cd 2TEST ; ls *.[Ffh]90 )` ; if [ -n "$$LSFILES" ] ; \ then echo $$LSFILES > ../$@/f2test.txt ; else rm -f ../$@/f2test.txt ; \ touch ../$@/f2test.txt ; fi ; ) @echo @echo ' ----->>>>>>>>> Links from NVTK/2TEST to '$@/MY_SRC 'done' @echo @echo ' Build the Makefile for' $@ 'configuration' @../../util/ins_make -w $@ @echo @echo @gmake -C ../$@ RUN='$(BUILD_MAKE)' JOB=$(JOBS_2LAUN) RTG=$(REF_TAGV) MKTE=$(MAK_TIME) MKMO=$(MAK_MEMO) REXP=$(NAM_V) -j 2 > $@_step.txt #- Rebuild dependencies when new cpp key and/or new module used dep: clear for conf in ${LISTE_CONF}; do \ echo ; \ echo ; \ echo ; \ echo ' ----->>>>>>>>> Rebuild dependencies for the' $$conf 'configuration' ; \ echo ; \ echo ' > Build links from 2TEST to '$$conf'/MY_SRC directory :' ; \ echo ; \ MYREP_LIST=`(cd 2TEST ; ls *.[Ffh]90 )` ; \ cd ../$$conf/MY_SRC ; rm -rf *.[Ffh]90 ; \ if [ -n "$$MYREP_LIST" ] ; \ then for F in $$MYREP_LIST; do \ echo " # link from 2TEST to "$$conf"/MY_SRC/$$F" ; \ ln -sf ../../NVTK/2TEST/$$F . ; \ done ; fi ; \ echo ; \ echo ; \ echo ' > Rebuild links in the '$$conf'/WORK directory:' ; \ echo ; \ cd ../WORK ; \ rm -rf `ls | fgrep -v -f .patron` ; \ check=`grep OPA_SRC .config` ; \ if [ -n "$$check" ] ; then \ echo " # use OPA_SRC component files" ; \ ln -sf ../../../modeles/NEMO/OPA_SRC/*.[Ffh]90 . ; \ ln -sf ../../../modeles/NEMO/OPA_SRC/*/*.[Ffh]90 . ; \ fi ; \ check=`grep LIM_SRC_2 .config` ; \ if [ -n "$$check" ] ; then \ echo " # use LIM_SRC_2 component files" ; \ ln -sf ../../../modeles/NEMO/LIM_SRC_2/*.[Ffh]90 . ; \ fi ; \ check=`grep LIM_SRC_3 .config` ; \ if [ -n "$$check" ] ; then \ echo " # use LIM_SRC_3 component files" ; \ ln -sf ../../../modeles/NEMO/LIM_SRC_3/*.[Ffh]90 . ; \ fi ; \ check=`grep NST_SRC .config` ; \ if [ -n "$$check" ] ; then \ echo " # use NST_SRC component files" ; \ \rm -rf agrif_opa_interp.F90 ; \ \rm -rf agrif_opa_sponge.F90 ; \ \rm -rf agrif_opa_update.F90 ; \ \rm -rf agrif_top_interp.F90 ; \ \rm -rf agrif_top_sponge.F90 ; \ \rm -rf agrif_top_update.F90 ; \ ln -sf ../../../modeles/NEMO/NST_SRC/*.[Ffh]90 . ; \ fi ; \ check=`grep C1D_SRC .config` ; \ if [ -n "$$check" ] ; then \ echo " # use C1D_SRC component files" ; \ ln -sf ../../../modeles/NEMO/C1D_SRC/*.[Ffh]90 . ; \ fi ; \ check=`grep TOP_SRC .config` ; \ if [ -n "$$check" ] ; then \ echo " # use TOP_SRC component files" ; \ \rm -rf trcstp.F90 ; \ \rm -rf sms.F90 ; \ \rm -rf trcini.F90 ; \ ln -sf ../../../modeles/NEMO/TOP_SRC/*.[Ffh]90 . ; \ ln -sf ../../../modeles/NEMO/TOP_SRC/*/*.[Ffh]90 . ; \ fi ; \ check=`grep OFF_SRC .config` ; \ if [ -n "$$check" ] ; then \ echo " # use OFF_SRC component files" ; \ ln -sf ../../../modeles/NEMO/OFF_SRC/*.[Ffh]90 . ; \ ln -sf ../../../modeles/NEMO/OFF_SRC/*/*.[Ffh]90 . ; \ fi ; \ mn=`awk '{ print $$1 }' .config ` ; \ myrep=../../../config/$$mn/MY_SRC ; \ echo " # use MY_SRC component files" ; \ for i in `ls $$myrep` ; do \ [ -f $$i ] && \rm -rf $$i ;\ done ; \ myrep_list=`(cd $$myrep ; ls *.[Ffh]90 )` ; \ if [ -n "$$myrep_list" ] ; then \ for F in $$myrep_list; do \ ln -sf $$myrep/$$F . ; \ done ; \ fi ; \ rm -f tmplist ; \ ls -1 | fgrep -v -f .patron > SRC_FILE_LIST.temp ; \ cd .. ; ../NVTK/fait_AA_make ; \ echo ; \ echo " #################################" ;\ echo " Dependencies for" $$conf "ready" ;\ echo " #################################" ;\ echo ;\ cd ../NVTK ; \ done @echo @echo " ##################################################" @echo " Launch the compilation and job process using gmake" @echo " ##################################################" @echo clear : @echo @echo @clear