Optimisation of DOMAINcfg/pysrc/local_area.py
Development description
The coding of several subroutines in nemo/tools/DOMAINcfg/pysrc/local_area.py
is inefficient. Recent efforts to create a localised vertical coordinate in eORCA12 takes around 20 hours to process. This is primarily down to the implementation of for
loops in the find_bdy_JI
and weighting_dist.py
.
Code implementation
- Replace
for
loop structure withkdcTree
inweighting_dist.py
to derive closest distance to the boundary of the transition zone. - Vectorise
for
loop structure infind_bdy_JI
using whole arrays.
Initial idealised tests in a jupyter notebook have demonstrated ~240 times speed up. This brings the processing of eORCA12 down to ~5mins.
Documentation updates
None required