NCL Windows System Installation

Source: Internet
Author: User
Tags valid email address

The installation of NCL under Linux is very easy, just download the appropriate version of the file and set the environment variable to use.
The installation of NCL under Windows is cumbersome and requires a virtual Linux environment (cygwin/x) to be installed first.

This post will detail the installation process of NCL on the Windows platform as follows, and it is easy to install NCL for users who only have basic Windows operating skills.

I. Introduction of NCL
Ii. preparatory work
Third, installation cygwin/x
Iv. familiar with the cygwin/x environment
V. Installation of NCL
Vi. example of the operation of NCL
Seven, syntax highlighting (this section is for interested users to refer to)
Viii.. hluresfile file (This section is for interested users)
Nine, FAQ
Ten, Get help

I. Introduction of NCL

NCL (NCAR Command Language) was developed by NCAR's "Computational & Information Systems Laboratory".

NCL is a programming language designed to analyze and visualize data. Mainly used in the following three areas:

Document Input/output (file-input and output):

Information processing (data processing):

Graphical display (graphical displays): Produces a black-and-white, grayscale, or color map at the publishing level.

From 5.0 onwards, NCL and NCAR graphics have been packaged together for distribution. March 4, 2009, NCL released the latest version of 5.1.0, which updated the map projection, fixed some bugs, added more functions and resources. For the addition of a map with Chinese provincial boundaries (see Figure 1-1).

Ii. preparatory work

2.1 Installation Environment

The installation environment is WinXP Professional SP3, and the following assumptions are made:

Computer Name: TEAM
User name: Grissom
Installation directory: D:\download

User in the actual installation, please replace the computer name and user name in this tutorial according to the information of your system.

Special Note: The user name can not appear in the space, or there will be some problems in the use.

2.2 Downloads cygwin/x

Cygwin/x=cygwin+x. In layman's words, cygwin/x can implement a command line + graphics Linux simulation environment on the Windows platform.

The cygwin/x is very flexible to download and install, and the user can customize it according to their needs. To facilitate installation, I have downloaded the required packages for the installation of NCL, including compilers, editors, X servers, etc., which can be downloaded directly from the following address and extracted to the D:\download\install directory.

Cygwin Download:http://www.lasg.ac.cn/xglm/2009/2/wnx45afnq7.htm


The following is a detailed introduction to Cygwin and cygwin/x for reference:

***************************************************
Cygwin:http://www.cygwin.com/

Cygwin is a collection of many free software that was originally developed by Cygnus Solutions and is used on various versions of Microsoft Windows to run UNIX class systems. The primary purpose of Cygwin is to port software on POSIX systems (such as Linux, BSD, and other Unix systems) to Windows by recompiling. Cygwin porting works better on Windows NT, Windows 2000, Windows XP, and Windows Server 2003, and is relatively poor on Windows 95 and Windows 98. Currently Cygwin is maintained by Red Hat and so on.

cygwin/x:http://x.cygwin.com/

Cygwin/xcygwin/x is an X Window system implementation that runs on Microsoft Windows. It is free software.

Cygwin/x is part of the Cygwin program and can be installed with the Cygwin standard installer.

cygwin/x originally used XFree86, but now uses the X.Org server because it is concerned that the new license for XFREE86 is incompatible with the GPL used by Cygwin.

The most recent release adds support for the "No root Window" operation, where the root window of x is not displayed, and the X app looks like a mature top-level application running on the Windows desktop. Before this feature was introduced, all x windows were confined to a separate container window (styled like an MDI child window).
***************************************************

2.3 Downloads NCL

NCL:http://www.earthsystemgrid.org/

Sign in and click on the link below to enter the final download page:

Scientific Data processing and visualization software
NCAR Command Language (NCL)
NCL 5.1.0 Release
NCL 5.1.0 binaries (not opendap-enabled)
NCL 5.1.0 binary for cygwin/x (Windows)

The downloaded file isncl_ncarg-5.1.0.cygwin_nt-5.1_i686.tar.gz, and put it under D:\download for subsequent operations.

Note: The so-called "opendap-enabled" is mainly through the network access, processing data, the current Cygwin version of NCL does not support this feature.

Regarding ESG registration, it is very simple, just provide effective information can pass smoothly.
The main purpose of registration is to collect user information, so that software development can obtain more funding.

Here's what the developer said:
This download are different than what do you do before, and requires a registration with a valid email address. We is required to keep metrics in how many people is downloading our software (for funding purposes), but we do not shar e Personal information (email ddresses, names, etc) with anybody.

Suggest that users use this method to download, they have the software is free to open, but also for the development of NCL to add some popularity bar. I don't have a download available here.

Third, installation cygwin/x

Under D:\download\install, double-click "Setup.exe" and the Program Installation Wizard interface appears (Figure 3-1).

Figure 3-1, Installation Wizard



Click "Next" and "Choose installation Type" appears (Figure 3-2), select "Install from Local Directory".

Figure 3-2, selecting the installation method

Click "Next" and "Choose installation Directory" appears (Figure 3-3). The default root directory is "C:\cygwin", please change to "D:\cygwin", other options are not moved.

Figure 3-3, select the installation destination

Click "Next" and the "Select Local package Directory" appears (Figure 3-4).

Figure 3-4, select the installation source


Clicking "Next" appears, "Select Packages" (Figure 3-5), which is a very important step.

Figure 3-5, selecting a package



In this interface (Figure 3-5), options such as "Keep", "Prev", "Curr", "Exp" at the top of the window are only used to change the way the current tree structure is displayed, without any effect on the installation. List packages by category in categories, such as "Base", "Database" and so on, click "+" above to expand the class package.

Click on the marked Red line, you can switch in the "Default" "Install" "Reinstall" "Uninstall" four kinds of installation states, Select "Install", and confirm in X11 "Xorg-cf-files" and " Xorg-server "is selected as the" Install "status, otherwise there will be a 3-6 warning message.

Figure 3-6, if this warning message appears, go back to the previous step and select




After figure 3-5, click "Next" to install, z until the figure 3-7 appears, click "Done" to end the installation of cygwin/x.
At the same time, the Windows Startup menu generates "Cygwin" and "Cygwin-x" two program groups, and the "Cygwin" icon is generated on the desktop (Figure 3-8).

Figure 3-7, complete the installation



Figure 3-8, generating program groups and desktop icons

Iv. familiar with the cygwin/x environment

4.1 Build User Run environment

Double-clicking the "Cygwin" icon on the Windows desktop launches a character terminal (term), creating a user home directory-"/home/grissom"-and copying several profiles to the user directory (Figure 4-1). The shell used by the user is "bash".

Figure 4-1, generating the user home directory



In a Linux environment, the "." The files that begin with are usually the configuration files generated by the system or software and can be modified to customize your work environment.

Note: "." File is a hidden file and cannot be created directly in Windows "." Start the file, create it in the Cygwin environment.

Tips:
Add the following line to the. BASHRC:
Export ps1= "\[email protected]\h:\ $PWD >"

After saving the file, enter the following command to make the settings effective:
source. BASHRC

This setting will cause bash's command prompt to appear as "user name @ Computer name: Current directory >" for future operations.

4.2 Cygwin directory with Windows directory

From figure 4-2 you can better see the relationship between the Cygwin directory and the Windows directory, and the Windows directory corresponding to the user home directory "/home/grissom" generated in 4.1 is "D:\cygwin\home\Grissom".

Figure 4-2,cygwin The relationship between the directory and the Windows directory

Users can also access the files of other drive characters in the Cygwin environment, and the corresponding relationships are as follows:


Windows directory-Cygwin directory
C:/cygdrive/c
D:/cygdrive/d
E:/cygdrive/e

And so on, for example, the "D:\download" directory under Windows is "/cygdrive/d/download" in the Cygwin environment.

4.3 Ways to start x server

You can start the character terminal by double-clicking the "Cygwin" icon on the desktop, but you will need to start X Server to run NCL.

1, find "D:\cygwin\bin\startxwin.bat" in Windows Explorer, right-click on it, select "Send To", "desktop Shortcut", and named "Startxwin", then just double click this icon, you can start X Server and Xterm.

2. After double-clicking the "Cygwin" icon on the desktop to start the character terminal, enter the following command to start x Server (Figure 4-3):
Startxwin.bat

Figure 4-3, run the "startxwin.bat" command to start the X Server



3, similar to Method 2, enter the following command to start x Server:
sh/bin/startxwin.sh

Recommended Method 1.

Note: Do not restart X Server again, otherwise the following error will occur (Figure 4-4):

Figure 4-4, this error message occurs if x Server is started more than once



4.3 Starting multiple xterm

4.4 Customization ". XWINRC "

v. Installation of NCL

5.1 Installing NCL

the user shell is "bash".
In Xterm, type the following command (#后为命令说明):

Cd/usr/local # NCL Loading directory
Tar xvfz/cygdrive/d/download/ncl_ncarg-5.1.0.cygwin_nt-5.1_i686.tar.gz # decompression NCL Software
CD # Return to User home directory

5.2 Setting the NCL environment variable

Edit the ". BASHRC" file in the user's home directory and add the following three lines:

Export ncarg_root=/usr/local
Export Path=/usr/local/bin: $PATH
Export display=:0.0

The description is as follows:
First line, set NCL environment variable
Second line, set the search path
Third row, setting the display environment

After saving the file, run the following command to make the settings effective (see Figure 6-1):
source. BASHRC

At this point, the NCL installation ends.

Vi. example of the operation of NCL

The operation can verify that NCL is properly installed and learns NCL programming.

Example one:

In the user's home directory, enter the following two commands in turn:

Cp/usr/local/lib/ncarg/nclex/xyplot/xy04n.ncl.
NCL Xy04n.ncl

Description
The first command, copy the sample file Xy04n.ncl to the current directory, and note the most recent ".", which indicates the current directory
Second command, run NCL and display the graph.


Figure 6-1, running the NCL example



Example two:

NCL provides a script "Ng4ex" that can run a series of examples from gsun01n, gsun02n ..., gsun11n.
Take gsun08n as an example, enter the following command in the user's home directory:

Ng4ex gsun08n

In addition to displaying graphics, the command also copies the sample file "Gsun08n.ncl" to the current directory and generates files of different formats, such as NCGM, PDF, PS, for different purposes.
Where the NCGM (NCAR computer Graphics Metafile) file can be viewed in "IDT" (Figure 6-3) or "Ctrans" (Figure 6-4), the PDF file can be viewed as "xpdf" or directly in Windows with Acrobat Reader view.

The following commands are used:

IDT GSUN08N.NCGM &
ctrans-d X11 GSUN08N.NCGM &

The "&" at the end of the command is placed in the background.


Figure 6-2, running Ng4ex




Figure 6-3, run IDT to display the NCGM file




Figure 6-4, run Ctrans display NCGM file

Seven, syntax highlighting

Edit NCL files in a Cygwin environment, using either VI (VIM) or Nedit. VI is unix/linux under the classic text editing software, but not familiar with Unix/linux users may not be accustomed to, Nedit is a graphical interface of the full-screen editing software, very close to Windows software, relatively easy to get started.

The various text editors in the Windows environment can edit NCL files, such as Notepad, UltraEdit, EditPlus, etc., and users can choose the appropriate editor based on their usage habits.

If the user is interested, you can add highlighting to NCL edit. Note: These highlighting syntax shows that the files are provided by the user, and the NCL development team does not provide official support.

7.1 nedit Syntax highlighting

See also: http://www.ncl.ucar.edu/Support/nedit.shtml

First, download this filencl.nedit (11.43 KB) is saved to the user's home directory/home/grissom (that is, D:\cygwin\home\Grissom) and is named "Ncl.nedit".

Execute the following command under the user's home directory:

Nedit-import Ncl.nedit

This command will launch the Nedit software, click "Preferences" in the menu, select "Save Defaults ..." and the following message appears:

Default preferences'll is saved in the file:
/home/grissom/.nedit/nedit.rc
Saving'll incorporate SETTINGS from FILE:ncl.nedit

Click "OK".
Description: After the first run, the ". Nedit" Directory is generated under the user's home directory, and the Nedit configuration files are located in this directory Nedit.

Start Nedit edit NCL file again to display the effect as shown in Figure 7-1.


Figure 7-1,nedit Editing the highlighting effect of "GSUN08N.NCL"



7.2 Vim Syntax highlighting

NCL Windows System Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.