-
Notifications
You must be signed in to change notification settings - Fork 2
/
gen.scrip.grids.ncl
49 lines (33 loc) · 1015 Bytes
/
gen.scrip.grids.ncl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
;; create SCRIP gridfiles for each model + UDEL
rcms = (/"CRCM","ECP2","HRM3","MM5I","RCM3","WRFG","UDEL"/)
nm = dimsizes(rcms)
do m=0,nm-1
model = rcms(m)
print(""+model)
infile = "landmask."+model+".nc"
fin = addfile(infile,"r")
lat = fin->lat
lon = fin->lon
land = fin->landmask
delete(fin)
outfile = "scrip.grid."+model+".nc"
opt = True
opt@ForceOverwrite = True
if (model .eq. "UDEL") then
rectilinear_to_SCRIP(outfile,lat,lon,opt)
else
curvilinear_to_SCRIP(outfile,lat,lon,opt)
end if
outfile = "scrip.mask."+model+".nc"
opt@Mask2D = land
if (model .eq. "UDEL") then
rectilinear_to_SCRIP(outfile,lat,lon,opt)
else
curvilinear_to_SCRIP(outfile,lat,lon,opt)
end if
delete([/lat,lon,land,infile,outfile,opt/])
end do
;; Copyright 2013 Univ. Corp. for Atmos. Research
;; Author: Seth McGinnis, mcginnis@ucar.edu