NCAR Command Language

1 program Added 2026-02-28T10:15:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: NCL
Provenance: commit 635be28d5e · authored 2026-02-28T13:24:10+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

5 sources · pl_id: pl/ncl
LLM (this repo) · 1PldbLinguistPygmentsHyperpolyglot

Extensions claimed by this language

2 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.ncllinguistprimary103.7K files
.nclpygmentsprimary103.7K files

Related languages

Guarded Command Language (0.49)CCL (0.49)Jacl (0.47)Stata (0.46)GCL (0.45)

LLM-contributed programs

Fibonacci sequence

Provenance: commit 635be28d5e · authored 2026-02-28T13:24:10+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.ncl · license: Public Domain · added: 2026-02-28T10:15:00Z
begin
    fib = new(15, integer)
    fib(0) = 0
    fib(1) = 1
    do i = 2, 14
        fib(i) = fib(i-1) + fib(i-2)
    end do
    print(fib)
end

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
mean_increment.ncl · 3278 B · ext .ncl · seen 4× in SWH
via heuristicrule h/linguist/.ncl/4
swh:1:cnt:1798e231bb4c8594a892fd74f477c889519058b0;origin=https://github.com/NCAR/DART;anchor=swh:1:rev:bc9f6b16a7dcac3aa852dfacc54bf69961e0c6a6;path=/models/wrf/shell_scripts_csh/mean_increment.ncl
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
; find the mean state space increment, output the fields to a single mean file
; that can be used to make plots
; G. Romine 2011-12
; Run for parent domain (d01) only B. Raczka 2024-08
begin

; get the list of files to read in
 fname = "analysis_increment_d01.nc"
 flist = systemfunc("ls ../*/" + fname)
 nfils = dimsizes(flist)
; if we only want say the last 7 days, then grab only the last 28
; here we practice with 3 days
 anl_days = 7
 ntimes = anl_days*4
 if (nfils .gt. ntimes) then
   tempf = flist(nfils-ntimes:nfils-1) 
   delete(flist)
   flist = tempf
   nfils = ntimes
   delete(tempf)
 end if 
 fil   = addfiles(flist, "r")
 ListSetType(fil, "join")

 pull_2D_field_names = (/"T2", "Q2", "U10", "V10", "PSFC"/)
 pull_3D_field_names = (/"U", "V", "THM", "QVAPOR"/)
 npulls = dimsizes(pull_2D_field_names)

; Below will dump out the data to a file for replotting later
    cnew = addfile("mean_increments_d01"+".nc","c")
; work through 2D fields
  do i=0,npulls-1
   print("   Extracting 2d variable "+pull_2D_field_names(i))
   do fil_num=0,nfils-1
;   print(" reading file "+flist(fil_num))
; dimensions are ncljoin, Time, south_north, west_east
; copy zero is the ensemble mean 
    pull_var = fil[fil_num]->$pull_2D_field_names(i)$(:,:,:,:)
    dims = dimsizes(pull_var)
    if (fil_num .eq. 0) then  ; first iteration, make var
     alltimes_var = new ( (/nfils,dims(2),dims(3)/), typeof(pull_var) )
    end if
;    printVarSummary(pull_var)
    alltimes_var(fil_num,:,:) = pull_var(0,0,:,:)
;   printVarSummary(alltimes_var)
    delete(pull_var)
   end do
; average over time (first dimension)
  mean_alltimes_var = dim_avg_n(alltimes_var,0)
; standard deviation over time (first dimension)
  stdv_alltimes_var = dim_stddev_n(alltimes_var,0)
; write to new file
   varname ="mean_"+pull_2D_field_names(i)
   cnew->$varname$ = mean_alltimes_var
   delete(varname)
   varname ="stdv_"+pull_2D_field_names(i)
   cnew->$varname$ = stdv_alltimes_var
   delete(varname)
   delete(alltimes_var)
   delete(mean_alltimes_var)
   delete(stdv_alltimes_var)
   delete(dims)
  end do

; work through 3D fields
 npulls = dimsizes(pull_3D_field_names)
  do i=0,npulls-1
   print("   Extracting 3d variable "+pull_3D_field_names(i))
   do fil_num=0,nfils-1
;    print(" reading file "+flist(fil_num))
; dimensions are ncljoin, Time, level, south_north, west_east
; copy zero is the ensemble mean
    pull_var = fil[fil_num]->$pull_3D_field_names(i)$(:,:,:,:,:)
    dims = dimsizes(pull_var)
    if (fil_num .eq. 0) then  ; first iteration, make var
     alltimes_var = new ( (/nfils,dims(2),dims(3),dims(4)/), typeof(pull_var) )
    end if
;    printVarSummary(pull_var)
    alltimes_var(fil_num,:,:,:) = pull_var(0,0,:,:,:)
    delete(pull_var)
   end do
; average over time (first dimension)
  mean_alltimes_var = dim_avg_n(alltimes_var,0)
; standard deviation over time (first dimension)
  stdv_alltimes_var = dim_stddev_n(alltimes_var,0)
; write to new file
   varname ="mean_"+pull_3D_field_names(i)
   cnew->$varname$ = mean_alltimes_var
   delete(varname)
   varname ="stdv_"+pull_3D_field_names(i)
   cnew->$varname$ = stdv_alltimes_var
   delete(varname)
   delete(alltimes_var)
   delete(mean_alltimes_var)
   delete(stdv_alltimes_var)
   delete(dims)
  end do

end

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.ncl/4.nclpredicates[{"kind": "any", "regexes": ["^load \"", "^begin$", "[0-9]\\.$", "^;"]}]

Contribute — propose a file extension

Tell us where to find evidence about NCAR Command Language (mapped to pl/ncl). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/NCAR Command Language/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← NCAP2 NCL →