The NCAR Command Language NCL .


16 views
Uploaded on:
Category: People / Lifestyle
Description
The NCAR Command Language (NCL). Ethan Alpert Visualization and Enabling Technologies Section, SCD, NCAR. What is NCL?. NCL is an interpreted programming language Array based algebraic operators Unique netCDF data model Traditional programming language constructs
Transcripts
Slide 1

The NCAR Command Language (NCL) Ethan Alpert Visualization and Enabling Technologies Section, SCD, NCAR

Slide 2

What is NCL? NCL is a deciphered programming dialect Array based mathematical administrators Unique netCDF information demonstrate Traditional programming dialect develops Wide assortment of representation abilities: Maps, Contours, XY, Vectors, Streamlines, labelbars, content, tickmarks and in addition line, marker and polygon primatives Output to X, NCGM, PostScript Scripts accessible to change over to picture designs

Slide 3

What is NCL? NCL is accessible on most UNIX stages NCL can keep running in group or intuitive mode Interactive mode has charge history and order line altering Many helpful capacities and techniques Code combination device (capacity to import FORTRAN)

Slide 4

Why utilize NCL? Fit information handling environment with numerous valuable capacities Strong and simple to utilize record I/O ability Useful for the improvement and reconciliation of FORTRAN preparing schedules Robust distribution quality 2D illustrations w/point by point maps Mature item Free!

Slide 5

Downloading NCL Go to: http://ngwww.ucar.edu/ncl/download Read and consent to GPL permit Fill out short enlistment frame Download pairs Precompiled variants exist for: IBM RS6000, DEC Alpha, Sun Solaris, Red Hat Linux and SGI IRIX

Slide 6

Installing NCL Uncompress tar record in establishment index: compact disc/usr/nearby gunzip ncl-4.2.0.Solaris2.7_sun4.tar.gz Untar: tar –xvf ncl-4.2.0.Solaris2.7_sun4.tar Set NCARG_ROOT environment variable: setenv NCARG_ROOT/usr/neighborhood/set way = (/usr/nearby/receptacle $PATH)

Slide 7

Important assets for utilizing and learning NCL Main NCL landing page: http://ngwww.ucar.edu/ncl Contains connections to documentation, cases, FAQ, ncl-talk email rundown, and upgrade data

Slide 8

Reference Documentation Main reference documentation http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/Overview.html All sentence structure and proclamations characterized Links to all strategies and capacities Basic review of illustrations Usage tips Information on bringing in FORTRAN Information on bolstered information groups Function and Procedure Reference http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/NclFuncsAndProcs.html

Slide 9

Getting Started Using NCL (GSUN) Getting Started Using NCL (GSUN) http://ngwww.ucar.edu/ngdoc/ng/ug/ncl/gsun/Intended for clients with next to zero NCL encounter Some programming dialect information is accepted Learning by case idea Starts with nuts and bolts and works from that point Provides an arrangement of straightforward capacities written in NCL to be utilized by new clients rather than NCL\'s protest situated Graphics interface The "Past the Basics" area covers joining FORTRAN into NCL

Slide 10

Additional assets for utilizing and learning NCL clients email list http://ngwww.ucar.edu/ncl-talk/Email list dedicated to NCL dialog Read by NCL engineers and bolster staff Examples page http://ngwww.ucar.edu/ncl/examples.html CCSM NCL page for extra cases http://www.cgd.ucar.edu/csm/bolster

Slide 11

Graphics Reference Documentation The High Level Utilities Reference Guide http://ngwww.ucar.edu/ngdoc/ng/ref/hlu/HluClasses.html Only for clients wishing to outline their own particular custom perception or for whom the default GSUN or WRF case are lacking NCL reference pages give brief utilization portrayal GSUN "Past the Basics" segment covers use too

Slide 12

Data Types Numeric Types double 64bits +/ - ( 2.22507e-308 ) to (8.98846e+307) float 32bits +/ - ( 1.175494e-38 ) to (1.701411e+38) long 32bits +/ - ( 2.147483e+09 ) (64bit on SGI) integer 32bits +/ - ( 2.147483e+09 ) short 16bits +/ - ( 32767 ) byte 8bits ( 0 ) - ( 255 ) Non-numeric Types string character graphic file logical

Slide 13

Variables Based on the netCDF information show Values, measurements Optionally: characteristics, facilitate information (meta-information) 4 sorts of factors Regular factors (in memory) File factors (reference documents) Graphic factors (reference plots) Lists (compartments for at least one of the above factor sorts)

Slide 14

Attributes Descriptive information around a variable or document Any information sort however "document" and "rundown" information sorts; 1D req. Doled out and referenced utilizing "@" character T@long_name = "temperature" T@_FillValue = - 999.0

Slide 15

Dimensions might be "named" Provides an option approach to reference subscripts Assigned with "!" character Example T!0 = "time" T!1 = "lat" T!2 = "lon" Allows for measurement reordering T(lon|:,lat|:,time|:) Used to dole out organize factors

Slide 16

Coordinate Variables Allow for more natural determination T({12},{35:45},{-95:- 105}) 1D exhibits; monotonically expanding or diminishing Can just be doled out to a named measurement Assigned utilizing "&" character T&time = (/0,6,12,18,24/)

Slide 17

Reading information from records For netCDF, HDF, GRIB Use addfiles work A= addfile("tmp.nc","r") K = A->variable For fortran double documents fbindirread, fbinread For content asciiread

Slide 18

Algebraic Operations Array based polynomial math Standard administrators: - , ^, *,/, %, + Unique administrators: %, #, <, > Logical administrators: .eq., .ne., .le., .gt., .ge., .lt., .and., .xor., .or., .not. Dimensionality of operands should either coordinate or be scalar Missing qualities are sifted through by distinguishing missing worth with _FillValue trait

Slide 19

Statements if - Requires a solitary scalar coherent esteem (i.e. Genuine or False) multi-dimensional sensible qualities must be lessen to single True or False esteem any - returns True if any of the information qualities are genuine all - returns True if the majority of the information qualities are valid (barring missing qualities) do - Do proclamations fundamentally the same as F77 do var = startval, endval [, stride] . . . end do do while(expression) . . . end do

Slide 20

Statements task (=) If left-hand-side unclear right-hand-side doled out to left-hand-side image All measurement names, facilitate factors, and ascribes replicated or overwritten to left-hand-side UNLESS right-hand-side encased in (/... /) Example: a = b ; measurements, properties, and arrange ; factors and additionally esteem replicated a = (/b/) ; just estimation of b is duplicated If left-hand-side is characterized information sorts must match and dimensionality

Slide 21

Functions and methodology Parameters are "go by reference" Support for meanings of NCL source based capacities and techniques Example: work myfunc(x,y[*][*]:numeric) start … end

Slide 22

Incorporating FORTRAN codes Create FORTRAN stub content document or add remarks to existing FORTRAN codes C NCLFORTSTART FUNCTION ARCLN(NUMPNT, POINTX, POINTY) DIMENSION POINTX(NUMPNT), POINTY(NUMPNT) C NCLEND Call wrapit77 wrapit77 < wrapper_input >! wrapper_W.c

Slide 23

Incorporating FORTRAN codes Compile FORTRAN and C wrapper to make .o documents Link question records to make shared protest Linux Example: nhlcc - c fcode_W.c nhlf77 - c fcode.f ld - shared - o fcode.so fcode_W.o fcode.o

Slide 24

Loading and Calling FORTRAN shared articles Use outer order Syntax: outside fcode "way to shared protest" Calling FORTRAN schedules fcode::arcln(n,x,y)

Recommended
View more...