#!/bin/bash #Following the procedures at: #http://www.drjack.info/twiki/bin/view/RASPop/ProgramInstall #be sure we have a fetching program #wget is preferrred #fetch or curl or lynx will do logfile=$BASEDIR/install.log echo " " >>$logfile echo " " >>$logfile echo " " >>$logfile echo $(date) >>$logfile echo " " >>$logfile echo " " >>$logfile echo " " >>$logfile if [[ -s /usr/bin/wget || -s /bin/wget || -s /usr/local/bin/wget ]] then fetcher="wget -O -" else if [[ -s /usr/bin/fetch || -s /bin/fetch || -s /usr/local/bin/fetch ]] then fetcher="fetch" else if [[ -s /usr/bin/curl || -s /bin/curl || -s /usr/local/bin/curl ]] then fetcher="curl" fi fi fi echo "$fetcher will be the program used to fetch rasp's needed programs and data." echo "$fetcher will be the program used to fetch rasp's needed programs and data." >>$logfile echo " " >>$logfile echo " " >>$logfile which perl haveperl=$? if [[ $haveperl -eq 0 ]] then echo "perl appears to be installed properly as $(which perl)" echo "perl appears to be installed properly as $(which perl)" >>$logfile echo $(perl -v) >>$logfile echo " " >>$logfile echo " " >>$logfile else echo " " >>$logfile echo "Woa! Halt! Arrete! Stop! Before you start anything else, you must install perl. The RASP scripts are written in perl and perl is needed by the wrf_tool." echo "Woa! Halt! Arrete! Stop! Before you start anything else, you must install perl. The RASP scripts are written in perl and perl is needed by the wrf_tool." >>$logfile echo " " >>$logfile exit fi #Create $BASEDIR environmental variable #The "BASE" directory name is used so often that it is best to create an environmental variable for it using the bash command "export BASEDIR=/home/youraccount/YOURBASENAME" so it will be inserted whenever $BASEDIR is used in the install commands below - otherwise you will have to type it manually each time. Remember that this must be done for each window you work in. You may want to add that command to your $HOME/.bashrc file so that $BASEDIR will also be available to you in later sessions. You can also put this and other environment variables in a SpecialShellEnvironment in order to make things easier to manage. export BASEDIR=$(PWD) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BASEDIR/UTIL/PGI export NETCDF=$BASEDIR/UTIL/NETCDF export NCARG_ROOT=$BASEDIR/UTIL/NCARG export NCL_COMMAND=$NCARG_ROOT/bin/ncl export PATH=$PATH:$BASEDIR/UTIL export EXT_DATAROOT=$BASEDIR/WRF/wrfsi/extdata export SOURCE_ROOT=$BASEDIR/WRF/wrfsi export INSTALLROOT=$BASEDIR/WRF/wrfsi export GEOG_DATAROOT=$BASEDIR/WRF/wrfsi/extdata/GEOG export DATAROOT=$BASEDIR/WRF/wrfsi/domains echo "BASEDIR=$BASEDIR" echo "EXT_DATAROOT=$EXT_DATAROOT" echo "SOURCE_ROOT=$SOURCE_ROOT" echo "INSTALLROOT=$INSTALLROOT" echo "GEOG_DATAROOT=$GEOG_DATAROOT" echo "DATAROOT=$DATAROOT" echo "NCARG_ROOT=$NCARG_ROOT" echo "NETCDF=$NETCDF" echo "NCL_COMMAND=$NCL_COMMAND" # rangs http://www.io-warnemuende.de/public/phy/rfeistel/index.htm #if [[ -z $BASEDIR || -z $EXT_DATAROOT || -z $SOURCE_ROOT || -z $INSTALLROOT || -z $GEOG_DATAROOT || -z $DATAROOT || -z $NCARG_ROOT || -z $NETCDF || -z $NCL_COMMAND ]] #then echo " " echo " " >>$logfile echo "You need to set all the above variables in your environment everytime you run RASP." echo "You need to set all the above variables in your environment everytime you run RASP." >>$logfile echo "To make it always available put lines like 'export BASEDIR=/home/myaccount/DRJACK' into your .bashrc file." echo "To make it always available put lines like 'export BASEDIR=/home/myaccount/DRJACK' into your .bashrc file." >>$logfile echo " You should also put it in your crontab file." echo " You should also put it in your crontab file." >>$logfile echo "BASEDIR=$BASEDIR" >>$logfile echo "EXT_DATAROOT=$EXT_DATAROOT" >>$logfile echo "SOURCE_ROOT=$SOURCE_ROOT" >>$logfile echo "INSTALLROOT=$INSTALLROOT" >>$logfile echo "GEOG_DATAROOT=$GEOG_DATAROOT" >>$logfile echo "DATAROOT=$DATAROOT" >>$logfile echo "NCARG_ROOT=$NCARG_ROOT" >>$logfile echo "NETCDF=$NETCDF" >>$logfile echo "NCL_COMMAND=$NCL_COMMAND" >>$logfile cd $BASEDIR $fetcher http://www.drjack.info/RASP/DOWNLOAD/index.html | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/rasp_scripts.tar.gz | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/README.rasp_scripts $fetcher http://www.drjack.info/RASP/DOWNLOAD/rasp_ncl.tar.gz | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/README.rasp_ncl | $fetcher http://www.drjack.info/RASP/DOWNLOAD/wrf_execs.tar.gz | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/README.wrf_execs $fetcher http://www.drjack.info/RASP/DOWNLOAD/wrfsi_misc.tar.gz | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/README.wrfsi_misc $fetcher http://www.drjack.info/RASP/DOWNLOAD/wrfsi_gui.tar.gz | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/README.wrfsi_gui $fetcher http://www.drjack.info/RASP/DOWNLOAD/drjack_utils.tar.gz | tar xvzf - $fetcher http://www.drjack.info/RASP/DOWNLOAD/README.drjack_utils $fetcher http://www2008.io-warnemuende.de/homepages/rfeistel/download/rangs(0).zip $fetcher http://www.drjack.info/RASP/DOWNLOAD/ncl.Linux_i686_gcc4.tar.gz | tar xvzf echo "DrJack's version of NCL is being installed. You will have to upgrad if you want to use the windgram scripts." >>$logfile convertver=$(convert -version |grep [0-9] |grep -v Studio |sed -e 's/^[^0-9]*//' -e 's/ .*$//') if[[ $convertver -gt 5.5.7 ]] echo "You have a more recent version of ImageMagick installed. You can use convert from that if you prefer" echo "You have a more recent version of ImageMagick installed. You can use convert from that if you prefer" >>$logfile fi ## index.html #tar -xzvf rasp_scripts.tar.gz #tar -xzvf README.rasp_scripts #tar -xzvf rasp_ncl.tar.gz #tar -xzvf README.rasp_ncl #tar -xzvf wrf_execs.tar.gz #tar -xzvf README.wrf_execs #tar -xzvf wrfsi_misc.tar.gz #tar -xzvf README.wrfsi_misc #tar -xzvf wrfsi_gui.tar.gz #tar -xzvf README.wrfsi_gui #tar -xzvf drjack_utils.tar.gz #tar -xzvf README.drjack_utils ## Andrea Barcelona uses these: #sudo apt-get install \ # netcdf-bin \ # ia32-libs \ # for 64bit systems # libproc-background-perl \ # curl \ # gdal-bin \ # imagemagick \ # mmv \ ################################3 # may need jasper libraries # http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-1.900.1.zip # may need http://www.libpng.org/pub/png/libpng.html # X11 development libraries also need to be installed for something... # ######################################## ## Download and install 32bit libpng #curl -O http://frozenfox.freehostia.com/cappy/getlibs-all.deb #sudo dpkg -i getlibs-all.deb #sudo getlibs -l libpng12.so.0 # ##sudo apt-get install \ ## netcdf-bin \ ##ia32-libs \ ##zip \ ##libproc-background-perl \ #nfs-kernel-server \ #bc \ #curl \ #gdal-bin \ #htop \ #iftop \ #imagemagick \ #inadyn \ #lm-sensors \ #lshw \ #mmv \ #ncftp \ #php5-gd \ #php5-cli \ #rsync \ #wput \ #ntfs-3g ################################################### # This is a shell script, if your file is called "$fetcher_geog.shx" rename # it to $fetcher_geog.sh, chmod +x $fetcher_geog.sh, then run. This script will # create a directory called 'GEOG/' containing all the geography necessary # for the WRF SI. ########################### if [[ $firsttime -eq "1" ]] then mkdir $BASEDIR/WRF/wrfsi/extdata mkdir $BASEDIR/WRF/wrfsi/extdata/GEOG cd $BASEDIR/WRF/wrfsi/extdata/GEOG $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/islope.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/greenfrac.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/maxsnowalb.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/albedo_ncep.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltemp_1deg.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/landuse_30s/landuse_30s.NE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/landuse_30s/landuse_30s.NW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/landuse_30s/landuse_30s.SE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/landuse_30s/landuse_30s.SW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_bot_30s/soiltype_bot_30s.NW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_bot_30s/soiltype_bot_30s.NE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_bot_30s/soiltype_bot_30s.SE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_bot_30s/soiltype_bot_30s.SW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_top_30s/soiltype_top_30s.NW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_top_30s/soiltype_top_30s.NE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_top_30s/soiltype_top_30s.SE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/soiltype_top_30s/soiltype_top_30s.SW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/topo_30s/topo_30s.NE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/topo_30s/topo_30s.NW.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/topo_30s/topo_30s.SE.tar.gz | tar xvzf - $fetcher -O - ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data/topo_30s/topo_30s.SW.tar.gz | tar xvzf - fi ########################### cd $BASEDIR/WRF/wrfsi/JACK ./edit.wrfsi_hardwired_basedirs.pl cd $BASEDIR/WRF/wrfsi/gui perl install_gui.pl --source_root=$SOURCE_ROOT --installroot=$INSTALLROOT perl -e 'use lib' haslib=$(echo $?) if [[ $haslib -eq 0 ]] then echo "perl module lib is installed and will be used to change the @inc path for perl modules." > else echo "perl module lib is not installed. You need to find a way to add libraries to the perl @inc path. The usual way is to use lib.pm" fi # these are the hardired files that should end up with your new $BASEDIR in them. # @filelist= ( "config_paths", "wrf_tools", "gui/guiTk/ui_system_tools.pl", "etc/localize_domain.pl", "etc/generate_images.pl", "graphics/ncl/generate_images.pl", "data/static/wrfsi.nl", "templates/default/dataroot.txt", "templates/default/wrfsi.nl" ); #push @filelist, ( 'src/include/makefile.inc' ); gccver=$(gcc --version |grep [34] |sed -e 's/^[^0-9]*//' -e 's/\..*$//') gccverlong=$(gcc --version |grep [34] |sed -e 's/^[^0-9]*\([0-9\.]*\)/\1/' -e 's/ 20.*$//') echo $gccver >> $logfile echo $gccver echo $gccverlong >> $logfile echo $gccverlong #if[[ $gccver -eq 4 ]] #then #cd $NCARG_ROOT # ncl_ncarg-5.2.1.Linux_i686_nodap_gcc432.tar.gz # tar -xzvf ncl.Linux_i686_gcc4.tar.gz #fi ## libpng should be taken care of by having the TK module installed... #curl and libcurl #gzip #zip # #*Install X11 developer libraries and includefiles #Downloadandbuildnon-optionalexternalsoftware ### see http://www.ncl.ucar.edu/Download/build_from_src.shtml #* JPEG #* ZLIB #* NetCDF #o szip #o HDF-5 #3o libcurl #* HDF-4 #Downloadandbuildoptionalexternalsoftware from NCL folks #* GRIB2 # o Jasper # o g2clib #* GDAL/PROJ.4 # o PROJ.4 # o GDAL #* HDF-EOS2 # o gctp #* HDF-EOS5 # o szip # o HDF-5 #* cairo # o PNG # o pkg-config # o fontconfig # o FreeType # o pixman # o expat #* Triangle #* UDUNITS-2 #* Vis5D+ # # # #need devel" XFree86 (X11) #need perl #need cpan #need imagemagick for convert #need jasper for png libraries #need some gcc compiler and runtime libraries # libg2c.so.0 fortran compatibility from compat-glibf2c # compat-libf2c-xx.i386 which cpan havecpan=$? if [[ $havecpan -eq 0 ]] then echo "cpan appears to be installed properly as $(which cpan)" >>$logfile echo "cpan appears to be installed properly as $(which cpan)" else echo "You must install Tk perl module needed by the wrf_tools gui normally this is done using cpan, but it is not installed." exit fi perl -e 'use Tk' haveTk=$? if [[ $haveTk -eq 0 ]] then echo "Tk appears to be installed properly" echo "Tk appears to be installed properly" >>$logfile else echo "Running cpan to install Tk perl module needed by the wrf_tools gui" fi perl -e 'use Proc::Background' haveprbkg=$? if [[ $haveprbkg -eq 0 ]] then echo "Proc::Background appears to be installed properly" echo "Proc::Background appears to be installed properly" >>$logfile else echo "You must install perl module Proc::Background before running RASP.pl " echo " " >>$logfile echo "You must install perl module Proc::Background before running RASP.pl " >>$logfile echo " " >>$logfile fi nclversion=$(ncl -V) echo "You have ncl version "$nclversion " installed" >>$logfile echo "You have ncl version "$nclversion " installed" #window time step must be an integer factor of 3600 2*3 *2*3 *2*5 *2*5 2*2*2*2 * 3*3 * 5*5 #12 15 18 20 24 25 30 36 40 45 48 50 #16 #25 #9 # 6 12 18 24 30 36 48 60 72 90 96 144 # 5 19 15 20 25 30 40 45 50 60 75 80 100 120 150 180 200 360 400 450 720 #Setup NetCDF #Create a link to where the WRF executables expect to find the NetCDF executables: " ls /usr/local/netcdf/ncgen havencgen=$? if [[ $havencgen -eq 0 ]] then echo "Netcdf is properly linked to $(ls /usr/local/netcdf/ncgen) " >>$logfile echo "Netcdf is properly linked to $(ls /usr/local/netcdf/ncgen) " exit else echo "linking /usr/local/netcdf as $BASEDIR/UTIL/NETCD" echo "linking /usr/local/netcdf as $BASEDIR/UTIL/NETCD" >>$logfile ln -s $BASEDIR/UTIL/NETCDF /usr/local/netcdf fi echo "the following is at the end of the file getneed_utilities.txt and can be modified to install SSE aware versions of wrf.exe the main modeling program." echo " If you have an i7 cpu then you should get and install the iz binaries." echo " " tail -20 getneeded_utilities.txt |sed -e 's*^*echo "*g' -e 's*$*"*g' >tmp cat tmp echo "Setting up a new domain using wrf_tools" echo " " echo " For more information on Grid Creation see: http://www.drjack.info/twiki/bin/view/RASPop/ProgramGridCreation " echo " " echo " " cd $BASEDIR/WRF/wrfsi wrf_tools echo " You should now run the script \"create_new_domain\" " exit # To install the wrf.exe SSE aware binaries Binaries issue the following commands to match your system. cd $BASEDIR $fetcher http://www.drjack.info/twiki/pub/RASPop/IfortCompile32/wrf-i386-sse3-binaries.tar.gz |tar xzvf - $fetcher http://www.drjack.info/twiki/pub/RASPop/IfortCompile32/wrf-corei7-sse4.2-binaries.tar.gz |tar xzvf - ## install the optimized wrf.exe file mv $BASEDIR/WRF/WRFV2/main/wrf.exe $BASEDIR/WRF/WRFV2/main/wrf.exe.drjack #tar -xvf $BASEDIR/wrf-i386-sse3-binaries.tar.gz cp ./wrf-i386-sse3-binaries/bin/wrf.exe $BASEDIR/WRF/WRFV2/main/ cp ./wrf-i386-sse3-binaries/lib/libguide.so /usr/lib/ #, so it can be re-enabled should the #alternative binary not work for your system. Copy the alternative wrf.exe #into directory $BASEDIR/WRF/WRFV2/main (retaining the existing real.exe and #ndown.exe executables). Copy file mv $BASEDIR/UTIL/PGI/libguide.so $BASEDIR/UTIL/PGI/libguide.so.jacknosse cp ./wrf-i386-sse3-binaries/lib/libguide.so $BASEDIR/UTIL/PGI/