Masking out a variable below a particular value using Grads

How to mask out a certain region below a particular water depth or above a particular elevation with GEBCO_2019.nc dataset.

GEBCO_2019.nc is a global topographic and bathymetric chart with 15 arc-sec resolution which can be obtained from https://www.gebco.net/

Below is an example to mask out the ocean part with water depth below 200 m.

reinit
sdfopen GEBCO_08.nc
q file
>
set lon 128 147
set lat 30 46
set mpdset hires
set map 1 1 10
set gxout shaded
d elevation
>
define d200 = maskout(maskout(elevation, elevation-(-200)),0-elevation)
d d200
cbarn
>
open surf_xxxx.ctl
q file 2
define mask = const(d200,10,-u)
d mask
>
set t 1
set z 1
define maskdata=lterp(mask,u.2(t=1))
d maskdata
>
d maskout(u.2(t=1),-maskdata)  
>
draw title Wind resource within 200 m depth