Sie sind auf Seite 1von 28

MAC INSTALLATION OF CMAQ It is now possible to do air quality simulations on your own computer without access to a cluster or supercomputer!

I am setting my MacPro to do the mesoscale meteorology (WRF), emissions processing (SMOKE), and air quality modleing (CMAQ). These instructions require a Mac with an Intel processor and OSX 10.5 (Leopard). I use Gnu C (gcc), Gnu C++ (g++) and an Intel Fortran Compiler (ifort). All of the installations are for 64-bit memory. My CMAQ, WRF, and SMOKE installations all work with the test data provided with each. I have also run WRF with real data. These instructions document my installations for CMAQ 4.6 and MCIP 3.3, The serial processing instructions are based on the work of Scott Spak of the University of Wisconsin. Carlie Coats, Jr., of Barons also provided guidance on netCDF and I/O API. I like my instructions in excruciating detail so thats what youll nd here. I have used my own le structure (/phd/basics/ioapi3.0, /phd/models/cmaq4.6, etc.). I use the UNIX tcsh shell but you are welcome to use other shells (bash is the default on Macs). I also like to use Emac to run my compilations so I can see error messages highlighted. If you dont use Emacs, you can enter the same instructions on the command line with a > log.txt added on. All the software is free except for ifort. I think this compiler is well worth the price since it has fewer problems than gfortran, has excellent support, and will better optimize your Intel processors. Academic and student pricing is available. If you run into problems, check my list of Fixes at the back. If this doesnt help, I suggest you use the m3users listserve (see http://www.cmascenter.org/help/listserves.cfm? temp_id=99999) or CMAS bugzilla http://www.cmascenter.org/help/email_support.cfm? temp_id=99999. As of this date, CMAS does not provide support for the Apple platform. Id list helpful websites but Google is the best way nd help! Please let me know if you have any corrections to these instructions. E-mail them to me at drb@atmos.umd.edu since I will be updating this draft. I am also interested in how it took you to complete the CMAQ install with these instructions. I also have instructions for Mac installations of WRF, SMOKE, ncview, AMET, NCO, and VERDI on my website: www.atmos.umd.edu/~drb. I hope these instructions will make the installation of CMAQ on Mac as painless as possible. May the computer gods be with you! Debra Baker University of Maryland Wednesday, September 24, 2008

TABLE OF CONTENTS Environmental Variables and Aliases ..................................................................... 3 Prequisite Programs XCode (gcc and CVS) ................................................................................. 4 ifort ......................................................................................................... 5 netCDF ........................................................................................................ 7 I/O API ......................................................................................................... 8 CMAQ Download .................................................................................................... 9 STENEX .................................................................................................... 10 M3BLD ...................................................................................................... 12 JPROC ...................................................................................................... 15 ICON ....................................................................................................... 17 BCON ....................................................................................................... 19 CCTM ....................................................................................................... 21 MCIP ....................................................................................................... 23 Other Troubleshooting ........................................................................................ 24 Back-Up .................................................................................................... 26

Set Up Environmental Variables and Aliases Here is the code I used for my shell start-up le, .tcshrc. While most installations require you to enter this information in the code, I found it useful to have these presets. They incorpate recommendations from http://support.intel.com/support/performancetools/sb/ CS-027812.htm (Intel), http://macwrf.blogspot.com/2007_09_01_archive.html (Fovell) and netCDF http://www.unidata.ucar.edu/software/netcdf/: echo "Setting compilers variables" setenv CC "/usr/bin/gcc -arch x86_64 -mmacosx-version-min=10.5" setenv CXX /usr/bin/g++ setenv FC ifort setenv F90 ifort setenv F77 ifort setenv PERL /usr/bin/perl echo "Setting code generation options" setenv CPPFLAGS "-O3 -DNDEBUG -DpgiFortran" setenv CFLAGS "-g -O3" setenv CXXFLAGS "-g -O3" setenv FFLAGS '-O3 -xT -ip -no-prec-div -m64' setenv F90FLAGS echo Setting CMAQ environmental variables setenv M3HOME /phd/models/cmaq4.6 setenv M3DATA $M3HOME/data setenv M3MODEL $M3HOME/models setenv M3LIB $M3HOME/lib setenv M3WORK $M3HOME/work echo "Setting ifort environmental variables" source /opt/intel/fce/10.1.006/bin/ifortvars.csh source /opt/intel/idbe/10.1.006/bin/idbvars.csh alias edit emacs -nw -q alias here ls -ltG alias cmaq cd /phd/models/cmaq4.6 To restart .tcshrc after making changes, enter su - followed by your Mac user name (the dash should one space before and after it). Enter your password when prompted.

Install Xcode 1. Download Xcode 3.0 for Leopard for free from the Apple Developers Connection (ADC) at http://developer.apple.com/tools/download/ 2. Click on Xcode 3.0 for Leopard. 1.1 GB 3. It requests a ADC login: click on sign up 4. Fill out the form but choose Log In instead of creating a username and password. This allows you to use your user name and password from Apple Registration. Make sure all categories with * are completed and press continue. 5. It would be nice if it took you back to the Xcode download page but it doesnt. Go to http://developer.apple.com/tools/download/ again and select Xcode 3.0. This is a large le so it will take a couple of hours to download. Be sure that Energy Saver in /System/Library/PreferencePanes is set to Never for sleep options. 6. Xcode icon is downloaded to your desktop: Click on it to install 7. Click on XcodeTools.mkpg 8. The Xcode Tools Installer will appear: press continue 9. The software license agreement is next: press continue then agree 10. Keep the install location to the default by pressing install 11. Click the install button 12. Supply account name and password 13. Installation only takes a few minutes. When it is complete, you will hear a tone and see Install Succeeded on the screen. The installer does not require you to restart your system afterwards. 14. The bulk of the installation occurs in the /Developer folder that is created at the root level of your boot volume. Here you will nd all of the Xcode applications, command-line tools, example code, and documentation. Do not attempt to move or rename this folder. It installs some special development frameworks, resources, and a few patches into the /System folder. Finally, it installs several UNIX man pages and a handful of tools into the /usr and /bin folders. 15. The documentation is in /Developer/ADC Reference Library/referencelibrary/ index.html 16. To uninstall Xcode developer tools on the boot volume along with the Xcode directory, from a Terminal window type: $ sudo /Developer/Library/uninstall-devtools --mode=all The uninstall is very thorough! Restart the computer before reinstalling XCode

Install ifort 1. XCode must be installed rst. 2. Go to http://www.intel.com/cd/software/products/asmo-na/eng/compilers/fmac/ 267426.htm and click on Buy Product. Choose the Professional Edition Full Product and click on Buy. Proceed to checkout. 3. Use or sign up for a Shop Intel Login and Password then enter billing information and then credit card information 4. Within two hours of ordering (during normal business hours), you should get an email from Intel Customer Service with instructions on how to download ifort. 5. Before installation, you will first have to register for Intel Premier Support at http:// www.intel.com/software/products/registrationcenter/index.htm. You must enter your e-mail address and Serial Number from the e-mail. You will have to fill in your registration information again because the Registration Center login is separate from the Shop Intel login. 6. The installation will require you to enter your administrative password. Double-click the downloaded file, which will have a name of the form m_fc_x_10.1.006.dmg. 7. Open the disk image file. Locate and click Install. 8. The Intel Installer will appear. Click Continue. 9. Select a license option. Click Continue. 10. A new screen appears. Click Install. (If the compiler is already installed, the option is Upgrade.) 11. Information about using the Intel Compiler and finding documentation will appear. Read the information, and click Continue. 12. The Software License Agreement appears. Click Continue. (You are prompted to accept or reject the license agreement.) 13. Select the Volume for the installation destination folder. The default installation directory for 64-bit compiler is /opt/intel/fce/10.1.006, where 006 represents the compiler package revision number. This is the version number used throughout these instructions but yours may be different. Click Continue. 14. Yet another screen appears. Click Install. 15. The installer installs the selected components on your system. Click Close. Click Continue. Click Finish on the final screen to exit the installer. 16. Reboot the system to make Xcode support the Intel compiler. 17. The programs in the Intel Fortran Compiler product rely on the environment variables PATH, DYLD_LIBRARY_PATH, and LD_LIBRARY_PATH. The compiler installation program creates compiler environment script files (ifortvars.sh/ idbvars.sh) that set these variables. Intel strongly recommends that you add those script files into your login script. I include them in my .tcshrc (see p. 3). Once the variables are set in the ".login" file there is no need to run the script files for each session.source the script to setup the compiler environment: source /opt/intel/fce/10.1.006/bin/ifortvars.csh #ifort source /opt/intel/fce/10.1.006/bin/idbvars.csh #idb 18. If you have any problems running the compiler, first check you have a valid license file (*.lic) in the license directory. By default this is /Users/Shared/Library/Application\ Support/Intel/Licenses. The compiler uses the environment variable
5

INTEL_LICENSE_FILE to locate the license file. If you still have problems, you can submit a help request to Intel Premier Support: http://www.intel.com/software/ products/support/fmac. 19. To uninstall ifort, you must use your administrative password. a. Open Terminal. b. Change to the root directory. c. To uninstall the compiler, enter a command similar to the following: /opt/intel/fce/10.1.006/bin/uninstall.sh d. To uninstall the debugger, enter a command similar to the following: /opt/intel/idbe/10.1.006//bin/uninstall.sh 20. If you install a new version of Xcode at any time, you must uninstall and reinstall the Intel Fortran Compiler. Monday, February 18, 2008

Install netCDF 1. Prerequisites for the netCDF v. 3.6.2 build are Fortran, C, and C++ compilers. 2. Download the source code from http://www.unidata.ucar.edu/software/netcdf/ as a gzipped tar le. 3. Copy the source code into the root directory and detar it: tar -xvf netcdf.tar (Mac automatically unzips gzip les). It will automatically create a netcdf-3.6.2 directory. Delete the tar le. Go into the netcdf-3.6.2 directory. 4. Run ./congure --enable-v2 --enable-f77 --enable-large-le-tests --disable-compilerrecover --disable-cxx in emacs compile mode. (DO NOT USE --enable-shared when you congure it because it excludes fortran symbols from libnetcdf.a). A log called cong.log is automatically created. Save the compilation as a log. Dont worry about error messages other than compiler failure. 5. Run make in emacs compile mode. Save the compilation as a log. An error in the make must be addressed. This step creates the library (libnetcdf.a) as well as the utilities ncgen and ncdump. 6. Run make test or make check in emacs compile mode. Save the compilation as a log. This tests whether the executables have been properly built. Compiler and linker warnings may be ignored. This takes a half hour, especially the large le tests. 7. Run sudo make install >&! ~/Documents/netcdf_install_{date}_run{#}.txt on the terminal command line. 8. You should see netCDF in usr/local/bin as well as new les in /include, /lib, /share and /man. 9. If you need to reinstall netCDF, run a make distclean. Note that this does not clean up all or even most of the les in /local subdirectories, which must be deleted manually. Tuesday, February 19, 2008

Install I/O API 1. Installing netCDF is a prequisites for installing I/O API iv. 3.0. 2. Download the source code at http://www.baronams.com/products/ioapi/AVAIL.html as a gzipped tar le. Mac automatically unzips it. 3. Also download Scott Spaks IOAPI Makeinclude le for Intel Macs using ifort (Makeinclude.Darwin_ifcgcc ) at http://prairie.sage.wisc.edu/~spak/m3_intelags.zip. 4. From the root directory, make a ioapi3.0 directory. Copy the tar le to this directory and detar it: tar -xvf {le}.tar. You should see ioapi, HTML, m3tools, iotest, and notcdf subdirectories. Delete the tar le. Copy Makeinclude.Darwin_ifcgcc into /ioapi. 5. Go to the /ioapi directory and copy Makeinclude.Darwin_ifcgcc as Makeinclude.Darwin_ifcgcc.default. Rename Makeinclude.Darwin_ifcgcc as Makeinclude.Darwin. Edit Makeinclude.Darwin: FC = ifort 6. Set the BIN variable at command line setenv BIN Darwin. (I add BIN = Darwin to the Makele so I do not have to reenter it for subsequent makes). 7. Go up to /ioapi3.0 and copy Makele as Makele.default. Edit the Makele: BASEDIR = /phd/basics/ioapi3.0 INSTALL = /phd/basics/ioapi3.0 BIN = Darwin CPLMODE = nocpl IOAPIDEFS = PVMINCL = /dev/null 8. In /ioapi3.0, run make dirs in emac compile mode. Save the compilation as a log. Check for the new directory named Darwin. 9. Go to Darwin directory and link the netCDF libraries in this directory: ln -s /usr/local/ lib/libnetcdf.a. 10. Go up to /ioapi3.0, run make congure in emac compile mode. Save the compilation as a log. This will congure all Makeles. 11. Go to ioapi3.0/ioapi and check the Makele to make sure that BASEDIR = /phd/ basics/ioapi3.0 12. In ioapi3.0/ioapi, run make in emac compile mode. Save the compilation as a log. This should build the ioapi library and precompiled object les. 13. Check for /ioapi3.0/Darwin/libioapi.a. At the command line, run ranlib -cs libioapi.a. 14. Make sure there is the xed_src directory required by CMAQ. If not, copy it from ioapi3.0/ioapi to ioapi3.0/Darwin. 15. If you need to recompile I/O API, use the make clean command in /ioapi3.0 or delete all les in /Darwin except netcdf library link. 16. For a full uninstall, delete the /ioapi3.0 directory using sudo rm -r ioapi3.0 and your password. Friday, March 21, 2008

Download CMAQ 1. NetCDF, CVS, and I/O API must be installed before CMAQ. If you have installed XCode, you will have CVS 2. Download CMAQ and MCIP les from the CMAS website: http:// www.cmascenter.org. You must use your CMAS login and password (you can register if you dont have a login and password). Click on Download Center, Models. Download CMAQ 4.6 (not unied), MCIP 3.3, and benchmark input and output. 3. Check that the following aliases are in your .tcshrc: echo Setting CMAQ environmental variables setenv M3HOME /phd/models/cmaq4.6 setenv M3DATA $M3HOME/data setenv M3MODEL $M3HOME/models setenv M3LIB $M3HOME/lib setenv M3WORK $M3HOME/work 4. In the cmaq4.6 directory, create the lib and work directories. In /cmaq4.6/lib, make subdirectories for build, netcdf, ioapi_3, and stenex. (This is a serial build). 5. Go to $M3LIB/netcdf and create a directory named Darwin. Link the netCDF library in this directory: ln -s /usr/local/lib/libnetcdf.a. 6. Go to $M3LIB/ioapi_3 and create a directory named Darwin. Link the I/O API library in this directory: ln -s /phd/basics/ioapi3.0/Darwin/libioapi.a. Also make a xed_src directory and link its contents: ln -s /phd/basics/ioapi3.0/Darwin/xed_src/* /$M3LIB/ ioapi_3/Darwin/xed_src. 7. Copy and detar these tar les in $M3HOME M3MODELS.CMAQv4.6.tar M3DATA.CMAQv4.6.tar M3DOCS.CMAQv4.6.tar mcip_v33.tar M3DATA_REF.CMAQv4.6.tar M3DATA_MCIP32.tar 8. Copy and detar M3SCRIPTS.CMAQv4.6.tar in $M3WORK then check for a scripts subdirectory. Return to $M3HOME and check for the following directories: work, models, data, docs, and MCIP3. Delete all tar les. 9. After installing all components, use benchmark data to test installation

Wednesday, February 20, 2008

Install STENEX 1. To install Stencil Exchange library for serial processing, go to $M3WORK/scripts/ stenex. 2. Copy bldit.se_noop.pgf as bldit.se_noop.pgf.default. 3. Change the permissions on it: chmod ugo+rwx bldit.se_noop.pgf. 4. Edit bldit.se_noop.pgf: a. Comment out the block that detects and requires Linux <BEFORE> if ($BLD_OS != 'Linux') then echo " $BLD_OS -> wrong bldit script for host\!" exit 1 endif <AFTER> # if ($BLD_OS != 'Linux') then # echo " $BLD_OS -> wrong bldit script for host\!" # exit 1 # endif NOTE: You must leave the line setting BLD_OS because it is used to name the subdirectory. b. Replace compiler path to point to ifort <BEFORE> set FC = /usr/pgi/linux86/bin/pgf90 <AFTER> set FC = /opt/intel/fce/10.1.006/bin/ifort c. Replace compiler options <BEFORE> set FSTD = "-Mxed -Mextend -c" <AFTER> set FSTD = "-extend-source 132 -c -cm -w95 -O2" d. Comment out under DEBUG <BEFORE> if ( $?DEBUG ) then set F_FLAGS = "${FSTD} -g" else set F_FLAGS = "${FSTD} -O2" endif <AFTER> #if ( $?DEBUG ) then # set F_FLAGS = "${FSTD} -g" #else # set F_FLAGS = "${FSTD} -O2" #endif e. Change the unused F_FLAGS to FSTD: <BEFORE> #> compile in the ist order (se_modules.f depends on the others)
10

foreach le ( $ist ) $FC $F_FLAGS $le end <AFTER> #> compile in the ist order (se_modules.f depends on the others) foreach le ( $ist ) $FC $FSTD $le end f. Make sure the library that has been created gets ranlib'd <BEFORE> ar rv $Arc *.o chmod 444 $Arc <AFTER> ar rv $Arc *.o ranlib -s $Arc chmod 444 $Arc 5. Run the edited script in emacs compile mode: ./bldit.se_noop.pgf. Save the log as ~/Documents/cmaq_stenex__{date}_run{#}.txt. 6. If it compiles successfully, you will see libsef90_noop.a in $M3LIB/stenex/Darwin. Check log for any errors or warnings (ignore Warning: noop_data_copy_module.f, line 65: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value). 7. If you need to rerun bldit.se_noop.pgf, delete the $M3WORK/scripts/stenex/ BLD_noop directory and the $M3LIB/stenex/Darwin directory 8. Next: Install M3BLD Thursday, February 28, 2008

11

Install M3BLD 1. 2. 3. 4. STENEX must be built before creating the m3bld utility. Go to $M3WORK/scripts/build. Copy bldit.m3bld as bldit.m3bld.default. Change permissions (chmod ugo+rwx) and edit bldit.m3bld: a. Comment out the Linux checker <BEFORE> if ($BLD_OS != 'Linux') then echo " $BLD_OS -> wrong bldit script for host\!" exit 1 endif <AFTER> # if ($BLD_OS != 'Linux') then # echo " $BLD_OS -> wrong bldit script for host\!" # exit 1 # endif b. Run ./bldit.m3bld in emac compile mode. Save the buffer as ~/Documents/ cmaq_build1_{date}_run{#}.txt. Expect a BLD directory (and a lot of errors). 5. Copy bldit.m3bld as bldit.m3bld .1st. Edit bldit.m3bld. a. Make sure all the code is compiled with 64-bit architecture <BEFORE> # set c compiler and ags set CC = /usr/bin/gcc set CFLAGS = " " <AFTER> # set c compiler and ags set CC = /usr/bin/gcc -arch x86_64 -mmacosx-version-min=10.5 set CFLAGS = "-O3 -m64" b. Comment out the portion that removes source les and the part that tells cvs to reload them <BEFORE> if ( ! -e "$Bld" ) then mkdir $Bld else if ( ! -d "$Bld" ) then echo " *** target exists, but not a directory ***" exit 1 else echo "Deleting les in $Bld" /bin/rm $Bld/* endif endif #set echo cd $Bld # extract source les from cvs archive
12

cvs export -r $Rel -d $Bld includes cvs export -r $Rel -d $Bld m3bld <AFTER> #unset echo if ( ! -e "$Bld" ) then mkdir $Bld else if ( ! -d "$Bld" ) then echo " *** target exists, but not a directory ***" exit 1 else # echo "Deleting les in $Bld" # /bin/rm $Bld/* endif endif #set echo cd $Bld # extract source les from cvs archive # cvs export -r $Rel -d $Bld includes # cvs export -r $Rel -d $Bld m3bld c. Go to new BLD directory. Edit sms.h the denition of boolean_t to be guaranteed <BEFORE> #if dened(CRAY) || dened(__osf__) || _WIN32 || __unix__ typedef unsigned char boolean_t; #endif #if dened(CRAY) || dened(__osf__) || _WIN32 || __unix__ || _AIX #dene B_TRUE 1 #dene B_FALSE 0 #endif <AFTER> //#if dened(CRAY) || dened(__osf__) || _WIN32 || __unix__ typedef unsigned char boolean_t; //#endif //#if dened(CRAY) || dened(__osf__) || _WIN32 || __unix__ || _AIX #dene B_TRUE 1 #dene B_FALSE 0 //#endif d. In the BLD directory, edit bld_parser.c. Comment out the inclusion of values.h. (gcc doesn't recognize it and the le builds ne without it.) <BEFORE> #ifndef _WIN32 #include <values.h> #endif <AFTER> //#ifndef _WIN32
13

//#include <values.h> //#endif e. In the BLD directory, edit bld_scanner.c to change the denition of yyout stdout: <BEFORE> #ifdef __unix__ FILE *yyin; #dene yyout stdout #else FILE *yyin = {stdin}, *yyout = {stdout}; #endif <AFTER> //#ifdef __unix__ FILE *yyin; #dene yyout stdout //#else //FILE *yyin = {stdin}, *yyout = {stdout}; //#endif 6. Save a copy of bldit.m3bld as bldit.m3bld.2nd. Run ./bldit.m3bld in emacs compile mode. Save the log as ~/Documents/cmaq_build2_{date}_run{#}.txt. 7. Check for m3bld in $M3LIB/build/Darwin. Check log (ignore bld_scanner.l:138{##}: warning: cast from pointer to integer of different size) 8. If you need to recompile, rst copy sms.h, bld_parser.c, and bld_scanner.c as revised to another directory. Delete $M3WORK/scripts/build/BLD directory and m3bld in $M3LIB/build. Thursday, February 28, 2008

14

Install JPROC 1. 2. 3. 4. 5. STENEX and M3BLD must be installed before creating the JPROC executable. Go to $M3WORK/scripts/jproc. Copy bldit.jproc.pgf as bldit.jproc.pgf .default. Change permissions on bldit.jproc.pgf: chmod ugo+rwx bldit.jproc.pgf Edit bldit.jproc.pgf a. Comment out the block that detects and requires Linux <BEFORE> if ($BLD_OS != 'Linux') then echo " $BLD_OS -> wrong makit script for host!" exit 1 endif <AFTER> #if ($BLD_OS != 'Linux') then #echo " $BLD_OS -> wrong makit script for host!" #exit 1 #endif b. Change the directory path for Fortran compiler to ifort and reset the compiler ags: <BEFORE> #> Set full path of Fortran 90 compiler set FC = /share/linux/pgi/linux86/5.0/bin/pgf90 set FP = $FC #> Set compiler ags set FSTD = "-Mxed -Mextend" set F_FLAGS = "${FSTD} -O2 -I." set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -I." set LINK_FLAGS = "-Bstatic" <AFTER> #> Set full path of Fortran 90 compiler set FC = /opt/intel/fce/10.1.006/bin/ifort set FP = $FC #> Set compiler ags set FSTD = "-extend-source 132 -w95 " set F_FLAGS = "${FSTD} -O3 -xT -ip -mdynamic-no-pic -warn declarations -recursive -I." set CPP_FLAGS = "" set C_FLAGS = "-O2 -m64 -I." set LINK_FLAGS = "" c. Revise the location of the ioapi library: <BEFORE> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS}2_x86pg -lioapi" <AFTER>
15

6. 7. 8. 9.

#> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS} -lioapi" Run ./bldit.jproc.pgf in emac compile mode. Save the log as ~/Documents/ cmaq_jproc_{date}_run{#}.txt. Check logs for problems. Check for executable JPROC_d1a in the same directory. If you need to recompile JRPOC, delete JPROC_d1 and cfg.d1a. Delete the BLD directory after changing permissions on its les. Next: Install ICON

Friday, March 21, 2008

16

Install ICON 1. 2. 3. 4. 5. STENEX and M3BLD must be installed before creating the ICON executable. Go to $M3WORK/scripts/icon. Copy bldit.icon.pgf as bldit.icon.pgf .default. Change permissions on bldit.icon.pgf: chmod ugo+rwx bldit.icon.pgf Edit bldit.icon.pgf a. Comment out the block that detects and requires Linux <BEFORE> if ($BLD_OS != 'Linux') then echo " $BLD_OS -> wrong makit script for host!" exit 1 endif <AFTER> #if ($BLD_OS != 'Linux') then #echo " $BLD_OS -> wrong makit script for host!" #exit 1 #endif b. Change the directory path for Fortran compiler to ifort and reset the compiler ags: <BEFORE> #> Set full path of Fortran 90 compiler set FC = /share/linux/pgi/linux86/5.0/bin/pgf90 set FP = $FC #> Set compiler ags set FSTD = "-Mxed -Mextend" set F_FLAGS = "${FSTD} -O2 -I." set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -m64 -I." set LINK_FLAGS = "-Bstatic" <AFTER> #> Set full path of Fortran 90 compiler set FC = /opt/intel/fce/10.1.006/bin/ifort set FP = $FC #> Set compiler ags set FSTD = "-extend-source 132 -w95 " set F_FLAGS = "${FSTD} -module ${MODLOC} -I. -O3 -xT -ip mdynamic-no-pic -warn declarations -recursive" set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -m64 -I." set LINK_FLAGS = "" c. Revise the location of the ioapi library: <BEFORE> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS}2_x86pg -lioapi" set ICL_IOAPI = ${M3LIB}/ioapi_3/ioapi/xed_src
17

6. 7. 8. 9.

<AFTER> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS} -lioapi" set ICL_IOAPI = ${M3LIB}/ioapi_3/${BLD_OS}/xed_src Run ./bldit.icon.pgf in emac compile mode. Save the log as ~/Documents/ cmaq_icon_{date}_run{#}.txt. Check logs for problems. Check for executable ICON_e1a in the same directory If you need to recompile ICON, delete cfg.d1a. Delete the BLD directory after changing permissions on its les. Also delete MOD_DIR. Next: Install BCON

Friday, March 21, 2008

18

Install BCON 1. 2. 3. 4. 5. STENEX and M3BLD must be installed before creating the BCON executable. Go to $M3WORK/scripts/bcon. Copy bldit.bcon.pgf as bldit.bcon.pgf .default. Change permissions on bldit.bcon.pgf: chmod ugo+rwx bldit.bcon.pgf Edit bldit.bcon.pgf a. Comment out the block that detects and requires Linux <BEFORE> if ($BLD_OS != 'Linux') then echo " $BLD_OS -> wrong makit script for host!" exit 1 endif <AFTER> #if ($BLD_OS != 'Linux') then #echo " $BLD_OS -> wrong makit script for host!" #exit 1 #endif b. Change the directory path for Fortran compiler to ifort and reset the compiler ags: <BEFORE> #> Set full path of Fortran 90 compiler set FC = /share/linux/pgi/linux86/5.0/bin/pgf90 set FP = $FC #> Set compiler ags set FSTD = "-Mxed -Mextend" set F_FLAGS = "${FSTD} -O2 -I." set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -m64 -I." set LINK_FLAGS = "-Bstatic" <AFTER> #> Set full path of Fortran 90 compiler set FC = /opt/intel/fce/10.1.006/bin/ifort set FP = $FC #> Set compiler ags set FSTD = "-extend-source 132 -w95" set F_FLAGS = "${FSTD} -I. -O3 -xT -ip -mdynamic-no-pic -warn declarations -recursive" set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -m64 -I." set LINK_FLAGS = "" c. Revise the location of the ioapi library: <BEFORE> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS}2_x86pg -lioapi" set ICL_IOAPI = ${M3LIB}/ioapi_3/ioapi/xed_src
19

6. 7. 8. 9.

<AFTER> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS} -lioapi" set ICL_IOAPI = ${M3LIB}/ioapi_3/${BLD_OS}/xed_src Run ./bldit.bcon.pgf in emac compile mode. Save the log as ~/Documents/ cmaq_bcon_{date}_run{#}.txt. Check logs for problems. Check for executable BCON_e1a in the same directory. If you need to recompile BCON, delete cfg.d1a. Delete the BLD directory after changing permissions on its les. Also delete MOD_DIR. Next: Install CCTM

Friday, March 21, 2008

20

Install CCTM 1. 2. 3. 4. 5. STENEX and M3BLD must be installed before creating the CCTM executable. Go to $M3WORK/scripts/cctm. Copy bldit.cctm.pgf as bldit.cctm.pgf .default. Change permissions on bldit.cctm.pgf: chmod ugo+rwx bldit.cctm.pgf Edit bldit.cctm.pgf a. Comment out the block that detects and requires Linux <BEFORE> if ($BLD_OS != 'Linux') then echo " $BLD_OS -> wrong makit script for host!" exit 1 endif <AFTER> #if ($BLD_OS != 'Linux') then #echo " $BLD_OS -> wrong makit script for host!" #exit 1 #endif b. Comment out set ParOpt (serial installation) c. Change the directory path for Fortran compiler to ifort and reset the compiler ags: <BEFORE> #> Set full path of Fortran 90 compiler set FC = /share/linux/pgi/linux86/5.0/bin/pgf90 set FP = $FC #> Set location of MPICH if using multiple processors set MPICH = /share/linux/bin/mpich-ch_p4 #> Set compiler ags set FSTD = "-Mxed -Mextend" set F_FLAGS = "${FSTD} -O2 -I." set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -I${MPICH}/include" set LINK_FLAGS = "-Bstatic" <AFTER> #> Set full path of Fortran 90 compiler set FC = /opt/intel/fce/10.1.006/bin/ifort set FP = $FC #> Set location of MPICH if using multiple processors set MPICH = /share/linux/bin/mpich-ch_p4 #> Set compiler ags set FSTD = "-extend-source 132 -w95 " set F_FLAGS = "${FSTD} -module ${MODLOC} -I. -O3 -xT -ip mdynamic-no-pic -warn declarations -recursive" set CPP_FLAGS = "" set C_FLAGS = "-v -O2 -m64 -I." set LINK_FLAGS = ""
21

Note that you can't comment out the MPICH setting because this environmental variable is needed in program so just leave the default setting. c. Revise the location of the ioapi library: <BEFORE> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS}2_x86pg -lioapi" set ICL_IOAPI = ${M3LIB}/ioapi_3/ioapi/xed_src <AFTER> #> Set location of libraries set IOAPI = "${M3LIB}/ioapi_3/${BLD_OS} -lioapi" set ICL_IOAPI = ${M3LIB}/ioapi_3/${BLD_OS}/xed_src 6. Run ./bldit.cctm.pgf in emac compile mode. It takes about 8 minutes to run. Save the log as ~/Documents/cmaq_cctm_{date}_run{#}.txt. Check logs for problems. 7. Check for executable CCTM_e1a in the same directory 8. Copy run.cctm as run.cctm.default 9. Change the permissions on run.cctm: chmod ugo+rwx run.cctm 10. Edit the run.cctm script for serial processing: a. Change horizontal domain: <BEFORE> #setenv NPCOL_NPROW "1 1"; set NPROCS = 1 # single processor setting setenv NPCOL_NPROW "4 2"; set NPROCS = 8 <AFTER> setenv NPCOL_NPROW "1 1"; set NPROCS = 1 # single processor setting #setenv NPCOL_NPROW "4 2"; set NPROCS = 8 b. Turn off MPIRUN: <BEFORE> #> Executable call for multiple PE, set location of MPIRUN script set MPIRUN = /share/linux/bin/mpich-ch_p4/bin/mpirun set TASKMAP = $BASE/machines8 cat $TASKMAP time $MPIRUN -v -machinele $TASKMAP -np $NPROCS $BASE/$EXEC <AFTER> #> Executable call for multiple PE, set location of MPIRUN script # set MPIRUN = /share/linux/bin/mpich-ch_p4/bin/mpirun # set TASKMAP = $BASE/machines8 # cat $TASKMAP # time $MPIRUN -v -machinele $TASKMAP -np $NPROCS $BASE/$EXEC 11. If you need to recompile CCTM, delete cfg.d1a. Delete the BLD directory after changing permissions on its les. Also delete MOD_DIR. 12. Next: Install MCIP Monday, March 24, 2008

22

Install MCIP 1. Unlike the other components of CMAQ, the M3BLD is not used for the MCIP installation. It is a Fortran makele. 2. Go to $M3HOME/MCIP3/mcip3. 3. Copy Makele as Makele.default 4. Change permissions on Makele: chmod ugo+rwx Makele 5. Edit the Makele: a. Change path for netCDF: <BEFORE> NETCDF = /usr/local/netcdf <AFTER> NETCDF = /usr/local b. Add compiler, ags, and libraries for Mac at line 7: #...MAC (Intel) FC = /opt/intel/fce/10.1.006/bin/ifort FFLAGS = -O3 -FR -convert big_endian -I$(NETCDF) LIBS = -L${NETCDF}/lib -lnetcdf \ -L/phd/basics/ioapi3.0/Darwin -lioapi c. Comment out all other denitions of FC, FFLAGS, and LIBS 6. Run make in emac compile mode. Save the log as ~/Documents/ cmaq_mcip_{date}_run{#}.txt. Check logs for problems. 7. Check for mcip.exe in same directory ($M3HOME/MCIP3/mcip3) 8. If you need to recompile, you do not have to delete any les. The make will recognize les correctly compiled from prior makes. Monday, March 24, 2008

23

Fixes Process: XCODE TOOLS Problem: DVD version cant nd boot disk Fix: DVD version does not work on Leoparddownload from ADC Process: Terminal Problem: refused to take my admin password Fix: use sudo command not su command Process: Finder Problem: hid most UNIX--could not use Time Machine to retrieve old versions Fix: In Terminal command line, entered: defaults wrote com.apple.Finder AppleShowAllFiles YES Process: Darwin Problem: Found out that Darwin had been upgraded from 9.1.0 to 9.2.0 as part of the Mac OSX software update. Fix: In System Preferences Software UpdateScheduled Check, I unchecked the box Check for Updates. However, Dave recommended I keep getting updates since he has not had it mess up his code. I reset it for Weekly updates but unchecked automatic installs fo important updates. Process: CMAQ/SMOKE Problem: Asked for help to compile with gfortran Fix: Change to ifort and use Scott Spaks information Process: netCDF Problem: checking if Fortran "byte" is C "signed char"... congure: error: Could not link conftestf.o and conftest.o --compilation exited abnormally with code 1 Fix: The problem is that the ifort is 64-bit and the gcc is 32-bit. Changed CC in .tcshrc: setenv CC "/usr/bin/gcc -arch x86_64 -mmacosx-version-min=10.5 Process: netCDF Problem: Make Test had signicant problems with libnetcdf_c++.a Fix: Added --disable-cxx to congure options Process: CMAQ Problem: STENEX build unsuccessful because of an undened symbol (_MAIN__). Fix: Added -c ag (no linking) to FSTD in bldit.se_noop.pgf. I think that -nofor_main (Fortran is not main program) would also have worked. Process: CMAQ Problem: M3BLD build unsuccessful because of errors in bld_scanner. Fix: Used Scott Spaks revised bld_scanner.c le

24

Process:. CMAQ Problem: STENEX build unsuccessful because F_FLAGS is undened Fix: Changed F_FLAG in bldit.se_noop.pgf to FSTD Process: CMAQ Problem: M3BLD part 2 run was unsucessful because of syntax error in bldit.m3bld Fix: Had an extra space above the rst line (#! /bin/csh -f), when I deleted it, it ran with no errors. Process: CMAQ Problem: JPROC build had undened symbols from ioapi library. (All are dened in libioapi according to nm -g). Fix: Ran a ranlib -cs libioapi.a before the bldit script for JPROC Process: CMAQ Problem: ICON build could not nd $M3LIB/ioapi_3/Darwin/xed_src les. Fix: I had changed the name of the /phd/basics/ioapi3.0/Darwin_ifcgcc to Darwin so I had to redo the soft links in the $M3LIB/ioapi_3/Darwin/xed_src directory. I also had to edit the directory path to the this directory. Process: CMAQ Problem: ICON build error message: sh opt/intel/fce/10.1.006/bin opt/intel/fce/10.1.006/bin: No such le or directory. Fix: Added backslash in front of FC pathname Process: CMAQ Problem: ICON build error message: ld: library not found for -lioapi Fix: I had changed the name of the /phd/basics/ioapi3.0/Darwin_ifcgcc to Darwin so I had to redo the soft links in the $M3LIB/ioapi_3/Darwin/libioapi.a. Process: CMAQ Problem: MCIP run exited abnormally: Error: Illegal character in statement label eld. Fix: Changed FFLAGS to -O3 -FR -convert big_endian -I$(NETCDF) based on Scott Spaks makele Process: CMAQ Problem: MCIP run exited abnormally because it could not nd the ioapi library Fix: Changed from $M3LIB directory for linked libioapi.a to the original libioapi.a in /phd/ basics/ioapi3.0/Darwin.

25

Set Up Time Machine 1. Make sure your Mac is shut down. Unpack the external hard drive you bought separately and attach it to the USB port (or Fire Wire) at the back of the Mac Pro. Plug in and then connect the AC Converter to the external hard drive. Turn on the hard drive and then the computer. 2. If the hard drive is not congured for Mac, copy all its software to your hard drive. Go to UtilitiesDisk Utilities then click on your new external hard drive. Go to the Erase page. Choose the format for the drive: Mac OS Extended (Journaled). Enter a name in the space. Hit the erase button. It will ask you if you really want to erase so click yes. The disk will be reformatted and renamed and will be displayed indented under the original name on the left pane. 3. Automatically, a window will appear asking if you want it to be used for Time Machine. Hit yes. 4. Because retrieval of old les requires they appear in the Finder, set the Finder to show all les. To do this, open up Terminal and on the command line enter: defaults wrote com.apple.Finder AppleShowAllFiles YES. If you later which to turn off this option, enter defaults wrote com.apple.Finder AppleShowAllFiles NO. 5. To exclude folders from the backup, choose Sytem Preferences from the Dock. Click on the Time Machine option. Click on the lock and enter your UNIX password. Choose Options.... Click + and the Finder will appear. Select the drive or folder you want to exclude and then push the Exclude button. The excluded drive/folder will now appear in the Do Not Backup list. Note that the external hard drive is automatically excluded. Click Done and relock the screen. Click the red x to exit. 6. When a backup is in progress, a progress bar will appear. You can stop it by hitting the x and then it will postpone the backup. It automatically stops if you shutdown your computer and restarts after the computer is next turned on. 7. The rst backup takes a long time, but after that backups are quick because only changes to the original backup are recorded. The copy is non-destructive. 8. To restore a le, use Finder to go to the folder in which it originally appeared (It also can be used in Mail and Safari). Then click the Time Machine icon from the Dock. You will see the current Window with all previous windows behind it. Use arrows. mouse, or date bar to nd the old le. The Fly button will take you to the date your window was last changed. Click on the le you want to restore and then press restore. 9. To delete all backups of a le, click on the Time Machine icon, go to Preferences, and click Options. Highlight the le/folder you wish to delete and then press the button that says Delete from all backups. 10. When the external hard drive is full, Time Machine will warn you. You have three options: a. Delete unwanted les taking up space on the external hard drive b. Exchange your hard drive to a larger hard drive with help from Time Machine. c. Reduce the time period for the oldest backup. 11. Note that Time machine does not protect against external hard drive failure. You can use an internal RAID volume for backup to avoid this

26

Wednesday, February 20, 2008

27

Setting Up RAID 1. To name an unnamed hard drive, open Finder and choose preferences. Put a check next to hard drives. They will now appear in Finder and on the Desktop. Click on the hard drive and then on the blue oval around the name. Type in the new name. Note that you cannot rename the RAID drives. 2. To check if the drives are set up for RAID, open Finder and click on Utilities Disk Utility. You should see all three drives (250, 750, 750 MB) listed. Click on Media Raid and then RAID button. This will display the RAID set made up of two RAID slices. A mirrored RAID set automatically copies everything from one drive to the other. A striped RAID does the same but adds a feature for quicker retrieval. Note that RAID only protects against one of the two hard drive failing. If data is corrupted or deleted on one drive, it will be corrupted or deleted on the other drive. 3. Next, you need to set permissions for the RAID drives. Go into Finder and click on the Media RAID icon. Go to the File dropdown menu and choose Get Info. This will show you a picture of the drive. At the bottom, open Sharing & Permissions. This lists names and privileges. Click on the lock symbol and enter your UNIX password. Change system, admin, and everyone to Read & Write by clicking on the up/down arrow heads. Now go down to + and click on it. Under Users & Groups, you will see your own name, choose it and click on Select. Now you will appear in the privileges list. Change your own permissions to Read & Write. This allows you to create and copy les to the RAID set. 4. On the Terminal, you can change to the /Volumes directory and see both the Main and RAID Media drives. Media RAID is a directory and Main is a link. Change directory with cd Me (tab for autocomplete). You will see Media\ Raid/. The path to this drive is /Volumes/Media Raid. 5. The RAID drives will be used for all input and output data, like the Storage drive on the mesocluster, although zipping will be unnecessary. Newly input and newly created data will remain temporarily on the Main drive and then be moved. February 14, 2008

28

Das könnte Ihnen auch gefallen