ParNCLDeveloperInfo/SimpleParNCLScripts: sfvp_eul.ncl

File sfvp_eul.ncl, 796 bytes (added by jayesh, 5 years ago)

Calculate stream function and velocity potential

Line 
1begin
2fili = systemfunc("ls eul26x48x96.t.3.nc")  ; 3 files     
3
4; Add the input files
5f = addfiles(fili, "r")
6
7; Read U and V
8U = f[:]->U
9V = f[:]->V
10
11; Allocate memory for stream function and velocity potential
12; on the mesh
13sf = new(dimsizes(U), typeof(U), U@_FillValue)
14sf@long_name = "Stream Function, calculated from U and V"
15vp = new(dimsizes(U), typeof(U), U@_FillValue)
16vp@long_name = "Velocity Potential, calculated from U and V"
17
18; Calculate stream function and velocity potential
19uv2sfvpa(U, V, sf, vp)
20
21; Create a file for writing out the results
22filo = "sf_vp_out.nc"
23fo = addfile(filo, "cw")
24fo@desc = "The results in this file were created using ParNCL and ParGAL"
25
26; Write stream function and velocity potential on the mesh
27; to the output file
28fo->sf = sf
29fo->vp = vp
30
31end
32