roms_surface_geostrophic_velocity

I found the function roms_surface_geostrophic_velocity.m, created by John Wilkin to process ROMS (Rutgers). I wonder if you guys can give me an idea of how to do the same with CROCO outputs. I tried to adapt that script but I got stuck somewhere.

Thanks

Julio