Numerical prediction method and system for estuary saltwater intrusion based on standard language parallel acceleration

The heterogeneous parallel computing framework designed using DO CONCURRENT and OpenACC instruction sets reconstructs the multi-loop structure of the estuary saltwater intrusion model, realizing efficient parallel computing on multi-core CPU and GPU platforms. This solves the computational efficiency and accuracy problems in high-resolution simulation of estuary saltwater intrusion and supports rapid early warning and forecasting.

CN121166382BActive Publication Date: 2026-02-17EAST CHINA NORMAL UNIV +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511705377.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-17
Estimated Expiration
2045-11-20

AI Technical Summary

Technical Problem

Traditional CPU parallel computing models take too long to simulate high-resolution saltwater intrusion in estuaries, failing to meet the requirements of real-time operational forecasting. Furthermore, existing multi-GPU parallel strategies struggle to achieve a balance between high efficiency and high accuracy when the computing modules are under uneven load.

Method used

A unified heterogeneous parallel computing framework is designed using the DO CONCURRENT statement and the OpenACC instruction set. Through CPU thread-level parallelization and GPU accelerated parallelization, the multi-loop nested structure is reconstructed to achieve parallel computing on multi-core CPU and GPU platforms. Different compilation commands are combined to switch between CPU and GPU usage scenarios.

Benefits of technology

It achieves efficient, stable, and rapid numerical forecasting of saltwater intrusion in estuaries under large-scale parallel conditions, solving the problems of low computational efficiency and insufficient real-time forecasting, while maintaining good portability and computational accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121166382B_ABST
    Figure CN121166382B_ABST
Patent Text Reader

Abstract

The application provides a numerical prediction method and system for estuary saltwater intrusion based on standard language parallel acceleration, comprising the following steps: step 1: based on the code of the high-resolution numerical model of estuary saltwater intrusion, a unified heterogeneous parallel computing framework is designed, and the DO CONCURRENT statement and the OpenACC instruction set are used for compilation; step 2: by analyzing the source code of the high-resolution numerical model, the multiple loop nesting structure in the high-resolution numerical model is determined as a parallelization target; step 3: the multiple loop nesting structure is reconstructed; step 4: the calculation efficiency and numerical accuracy of the parallelization scheme are evaluated through comparison tests. The DO CONCURRENT statement and the OpenACC instruction set are combined to construct a unified parallel framework suitable for CPU and GPU platforms, and the huge calculation bottleneck caused by the modeling mode of 'large-scale coverage + small-scale fine analysis' is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of heterogeneous parallel computing, in particular to a numerical prediction method and system for estuary saltwater intrusion based on standard language parallel acceleration. BACKGROUND

[0002] At present, the numerical prediction of estuary saltwater intrusion has very high requirements for computing efficiency. The traditional CPU parallel computing model takes too long to process large-scale and high-resolution simulations, and cannot meet the timeliness requirements of real-time business prediction. Even if parallel computing technology is used, if the parallel architecture design is not good, it is still difficult to achieve qualitative change in computing performance while ensuring accuracy.

[0003] Therefore, the parallel computing method based on multiple GPUs in the prior art (Chinese invention patent with application number CN202510747074X discloses "a lake flow efficient simulation method based on multiple GPU parallel computing") can significantly improve the efficiency of lake flow simulation, but it cannot be effectively applied to the more complex estuary saltwater intrusion scenario, and the single GPU parallel strategy cannot achieve optimal utilization of heterogeneous computing resources when facing an estuary model with uneven load of computing modules, and cannot guarantee the unity of efficiency and accuracy under high-resolution simulation. SUMMARY

[0004] In view of the defects in the prior art, the purpose of the present application is to provide a numerical prediction method and system for estuary saltwater intrusion based on standard language parallel acceleration.

[0005] The numerical prediction method for estuary saltwater intrusion based on standard language parallel acceleration provided by the present application comprises:

[0006] Step 1: Based on the code of the high-resolution numerical model of estuary saltwater intrusion, a unified heterogeneous parallel computing framework is designed, and DO CONCURRENT statements and OpenACC instruction sets are used for compilation to support parallel computing on multi-core CPU and GPU platforms;

[0007] Step 2: By analyzing the source code of the high-resolution numerical model, the multiple loop nesting structure is determined as the parallelization target;

[0008] Step 3: The multiple loop nesting structure is reconstructed, including using DO CONCURRENT statements for CPU thread-level parallelization and using OpenACC instructions for GPU acceleration parallelization;

[0009] Step 4: The computing efficiency and numerical accuracy of the parallelization scheme are evaluated through comparative experiments.

[0010] Preferably, the CPU thread-level parallelization includes: transforming the target loop part into a DO CONCURRENT statement, using the feature of automatically detecting the absence of data dependency between loops to distribute loop iteration tasks to multiple CPU threads for parallel execution;

[0011] The GPU acceleration parallelization includes: in the main program initialization stage, using the ENTER DATA COPY IN instruction of OpenACC to inject multiple key variables into the video memory, the key variables including velocity, water level, salinity, and grid structure; in the time advancement process, using the UPDATE DEVICE instruction of OpenACC to synchronize the updated variables on the host to the GPU end; before outputting the results, using the UPDATE HOST instruction of OpenACC to return the key variables to the host end.

[0012] Preferably, the code combined with DO CONCURRENT and OpenACC at compile time is switched between CPU and GPU usage scenarios by different compilation commands;

[0013] The CPU-side compilation command includes preprocessing options, optimization options, and standard parallel structure recognition options, and is used to start CPU compilation;

[0014] The GPU-side compilation command includes preprocessing options, GPU parallel compilation options, standard parallel structure recognition options, and unmanaged memory mode options, and is used to start GPU compilation.

[0015] Preferably, the high-resolution numerical model of estuary saltwater intrusion adopts three-dimensional incompressible fluid control equation groups, including momentum equation, continuity equation and salinity transport equation, to describe the spatiotemporal evolution characteristics of estuary tidal flow and salinity field;

[0016] The horizontal direction adopts curved non-orthogonal grid, and the vertical direction adopts grid.

[0017] and The horizontal momentum equation is:

[0018]

[0019]

[0020] wherein, , is the horizontal curved coordinate, is the vertical normalized coordinate, , is the still water depth, is the total water depth, is the water level deviation, is the velocity in the normal direction, is the velocity in the normal direction, is the vertical velocity in the coordinate system, is the length scale factor in the direction, is the length scale factor in the direction, is the measure of grid non-orthogonality, is the Coriolis force coefficient, is the gravitational acceleration, is the reference density, is the water body density;

[0021] The continuity equation is:

[0022]

[0023] where:

[0024]

[0025] where, is the actual vertical velocity;

[0026] The salinity transport equation is:

[0027]

[0028] where, is the salinity;

[0029] The temperature transport equation is:

[0030]

[0031] where, is the temperature;

[0032] , , is the Jacobian function; , is the coordinate of , , is the coordinate of ;

[0033]

[0034]

[0035]

[0036] vertical coordinate at the sea surface at the sea bottom ;

[0037] wherein, is the actual physical height;

[0038] and are the velocity components in the and directions, defined as:

[0039]

[0040]

[0041] wherein, and are the horizontal velocity components in the Cartesian coordinate system;

[0042] and are the velocities normal to the and directions:

[0043]

[0044]

[0045] wherein, and are the vertical turbulent viscosity and the vertical turbulent diffusion coefficients, respectively;

[0046] , , and are the horizontal momentum, salinity and heat diffusion terms, respectively:

[0047]

[0048]

[0049]

[0050]

[0051] wherein, is the horizontal viscosity coefficient, is the horizontal diffusion coefficient.

[0052] Preferably, said step 4 comprises:

[0053] Step 4.1: Run the serial version, the CPU multi-thread version and the GPU version respectively under the same hardware and simulation configuration, record the calculation time consumption and calculate the speedup ratio;

[0054] Step 4.2: Perform long-time scale simulation, quantitatively compare the calculation results of the parallel version and the serial version, and evaluate using the root mean square error RMSE and the correlation coefficient CC.

[0055] The estuary saltwater intrusion numerical prediction system based on standard language parallel acceleration provided by the application comprises:

[0056] Module M1: Based on the code of the high-resolution numerical model of estuary saltwater intrusion, a unified heterogeneous parallel computing framework is designed, and DO CONCURRENT statements and OpenACC instruction sets are used for compilation to support parallel computing of multi-core CPU and GPU platforms;

[0057] Module M2: By analyzing the source code of the high-resolution numerical model, the multiple loop nesting structure is determined as the parallelization target;

[0058] Module M3: The multiple loop nesting structure is reconstructed, including using DO CONCURRENT statements for CPU thread-level parallelization and using OpenACC instructions for GPU acceleration parallelization;

[0059] Module M4: The calculation efficiency and numerical accuracy of the parallelization scheme are evaluated through comparison tests.

[0060] Preferably, the CPU thread-level parallelization includes: transforming the target loop part into a DO CONCURRENT statement, using its automatic detection of no data dependency between loops to distribute loop iteration tasks to multiple CPU threads and execute them in parallel;

[0061] The GPU acceleration parallelization includes: using the ENTER DATA COPYIN instruction of OpenACC to inject multiple key variables into the video memory during the initialization stage of the main program, the key variables including speed, water level, salinity, and grid structure; during the time advancement process, using the UPDATE DEVICE instruction of OpenACC to synchronize the updated variables on the host to the GPU end; before outputting the results, using the UPDATE HOST instruction of OpenACC to return the key variables to the host end.

[0062] Preferably, the code combined with DO CONCURRENT and OpenACC is used during compilation, and different compilation commands are used to switch between CPU and GPU usage scenarios;

[0063] The CPU-side compiling command includes a pre-processing option, an optimization option and a standard parallel structure identification option, and is used to start CPU compiling;

[0064] The GPU-side compiling command includes a pre-processing option, a GPU parallel compiling option, a standard parallel structure identification option and a non-managed memory mode option, and is used to start GPU compiling.

[0065] Preferably, the estuary saltwater intrusion high-resolution numerical model adopts three-dimensional incompressible fluid control equation groups, including momentum equation, continuity equation and salinity transport equation, to describe the spatial and temporal evolution of estuary tidal current and salinity field.

[0066] The horizontal uses curved non-orthogonal grid, and the vertical uses grid.

[0067] and The horizontal momentum equation is:

[0068]

[0069]

[0070] wherein, , is a horizontal curved coordinate, is a vertical normalized coordinate, , is a still water depth, is a total water depth, is a water level deviation, is a velocity in the normal direction, is a velocity in the normal direction, is a vertical velocity in the coordinate system, is a length scale factor in the direction, is a length scale factor in the direction, is a measure of grid non-orthogonality, is a Coriolis force coefficient, is a gravity acceleration, is a reference density, is a water body density.

[0071] The continuity equation is:

[0072]

[0073] wherein:

[0074]

[0075] where, is the actual vertical velocity;

[0076] The salinity transport equation is:

[0077]

[0078] where, is the salinity;

[0079] The temperature transport equation is:

[0080]

[0081] where, is the temperature;

[0082] , , is the Jacobian function; , is the coordinate of , , is the coordinate of ;

[0083]

[0084]

[0085]

[0086] The vertical coordinate , at the sea surface , at the sea bottom ;

[0087] where, is the actual physical height;

[0088] and are the flow velocity components in and directions, defined as:

[0089]

[0090]

[0091] where, and are the horizontal flow velocities in the Cartesian coordinate system;

[0092] and to define the vertical velocity and the velocity in the normal direction:

[0093]

[0094]

[0095] wherein, and are the vertical turbulent viscosity and the vertical turbulent diffusion coefficient, respectively;

[0096] , , and are the horizontal momentum, salinity and heat diffusion terms, respectively:

[0097]

[0098]

[0099]

[0100]

[0101] wherein, is the horizontal viscosity coefficient, is the horizontal diffusion coefficient.

[0102] Preferably, said module M4 comprises:

[0103] Module M4.1: running the serial version, the CPU multi-thread version and the GPU version, respectively, under the same hardware and simulation configuration, recording the calculation time consumption and calculating the speedup ratio;

[0104] Module M4.2: performing a long-time scale simulation, quantitatively comparing the calculation results of the parallel version and the serial version, and evaluating by using the root mean square error RMSE and the correlation coefficient CC.

[0105] Compared with the prior art, the present application has the beneficial effects as follows:

[0106] The present application solves the problem of huge computing load caused by the dual needs of "large-scale coverage" and "small-scale fine analysis" in estuary saltwater intrusion numerical simulation by adopting a heterogeneous unified parallel architecture combining DO CONCURRENT statements and OpenACC instruction sets, thereby overcoming the key technical bottlenecks of low computing efficiency, insufficient real-time prediction and poor portability in the traditional CPU parallel computing mode, realizing that the unified GPU high-performance computing framework can solve the efficiency bottleneck under large-scale parallel conditions while maintaining good portability and stability, thereby supporting rapid early warning and prediction. BRIEF DESCRIPTION OF DRAWINGS

[0107] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments, made with reference to the accompanying drawings:

[0108] Figure 1 The present application is based on a standard language parallel acceleration estuary saltwater intrusion numerical prediction method flowchart. DETAILED DESCRIPTION

[0109] The present application will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of changes and improvements can be made. These are within the scope of the present application.

[0110] EMBODIMENT

[0111] The core of the present application is to provide a heterogeneous parallel computing method for estuary saltwater intrusion high-resolution numerical model (UFDECOM-i). The estuary saltwater intrusion process has significant multiscale coupling characteristics, and its evolution is affected by runoff, tides, wind, topography, mixing, etc. On a large scale, the remote wind field and the alongshore water level can change the nearshore water level and circulation structure, thereby adjusting the overall trend of saltwater intrusion; on a small scale, the complex estuary branching topography, deepwater channel and engineering structure significantly affect the local flow field and salinity distribution, resulting in strong non-uniformity and nonlinearity of the dynamic and transport processes, therefore in numerical modeling, to analyze the above large-scale offshore driving and small-scale estuary details at the same time, high-resolution grids are used in the wide-area computing domain to realize the modeling strategy of "large-scale coverage + small-scale fine analysis". However, this multiscale high-resolution computing pattern will cause extremely uneven distribution of computing load, increase the time step limitation problem, and make the physical variables (such as flow rate, salinity, etc.) between different computing units strongly coupled and highly dependent on data, significantly increasing the parallel communication and synchronization overhead, which is the main bottleneck restricting long-term simulation and real-time prediction commercialization.

[0112] To cope with the above challenges, the present application provides a heterogeneous parallel acceleration method for an estuary saltwater intrusion numerical model, aiming to solve the computational efficiency bottleneck problem in large-scale and high-resolution numerical simulation. The core of the method is to parallelize the self-developed bidirectional encryption nested unstructured quadrilateral grid finite difference estuary and offshore three-dimensional model (UFDECOM-i), as shown in Figure 1 , and the specific technical solutions are as follows:

[0113] Step 1: Construct a parallel computing framework;

[0114] Based on the original UFDECOM-i model code, a unified heterogeneous parallel computing framework is designed. The framework needs to support multi-core CPU and GPU acceleration at the same time. DO CONCURRENT statement in Fortran 2008 standard and OpenACC instruction set are chosen as the main parallelization technology to ensure the modernity, portability and maintainability of the code. Although DO CONCURRENT is a statement in Fortran 2008 standard, it is not supported by different compilers (NVFORTRAN, Intel fortran, etc.) until recent years. Previous parallel mode is for multi-core CPU parallel, and different tools are needed for GPU computing, which requires different versions of development. Using DO CONCURRENT statement supported by compilers in recent years, a unified heterogeneous parallel computing framework can be achieved. In the specific implementation, on the CPU side, the model core loop structure is reconstructed by DO CONCURRENT parallel statement, which fully utilizes the parallel computing capability of multi-core processors in shared memory environment. On the GPU side, on the basis of the CPU version, to realize efficient synchronization of data between the host and the device, the model uses $ACCENTER DATA COPYIN(...) instruction to inject multiple key variables (such as velocity, water level, salinity, grid structure, etc.) into the video memory in the initialization stage of the main program, which realizes explicit data allocation and avoids frequent implicit data transmission. In the process of time advancement, by inserting $ACCUPDATE DEVICE(...) instruction, the data is synchronized to the GPU device side in time after the variable is updated, which ensures the accuracy of subsequent calculation. Before outputting the results, through $ACC UPDATE HOST(...) instruction, the key variables are returned to the host side, which realizes the effective connection with the output module.Therefore, this set of codes using DO CONCURRENT combined with OpenACC at compile time can be used, and only according to different compilation commands, the CPU and GPU use scenarios can be switched at any time. The CPU end compilation command is: FC = nvfortran -Mpreprocess -O4 -stdpar = multicore, -Mpreprocess is preprocessing, and it also combines the advanced optimization options of the NVFORTRAN compiler (-O4). The compiler can effectively identify parallel loops, and start CPU compilation through -stdpar = multicore. The GPU end compilation command is: FC = nvfortran -Mpreprocess -stdpar = gpu -acc = gpu -gpu = nomanaged. GPU parallel compilation (-acc = gpu), standard parallel structure identification (-stdpar = gpu) and non-managed memory mode (-gpu = nomanaged) are enabled, thereby providing higher flexibility for display data control and ensuring the synergistic effect of DO CONCURRENT structure and OpenACC instructions.

[0115] DO CONCURRENT is used to conveniently express the data parallel paradigm, and OpenACC is used to guide the compiler to generate parallel code suitable for GPU. The combination of the two realizes the goal of "one set of code, multiple platform deployment".

[0116] Step 2: Identify and mark the parallel computing core module;

[0117] The source code of the UFDECUM-i model is analyzed, and the core computing modules (such as ADVUV in the water dynamic module, Q in the transport module, and EL in the water level calculation module) with high computational intensity and long time consumption are identified. The multiple loop nesting structure in these modules is determined as the key target of parallelization reconstruction.

[0118] Step 3: Implement loop-level parallelization reconstruction; for the core computing loops identified in step 2, use parallel programming statements and instructions for reconstruction.

[0119] Step 3.1: CPU thread-level parallelization. The target loop part is modified to DO CONCURRENT instruction, which automatically detects the characteristic of no data dependency between loops, and automatically distributes loop iteration tasks to multiple CPU threads for parallel execution.

[0120] Step 3.2: GPU acceleration and parallelization. To achieve efficient synchronization of data between the host and the device, the model uses the $ACC ENTER DATA COPYIN(...) instruction to inject all variables involved in the model calculation (such as velocity, water level, salinity, grid structure, etc.) into the video memory at once during the initialization phase of the main program, achieving explicit data allocation and avoiding frequent implicit data transmission. During the time advancement process, the $ACC UPDATE DEVICE(...) instruction is inserted to synchronize the updated variables on the host side (such as boundary conditions, external forcing terms, etc.) to the GPU side, ensuring the accuracy and timing consistency of subsequent physical process calculations. For intermediate field variables used only within the GPU, they are kept in the video memory to avoid unnecessary data transfer. Before outputting the results, the $ACC UPDATE HOST(...) instruction is used to return the key variables to the host side, thereby effectively connecting with the output module. By offloading the calculation tasks to the GPU through the compiler, large-scale parallel computing is achieved using its many-core architecture.

[0121] Step 4: Verify the correctness and performance of parallel computing; design comparative experiments to comprehensively evaluate the effectiveness of the parallelization scheme.

[0122] Step 4.1: Verification of computational efficiency. Under the same hardware and simulation configuration, run the serial version, CPU multi-threaded version, and GPU version respectively, record the computation time and calculate the speedup ratio. The performance improvement goal is to achieve good scalability for the CPU version on the scale of dozens of cores, and the GPU version has a significantly higher speedup ratio than the CPU version. The specific results are shown in Table 1 below.

[0123] Table 1 Comparison of 5000-step time (seconds) for different running modes

[0124]

[0125] Step 4.2: Numerical accuracy verification. Perform long-time scale simulation (such as three months), and quantitatively compare the calculation results (such as water level, salinity, and other key variables) of the parallel version with the verified serial version. Use root mean square error (RMSE), correlation coefficient (CC), and other indicators for evaluation. It must be ensured that no numerical bias is introduced after parallelization, and all errors remain within an acceptable magnitude (such as RMSE at the 10-3 level), proving the correctness of parallel computing. The specific results are shown in Tables 2 and 3.

[0126] Table 2 Computational performance table of UFDECOM-i model under different configurations

[0127]

[0128] Table 3 Water level and salinity simulation accuracy table of Qingcaosha Reservoir under different parallel configurations

[0129]

[0130] The estuary salt tide invasion numerical model (UFDECOM-i) based on the present application adopts three-dimensional incompressible fluid control equation set, with momentum equation, continuity equation and salinity transport equation as the core, to describe the space-time evolution of estuary tidal current and salinity field. Curvilinear non-orthogonal grid is adopted in the horizontal direction and vertical direction . And the direction momentum equation is:

[0131]

[0132]

[0133] The continuity equation is:

[0134]

[0135] Among them:

[0136]

[0137] The salinity transport equation is:

[0138]

[0139] The temperature transport equation is:

[0140]

[0141] In the above equation set, is the Coriolis force coefficient, is the gravitational acceleration, , , is the Jacobian function. , and are defined as:

[0142]

[0143] , is the still water depth, is the total water depth. The vertical coordinate is at the sea surface is at the sea bottom . and are the flow velocity in and direction components, defined as:

[0144]

[0145] where, and are the horizontal velocity components in Cartesian coordinate system. and are the velocities in the normal direction of and

[0146]

[0147] and are the vertical turbulent viscosity and diffusivity coefficients, respectively. Mellor-Yamada 2.5 order turbulence closure model is used. , , and are the horizontal momentum, salinity and heat diffusion terms, respectively.

[0148]

[0149]

[0150]

[0151]

[0152] where, is the horizontal viscosity coefficient, is the horizontal diffusivity coefficient, both of which are calculated by parameterization formula and have the same value.

[0153] The calculation process, i.e. the numerical solution of the model and the time advancing procedure, is used to discretize the above three-dimensional control equations and solve them in parallel on a heterogeneous computing platform. The overall process includes five stages:

[0154] I. Initialization and grid construction;

[0155] Read in the prepared terrain, boundary and initial conditions; construct unstructured quadrilateral grid and generate node connection relationship.

[0156] II. Time advancing loop;

[0157] ​Semi-implicit time integration scheme or split mode (outer water level, inner flow velocity step by step solution) is adopted, and the following calculation is performed at each time step: call ADVU_TVD_3RD, ADVV_TVD_3RD module to calculate the convection term; call PROFU, PROFV module to calculate the vertical viscous flux; call ELTEST module to build the water level equation and solve the sparse matrix; update the salinity field and turbulent coefficient and the like.

[0158] III. GPU parallel computing stage;

[0159] Each computing core is independently and parallelly executed on the GPU: momentum equation core → update U / V; continuity equation core → correct EL; salinity transport core → update S. The spatial point independent calculation is realized by using the multi-thread structure of the GPU, and the race condition is avoided by using the PRIVATE and REDUCTION mechanisms.

[0160] IV. Synchronization and boundary processing;

[0161] Update the boundary conditions, tides, wind field and runoff input; perform $ACC UPDATEHOST(...) back to the host for the variables that need to participate in the output.

[0162] V. Output and post-processing;

[0163] Output the water level, flow velocity, salinity and the like as a time series file; perform salt tide front position and salinity gradient analysis on the key section.

[0164] Those skilled in the art know that, in addition to implementing the system, device and each module thereof provided by the present application in the form of pure computer readable program code, the same program can also be realized by logically programming the method steps to make the system, device and each module thereof provided by the present application in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers. Therefore, the system, device and each module thereof provided by the present application can be considered as a hardware component, and the modules included therein for realizing various programs can also be considered as structures in the hardware component; the modules for realizing various functions can also be considered as both software programs for realizing methods and structures in the hardware component.

[0165] The specific embodiments of the present application are described above. It needs to be understood that the present application is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essential content of the present application. In the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other at will.

Claims

1. A numerical prediction method for estuary saltwater intrusion based on standard language parallel acceleration, characterized in that, The application relates to a high-resolution numerical model for estuary saltwater intrusion, and a parallel computing method thereof. Step 1: Based on the code of the high-resolution numerical model for estuary saltwater intrusion, a unified heterogeneous parallel computing framework is designed, DO CONCURRENT statements and OpenACC instruction sets are used for compilation, and parallel computing of a multi-core CPU and a GPU platform is supported; Step 2: The multiple loop nesting structures in the source code of the high-resolution numerical model are determined as parallelization targets through analysis; Step 3: The multiple loop nesting structures are reconstructed, including CPU thread-level parallelization using DO CONCURRENT statements and GPU acceleration parallelization using OpenACC instructions; Step 4: The calculation efficiency and numerical accuracy of the parallelization scheme are evaluated through comparison tests; On the CPU side, the core loop structure of the model is reconstructed through the DO CONCURRENT parallel statement; on the GPU side, based on the CPU version, the model uniformly uses the! $ACC ENTER DATA COPYIN instruction to inject multiple key variables into the video memory in the main program initialization stage, realizes explicit data allocation, in the time advancement process, through the insertion of the! $ACC UPDATE DEVICE instruction, the data is synchronized to the GPU device end in time after the variable is updated, and before the output result, the! $ACC UPDATE HOST instruction is used to return the key variables to the host end, so that the effective connection with the output module is realized; The source code of the model is analyzed, the core calculation modules with high calculation intensity and long time consumption are identified, and the multiple loop nesting structures in the modules are determined as the key targets of parallelization reconstruction; The target loop part is transformed into a DO CONCURRENT instruction, and the loop iteration tasks are automatically distributed to multiple CPU threads for parallel execution by using the characteristic that the DO CONCURRENT instruction automatically detects the data dependency between loops; For the intermediate field variables used only in the GPU, the variables are kept in the video memory; the calculation tasks are unloaded to the GPU by using the compiler, and large-scale parallel calculation is realized by using the many-core architecture of the GPU.

2. The numerical prediction method of saltwater intrusion in estuary based on standard language parallel acceleration according to claim 1, characterized in that, The CPU thread-level parallelization includes: the target loop part is transformed into a DO CONCURRENT statement, and the loop iteration tasks are distributed to multiple CPU threads for parallel execution by using the characteristic that the DO CONCURRENT statement automatically detects the data dependency between loops; The GPU acceleration parallelization includes: in the main program initialization stage, multiple key variables including speed, water level, salinity and grid structure are injected into the video memory by using the ENTER DATA COPYIN instruction of OpenACC; in the time advancement process, the variables updated on the host end are synchronized to the GPU end by using the UPDATE DEVICE instruction of OpenACC; and before the output result, the key variables are returned to the host end by using the UPDATE HOST instruction of OpenACC.

3. The numerical prediction method of saltwater intrusion in estuary based on standard language parallel acceleration according to claim 1, characterized in that, The DO CONCURRENT and OpenACC combined code is used during compilation, and the CPU and GPU use scenarios are switched through different compilation commands. The CPU-side compiling command includes a pre-processing option, an optimization option, and a standard parallel structure identification option, and is used to start CPU compiling; The GPU-side compiling command includes a pre-processing option, a GPU parallel compiling option, a standard parallel structure identification option, and a non-managed memory mode option, and is used to start GPU compiling.

4. The numerical prediction method of saltwater intrusion in estuary based on standard language parallel acceleration according to claim 1, characterized in that, The estuary saltwater intrusion high-resolution numerical model adopts three-dimensional incompressible fluid control equations, including momentum equations, continuity equations and salinity transport equations, to describe the spatial and temporal evolution of the estuary tidal current and salinity field; horizontal curved non-orthogonal grid, vertical curved orthogonal grid and The directional momentum equation is: in, , It is a horizontal curve coordinate. For vertically normalized coordinates, , It is the depth of still water. For the total water depth, For water level deviation, In order to be in Speed ​​in the normal direction, In order to be in Speed ​​in the normal direction, for Vertical velocity in the coordinate system for Length scale factor in the direction, for Length scale factor in the direction, A measure of grid nonorthogonality. It is the Coriolis force coefficient. It is gravitational acceleration. For reference density, The density of the water body; The continuity equation is: Wherein: wherein Vp is the actual vertical velocity; The salinity transport equation is: wherein, S = salinity; The temperature transport equation is: wherein T is temperature; , , is a Jacobian function; , is coordinates of , is coordinates of vertical coordinate at the sea surface at the sea floor ; wherein, is the actual physical height; and are the flow rates in and directional components, defined as: wherein and is the horizontal flow velocity in the Cartesian coordinate system; and is defined as and velocity in the normal direction: wherein, and are the vertical turbulent viscosity and the vertical turbulent diffusion coefficient, respectively; , , and are the horizontal momentum, salinity and heat diffusion terms, respectively: wherein is the horizontal viscosity coefficient, is the horizontal diffusion coefficient.

5. The numerical prediction method of saltwater intrusion in estuary based on standard language parallel acceleration according to claim 1, characterized in that, The step 4 comprises: Step 4.1: Under the same hardware and simulation configuration, respectively running the serial version, the CPU multi-thread version and the GPU version, recording the calculation time consumption and calculating the speedup ratio; Step 4.2: Perform long-time scale simulation, and quantitatively compare the calculation results of the parallel version and the serial version, and evaluate by using root mean square error RMSE and correlation coefficient CC.

6. A numerical prediction system for estuary saltwater intrusion based on standard language and parallel acceleration, characterized in that, Comprise: Module M1: Based on the code of the estuary saltwater intrusion high-resolution numerical model, a unified heterogeneous parallel computing framework is designed, and DO CONCURRENT statements and OpenACC instruction sets are used for compilation to support parallel computing of multi-core CPU and GPU platforms; Module M2: By analyzing the source code of the high-resolution numerical model, the multi-loop nested structure therein is determined as the parallelization target; Module M3: The multi-loop nested structure is reconstructed, including using DO CONCURRENT statements for CPU thread-level parallelization and using OpenACC instructions for GPU accelerated parallelization; Module M4: The calculation efficiency and numerical accuracy of the parallelization scheme are evaluated through comparison tests; On the CPU side, the model core loop structure is reconstructed by DO CONCURRENT parallel statements; on the GPU side, based on the CPU version, the model uses the! $ACC ENTER DATA COPYIN instruction to inject multiple key variables into the video memory during the main program initialization stage, realizing explicit data allocation; during the time advancement process, by inserting the! $ACC UPDATE DEVICE instruction, the data is synchronized to the GPU device side in time after the variable is updated; before outputting the results, the! $ACC UPDATE HOST instruction is used to return the key variables to the host side, thereby realizing effective connection with the output module; The source code of the model is analyzed, and the multi-loop nested structure in the core calculation module with high calculation intensity and long time consumption is determined as the key target of parallelization reconstruction; The target loop part is transformed into a DO CONCURRENT instruction, which automatically detects the characteristics of no data dependency between loops, and automatically distributes loop iteration tasks to multiple CPU threads for parallel execution; For intermediate field variables used only within the GPU, the resident video memory is maintained; the calculation task is offloaded to the GPU by the compiler, and large-scale parallel computing is performed by using the many-core architecture of the GPU.

7. The numerical prediction system for saltwater intrusion in estuary based on standard language and parallel acceleration according to claim 6, characterized in that, The CPU thread level parallelization includes: modifying a target loop part into a DO CONCURRENT statement, using the characteristic of automatically detecting no data dependency between loops to distribute loop iteration tasks to multiple CPU threads and perform parallel execution; The GPU acceleration parallelization includes: in the main program initialization stage, using the ENTER DATA COPYIN instruction of OpenACC to inject multiple key variables into the video memory, the key variables including velocity, water level, salinity, and grid structure; in the time advancing process, using the UPDATE DEVICE instruction of OpenACC to synchronize the updated variables on the host to the GPU end; before outputting the results, using the UPDATE HOST instruction of OpenACC to return the key variables to the host end.

8. The numerical prediction system for estuary saltwater intrusion based on standard language parallel acceleration according to claim 6, characterized in that, The code combined with DO CONCURRENT and OpenACC at the compilation time is switched between CPU and GPU use scenarios through different compilation commands; The CPU end compilation command includes a preprocessing option, an optimization option, and a standard parallel structure recognition option, and is used to start CPU compilation; The GPU end compilation command includes a preprocessing option, a GPU parallel compilation option, a standard parallel structure recognition option, and a non-managed memory mode option, and is used to start GPU compilation.

9. The numerical prediction system for saltwater intrusion in estuary based on standard language and parallel acceleration according to claim 6, characterized in that, The estuary saltwater intrusion high-resolution numerical model adopts three-dimensional incompressible fluid control equation groups, including momentum equation, continuity equation and salinity transport equation, to describe the space-time evolution of estuary tidal flow and salinity field; horizontal curved non-orthogonal grid, vertical curved orthogonal grid; and The directional momentum equation is: where , is the horizontal curvilinear coordinate, is the vertical normalized coordinate, , is the still water depth, is the total water depth, is the water level deviation, is the velocity in normal direction, is the velocity in normal direction, is the vertical velocity in the curvilinear coordinate system, is the length scale factor in the direction, is the length scale factor in the direction, is the measure of grid non-orthogonality, is the Coriolis force coefficient, is the gravitational acceleration, is the reference density, is the water density; The continuity equation is: wherein: wherein Vp is the actual vertical velocity; The salinity transport equation is: wherein, S = salinity; The temperature transport equation is: wherein T is temperature; , , is a Jacobian function; , is coordinates of , is coordinates of vertical coordinate at the sea surface at the sea floor ; wherein, is the actual physical height; and are the flow rates in and directional components, defined as: wherein and is the horizontal flow velocity in Cartesian coordinates; and is defined in and velocity in the normal direction: wherein, and are the vertical turbulent viscosity and the vertical turbulent diffusion coefficient, respectively; , , and are the horizontal momentum, salinity and heat diffusion terms, respectively: wherein is the horizontal viscosity coefficient, is the horizontal diffusion coefficient.

10. The numerical prediction system for saltwater intrusion in estuary based on standard language and parallel acceleration according to claim 6, characterized in that, The module M4 includes: Module M4.1: under the same hardware and simulation configuration, respectively running a serial version, a CPU multi-thread version and a GPU version, recording the calculation time consumption and calculating the speedup ratio; Module M4.2: performing long-time scale simulation, quantitatively comparing the calculation results of the parallel version and the serial version, and using root mean square error RMSE and correlation coefficient CC for evaluation.

Citation Information

Patent Citations

  • Techniques for identifying errors introduced during encoding

    CN107431804A

  • Ocean model parallel computing method and system

    CN119201478A