# $Id$ ##################################################################### # Author : Claude Talandier for NEMO team # Contact : nemo_st@locean-ipsl.upmc.fr # # VARS TO SET: 12 + 1 (optional) # - NAM_V : name of the current test (associated to the same directory name) # - LISTE_CONF : configurations name (ORCA2_LIM, GYRE ...) # - JOBS_2LAUN : jobs to launch (nojob, all, long, short or gtime) # - BUILD_MAKE : run type (mon, mpi ... ) # - MPI_I : i- MPI decomposition # - MPI_J : j- MPI decomposition # - MPIIJ : Total number of processors # - MAK_TIME : to perform a CPU time check use keyword: 'timing' or 'notiming' # - USE_IOMPUT : use or not the new I/O interface # - USE_IOSERVER : use the I/O interface using the server possibility # - NB_PROCS_IOSERVER : number of processors dedicated to the I/O server # - MAK_MEMO : to perform a memory check use keyword: 'memo' or 'nomemo' # - REF_TAGV : (optional) tag/experience name. If specified, # current results will be compare to the results # of this tag/experience (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 # III. to remove NetCDF output files of the NAM_V experience use: > gmake delf # ##################################################################### SHELL = /bin/ksh ##################################################################### ##### Begin Users modifications ##################################################################### #- #- Name of the test NAM_V = 2TEST #- #- Configurations list which must be tested LISTE_CONF = GYRE GYRE_LOBSTER ORCA2_LIM ORCA2_LIM3 ORCA2_LIM_PISCES ORCA2_OFF_PISCES ZAGRIF #- #- 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 #- #- MPI decomposition MPI_I=2 MPI_J=4 MPIIJ=8 #- #- Do we use the new io interface (iom_put)? With the io_server? On how many procs? USE_IOMPUT = false USE_IOSERVER = false NB_PROCS_IOSERVER = 1 #- #- Proceed to a timing, use keyword: 'timing' or 'notiming' MAK_TIME = notiming #- #- Proceed to a memory check, use keyword: 'memo' or 'nomemo' MAK_MEMO = memo #- #- Experience name or reference Tag name (nemo_v2, nemo_v2_3 ,nemo_v3 or nemo_v3_2) REF_TAGV = nemo_v3_2 #- ##################################################################### ##### 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 :" $@ @( if [ ! -d ${NAM_V} ] ; then mkdir ${NAM_V} ; fi ; ) @( cd ${NAM_V} ; MYREP_LIST=`( ls *.[Ffh]90 )` ; cd ../../$@/MY_SRC ; rm -rf *.[Ffh]90 ; \ if [ -n "$$MYREP_LIST" ] ; then ln -sf ../../NVTK/${NAM_V}/*.[Ffh]90 . ; fi ; ) @echo "test=" $(NAM_V) > DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo "runs=" $(BUILD_MAKE) >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo "mpis=" $(MPI_I) $(MPI_J) $(MPIIJ) >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo "time=" $(MAK_TIME) >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo "memo=" $(MAK_MEMO) >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo "tagname=" $(REF_TAGV) >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo `svn info ../../modeles/NEMO | grep URL` >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @echo `svn info ../../modeles/NEMO | grep Revision ` >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt @( cd ${NAM_V} ; LSFILES=`( ls *.[Ffh]90 )` ; if [ -n "$$LSFILES" ] ; then \ echo $$LSFILES >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt ; else \ echo " " >> DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt ; fi ; ) @echo @echo ' ----->>>>>>>>> Links from NVTK/'${NAM_V} ' to '$@/MY_SRC 'done' @echo @echo ' Build the Makefile for' $@ 'configuration' @../../util/ins_make -w $@ ifeq ($(USE_IOMPUT),true) @../../util/ins_make -w XMLF90 @../../util/ins_make -w XMLIO_SERVER endif @( cd ../$@/WORK ; grep P_P Makefile | head -1 > $$ ; LSCPPKEY=`( cut -c,6- $$ )` ; \ rm -f $$ ; if [ -n "$$LSCPPKEY" ] ; then echo $$LSCPPKEY >> \ DELFIL/NEMO_VALID/W$@/infos/specifs_$(NAM_V).txt ; fi ; ) @echo @echo @gmake -C ../$@ RUN='$(BUILD_MAKE)' MPI_I=$(MPI_I) MPI_J=$(MPI_J) MPIIJ=$(MPIIJ) 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) > $@_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 NVTK/'${NAM_V} ' to '$$conf'/MY_SRC directory :' ; \ echo ; \ cd ${NAM_V} ; \ MYREP_LIST=`( 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 NVTK/"${NAM_V} "to "$$conf"/MY_SRC/$$F" ; \ ln -sf ../../NVTK/${NAM_V}/$$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" ; \ 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 ; \ cd $$myrep ; \ myrep_list=`( ls *.[Ffh]90 )` ; \ cd ../WORK ; \ if [ -n "$$myrep_list" ] ; then \ for F in $$myrep_list; do \ ln -sf $$myrep/$$F . ; \ done ; \ fi ; \ cd .. ; ../NVTK/fait_AA_make ; \ cd WORK ; \ ls -1 | fgrep -v -f .patron >tmplist ; \ cp tmplist SRC_FILE_LIST.temp ; \ 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 #- Delete NetCDF files for a given experience to save memory delf: @for conf in ${LISTE_CONF}; do \ echo ; \ echo ; \ echo ; \ echo ' ----->>>>>>>>> Remove all' $$conf '*.nc output files for the' ${NAM_V} 'experience' ; \ echo ; \ echo ; \ for typer in ${BUILD_MAKE}; do \ rm -f DELFIL/NEMO_VALID/W$$conf/$$typer/LONG/${NAM_V}/*.nc ; \ rm -f DELFIL/NEMO_VALID/W$$conf/$$typer/1_SHORT/${NAM_V}/*.nc ; \ rm -f DELFIL/NEMO_VALID/W$$conf/$$typer/2_SHORT/${NAM_V}/*.nc ; \ rm -f DELFIL/NEMO_VALID/W$$conf/$$typer/GTIME/${NAM_V}/*.nc ; \ done ; \ done