Skip to content

Commit aa52dae

Browse files
author
Kasra Farmer
committed
changing the NCL function to include the optimized region while subsetting WRF outputs
1 parent 68469f7 commit aa52dae

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

assets/coord_wrf_idx.ncl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
;---coordinate variable path and and name must be entered as input arguments
3030
a = addfile(coord_file,"r")
31-
xlat = a->XLAT(0,:,:)
32-
xlon = a->XLONG(0,:,:)
31+
glat2d = a->XLAT(0,:,:)
32+
glon2d = a->XLONG(0,:,:)
3333

3434
;---variable names below should be defined as input arguments
3535
; minlat
@@ -44,13 +44,13 @@
4444

4545
;---Get xy indexes, and then use these to get lat/lon values back again.
4646
opt = True
47-
loc = wrf_user_ll_to_xy(a,(/minlon,maxlon/),(/minlat,maxlat/),opt)
47+
loc = region_ind (glat2d, glon2d, minlat, maxlat, minlon, maxlon)
4848

4949
;---print the following box of data: [minlonidx, maxlonidx, minlatidx, maxlatidx]
50-
minlonidx = loc(0,0)
51-
maxlonidx = loc(0,1)
52-
minlatidx = loc(1,0)
53-
maxlatidx = loc(1,1)
50+
minlonidx = loc(2)
51+
maxlonidx = loc(3)
52+
minlatidx = loc(0)
53+
maxlatidx = loc(1)
5454
print(minlonidx+","+maxlonidx)
5555
print(minlatidx+","+maxlatidx)
5656
;---END

0 commit comments

Comments
 (0)