Changeset 2238 for LMDZ5/trunk/makelmdz


Ignore:
Timestamp:
Mar 20, 2015, 11:54:59 AM (10 years ago)
Author:
Ehouarn Millour
Message:

Update of "makelmdz" and "create_make_gcm" scripts so that only required directories are scanned when building the makefile.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/makelmdz

    r2202 r2238  
    8484PARA_LD=""
    8585EXT_SRC=""
    86 
     86#src_dirs: directories containing source files
     87src_dirs="grid bibio"
    8788########################################################################
    8889# lecture des options
     
    106107          true        : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6
    107108[-chimie INCA/false]       : with INCA chemistry model or without (default: false)
     109[-cosp true/false]    : compile with/without cosp package (default: false)
     110[-sisvat true/false]  : compile with/without sisvat package (default: false)
     111[-rrtm true/false]    : compile with/without rrtm package (default: false)
    108112[-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp
    109113[-g GRI]                   : grid configuration in dyn3d/GRI_xy.h  (default: reg, inclues a zoom)
     
    186190
    187191      "-ext_src")
    188           EXT_SRC=$2 ; shift ; shift ;;
     192          EXT_SRC=$2 ; src_dirs="$src_dirs $EXT_SRC" ; shift ; shift ;;
    189193
    190194      "-arch")
     
    283287then
    284288   #We'll use some physics
     289   src_dirs="$src_dirs phy$physique"
    285290   CPP_KEY="$CPP_KEY CPP_PHYS"
    286291   if [[ "${physique:0:3}" == "lmd" ]]
     
    316321      echo "You should use option \"-mem\"."
    317322      exit 1
    318   fi     
     323  fi
    319324fi
    320325
     
    413418   CPP_KEY="$CPP_KEY CPP_COSP"
    414419   COSP_PATH="$LIBFGCM/cosp"
     420   src_dirs="$src_dirs cosp"
    415421#   LIB="${LIB} -l${LIBPREFIX}cosp"
    416422   opt_dep="$opt_dep cosp"
     
    422428then
    423429   CPP_KEY="$CPP_KEY CPP_SISVAT"
     430   src_dirs="$src_dirs phy${physique}/sisvat"
    424431fi
    425432
     
    427434then
    428435   CPP_KEY="$CPP_KEY CPP_RRTM"
     436   src_dirs="$src_dirs phy${physique}/rrtm"
    429437fi
    430438
     
    489497
    490498if (( $dimc == 3 )) ; then
     499   src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}"
    491500   cd $LIBFGCM/grid
    492501   \rm fxyprim.h
     
    498507   INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d'
    499508elif (( $dimc == 1 )) ; then
     509   src_dirs="$src_dirs dyn3d dyn3d_common filtrez"
    500510   CPP_KEY="$CPP_KEY CPP_1D"
    501511   filtre="L_DYN= DYN= FILTRE= L_FILTRE= DIRMAIN=phy$physique "
     
    539549cd $LMDGCM
    540550
    541 find libf -name '*.[Fh]' -print > tmp77
    542 find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print > tmp90
    543 find libf -name '*.F90' -print >> tmp90
    544 
    545 if [[ ! ( -r makefile ) || ! ( -r liste_des_sources_f90 ) || ! ( -r liste_des_sources_f77 ) || ` diff tmp77 liste_des_sources_f77 | wc -w ` -ne 0 || ` diff tmp90 liste_des_sources_f90 | wc -w ` -ne 0 ]]
     551find libf -name '*.[Fh]' -print | sort > tmp77
     552#find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print > tmp90
     553find libf -name '*.F90' -print | sort > tmp90
     554
     555if [[ -r .makelmdz ]]
     556then
     557old_lmdz_configuration=$(cat .makelmdz )
     558else
     559old_lmdz_configuration=""
     560fi
     561lmdz_configuration="$src_dirs"
     562if [[ "$lmdz_configuration" != "$old_lmdz_configuration" ]]
     563then
     564  configuration_change="true"
     565else
     566  configuration_change="false"
     567fi
     568
     569if [[ $configuration_change == "true" || ! ( -r makefile ) || ! ( -r liste_des_sources_f90 ) || ! ( -r liste_des_sources_f77 ) || ` diff tmp77 liste_des_sources_f77 | wc -w ` -ne 0 || ` diff tmp90 liste_des_sources_f90 | wc -w ` -ne 0 ]]
    546570then
    547571  echo "les fichiers suivants ont ete crees ou detruits"
     
    551575  \cp -f tmp77 liste_des_sources_f77
    552576  \cp -f tmp90 liste_des_sources_f90
    553   echo "on recree le makefile"
    554   ./create_make_gcm > tmp
     577  echo "Recreating the makefile"
     578  echo "src_dirs: $src_dirs"
     579  ./create_make_gcm $src_dirs > tmp
    555580  \mv -f tmp makefile
    556   echo "Nouveau makefile cree"
    557 fi
     581  echo "New makefile created"
     582fi
     583
     584#Create a .makelmdz file containing main compilation option for later comparisons
     585echo "$lmdz_configuration" > .makelmdz
    558586
    559587#################################################################
Note: See TracChangeset for help on using the changeset viewer.