Coder Social home page Coder Social logo

shallow_water_equation's Introduction

本程序基于有限差分方法,利用Arakawa-C交错网格对计算域进行离散,实现了对二维浅水方程组数值解的求解。其中,方程组比较全面地包含了浅水方程的物理过程,包括了风应力,底摩擦力,科氏力,水平压强梯度力,对流项,扩散项。程序中所采用的原始方程、离散方法均可以在《ocean modelling for beginners》此书中找到,本程序的编写也是基于书中所附练习题的代码。
程序包含了三个源文件,其中:
(1)var.f90
该文件为模块,模块名为var。里面定义了主程序中用到的所有“全局变量“。
(2)proc.f90
该文件为模块,模块名为proc。里面封装了计算过程有关的四个子程序,包括:cal_u,用于计算迭代步流速u;cal_v,用于计算迭代步流速v;cal_eta,用于计算迭代步水位eta;advect,用于计算对流项,被cal_u,cal_v两个字程序调用。
(3)main.f90
该文件为主程序,主要作用为读取水深,参数赋值,数组初始化,输出文件等。
以上程序均经过gfortran(4.4.7)和ifort(15.0.2)编译器编译通过,系统平台为CentOS 6.8。计算结果经绘图分析,也基本符合合理认知。由于水平有限,程序中如有算法错误或者程序bug,欢迎读者指正批评。

PS:本程序所有边界均采用闭边界,即边界处u,v为零,净水深为零或负值。下一步(有时间精力的话)考虑将开边界类型加入到程序算法中来,考虑的开边界类型包括clamp,零梯度以及辐射边界类型。

shallow_water_equation's People

Contributors

lihu8918 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.