#!/bin/bash # # This script compiles UNL-VRTM source code. # xxu, 9/27/2018 # #----------------------------------------------------------------------- # CHANGES SHOULD BE MADE BY USER (VERY IMPORTANT!) #----------------------------------------------------------------------- # 1. Specify/load compiler and netcdf library compiled with intel fortran # (Note: NETCDF_PATH is The netcdf folder containing 'include/' and 'lib/' # For argon@uiow #module load netcdf-fortran/4.4.4_parallel_studio-2017.1 #export NETCDF_PATH=$ROOT_NETCDF_FORTRAN # for Taki #module load intel/2018b #module load netCDF-Fortran/4.4.4-intel-2018b #export NETCDF_PATH=$EBROOTNETCDFMINFORTRAN module load license_intel module load intel/20.0.2 module load netcdf4/4.7.4 # For orchid-submit only export NETCDF_PATH=/opt/netcdf4/4.7.4-intel-20.0.2 # for NASA pfe #module load comp-intel/2015.3.187 #module load hdf4/4.2.12 #module load hdf5/1.8.18_serial #module load netcdf/4.4.1.1_serial #export NETCDF_PATH=$NETCDF # 2. Specify where the unlvrtm.exe be generated DIRRUN=./run if [ ! -d "$DIRRUN" ]; then mkdir $DIRRUN fi #----------------------------------------------------------------------- # NO CHANGE SHOULD BE MADE BELOW THIS LINE! #----------------------------------------------------------------------- # Read prompt echo ' ' echo 'Please select one of the following options:' echo ' ' echo ' 1. Fresh and full compilation' echo ' 2. Qucik re-compilation' echo ' 3. Full compilation, debug on' echo ' 4. Qucik re-compilation, debug on' echo ' 0. Fully clean up the compilation' echo ' ' option= while [[ $option = "" ]];do echo -n 'Enter option (0-4) and press [ENTER]: ' read option done echo ' ' echo ' You entered option: '$option # Setting the compilation option Debug=NO if [ $option == "1" ]; then echo ' Now, fresh and full compilation ...' FullyClean=YES Compile=YES elif [ $option == "2" ]; then echo ' Now, qucik re-compilation ...' FullyClean=NO Compile=YES elif [ $option == "3" ]; then echo ' Now, full compilation with debug on ...' FullyClean=YES Compile=YES Debug=YES elif [ $option == "4" ]; then echo ' Now, qucik re-compilation, with debug on ...' FullyClean=NO Compile=YES Debug=YES elif [ $option == "0" ]; then echo ' Now, clean up compilations ...' FullyClean=YES Compile=NO else echo ' ' echo ' *** Ops, not a valid option!!!' echo ' *** Nothing done, and exit!!!' echo ' ' exit fi echo '' # unlimited memory and enable large stack size ulimit -s unlimited export KMP_STACKSIZE=9209715200 # Directories DIRROOT=`pwd` DIRSRC=$DIRROOT/src # Cleanup if [ $FullyClean = 'YES' ]; then cd $DIRSRC make clean -f Makefile cd $DIRROOT if [ -f $DIRRUN/unlvrtm.exe ]; then rm -rf $DIRRUN/unlvrtm.exe fi echo "objects in src/ are cleaned up ..." fi # Compile if [ $Compile = 'YES' ]; then cd $DIRSRC make DEBUG=$Debug -f Makefile cd $DIRROOT cp -vf $DIRSRC/unlvrtm.exe $DIRRUN echo else exit fi