Changeset 2298 for LMDZ5/branches/testing/makelmdz
- Timestamp:
- Jun 14, 2015, 9:13:32 PM (10 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2238-2257,2259-2271,2273,2277-2282,2284-2288,2290-2291
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/makelmdz
r2220 r2298 77 77 78 78 CPP_KEY="" 79 INCLUDE='-I$(LIBF)/grid -I$(LIBF)/ bibio-I$(LIBF)/filtrez -I. '79 INCLUDE='-I$(LIBF)/grid -I$(LIBF)/misc -I$(LIBF)/filtrez -I. ' 80 80 LIB="" 81 81 adjnt="" … … 84 84 PARA_LD="" 85 85 EXT_SRC="" 86 86 #src_dirs: directories containing source files 87 src_dirs="grid misc" 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") … … 280 284 for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done 281 285 286 phys_root=$physique 287 if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi 288 if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi 289 if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi 290 if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi 291 if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi 292 if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi 293 if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi 294 282 295 if [[ "$physique" != "nophys" ]] 283 296 then 284 297 #We'll use some physics 298 src_dirs="$src_dirs phy$physique" 299 LIBPHY='$(LIBO)/libphy'"$physique"'.a' 300 lib_phy='-lphy'"$physique" 285 301 CPP_KEY="$CPP_KEY CPP_PHYS" 286 if [[ "${physique:0:3}"== "lmd" ]]287 then288 #For lmd physics, default planet type is Earth289 CPP_KEY="$CPP_KEY CPP_EARTH"302 if [[ $phys_root == "lmd" ]] 303 then 304 #For lmd physics, default planet type is Earth 305 CPP_KEY="$CPP_KEY CPP_EARTH" 290 306 fi 291 307 fi … … 316 332 echo "You should use option \"-mem\"." 317 333 exit 1 318 fi 334 fi 319 335 fi 320 336 … … 412 428 then 413 429 CPP_KEY="$CPP_KEY CPP_COSP" 414 COSP_PATH="$LIBFGCM/cosp" 430 COSP_PATH="$LIBFGCM/phylmd/cosp" 431 src_dirs="$src_dirs cosp" 415 432 # LIB="${LIB} -l${LIBPREFIX}cosp" 416 433 opt_dep="$opt_dep cosp" … … 422 439 then 423 440 CPP_KEY="$CPP_KEY CPP_SISVAT" 441 src_dirs="$src_dirs phy${physique}/sisvat" 424 442 fi 425 443 … … 427 445 then 428 446 CPP_KEY="$CPP_KEY CPP_RRTM" 447 src_dirs="$src_dirs phy${physique}/rrtm" 429 448 fi 430 449 … … 489 508 490 509 if (( $dimc == 3 )) ; then 510 src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}" 511 if [[ $physique != "nophys" ]] ; then 512 src_dirs="$src_dirs dynlonlat_phylonlat dynlonlat_phylonlat/phy${phys_root}" 513 libdyn_phy="-ldynlonlat_phylonlat" 514 LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 515 INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat' 516 INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat/'"phy${phys_root}" 517 fi 491 518 cd $LIBFGCM/grid 492 519 \rm fxyprim.h … … 495 522 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d${FLAG_PARA} -I$(LIBF)/dyn3d_common ' 496 523 elif (( $dimc == 2 )) ; then 524 src_dirs="$src_dirs dyn2d" 497 525 filtre="FILTRE= L_FILTRE= " 498 526 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d' 499 527 elif (( $dimc == 1 )) ; then 528 #src_dirs="$src_dirs dyn3d dyn3d_common filtrez" 529 src_dirs="$src_dirs phy${physique}/dyn1d" 500 530 CPP_KEY="$CPP_KEY CPP_1D" 501 filtre="L_DYN= DYN= FILTRE= L_FILTRE= DIRMAIN=phy$physique " 502 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre 531 filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 532 #INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre 533 INCLUDE="$INCLUDE "' -I$(LIBF)/phy'"$physique"'/dyn1d' 503 534 else 504 535 echo Dimension dimc=$dimc pas prevu ; exit … … 539 570 cd $LMDGCM 540 571 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 ]] 572 573 if [[ -r .makelmdz ]] 574 then 575 old_lmdz_configuration=$(cat .makelmdz ) 576 else 577 old_lmdz_configuration="" 578 fi 579 lmdz_configuration="$src_dirs" 580 if [[ "$lmdz_configuration" != "$old_lmdz_configuration" ]] 581 then 582 configuration_change="true" 583 else 584 configuration_change="false" 585 fi 586 587 mkdir -p make_dir 588 suf_make=`echo $src_dirs | sed -e 's/\//_/g' -e 's/ /_/g'` 589 echo suf_make $suf_make 590 591 \rm tmp77 tmp90 592 for dir in $src_dirs ; do 593 find libf/$dir -name '*.[Fh]' -print | sort >> tmp77 594 find libf/$dir -name '*.F90' -print | sort >> tmp90 595 done 596 597 liste77=make_dir/liste_des_sources_f77_$suf_make 598 liste90=make_dir/liste_des_sources_f90_$suf_make 599 makefile=make_dir/makefile_$suf_make 600 601 if [[ $configuration_change == "true" || ! ( -r $makefile ) || ! ( -r $liste90 ) || ! ( -r $liste77 ) || ` diff tmp77 $liste77 | wc -w ` -ne 0 || ` diff tmp90 $liste90 | wc -w ` -ne 0 ]] 546 602 then 547 603 echo "les fichiers suivants ont ete crees ou detruits" 548 604 echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90" 549 diff liste_des_sources_f77 tmp77 550 diff liste_des_sources_f90 tmp90 551 \cp -f tmp77 liste_des_sources_f77 552 \cp -f tmp90 liste_des_sources_f90 553 echo "on recree le makefile" 554 ./create_make_gcm > tmp 555 \mv -f tmp makefile 556 echo "Nouveau makefile cree" 557 fi 605 diff $liste77 tmp77 606 diff $liste90 tmp90 607 \cp -f tmp77 $liste77 608 \cp -f tmp90 $liste90 609 echo "Recreating the makefile" 610 echo "src_dirs: $src_dirs" 611 ./create_make_gcm $src_dirs > tmp 612 \mv -f tmp $makefile 613 echo "New makefile created" 614 fi 615 616 ln -sf $makefile makefile 617 618 #Create a .makelmdz file containing main compilation option for later comparisons 619 echo "$lmdz_configuration" > .makelmdz 558 620 559 621 ################################################################# … … 562 624 563 625 source_code=${code}.F 626 dirmain=dyn${dimc}d${FLAG_PARA} 564 627 if [[ -r $LMDGCM/libf/dyn${dimc}d${FLAG_PARA}/${code}.F90 ]] 565 628 then 566 629 source_code=${code}.F90 567 630 elif [[ -r $LMDGCM/libf/phy$physique/${code}.F90 ]] ; then 631 dirmain=phy$physique 632 source_code=${code}.F90 633 elif [[ -r $LMDGCM/libf/dynlonlat_phylonlat/phy$phys_root/${code}.F90 ]] ; then 634 dirmain="dynlonlat_phylonlat/phy${phys_root}" 635 source_code=${code}.F90 636 elif [[ -r $LMDGCM/libf/phy$physique/dyn1d/${code}.F90 ]] ; then 637 dirmain=phy$physique/dyn1d 568 638 source_code=${code}.F90 569 639 fi … … 619 689 LIBO=${LIBOGCM}/${nomlib} \ 620 690 "PHYS=$physique" \ 691 LIBPHY=${LIBPHY} \ 692 LIBDYN_PHYS=${LIBDYN_PHYS} \ 621 693 DIM=$dimc \ 622 694 FLAG_PARA=$FLAG_PARA \ 695 L_PHY="$lib_phy" \ 696 L_DYN_PHY="$libdyn_phy" \ 623 697 L_ADJNT=$adjnt \ 624 698 L_COSP="$lcosp" \ … … 633 707 MOD_SUFFIX="mod" \ 634 708 AR=$arcommand \ 709 DIRMAIN=$dirmain \ 635 710 SOURCE=$source_code \ 636 711 PROG=$code … … 645 720 LIBO=${LIBOGCM}/${nomlib} \ 646 721 "PHYS=$physique" \ 722 LIBPHY=${LIBPHY} \ 723 LIBDYN_PHYS=${LIBDYN_PHYS} \ 647 724 DIM=$dimc \ 648 725 FLAG_PARA=$FLAG_PARA \ 726 L_PHY="$lib_phy" \ 727 L_DYN_PHY="$libdyn_phy" \ 649 728 L_ADJNT=$adjnt \ 650 729 L_COSP="$lcosp" \ … … 659 738 MOD_SUFFIX="mod" \ 660 739 AR=$arcommand \ 740 DIRMAIN=$dirmain \ 661 741 SOURCE=$source_code \ 662 742 PROG=$code
Note: See TracChangeset
for help on using the changeset viewer.