# An Asynchronous Parallel I/O Framework for Mass Conservation Ocean Model
## 1 Introduction  
The Mass Conservation Ocean Model (MaCOM) is a numerical ocean model developed by the National Marine Environmental Forecasting Center of China based on the non-Boussinesq momentum equations in the pressure coordinate system. The MaCOM, along with its data assimilation system, is capable of providing short-term forecasts of temperature, salinity, flow velocity, and sea surface height from global basins to regional areas with a valid forecasting period of 7 days. The MaCOM utilizes cubed sphere grids and the pressure vertical coordinate system. The physical solving equations of the MaCOM are based on the Navier-Stokes equations, which are simplified with methods including the spherical approximation of the Earth, the thin layer approximation of seawater, and the hydrostatic balance approximation. The simplified equations for solving the horizontal velocity component \(\mathbf{u}\) in the Cartesian coordinate system are shown in Equations (1) and (2), \(\Phi\) represents geopotential height, \(\zeta_{a}\) represents absolute vorticity, KE (\(KE=\frac{1}{2}(u^{2}+v^{2})\)) represents the kinetic energy of the fluid element, \(G^{diss}\) represents the parameterization of small-scale physics for horizontal momentum, \(G^{diss}\) represents the parameterization of small-scale physics for vertical momentum, \(G^{force}\) represents the parameterization of surface turbulent fluxes between the atmosphere and ocean, and \(G^{flag}\) represents the parameterization of drag between water and land/ice. The equation for solving the vertical velocity \(\omega\) in the \(p\) coordinate system is shown in Equation (3), and \(\
abla_{p}\) represents the generalized derivative vector operator in the pressure vertical coordinate. The equations for solving the active tracers (temperature \(T\) and salinity \(S\)) are shown in Equations (4) and (5), where \(G^{diff}\) represents the parameterizationof small-scale physics for horizontal tracer diffusion, \(G^{\textit{diff}}\) represents the parameterization of small-scale physics for vertical tracer diffusion. \[\frac{\partial u}{\partial t}=-\frac{\partial\Phi}{\partial x}+\zeta_{a}v-\frac {\partial KE}{\partial x}-\omega\frac{\partial u}{\partial p}+G_{u}^{\textit{ hdiss}}+G_{u}^{\textit{pdiss}}+G_{u}^{\textit{force}}+G_{u}^{\textit{ drag}} \tag{1}\]  
\[\frac{\partial v}{\partial t}=-\frac{\partial\Phi}{\partial y}-\zeta_{a}u- \frac{\partial KE}{\partial y}-\omega\frac{\partial v}{\partial p}+G_{v}^{ \textit{hdiss}}+G_{v}^{\textit{pdiss}}+G_{v}^{\textit{force}}+G_{v}^{\textit{ drag}} \tag{2}\]  
\[\frac{\partial\omega}{\partial p}=-\
abla_{p}\cdot\mathbf{u} \tag{3}\]  
\[\frac{\partial T}{\partial t}=-\
abla_{p}\cdot(TU)+G_{T}^{\textit{hdiff}}+G_{T }^{\textit{rdiff}}+G_{T}^{\textit{force}} \tag{4}\]  
\[\frac{\partial S}{\partial t}=-\
abla_{p}\cdot(SU)+G_{S}^{\textit{hdiff}}+G_{ S}^{\textit{rdiff}}+G_{S}^{\textit{force}} \tag{5}\]  
NetCDF (Network Common Data Form) is the data format of I/O (Input/Output) in MaCOM. It is a machine-independent format that is widely used for storing and retrieving multidimensional data in large-scale scientific applications such as climate, oceanic, and atmospheric models [1]. It is also user-friendly to read and write data in files through a variety of interface libraries of NetCDF. In the performance test of MaCOM, I/O becomes a bottleneck that impedes efficiency, particularly when a large scale of parallel processes is involved. As the number of computing processes increases, the computation time decreases proportionally, which shows strong scalability. However, the time of I/O decreases disproportionately with computation. For instance, for a global 1/12-degree modeling of ocean circulation with an output interval of 2 h that is used in forecast result comparison and artificial intelligence (AI) models, I/O takes up over 40% of the entire execution time when MaCOM runs on 1024 processors.