Advertisement
Guest User

CMAQ Installation Guide

a guest
Nov 12th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.44 KB | None | 0 0
  1. ## This document has been created by Taufiq Hassan||Email:taufiq@gist.ac.kr||Date: 20-03-2014||Updated: 21-03-2014
  2. ## In this guide, informations will be given after ## mark and shell commands with $ mark, as a superuser (s) mark
  3. ## Before starting make sure you have netcdf lib ($ find / -name "libnetcdf.a" (s)) and cvs ($ which cvs)
  4. ## For netcdf compilation refer to my WRF compilation script
  5. ## If you do not have these; install them and remember to use the same compiler (e.g. gfortran/pgf90 . .) [important]
  6. ## If you are planning to ultimately compile WRF-CMAQ coupled system; use pgf90 compiler (supported)
  7. ## Copy files from Taufiq@gcm2:/home/Taufiq/WRF-CMAQ
  8. ## Always check the log file with ctrl+f (keywords: error, warning, abort, failed, unbalanced, quote)
  9. ## Check at the end of every run.log for successful completion
  10.  
  11. $ export work=~/work (## your working directory)
  12. $ cd $work
  13. $ scp Taufiq@gcm2:/home/Taufiq/WRF-CMAQ/\{ioapi-3.1.tar,CMAQv5.tar,CMAQ_installation_guide,DATA.CMAQv5.tar,DATA_REF.CMAQv5.tar,config.cmaq\} .
  14. $ tar -xvf ioapi-3.1.tar
  15.  
  16. ## Installation of IOAPI (must be 3.1) for CMAQ CCTM
  17. ## It is important to know exact compiler and machine arch ($ uname -a)(I used pgf with gcc for Linux2_x86_64)
  18. ##===============================IOAPI Build Start============================================================
  19. ##============================================================================================================
  20. $ cd ioapi
  21. $ ls -al Makeinclude.*
  22. ## Choose Makeinclude file according to your arch/compiler (I chose Linux2_x86_64pg_gcc_nomp)
  23. ## In this file make the following changes
  24. (1) CC = /usr/bin/gcc
  25. (2) OMPFLAGS =
  26. (3) COPTFLAGS = -O2 -ffast-math -DIOAPI_NO_STDOUT
  27. (4) FOPTFLAGS = -O2 -fast -DIOAPI_NO_STDOUT
  28. (5) FSFLAGS = -Bstatic
  29.  
  30. $ export BIN=Linux2_x86_64pg_gcc_nomp
  31. $ cp Makefile.nocpl Makefile
  32. $ vi Makefile
  33. ## Make the follwoing changes
  34. (1) BASEDIR = /usr/local/ioapi_3.1
  35. (2) SRCDIR = $work/ioapi
  36.  
  37. $ make >& ioapi.log (s)
  38. $ find / -name "libioapi*" (s)
  39. ##===============================IOAPI Build End========================================================
  40. ## run as superuser only at (s) mark; other than that use regular user
  41. ##===============================CMAQ Build Start=======================================================
  42. ##======================================================================================================
  43. $ tar -xvf CMAQv5.tar
  44. $ cd CMAQv5.0/scripts
  45. $ cp $work/config.cmaq ./
  46. $ mkdir -p $M3LIB
  47. $ cd $M3LIB
  48. ## Link netcdf, mpich, ioapi libs for my case i use the following
  49. $ ln -s /usr/local netcdf
  50. $ mkdir ioapi_3.1
  51. $ cd ioapi_3.1
  52. $ ln -s /usr/local/ioapi_3.1/Linux2_x86_64pg Linux2_x86_64pgf
  53. $ ln -s /usr/local mpich
  54.  
  55. ## Build bldmake which is needed to extract other scripts
  56. $ cd $M3HOME/scripts/build
  57. $ ./bldit.bldmake >& bld.log
  58.  
  59. ## Build STENEX for parallel and serial processing
  60. $ source $M3HOME/scripts/config.cmaq
  61. $ cd $M3HOME/scripts/stenex
  62. $ ./bldit.se >& bld_se
  63. $ ./bldit.se_noop >& bld_noop
  64.  
  65. ## Build Pario for parallel CCTM operation
  66. $ cd $M3HOME/scripts/pario
  67. $ source $M3HOME/scripts/config.cmaq
  68. ## Change in the script >> set IOAPIEXT = $work/ioapi/fixed_src
  69. $ ./bldit.pario >& bld.log
  70.  
  71. ## Build icon for initial condition of the model
  72. $ source $M3HOME/scripts/config.cmaq
  73. $ cd $M3HOME/scripts/icon
  74. ## Change in bldit.icon >>
  75. (1) set NETCDF = "${M3LIB}/netcdf/lib -lnetcdff -lnetcdf"
  76. $ ./bldit.icon >& bld.log
  77. ## ICON_V5f_Linux2_x86_64pgf executable will be created
  78.  
  79. ## Build bcon for boundary condition of the model
  80. $ source $M3HOME/scripts/config.cmaq
  81. $ cd $M3HOME/scripts/bcon
  82. ## Change in bldit.bcon >>
  83. (1) set NETCDF = "${M3LIB}/netcdf/lib -lnetcdff -lnetcdf"
  84. $ ./bldit.bcon >& bld.log
  85. ## BCON_V5f_Linux2_x86_64pgf executable will be created
  86.  
  87. ## Build CCTM (CMAQ Chemistry Transport Model)
  88. $ source $M3HOME/scripts/config.cmaq
  89. $ cd $M3HOME/scripts/cctm
  90. $ yum install librdmacm-static.x86_64 (s)
  91. $ yum install libibumad-static.x86_64 (s)
  92. ## also get these two libs >> opa & mpl
  93. ## Change in bldit.cctm >>
  94. (1) set NETCDF = "${M3LIB}/netcdf/lib -lnetcdff -lnetcdf"
  95. $ ./bldit.cctm >& bld.log
  96. ## CCTM_V5f_Linux2_x86_64pgf execution file should be created
  97.  
  98. ## Build jproc to produce photolysis rates for the mechanism
  99. $ source $M3HOME/scripts/config.cmaq
  100. $ cd $M3HOME/scripts/jproc
  101. ## Change in bldit.jproc >>
  102. (1) set NETCDF = "${M3LIB}/netcdf/lib -lnetcdff -lnetcdf"
  103. $ ./bldit.jproc >& bld.log
  104. ## JPROC_V5f_Linux2_x86_64pgf execution file should be created
  105.  
  106. ## MCIP is required to pre-process the meteorological data to feed into CCTM
  107. $ cd $M3HOME/scripts/mcip4/src
  108. $ source $M3HOME/scripts/config.cmaq
  109. $ yum install pvm.x86_64 (s)
  110. ## Change in Makefile >>
  111. (1) NETCDF = ${M3LIB}/netcdf
  112. (2) IOAPI_ROOT = ${M3LIB}/ioapi_3.1
  113. (3) PVM = /usr/share/pvm3/src/LINUXX86_64
  114. (4) uncomment portland group fortran
  115. (5) uncomment 2nd FFLAGS
  116. (6) in FFLAGS -I$(IOAPI_ROOT)/Linux2_x86_64pgf
  117. (7) in LIBS -L$(PVM) -lpvm3
  118. (8) FC = pgf90
  119. $ make
  120. ## Executable mcip.exe should be created
  121. ##======================================CMAQ Build End===========================================
  122. ##=================================================================================================
  123. ##======================================CMAQ Benchmarking Start=========================================
  124. ## run icon for initial conditions
  125. $ source $M3HOME/scripts/config.cmaq
  126. $ tar -xvf $work/DATA.CMAQv5.tar
  127. $ cd $M3HOME/scripts/icon
  128. ## in run.icon comment 4 lines below species defn
  129. $ ln -s $M3HOME/scripts/icon/BLD_V5f/GC_cb05tucl_ae6_aq.nml gc_matrix.nml
  130. $ ln -s $M3HOME/scripts/icon/BLD_V5f/AE_cb05tucl_ae6_aq.nml ae_matrix.nml
  131. $ ln -s $M3HOME/scripts/icon/BLD_V5f/NR_cb05tucl_ae6_aq.nml nr_matrix.nml
  132. $ ln -s $M3HOME/scripts/icon/BLD_V5f/Species_Table_TR_0.nml tr_matrix.nml
  133. $ export LD_LIBRARY_PATH=/usr/local/lib
  134. $ ./run.icon >& run.log
  135.  
  136. ## run bcon for boundary conditions
  137. $ source $M3HOME/scripts/config.cmaq
  138. $ cd $M3HOME/scripts/bcon
  139. ## in run.bcon comment 4 lines below species def
  140. $ ln -s $M3HOME/scripts/bcon/BLD_V5f/GC_cb05tucl_ae6_aq.nml gc_matrix.nml
  141. $ ln -s $M3HOME/scripts/bcon/BLD_V5f/AE_cb05tucl_ae6_aq.nml ae_matrix.nml
  142. $ ln -s $M3HOME/scripts/bcon/BLD_V5f/NR_cb05tucl_ae6_aq.nml nr_matrix.nml
  143. $ ln -s $M3HOME/scripts/bcon/BLD_V5f/Species_Table_TR_0.nml tr_matrix.nml
  144. $ ./run.bcon >& run.log
  145.  
  146. ## run CCTM for parallel processing
  147. $ cd $M3HOME/scripts/cctm
  148. $ source $M3HOME/scripts/config.cmaq
  149. ## in run.cctm change the following >>
  150. (1) setenv NPCOL_NPROW "4 2"; set NPROCS = 8
  151. (2) # time $BASE/$EXEC
  152. (3) set MPI = /usr/local/bin
  153. set MPIRUN = $MPI/mpiexec
  154. time $MPIRUN -n $NPROCS $BASE/$EXEC
  155. (4) comment 4 lines below species def
  156. $ ln -s $M3HOME/scripts/cctm/BLD_V5f/GC_cb05tucl_ae6_aq.nml gc_matrix.nml
  157. $ ln -s $M3HOME/scripts/cctm/BLD_V5f/AE_cb05tucl_ae6_aq.nml ae_matrix.nml
  158. $ ln -s $M3HOME/scripts/cctm/BLD_V5f/NR_cb05tucl_ae6_aq.nml nr_matrix.nml
  159. $ ln -s $M3HOME/scripts/cctm/BLD_V5f/Species_Table_TR_0.nml tr_matrix.nml
  160. $ ./run.cctm >& run.log
  161. ## This should start running in 8 processors (can be seen with $top)
  162. ##=========================================CMAQ Benchmarking End====================================
  163. ##==========================================Verify Output===========================================
  164. $ tar -xvf $work/DATA_REF.CMAQv5.tar
  165. ## this should produce the reference output in $M3DATA/ref
  166. ## we can verify for any data variable with ncdump -v variable output.file
  167. $ ncdump -v CO ICON_V5f_CMAQ-BENCHMARK_profile |less
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement