Li Jiajing, Yang Ze, Wang Bin, et al. A quality detection method and its implementation for CMA numerical prediction model code. J Appl Meteor Sci, 2025, 36(2): 155-163. DOI: 10.11898/1001-7313.20250203.
Citation: Li Jiajing, Yang Ze, Wang Bin, et al. A quality detection method and its implementation for CMA numerical prediction model code. J Appl Meteor Sci, 2025, 36(2): 155-163. DOI: 10.11898/1001-7313.20250203.

A Quality Detection Method and Its Implementation for CMA Numerical Prediction Model Code

  • The coordinated research and development of numerical prediction at the national and provincial levels, conducted by CMA is an innovative shift from CMA Earth System Modeling and Prediction Center to a collaborative approach involving multiple stakeholders. However, diverse technical backgrounds and varying programming proficiency levels of participants present a significant challenge in ensuring the code quality of the numerical prediction model. It is required that the research and development support platform should possess code quality detection capabilities, providing tools to promptly identify and analyze the code submitted by developers, and offering feedback to enhance the software quality and work efficiency.Static detection methods can address challenges associated with reproducing runtime errors in numerical model programs. Additionally, they facilitate the analysis of specific critical code segments, thereby improving detection efficiency. Therefore, it focuses on static detection methods and primarily aims at identifying poor programming practices and performance defects in CMA numerical prediction model codes. There are limited research efforts focused on the quality analysis of numerical prediction model codes, particularly concerning performance defects such as memory access issues and I/O operations. Additionally, the substantial volume of numerical prediction model code places greater demands on the accuracy and performance of detection methods.In response to these issues, a quality detection method for CMA numerical prediction model is proposed and implemented. The method emphasizes 8 standard rules in CMA numerical prediction model coding, which encompass subroutine definitions, array operations, and I/O operations. Finite state machines are utilized to abstractly represent these rules. Key technologies, including program code parsing, abstract syntax tree matching, and flow-sensitive static program analysis, are employed to identify violations of these rules. The approach to managing branch and loop statements can effectively mitigate the problem of path explosion. Based on it, the detection tool is implemented, and its system framework, along with the key technologies, is introduced.The tool is deployed on CMA numerical prediction innovation platform and has been successfully applied to the coordinated development of regional numerical models. The performance, result analysis, and code improvement suggestions for quality inspection tool of CMA-MESO V5.1 are presented in the experimental section. Experimental results demonstrate that the method satisfies performance requirements for code quality detection and holds practical significance for enhancing the quality of model code.
  • loading

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return