This MATLAB codes simulates deterministic or randomized version of the Surface Quasi-Geostrophic (SQG) model in geophysical fluid dynamics. The random dynamics is based on the transport under location uncertainty. The ensuing model is referred to as SQG model under moderate uncertainty (SQG_MU).