CN115620824B - Air quality model processing method, device, equipment and medium - Google Patents

Air quality model processing method, device, equipment and medium Download PDF

Info

Publication number
CN115620824B
CN115620824B CN202211372717.XA CN202211372717A CN115620824B CN 115620824 B CN115620824 B CN 115620824B CN 202211372717 A CN202211372717 A CN 202211372717A CN 115620824 B CN115620824 B CN 115620824B
Authority
CN
China
Prior art keywords
matrix
chemical reaction
calculation
air quality
solver
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211372717.XA
Other languages
Chinese (zh)
Other versions
CN115620824A (en
Inventor
马金钢
陈焕盛
吴剑斌
金鑫
范凡
余芬芬
王文丁
秦东明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
3Clear Technology Co Ltd
Original Assignee
3Clear Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 3Clear Technology Co Ltd filed Critical 3Clear Technology Co Ltd
Priority to CN202211372717.XA priority Critical patent/CN115620824B/en
Publication of CN115620824A publication Critical patent/CN115620824A/en
Application granted granted Critical
Publication of CN115620824B publication Critical patent/CN115620824B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/10Analysis or design of chemical reactions, syntheses or processes
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C10/00Computational theoretical chemistry, i.e. ICT specially adapted for theoretical aspects of quantum chemistry, molecular mechanics, molecular dynamics or the like

Abstract

The application provides a processing method, a device, equipment and a medium of an air quality model, which aim to solve the problems that the air quality model is long in calculation time, low in efficiency and difficult to widely apply, and the method comprises the following steps: determining a chemical reaction mechanism of the air quality model, and determining a chemical reaction equation for meteorological observation data and pollutant data based on the chemical reaction mechanism; a chemical reaction solver that determines the air quality model; generating one or more calculation code files based on the chemical reaction equation and the chemical reaction solver using a kinetic preprocessor KPP; and executing the one or more calculation code files based on a depth calculation processor DCU, and solving the chemical reaction concentration of each substance in the chemical reaction equation at different moments. By the method, a chemical mechanism and a solving mode can be flexibly adapted, the calculating process of the DCU is combined to effectively accelerate the model, the calculating time is shortened, and support is provided for the wide application of the air quality model.

Description

Air quality model processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of environmental protection technologies, and in particular, to a method, an apparatus, a device, and a medium for processing an air quality model.
Background
An air quality model is a mathematical model that simulates the physical and chemical processes that affect the diffusion and reaction of atmospheric pollutants.
Taking an OBservation-based Model (OBM) as an example, it takes hydrocarbons, NO, CO, O 3 And meteorological conditions are input into the model to simulate the atmospheric photochemical reaction process, and then the relative incremental reactivity of different ozone precursors is calculated by reducing the concentration of specific precursors (simulating the reduction of pollution sources), so that the sensitivity of ozone generation to NOx and different types of VOCs can be judged.
However, the air quality model generally needs to calculate multi-site data according to requirements, which has huge calculation amount, high calculation time cost and low efficiency, and limits the wide application of the air quality model to a certain extent.
Disclosure of Invention
In view of the above problems, namely, the problems of long calculation time and low efficiency of the air quality model, the application provides a method, a device, equipment and a medium for processing the air quality model.
In order to achieve the above object, the present application provides the following technical solutions:
according to an aspect of the present application, there is provided a method for processing an air quality model, including:
determining a chemical reaction mechanism of the air quality model, and determining a chemical reaction equation for meteorological observation data and pollutant data based on the chemical reaction mechanism;
a chemical reaction solver that determines the air quality model;
generating one or more calculation code files based on the chemical reaction equation and the chemical reaction solver using a kinetic preprocessor KPP;
and executing the one or more calculation code files based on a depth calculation processor DCU, and solving the chemical reaction concentration of each substance in the chemical reaction equation at different moments.
In one embodiment, the determining the chemical reaction mechanism of the air quality model comprises:
and selecting an MCM mechanism as a chemical reaction mechanism of the air quality model.
In one embodiment, the chemical reaction solver for determining the air quality model comprises:
and selecting a normal differential equation solver as a chemical reaction solver of the air quality model.
In one embodiment, the employing a kinetic preprocessor KPP generates one or more calculation code files based on the chemical reaction equation and the chemical reaction solver, comprising:
inputting the chemical reaction equation as a dynamics description file and the chemical reaction solver as an auxiliary file into a dynamics preprocessor KPP tool;
generating, at the dynamics preprocessor KPP tool, one or more calculation code files based on the dynamics description file and the assistance file.
In one embodiment, the ordinary differential equation solver is a rosenblock solver, the rosenblock solver including a linear equation set with an a matrix as a reaction coefficient, the one or more calculation code files including calculation code of the linear equation set with an a matrix as a reaction coefficient, the depth-based calculation processor DCU executing the one or more calculation code files, including:
performing matrix decomposition on the matrix A based on an LU decomposition Gaussian elimination method to obtain a decomposition matrix;
and determining a plurality of matrix computing tasks corresponding to the computing codes based on the decomposition matrix, and executing the matrix computing tasks in parallel based on the DCU.
In one embodiment, the determining, based on the decomposition matrix, a matrix calculation task corresponding to the calculation code includes:
and establishing a matrix elimination tree according to the decomposed topological order based on the decomposed matrix, and determining a plurality of matrix calculation tasks corresponding to the calculation codes based on the matrix elimination tree.
In one embodiment, after the matrix elimination tree is built, further comprising:
nesting an MPI communicator in the matrix elimination tree;
the DCU-based parallel execution of the plurality of matrix computing tasks includes: and acquiring the matrix calculation tasks distributed by the MPI communicator based on the DCU, and executing the matrix calculation tasks in parallel according to the structure of the matrix elimination tree.
According to another aspect of the present application, there is provided a processing apparatus of an air quality model, including:
a first determination module configured to determine a chemical reaction mechanism of the air quality model and determine a chemical reaction equation for the meteorological observation data and the contaminant data based on the chemical reaction mechanism;
a second determination module configured to determine a chemical reaction solver of the air quality model;
a code file generation module arranged to generate one or more computational code files based on the chemical reaction equations and the chemical reaction solver using a kinetic preprocessor KPP;
and the DCU processing module is used for solving the chemical reaction concentration of each substance in the chemical reaction equation at different moments based on the execution of the one or more calculation code files by the depth calculation processor DCU.
According to still another aspect of the present application, there is provided an electronic apparatus including: a memory and a DCU processor;
the memory stores computer-executable instructions;
and the DCU processor executes the computer execution instructions stored in the memory to enable the electronic equipment to execute the processing method of the air quality model.
According to yet another aspect of the present application, there is provided a computer readable storage medium having stored therein computer executable instructions for implementing the method of processing an air quality model when executed by a DCU processor.
It can be appreciated that the method, device, equipment and medium for processing the air quality model provided by the application determine the chemical reaction mechanism of the air quality model, and determine the chemical reaction equation about meteorological observation data and pollutant data based on the chemical reaction mechanism; a chemical reaction solver that determines the air quality model; generating one or more calculation code files based on the chemical reaction equation and the chemical reaction solver using a kinetic preprocessor KPP; and executing the one or more calculation code files based on a depth calculation processor DCU, and solving the chemical reaction concentration of each substance in the chemical reaction equation at different moments. By the method, a chemical mechanism and a solving mode can be flexibly adapted, the calculation process of the model is effectively accelerated, the calculation time is shortened, the calculation efficiency is improved, and support is provided for the wide application of the air quality model.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of one possible scenario provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for processing an air quality model according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of step S203 in fig. 2;
fig. 4 is a schematic flow chart of step S204 in fig. 2;
FIG. 5 is a schematic structural diagram of a processing device for an air quality model according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
In the related art, a more common observation-based model is AtChem2 (Atmospheric chemistry box-model for the MCM), which uses MCM (The Master Chemical Mechanism, grasping chemical mechanism), CVODE (a Variable-Coefficient Ordinary differential equation Solver, coefficient-Variable ordinary differential equation solver). On one hand, the model fixedly selects an MCM chemical mechanism, so that the chemical mechanism can not be flexibly adjusted according to the needs; on the other hand, CVODE is a multi-step solution using a system of ordinary differential equations, and is computationally intensive: (1) The CVODE method relates to modified Newton iteration, and the iteration calculation amount is large; (2) Each iteration of the modified Newton iteration method involves matrix derivation, and the derivation calculation amount is large.
Aiming at the technical problems, the embodiment of the application provides a processing method, a device, equipment and a medium of an air quality model, wherein when the air quality model is calculated, a chemical reaction mechanism and a chemical reaction solver of the air quality model are determined, the chemical mechanism and the solving mode can be flexibly adapted, then a dynamic preprocessor KPP tool is adopted to generate a calculation code file according to a corresponding chemical reaction equation and chemical reaction solver, a deep calculation processor (Deep Computing Unit, DCU for short) is adopted to execute the calculation code file, chemical reaction concentrations of all substances in the chemical reaction equation at different moments are solved, and the calculation code file is processed through DCU acceleration, so that the calculation process of an observation model can be effectively accelerated, and the timeliness is improved.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. In the drawings, the same or similar reference numerals refer to the same or similar components or components having the same or similar functions throughout. The described embodiments are some, but not all, of the embodiments of the present application. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present application and are not to be construed as limiting the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Fig. 1 is a schematic diagram of one possible scenario provided in the embodiment of the present application, as shown in fig. 1, including a server 110 and a terminal device 120, where the server 110 and the terminal device 120 are connected to each other through a wired or wireless network, and an air quality model is deployed in the server 110. In some embodiments, the terminal device 120 is configured to provide meteorological observation data and pollutant data, different chemical reaction mechanism models, and chemical reaction solvers, etc., to the server 110, and the server 110 is configured to determine the corresponding chemical reaction mechanism and chemical reaction solver based on the data provided by the terminal device 120, and generate a calculation code file, and perform operations, etc. Alternatively, the server 110 may undertake the primary computing effort during the processing and computation of the air quality model, or solely undertake the computing effort.
The terminal device may include, but is not limited to, a computer, a smart phone, a tablet computer, an electronic book reader, a dynamic image expert compression standard audio layer 3 (Moving Picture experts group audio layer III, MP3 for short) player, a dynamic image expert compression standard audio layer 4 (Moving Picture experts group audio layer IV, MP4 for short) player, a portable computer, a car computer, a wearable device, a desktop computer, a set-top box, a smart television, and the like.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Alternatively, the number of the servers 110 and the terminal devices 120 may be more or less, which is not limited in the embodiment of the present application.
The schematic view of the scenario of the present application is briefly described above, and the processing method of the air quality model provided in the embodiment of the present application is described in detail below by taking the server 110 applied in fig. 1 as an example.
Referring to fig. 2, fig. 2 is a flowchart of a processing method of an air quality model according to an embodiment of the present application, including the following steps S201 to S204:
step S201, determining a chemical reaction mechanism of the air quality model, and determining a chemical reaction equation about meteorological observation data and pollutant data based on the chemical reaction mechanism.
It will be appreciated that the (atmospheric) chemical mechanism is a critical component of the atmospheric chemical model that describes the process in the atmosphere from the interaction of initial VOCs and NOx to the production of ozone and other oxidation products, expressed quantitatively by mathematical differential equations for chemical processes in the atmosphere. The chemical (reaction) mechanisms are generally divided into two broad categories, one is a specific chemical mechanism, which details specific reactants, products, intermediates of atmospheric chemical reactions and their reaction rate constants, and because of their one-to-one nature, the species and reactions in the mechanism are huge, such as MCM mechanisms; the other is an inductive chemical mechanism, which uses a parameterized method according to the molecular structure or chemical characteristics of various organic pollutants to simplify specific organic matters and reactions into model species and inductive reactions to express, so as to adapt to the complex calculation process in an air quality model.
In this embodiment, step S201 determines a chemical reaction mechanism of the air quality model, specifically: and selecting an MCM mechanism as a chemical reaction mechanism of the air quality model.
MCM is a nearly explicit chemical mechanism that describes a series of detailed gas phase chemical processes involved in the degradation of primarily emitted VOCs in the atmosphere. Including a large number of primarily discharged human species (hydrocarbons and oxygen-containing volatile organic compounds), and also including the following major biological species: isoprene, three monoterpenes (α -pinene, β -pinene, limonene), a sesquiterpene (β -caryophyllene), an oxygen-containing VOC (2-methyl-but-3-en-2-ol) and an organic sulfur (dimethyl sulfide). The mechanism thus produced contains about 17000 basic reactions of 6700 primary, secondary and radical species. Further, this example may choose to use a new version of MCM v3.3 that systematically improves and updates the chemistry of isoprene degradation.
Clearly, the MCM mechanism provides a straightforward method by which the dynamics and mechanisms of the basic chemical reactions associated with VOC oxidation in atmospheric models can be understood using published laboratory and theoretical data, and also serves as a reference benchmark mechanism to help develop or evaluate the simplified mechanisms required for many applications. Therefore, MCM provides a major link in experimental/theoretical knowledge transfer and a method to trace the mechanism used in the atmosphere model back to basic reaction studies without directly applying MCM. In the embodiment, an MCM mechanism is selected as a default chemical reaction mechanism of an air quality model, so that the calculation efficiency can be improved to a certain extent.
It will be appreciated that in some embodiments, other chemical reaction mechanisms may be selected based on the particular calculation of the air quality model.
Step S202, determining a chemical reaction solver of the air quality model.
In practical application, the chemical reaction dynamics are described as a group of highly coupled, nonlinear and rigid ordinary differential equations, and the solution method is mainly divided into a single-step method and a multi-step method, and the implicit method is widely adopted because the implicit method generally has better stability. In this embodiment, the corresponding chemical reaction solver is predetermined, so that convenience is provided for concentration calculation in the later stage.
In this embodiment, step S202 determines a chemical reaction solver of the air quality model, specifically: a ordinary differential equation solver, such as a rosenblock solver, is chosen as the chemical reaction solver for the air quality model.
Further, the embodiment selects an s-order implicit Rosenblock solver, which is a single-step method and can achieve higher precision. The Rosenblock solver adopts an embedded method to evaluate single-step calculation errors and update step length in calculation, so that derivative calculation is greatly reduced, and good calculation performance is achieved. The calculation method is as follows:
wherein y is n+1 ,y n Species concentration at times n and n+1, h is iteration step length, t n Represents the time of n time, ERR n+1 To calculate the error from time n to time n+1, k i Solution of linear equation system with A as coefficient matrix, gamma, m i ,α ij ,γ ij ,c ij ,e i Are all constant.
In the embodiment, the Rosenblock is selected to solve the chemical reaction concentration, so that the calculation speed is higher on the premise of effectively ensuring the calculation accuracy, and the method is suitable for heterogeneous acceleration calculation.
Step S203, generating one or more calculation code files based on the chemical reaction equation and the chemical reaction solver by using a dynamics preprocessor KPP.
It can be appreciated that a Kinetic Pre-Processor (KPP) tool, which is a chemical Kinetic model code generator, is a software tool that assists in the computer simulation of a chemical Kinetic system. According to the corresponding differential equation set of mass action dynamics, the concentration change of a chemical system with time is calculated. Computer simulation requires identifying and modeling a differential equation set and numerically integrating it. The KPP may convert the specification of the chemical mechanism into FORTRAN or C analog codes of the concentration time derivative function and its jacobian matrix, or other suitable numerical integration schemes.
In the embodiment, a KPP tool is adopted to analyze chemical mechanisms, a calculation code is constructed, the modularization level is improved, flexible reading is achieved, and possibility is provided for selecting different chemical mechanisms and solvers.
Further, step S203 uses a kinetic preprocessor KPP to generate one or more calculation code files based on the chemical reaction equation and the chemical reaction solver, as shown in fig. 3, specifically the following steps:
step S203a, taking the chemical reaction equation as a dynamics description file, and inputting the chemical reaction solver as an auxiliary file into a dynamics preprocessor KPP tool;
step S203b, generating, at the dynamics preprocessor KPP tool, one or more calculation code files based on the dynamics description file and the auxiliary file.
In this embodiment, KPP takes two types of files as input: a dynamics description file and an auxiliary file. The dynamics description file adopts KPP grammar, and designates a predetermined chemical equation, an initial value of each species involved, integral parameters or other options and the like; the auxiliary file mainly comprises updated calculation part codes of the reaction coefficients, the KPP preprocessor analyzes the dynamics description file, applies a predetermined chemical reaction solver and generates one or more calculation code files.
Step S204, executing the one or more calculation code files based on the depth calculation processor DCU, and solving the chemical reaction concentrations of all substances in the chemical reaction equation at different moments.
In practical application, KPP integration is mainly to process input and output data, dynamically update a reaction coefficient according to an operation parameter, so that a box mode code of an operation air quality model can be compiled, but a box mode can iteratively calculate species concentration at the next moment in calculation, a rosenblock solver in each time step calculation can be further divided into a plurality of small steps according to error control, each small step can solve an oversized equation set determined by two dimensions of the species number and the equation number of a chemical mechanism, the calculated amount is large, the operation is slow, and the service use is almost impossible.
Therefore, the method and the device combine DCU to perform acceleration calculation, optimize the calculation process of the model, reduce the operation amount and shorten the calculation time. It can be appreciated that the deep computing DCU processor is mainly oriented towards HPC (High Performance Computing, high performance computing cluster), developing double precision computing capabilities. The training device adopts a flexible programmable structure, has the characteristics of high calculation power, low power consumption, strong interconnection and the like, and supports various training algorithms.
Specifically, the rosenblock solver includes a linear equation set with an a matrix as a reaction coefficient, the one or more calculation code files include calculation codes of the linear equation set with the a matrix as a reaction coefficient, and the depth-based calculation processor DCU executes the one or more calculation code files, as shown in fig. 4, and may include the following steps:
step S204a, performing matrix decomposition on the matrix A based on an LU decomposition Gaussian elimination method to obtain a decomposition matrix;
step S204b, determining a plurality of matrix computing tasks corresponding to the computing codes based on the decomposition matrix, and executing the matrix computing tasks in parallel based on the DCU.
In combination with the algorithm process of the Rosenblock solver, the linear equation set taking the matrix A as the reaction coefficient needs to be solved, and the calculation process is time-consuming. It will be appreciated that in addition to optimization of the solution process for the computation code corresponding to the rosenblock solver, the DCU may also perform accelerated optimization for the execution process of other computation code.
In this embodiment, a block LU (LU Factorization, upper and lower triangular decomposition) is used to decompose the matrix a by gaussian elimination: a=lu, L is a lower triangular matrix, and U is an upper triangular matrix.
Specifically, matrix A is divided into m block-shaped sub-matrices A ij P×p blocking matrices of (b), where n=mp.
By calculation of
Eliminating a block matrix below the diagonal of the first block column, this matrix being A 11 Schur complement in a. The block LU decomposition Gaussian elimination method converts the decomposition of a sparse matrix into a series of partial decomposition and Schur's complement update of a plurality of smaller dense matrices to obtain a decomposition matrix.
Further, the determining the matrix calculation task corresponding to the calculation code based on the decomposition matrix specifically includes the following steps:
and establishing a matrix elimination tree according to the decomposed topological order based on the decomposed matrix, and determining a plurality of matrix calculation tasks corresponding to the calculation codes based on the matrix elimination tree.
Specifically, matrix elimination trees are formed according to the decomposed topological order, traversing is carried out, and corresponding matrix calculation tasks are determined.
It can be understood that the matrix elimination tree refers to a supernode formed by dense sub-blocks after the matrix elimination tree is subjected to node fusion, and each node can correspond to a calculation task. When the calculation is performed, the matrix calculation tasks corresponding to each layer of node of the matrix elimination tree can be executed in parallel.
Further, the method includes the following steps after the matrix elimination tree is established by introducing the MPI communicator:
nesting an MPI communicator in the matrix elimination tree;
the DCU-based parallel execution of the plurality of matrix computing tasks includes: and acquiring the matrix calculation tasks distributed by the MPI communicator based on the DCU, and executing the matrix calculation tasks in parallel according to the structure of the matrix elimination tree.
MPI (Multi-PointInterface) communicator is a cross-language communication protocol used for writing parallel computers. Supporting point-to-point and broadcast. The objectives of MPI are high performance, large scale, and portability. The embodiment distributes matrix calculation tasks to the DCU by utilizing the MPI so as to improve the calculation efficiency.
In one implementation, the parallel algorithm can develop a parallel strategy from two aspects, namely, parallelizing the problem to be solved as much as possible; on the other hand, by selecting proper task granularity as a scheduling unit, the high efficiency of parallel processing is realized. The distributed algorithm sets up nested MPI sub-communicators to facilitate computation of each node and its sub-tree. At the root of the tree, a two-dimensional grid of processes may be created using all available processes in the master MPI communicator and a positive definite matrix distributed over the grid using a block-round data layout. The root MPI communicator then divides into two communicators in proportion to the number of triggers required for the subtree rooted at the child node of the root node. Also, each subtree can be recursively decomposed. LU decomposition requires elimination of the tree from leaf to root traversal. The local subtree, i.e. the tree assigned to a single MPI process, uses DCU for acceleration calculations.
In one implementation, the DCU is a marine DCU, which uses HIP (Heterogeneous Compute Interface, heterogeneous computing interface) as a programming interface, programming using hipBLAS and hipSOLVER may implement matrix computing tasks distributed by the MPI communicator, and the underlying layer may support NVIDIA, AMD, and marine DCU hardware for computing.
In the process, the method of decomposing Gaussian elimination by using LU of MPI+DCU can effectively accelerate calculation of a Rosenblock solver, so that the calculation efficiency of an air quality model is greatly improved, the calculation time is shortened, and wide application of the air quality model is possible.
The embodiment of the application correspondingly provides a processing device of the air quality model, as shown in fig. 5, including:
a first determination module 51 arranged to determine a chemical reaction mechanism of the air quality model and to determine a chemical reaction equation for the meteorological observation data and the contaminant data based on the chemical reaction mechanism;
a second determination module 52 configured to determine a chemical reaction solver of the air quality model;
a code file generation module 53 arranged to generate one or more computational code files based on the chemical reaction equations and the chemical reaction solver using a kinetic preprocessor KPP;
the DCU processing module 54 is configured to solve the chemical reaction concentrations of the substances in the chemical reaction equation at different moments based on the one or more calculation code files executed by the depth calculation processor DCU.
In one embodiment, the first determination module 51 is specifically configured to select an MCM mechanism as the chemical reaction mechanism of the air quality model.
In one embodiment, the second determination module 52 is specifically configured to select a ordinary differential equation solver as the chemical reaction solver for the air quality model.
In one embodiment, the code file generation module 53 includes:
an input unit arranged to input the chemical reaction equation as a kinetic description file and the chemical reaction solver as an auxiliary file into a kinetic preprocessor KPP tool;
a generation unit arranged to generate, at the dynamics preprocessor KPP tool, one or more calculation code files based on the dynamics description file and the auxiliary file.
In one embodiment, the ordinary differential equation solver is a Rosenblock solver comprising a system of linear equations with an A matrix as the reaction coefficients, the one or more calculation code files comprising the calculation code of the system of linear equations with an A matrix as the reaction coefficients,
the DCU processing module 54 includes:
the matrix decomposition unit is used for carrying out matrix decomposition on the matrix A based on an LU decomposition Gaussian elimination method to obtain a decomposition matrix;
and the parallel processing unit is used for determining a plurality of matrix computing tasks corresponding to the computing codes based on the decomposition matrix and executing the matrix computing tasks based on the DCU in parallel.
In one embodiment, the parallel processing unit is specifically configured to establish a matrix elimination tree according to the decomposed topological order based on the decomposition matrix, and determine a plurality of matrix calculation tasks corresponding to the calculation codes based on the matrix elimination tree.
In one embodiment, the apparatus further comprises:
a nesting module arranged to nest the MPI communicator in the matrix elimination tree;
the parallel processing unit is specifically configured to obtain the plurality of matrix computing tasks distributed by the MPI communicator based on the DCU, and execute the plurality of matrix computing tasks in parallel according to the structure of the matrix elimination tree.
The embodiment of the application correspondingly further provides an electronic device, as shown in fig. 6, including: a memory 61 and a DCU processor 62;
the memory 61 stores computer-executable instructions;
the DCU processor 62 executes the computer-executable instructions stored in the memory to cause the electronic device to perform the method of processing the air quality model.
The embodiment of the application correspondingly provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and the computer execution instructions are used for realizing the processing method of the air quality model when being executed by the DCU processor.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.
Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
In the description of the embodiments of the present application, the term "and/or" merely represents an association relationship describing an association object, which means that three relationships may exist, for example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" means any combination of any one or at least two of the plurality, e.g., including at least one of A, B, may mean any one or more elements selected from the set consisting of A, B and C communication. Furthermore, the term "plurality" means two or more, unless specifically stated otherwise.
In the description of embodiments of the present application, the terms "first," "second," "third," "fourth," and the like (if any) are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (6)

1. A method of processing an air quality model, comprising:
determining a chemical reaction mechanism of the air quality model, and determining a chemical reaction equation for meteorological observation data and pollutant data based on the chemical reaction mechanism;
a chemical reaction solver that determines the air quality model;
generating one or more calculation code files based on the chemical reaction equation and the chemical reaction solver using a kinetic preprocessor KPP;
executing the one or more calculation code files based on a depth calculation processor DCU, and solving chemical reaction concentrations of all substances in the chemical reaction equation at different moments;
the chemical reaction solver for determining the air quality model comprises:
a normal differential equation solver is selected as a chemical reaction solver of the air quality model;
the ordinary differential equation solver is a Rosenblock solver, the Rosenblock solver comprises a linear equation set taking an A matrix as a reaction coefficient, and the one or more calculation code files comprise calculation codes of the linear equation set taking the A matrix as the reaction coefficient;
the depth-based computing processor DCU executes the one or more computing code files, including:
performing matrix decomposition on the matrix A based on an LU decomposition Gaussian elimination method to obtain a decomposition matrix;
establishing a matrix elimination tree according to the decomposed topological order based on the decomposition matrix, determining a plurality of matrix calculation tasks corresponding to the calculation codes based on the matrix elimination tree, and executing the matrix calculation tasks in parallel based on a DCU;
after the matrix elimination tree is established, the method further comprises:
nesting an MPI communicator in the matrix elimination tree;
the DCU-based parallel execution of the plurality of matrix computing tasks includes: acquiring the matrix calculation tasks distributed by the MPI communicator based on the DCU, and executing the matrix calculation tasks in parallel according to the structure of the matrix elimination tree;
wherein the a matrix is expressed as follows:
wherein y is n For the species concentration at time n, h is the iteration step length, t n The time at time n is indicated, and γ is a constant.
2. The method of claim 1, wherein determining a chemical reaction mechanism of the air quality model comprises:
and selecting an MCM mechanism as a chemical reaction mechanism of the air quality model.
3. The method of claim 1, wherein the employing a kinetic preprocessor KPP to generate one or more calculation code files based on the chemical reaction equation and the chemical reaction solver comprises:
inputting the chemical reaction equation as a dynamics description file and the chemical reaction solver as an auxiliary file into a dynamics preprocessor KPP tool;
generating, at the dynamics preprocessor KPP tool, one or more calculation code files based on the dynamics description file and the assistance file.
4. A processing apparatus for an air quality model, comprising:
a first determination module configured to determine a chemical reaction mechanism of the air quality model and determine a chemical reaction equation for the meteorological observation data and the contaminant data based on the chemical reaction mechanism;
a second determination module configured to determine a chemical reaction solver of the air quality model;
a code file generation module arranged to generate one or more computational code files based on the chemical reaction equations and the chemical reaction solver using a kinetic preprocessor KPP;
the DCU processing module is used for executing the one or more calculation code files based on a depth calculation processor DCU and solving the chemical reaction concentration of each substance in the chemical reaction equation at different moments;
the second determining module is specifically configured to select a normal differential equation solver as a chemical reaction solver of the air quality model;
the ordinary differential equation solver is a Rosenblock solver, the Rosenblock solver comprises a linear equation set taking an A matrix as a reaction coefficient, and the one or more calculation code files comprise calculation codes of the linear equation set taking the A matrix as the reaction coefficient;
the DCU processing module comprises:
the matrix decomposition unit is used for carrying out matrix decomposition on the matrix A based on an LU decomposition Gaussian elimination method to obtain a decomposition matrix;
the parallel processing unit is used for establishing a matrix elimination tree according to the decomposed topological order based on the decomposition matrix, determining a plurality of matrix calculation tasks corresponding to the calculation codes based on the matrix elimination tree, and executing the matrix calculation tasks based on DCU in parallel;
the apparatus further comprises:
a nesting module arranged to nest the MPI communicator in the matrix elimination tree;
the parallel processing unit is configured to acquire the plurality of matrix calculation tasks distributed by the MPI communicator based on the DCU, and execute the plurality of matrix calculation tasks in parallel according to the structure of the matrix elimination tree;
wherein the a matrix is expressed as follows:
wherein y is n For the species concentration at time n, h is the iteration step length, t n The time at time n is indicated, and γ is a constant.
5. An electronic device, comprising: a memory and a DCU processor;
the memory stores computer-executable instructions;
the DCU processor executes computer-executable instructions stored in the memory to cause the electronic device to perform the method of processing an air quality model of any of claims 1-3.
6. A computer-readable storage medium, in which computer-executable instructions are stored, which computer-executable instructions, when executed by a DCU processor, are adapted to implement the method of processing an air quality model according to any of claims 1-3.
CN202211372717.XA 2022-11-03 2022-11-03 Air quality model processing method, device, equipment and medium Active CN115620824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211372717.XA CN115620824B (en) 2022-11-03 2022-11-03 Air quality model processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211372717.XA CN115620824B (en) 2022-11-03 2022-11-03 Air quality model processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN115620824A CN115620824A (en) 2023-01-17
CN115620824B true CN115620824B (en) 2024-02-13

Family

ID=84876081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211372717.XA Active CN115620824B (en) 2022-11-03 2022-11-03 Air quality model processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115620824B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909775A (en) * 2017-01-22 2017-06-30 武汉水天成环保科技有限公司 For the system and method for the photochemical reaction box mode of nested fine chemistry mechanism
CN109446696A (en) * 2018-11-08 2019-03-08 成都市环境保护科学研究院 Quick atmospheric environment capacity measuring method, storage medium and terminal based on CMAQ model
CN114564841A (en) * 2022-03-03 2022-05-31 上海市环境科学研究院 City atmospheric emission list inversion method, system, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2697735A4 (en) * 2011-04-13 2015-04-01 Reaction Design Llc Method and apparatus for reducing chemical reaction mechanisms
US20180188166A1 (en) * 2016-11-03 2018-07-05 Texas Research International, Inc. Air Crew Breathing Air Quality Monitoring System

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909775A (en) * 2017-01-22 2017-06-30 武汉水天成环保科技有限公司 For the system and method for the photochemical reaction box mode of nested fine chemistry mechanism
CN109446696A (en) * 2018-11-08 2019-03-08 成都市环境保护科学研究院 Quick atmospheric environment capacity measuring method, storage medium and terminal based on CMAQ model
CN114564841A (en) * 2022-03-03 2022-05-31 上海市环境科学研究院 City atmospheric emission list inversion method, system, equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
临近空间大气化学过程快速建模技术初探;张思聪等;空间科学学报;91-102 *
奇异时变非线性方程组的数值解法;张泽;中国优秀博硕士学位论文全文数据库(硕士)信息科技辑(第4期);论文正文第1-5章 *
张思聪等.临近空间大气化学过程快速建模技术初探.空间科学学报.2022,91-102. *
面向异构体系结构的稀疏矩阵算法研究;邹丹;中国优秀博硕士学位论文全文数据库(博士)信息科技辑(第1期);论文正文第1-7章 *

Also Published As

Publication number Publication date
CN115620824A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
CN109800883A (en) Quantum machine learning framework establishment method, apparatus and quantum computer
CN114564841B (en) City atmospheric emission list inversion method, system, equipment and storage medium
Jöckel et al. Coupling of chemical processes with the Modular Earth Submodel System (MESSy) submodel TRACER
CN116577464A (en) Intelligent monitoring system and method for atmospheric pollution
Shen et al. An adaptive method for speeding up the numerical integration of chemical mechanisms in atmospheric chemistry models: application to GEOS-Chem version 12.0. 0
CN113672227B (en) User interface code generation method and device, electronic equipment and storage medium
CN115938494B (en) DCU acceleration calculation method, equipment and storage medium of gas phase chemical module
CN115620824B (en) Air quality model processing method, device, equipment and medium
Liu et al. Emulation of an atmospheric gas-phase chemistry solver through deep learning: Case study of Chinese Mainland
Martin et al. Improved advection, resolution, performance, and community access in the new generation (version 13) of the high-performance GEOS-Chem global atmospheric chemistry model (GCHP)
KR102188044B1 (en) Framework system for intelligent application development based on neuromorphic architecture
CN112966433A (en) Instant compiling-based neurodynamics simulation method and device
CN116560968A (en) Simulation calculation time prediction method, system and equipment based on machine learning
CN116070500B (en) Air mass concentration field simulation simulator based on deep learning
CN106599244B (en) General original log cleaning device and method
CN115527626A (en) Molecular processing method, molecular processing apparatus, electronic device, storage medium, and program product
CN112748953A (en) Data processing method and device based on neural network model and electronic equipment
CN112507554B (en) Hydrological model parallelism calibration method and system based on graph calculation
CN112184592A (en) Image restoration method, device, equipment and computer readable storage medium
Chandy et al. Integrating task and data parallelism with the group communication archetype
CN116954932B (en) Air quality mode operation method and device, storage medium and electronic equipment
CN113807517B (en) Pruning parameter searching method, pruning device, pruning equipment and pruning medium
CN110427630B (en) Machine translation method, device, electronic equipment, storage medium and translation model
CN108415815B (en) APP software operation data abnormity judgment method
CN116756555A (en) Method for generating training model tool, model training method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant