source: codes/icosagcm/trunk/make_icosa @ 41

Last change on this file since 41 was 28, checked in by ymipsl, 12 years ago

update of bld.cfg and make_icosa for parallelism

YM

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2set -x
3export PATH=$PWD/tools/FCM/bin:$PATH
4
5compil_mode_defined="FALSE"
6compil_mode="prod"
7
8arch_defined="FALSE"
9parallel_defined="FALSE"
10arch=""
11parallel="none"
12CPP_KEY="CPP_NONE" 
13
14while (($# > 0))
15  do
16  case $1 in
17      "-h") cat <<fin
18Usage :
19makegcm [options] -m arch exec
20[-h]                       : help
21[-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug .
22 -arch nom_arch            : nom de l\'architecture cible
23fin
24          exit;;
25
26      "-prod")
27          compil_mode="prod" ; shift ;;
28
29      "-dev")
30          compil_mode="dev" ; shift ;;
31
32      "-debug")
33          compil_mode="debug" ; shift ;;
34
35      "-arch")
36          arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
37
38      "-parallel")
39          parallel=$2 ; parallel_defined="TRUE"; shift ; shift ;;
40
41      *)
42          code="$1" ; shift ;;
43  esac
44done
45
46rm -f .void_file
47echo > .void_file
48rm -rf .void_dir
49mkdir .void_dir
50
51if [[ "$arch_defined" == "TRUE" ]]
52then
53  rm -f arch.path
54  rm -f arch.fcm
55  rm -f arch.env
56  ln -s arch/arch-${arch}.path ./arch.path
57  ln -s arch/arch-${arch}.fcm  ./arch.fcm
58  if test -f arch/arch-${arch}.env
59    then
60      ln -s arch/arch-${arch}.env arch.env
61    else
62      ln -s .void_file arch.env
63    fi
64  source arch.env
65  source arch.path
66else
67  echo "Veuillez definir une architecture cible"
68  exit 1
69fi
70
71if [[ "$compil_mode" == "prod" ]]
72then
73  COMPIL_FFLAGS="%PROD_FFLAGS"
74elif [[ "$compil_mode" == "dev" ]]
75then
76  COMPIL_FFLAGS="%DEV_FFLAGS"
77elif [[ "$compil_mode" == "debug" ]]
78then
79  COMPIL_FFLAGS="%DEBUG_FFLAGS"
80fi
81
82if [[ "$parallel" == "mpi" ]]
83then
84  CPP_KEY="$CPP_KEY CPP_USING_MPI"
85elif [[ "$parallel" == "none" ]]
86then
87  parallel="none"
88else
89  echo "-parallel value $parallel is invalid, only permited <none> or <mpi>"
90  exit 1
91fi
92
93ICOSA_LIB="$NETCDF_LIBDIR $HDF5_LIBDIR $NETCDF_LIB $HDF5_LIB"
94
95rm -f config.fcm
96
97echo "%COMPIL_FFLAGS $COMPIL_FFLAGS $NETCDF_INCDIR" >> config.fcm
98echo "%CPP_KEY $CPP_KEY" >> config.fcm
99echo "%LIB $ICOSA_LIB">> config.fcm
100
101./build
Note: See TracBrowser for help on using the repository browser.