Advertisement
Guest User

SMOKE installation

a guest
Nov 12th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.43 KB | None | 0 0
  1. #!/bin/csh
  2. ## Installing SMOKE model
  3. ## IMPORTANT:: Please run this script on csh / tcsh shell (bash shell will not work)
  4. ## This script has been modified to run on Eddy@gcm1.gist.ac.kr
  5. ## Make proper changes in the linking section
  6. ##_____________________________________________________________________________________________________________
  7. echo "The SMOKE model home directory will be -"
  8. mkdir SMOKE
  9. cd SMOKE/
  10. echo $cwd
  11. ## Downloading the required scripts, Source code and Data
  12. echo "Downloading required files and this should not take long."
  13. echo "Thank you for understanding."
  14. wget ftp://ftp.unc.edu/pub/cmas/SOFTWARE/MODELS/SMOKE/3.5/smoke_install.csh
  15. wget ftp://ftp.unc.edu/pub/cmas/SOFTWARE/MODELS/SMOKE/3.5/MOVES_Processing_Scripts_SMOKEv35_Mar2013.zip
  16. wget ftp://ftp.unc.edu/pub/cmas/SOFTWARE/MODELS/SMOKE/3.5/smoke_v35.nctox.data.tar.gz
  17. wget ftp://ftp.unc.edu/pub/cmas/SOFTWARE/MODELS/SMOKE/3.5/smoke_v35.Linux2_x86_64pg.tar.gz
  18. ## setting important env variable
  19. setenv SMK_HOME $cwd
  20. source smoke_install.csh
  21. cd $SMK_HOME/scripts/
  22. ## Determining OS for compilation
  23. cat > platform << EOF
  24. #!/bin/csh -f
  25. #***************************************************************************
  26. #
  27. # COPYRIGHT (C) 2006, Carolina Environmental Program - UNC Chapel Hill
  28. # All Rights Reserved
  29. #
  30. # See file COPYRIGHT for conditions of use.
  31. #
  32. # Center for Environmental Modeling for Policy Development
  33. # Carolina Environmental Program
  34. # University of North Carolina
  35. # 137 E. Franklin St., CB# 6116
  36. # Chapel Hill, NC  27599-6116
  37. #
  38. # smoke@unc.edu
  39. #
  40. # Last Updated: 9-25-06
  41. #***************************************************************************
  42. #
  43. # Purpose: Configure platform settings for running and compiling SMOKE
  44. #
  45. # Usage Notes: <include hardware and operating system restrictions>
  46. #
  47. #   Script must be executed by "source platform" to set
  48. #   the environment variables in the parent.
  49. #
  50. # History of Major Revisions: (in reverse chronological order)
  51. #
  52. # Date: Unknown
  53. #   Ted Smith        Environmental Programs - MCNC
  54. #   919 248 9232     smith_w@mcnc.org
  55. #   creation
  56. # Date: September 25, 2006
  57. #   Zac Adelman      CEMPD - UNC
  58. #   zac@unc.edu
  59. #   updated to remove all references to EDSS
  60. #   generalized for non-Linux O/S
  61. # Date: March 15, 2011
  62. #   BH Baek          CEMPD - UNC
  63. #   bbaek@unc.edu  
  64. #   removed M6FLAG : no more support of MOBILE6
  65. #
  66. #  %W% %P% %G% %U%
  67.  
  68. #  Determine operating system for compiling SMOKE
  69. #  Set executable format, making allowances for 64-bit architecture
  70.  
  71. setenv SMOKE_EXE Linux2_x86_64pg
  72.  
  73. # Set default compiler flags for Linux; if using other O/S override by setting env variables manually
  74. if ( $SMOKE_EXE == Linux2_x86_64pg ) then
  75.     setenv FC      pgf90
  76.     setenv FFLAG   "-O2 -Msave -Mbackslash -Mbyteswapio -Kieee -Mextend -Bstatic "
  77.     setenv DBGFLAG "-g -Mbounds -Msave -Mbackslash -Mbyteswapio -Kieee -Mextend -Bstatic"
  78. else
  79.     if ( ! $?FC || ! $?FFLAG || ! $?DBGFLAG ) then
  80.        echo ""
  81.        if ( ! $?FC ) echo "--> Compiler variable FC undefined..."
  82.        if ( ! $?FFLAG ) echo "--> Compiler flag variable FFLAG undefined..."
  83.        if ( ! $?DBGFLAG ) echo "--> Compiler flag variable DBGFLAG undefined..."
  84.        echo ""
  85.        echo "--> Set the variables above to proceed..."
  86.        echo ""
  87.        exit( 1 )
  88.      endif
  89. endif
  90.  
  91. exit( 0 )
  92.  
  93. EOF
  94. source platform
  95.  
  96. ## Linking proper Libraries
  97. #cd $SMK_HOME/subsys/ioapi/Linux2_x86_64pg
  98. ln -s /usr/local/lib/Linux2_x86_64pg_gcc_nomp/libioapi.a libioapi.a
  99. ln -s /usr/local/ioapi_3.1/Linux2_x86_64pg/libioapi.a libioapi.a
  100. mkdir $SMK_HOME/subsys/ioapi_includes/
  101. cd $SMK_HOME/subsys/ioapi_includes/
  102. cp /work7/CMAQ/ioapi/fixed_src/*.EXT ./
  103. #cp /home/guest/CMAQ/ioapi/fixed_src/*.EXT ./
  104. cd $SMK_HOME/subsys/netcdf/$SMOKE_EXE/
  105. ln -s /usr/local/lib/libnetcdf.a libnetcdf.a
  106. cd $SMK_HOME/subsys/smoke/assigns
  107. source ASSIGNS.nctox.cmaq.cb05_soa.us12-nc
  108.  
  109. ## Make SMOKE
  110. cd $SCRIPTS/make/
  111. Makeall
  112. ## VERIFICATION-01:: Verify Installation bychecking if the required files were created
  113. cd $SMK_BIN
  114. echo "Installation went fine; if These following files exist"
  115. find aggwndw beld3to2 bluesky2inv cemscan cntlmat elevpoint extractida geofac grdmat grwinven invsplit layalloc laypoint met4moves metcombine metscan movesmrg mrgelev mrggrid normbeis3 pktreduc rawbio smk2emis smkinven smkmerge smkreport spcmat surgtool temporal tmpbeis3 tmpbio uam2ncf
  116.  
  117. ## VERIFICATION-02:: Verify Installation by running the model for test case
  118. echo "**Verify Installation by running the model for test case**"
  119. echo "In this step, several scripts will run."
  120. echo "This step of verification may take some time."
  121. echo "Would you still be willing to go through it?"
  122. echo "Put 'y' for Continuing or 'n' for Exit"
  123. set WISH = $<
  124. if ($WISH == "y") then
  125. echo "Please standby while the whole process completes:"
  126. cd $SMK_HOME
  127. source smoke_install.csh
  128. cd $SMK_HOME/subsys/smoke/scripts/run
  129. smk_area_nctox.csh
  130. smk_bg_nctox.csh
  131. smk_nonroad_nctox.csh
  132. smk_point_nctox.csh
  133. smk_rateperdistance_noRFL_nctox.csh
  134. smk_rateperdistance_RFLonly_nctox.csh
  135. smk_ratepervehicle_noRFL_nctox.csh
  136. smk_ratepervehicle_RFLonly_nctox.csh
  137. smk_rateperprofile_nctox.csh
  138. smk_mrgall_nctox.csh
  139. cd $LOGS
  140. echo "The test case run is over."
  141. echo "Please check carefully for any error"
  142. grep ERROR *
  143. cd $SCRIPTS/install/
  144. check_smk_install
  145. endif
  146.  
  147. if ($WISH == "n") then
  148. echo "You can run the test case anytime you want."
  149. echo "you've chosen not to run it now."
  150. echo "Have a nice day!"
  151. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement