Changeset 2238
- Timestamp:
- Mar 20, 2015, 11:54:59 AM (10 years ago)
- Location:
- LMDZ5/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/create_make_gcm
r2085 r2238 5 5 #set -xv 6 6 7 # arguments given to create_make_gcm are the directories to scan 8 src_dirs=$* 7 9 8 10 machine=`hostname` … … 121 123 cd $libf >/dev/null 2>&1 122 124 123 for diri in ` ls `; do125 for diri in $src_dirs ; do 124 126 125 127 if [ -d $diri ] ; then 126 if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.[fF]90 $diri/*/*.[fF]90`" != "" ] ; then128 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ] ; then 127 129 # cd $diri >/dev/null 2>&1 128 130 echo 129 131 listlib="" 130 132 # Liste des fichiers .F et .F90 n'etant pas des programmes principaux 131 for fili in `ls $diri/*.[fF] $diri/*/*.[fF]` ; do 132 test=` ( head $fili | grep ' PROGRAM' ) ` 133 for fili in `ls $diri/*.[fF]` ; do 134 # Check if file is a routine or main program 135 # i.e: look for the "program" keword preceeded by leading spaces 136 test=` ( head $fili | grep -i '^ *program' ) ` 137 # if it is not a main program, add it to the list 133 138 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 134 139 done 135 for fili in `ls $diri/*.[fF]90 $diri/*/*.[fF]90` ; do 136 test=` ( head $fili | grep 'PROGRAM' ) ` 140 for fili in `ls $diri/*.[fF]90` ; do 141 # Check if file is a routine or main program 142 # i.e. look for "program" keyword (with possibly some leading spaces) 143 test=` ( head $fili | grep -i '^ \{0,\}program' ) ` 144 # if it is not a main program, add it to the list 137 145 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 138 146 done … … 140 148 echo $listlib >> $logfile 141 149 echo 150 # topdiri contains main dir name (without trailing "/blabla" for subdirs) 151 topdiri=${diri%/*} 142 152 echo "#==================================================================" 143 153 echo "# Contenu de la bibliotheque correspondant au Directory "$diri … … 146 156 for trufile in $listlib ; do 147 157 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 148 echo '$(LIBO)/lib'$ diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"158 echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)" 149 159 echo 150 160 done 151 echo '.PRECIOUS : $(LIBO)/lib'$ diri'.a'152 echo 153 echo 154 echo "# Compilation des membres de la bibliotheque lib"$diri".a"161 echo '.PRECIOUS : $(LIBO)/lib'$topdiri'.a' 162 echo 163 echo 164 echo "# Compilation of elements in $diri of library lib"$topdiri".a" 155 165 echo 156 166 for trufile in $listlib ; do … … 159 169 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 160 170 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 161 str1='$(LIBO)/lib'$ diri'.a('$fili'.o) : $(LIBF)/'$trufile171 str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile 162 172 [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 163 173 … … 175 185 strj=`echo $stri | tr [A-Z] [a-z]` 176 186 str2="" 177 for dirinc in filtrez bibio dyn3d_common grid dyn3d phydev $diri $diri/*/; do187 for dirinc in $src_dirs ; do 178 188 # Recherche dans l'ordre hierarchique inverse car seule la derniere 179 189 # ligne est conservee 180 if [ $dirinc = phydev ] ; then181 dirstr='$(PHYS)'182 libstr='phy$(PHYS)'183 else190 # if [ $dirinc = phydev ] ; then 191 # dirstr='$(PHYS)' 192 # libstr='phy$(PHYS)' 193 # else 184 194 dirstr=$dirinc 185 195 libstr=$dirinc 186 fi196 # fi 187 197 echo dirinc $dirinc >> $logfile 188 198 if [ -f $dirinc/$stri ] ; then … … 214 224 # object from library 215 225 echo ' cd $(LIBO); \' 216 echo ' $(AR) d $(LIBO)/lib'$ diri'.a '$fili'.o ; \'226 echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \' 217 227 if [ "$F90" -eq '0' ] ; then 218 228 ## Fixed Form Fortran 77 … … 228 238 fi 229 239 # Put generated object in library 230 echo ' $(AR) r $(LIBO)/lib'$ diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'240 echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 231 241 echo 232 242 done -
LMDZ5/trunk/makelmdz
r2202 r2238 84 84 PARA_LD="" 85 85 EXT_SRC="" 86 86 #src_dirs: directories containing source files 87 src_dirs="grid bibio" 87 88 ######################################################################## 88 89 # lecture des options … … 106 107 true : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6 107 108 [-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) 108 112 [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp 109 113 [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) … … 186 190 187 191 "-ext_src") 188 EXT_SRC=$2 ; s hift ; shift ;;192 EXT_SRC=$2 ; src_dirs="$src_dirs $EXT_SRC" ; shift ; shift ;; 189 193 190 194 "-arch") … … 283 287 then 284 288 #We'll use some physics 289 src_dirs="$src_dirs phy$physique" 285 290 CPP_KEY="$CPP_KEY CPP_PHYS" 286 291 if [[ "${physique:0:3}" == "lmd" ]] … … 316 321 echo "You should use option \"-mem\"." 317 322 exit 1 318 fi 323 fi 319 324 fi 320 325 … … 413 418 CPP_KEY="$CPP_KEY CPP_COSP" 414 419 COSP_PATH="$LIBFGCM/cosp" 420 src_dirs="$src_dirs cosp" 415 421 # LIB="${LIB} -l${LIBPREFIX}cosp" 416 422 opt_dep="$opt_dep cosp" … … 422 428 then 423 429 CPP_KEY="$CPP_KEY CPP_SISVAT" 430 src_dirs="$src_dirs phy${physique}/sisvat" 424 431 fi 425 432 … … 427 434 then 428 435 CPP_KEY="$CPP_KEY CPP_RRTM" 436 src_dirs="$src_dirs phy${physique}/rrtm" 429 437 fi 430 438 … … 489 497 490 498 if (( $dimc == 3 )) ; then 499 src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}" 491 500 cd $LIBFGCM/grid 492 501 \rm fxyprim.h … … 498 507 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d' 499 508 elif (( $dimc == 1 )) ; then 509 src_dirs="$src_dirs dyn3d dyn3d_common filtrez" 500 510 CPP_KEY="$CPP_KEY CPP_1D" 501 511 filtre="L_DYN= DYN= FILTRE= L_FILTRE= DIRMAIN=phy$physique " … … 539 549 cd $LMDGCM 540 550 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 ]] 551 find libf -name '*.[Fh]' -print | sort > tmp77 552 #find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print > tmp90 553 find libf -name '*.F90' -print | sort > tmp90 554 555 if [[ -r .makelmdz ]] 556 then 557 old_lmdz_configuration=$(cat .makelmdz ) 558 else 559 old_lmdz_configuration="" 560 fi 561 lmdz_configuration="$src_dirs" 562 if [[ "$lmdz_configuration" != "$old_lmdz_configuration" ]] 563 then 564 configuration_change="true" 565 else 566 configuration_change="false" 567 fi 568 569 if [[ $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 ]] 546 570 then 547 571 echo "les fichiers suivants ont ete crees ou detruits" … … 551 575 \cp -f tmp77 liste_des_sources_f77 552 576 \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 555 580 \mv -f tmp makefile 556 echo "Nouveau makefile cree" 557 fi 581 echo "New makefile created" 582 fi 583 584 #Create a .makelmdz file containing main compilation option for later comparisons 585 echo "$lmdz_configuration" > .makelmdz 558 586 559 587 ################################################################# -
LMDZ5/trunk/makelmdz_fcm
r2202 r2238 78 78 true : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6 79 79 [-chimie INCA/false] : with INCA chemistry model or without (default: false) 80 [-cosp true/false] : compile with/without cosp package (default: false) 81 [-sisvat true/false] : compile with/without sisvat package (default: false) 82 [-rrtm true/false] : compile with/without rrtm package (default: false) 80 83 [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp 81 84 [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom)
Note: See TracChangeset
for help on using the changeset viewer.