1.Find Source grid tx0.1v3

1.1 install pop_tools

conda install -c conda-forge pop-tools

1.2 output NetCDF grid file

python3
import xarray as xr
import pop_tools
ds = pop_tools.get_grid('POP_tx0.1v3', scrip=True)
ds.info()
ds.to_netcdf('./tx0.1v3_grid.nc')

2. Generate destination grid(Global/Regional)

Global destination grid: lat(-89.95:0.1:89.95),lon(0:0.1:360)

ncremap -g grid_0.1x0.1_uni_global.nc -G ttl='Equi-Angular grid 1800x3600'#latlon=1800,3600#lat_typ=uni 

Regional destination grid:KOE lat(25.05:0.1:44.95),lon(140.05:0.1:169.95)

ncremap -g grid_0.1x0.1_uni_regional_KOE.nc -G ttl='Equi-Angular Kuroshio&Oyashio Region grid 200x300'#latlon=200,300#lat_typ=uni#snwe=25.0,45.0,140.0,170.0

3. Generate weight file(Global/Regional)

ncremap -a bilinear -s tx0.1v3_grid.nc -g grid_0.1x0.1_uni_global.nc -m tx0.1v3_to_0.1x0.1_uni_global.nc

ncremap -a bilinear -s tx0.1v3_grid.nc -g grid_0.1x0.1_uni_regional_KOE.nc -m tx0.1v3_to_0.1x0.1_uni_regional_KOE.nc

4. remap(Global/Regional)

 ncks -v SSH g.e20.G.TL319_t13.control.001_contd.pop.h.0148-01-05.nc ./g.e20.G.TL319_t13.control.001_contd.pop.h.0148-01-05.SSH.nc

 ncremap -m tx0.1v3_to_0.1x0.1_uni_regional_KOE.nc g.e20.G.TL319_t13.control.001_contd.pop.h.0148-01-05.SSH.nc g.e20.G.TL319_t13.control.001_contd.pop.h.0148-01-05.SSH.remap.KOE.nc

 ncremap -m tx0.1v3_to_0.1x0.1_uni_global.nc g.e20.G.TL319_t13.control.001_contd.pop.h.0148-01-05.SSH.nc g.e20.G.TL319_t13.control.001_contd.pop.h.0148-01-05.SSH.remap.global.nc

Ref:
https://pop-tools.readthedocs.io/en/latest/examples/get-model-grid.html
http://nco.sourceforge.net/nco.html#ncremap
http://nco.sourceforge.net/nco.html#Grid-Generation

Last modification:March 4th, 2021 at 07:46 pm
If you think my article is useful to you, please feel free to appreciate