#!/bin/csh set verbose echo set is_parallel_opt = FALSE set is_driver_opt = FALSE set is_arch_opt = FALSE set is_compile_opt = FALSE set default_compile_flags = "%PROD_FFLAGS" set fcm_path=none top: if ($#argv > 0) then switch ($1) case -h ######################################################################## # Manuel en ligne ######################################################################## more <> is missing, exiting...." exit endif if ( -e arch/arch-${arch}.path ) then rm -f arch.path ln -s arch/arch-${arch}.path arch.path else echo "architecture file : << arch/arch-${arch}.path >> is missing, exiting...." exit endif else echo "Warning : architecture not specified, taking default file <> and <>" if ( ! -e arch.fcm ) then echo "architecture file : << arch.fcm >> is missing, exiting...." exit endif if ( ! -e arch.fcm ) then echo "architecture file : << arch.path >> is missing, exiting...." exit endif endif # set compiler flags set FFLAGS="%BASE_FFLAGS" set LD_FFLAGS="%LD_BASE" set CPP_KEY="%FPP_DEF" # set compiler flags for optimisation if ( $is_compile_opt == FALSE ) then set compile_flags=$default_compile_flags endif set FFLAGS=${FFLAGS}" "$compile_flags # set compiler flags for parallelism if ( $is_parallel_opt == TRUE ) then echo $parallel switch ($parallel) case mpi case MPI set FFLAGS="${FFLAGS} %MPI_FFLAGS" set LD_FFLAGS="%MPI_LD ${LD_FFLAGS}" set CPP_KEY="CPP_PARA ${CPP_KEY}" breaksw case omp case OMP set FFLAGS="${FFLAGS} %OMP_FFLAGS" set LD_FFLAGS="%OMP_LD ${LD_FFLAGS}" set CPP_KEY="CPP_OMP CPP_PARA ${CPP_KEY}" breaksw case mpi_omp case MPI_OMP set FFLAGS="${FFLAGS} %MPI_FFLAGS %OMP_FFLAGS" set LD_FFLAGS="%MPI_LD %OMP_LD ${LD_FFLAGS}" set CPP_KEY="CPP_OMP CPP_PARA ${CPP_KEY}" breaksw default echo "unknown option for parallelism :$parallel , only <>, <> or <>, <> or <> <> allowed , exiting..." exit endsw endif # set target set TARGET = liborchidee.a if ( $is_driver_opt == TRUE) then set TARGET="liborchidee_ol.a dim2_driver.exe teststomate.exe forcesoil.exe" endif source ./arch.path # build config file set config_fcm="config.fcm" rm -f $config_fcm echo "%FFLAGS $FFLAGS" > $config_fcm echo "%CPP_KEY $CPP_KEY" >> $config_fcm echo "%EXEC $TARGET" >> $config_fcm echo "%LD_FFLAGS $LD_FFLAGS" >> $config_fcm echo "%INCDIR -I$NETCDF_INCDIR -I$IOIPSL_INCDIR" >> $config_fcm echo "%LIBDIR -L$NETCDF_LIBDIR -L$IOIPSL_LIBDIR" >> $config_fcm fcm build