CFL3D使用教程_编译与WSL

官网链接:https://nasa.github.io/CFL3D/
使用手册下载:https://www.docin.com/p-43691400.html
一个Github项目:https://github.com/nasa/CFL3D


1 Install

To install CFL3v6 on a particular machine, you must first get it from:

https://github.com/NASA/CFL3D 

STEP 1)

You should have the following directory structure:
在这里插入图片描述Next, cd to the build directory. Make sure the script file Install has execute permission.

STEP 2)

NOTE: the Install script is very old, and may or may not create a workable makefile for your particular machine. Also, CFL3D has mostly been used on Linux-type machines; there is no option for compiling on a Windows machine.

Type:
Install [options]

Where [options] may be one or more of the following:

  • no_opt
    create executables with little optimization but fast compilation

  • single
    create single precision executables

  • noredirect
    disallow redirected input file; often needed for SP2 and for Linux with MPI (generally recommended for MPI - see note below)

  • mpichdir=dir1
    use MPICH on a workstation cluster; dir1 is the directory where mpich is located - not used on MPP machines

  • purify
    fortran memory checker: need 3rd party license for this

  • fastio
    fast I/O option when using MPI: creates cfl3d.out.reass file (in place of standard output file)… this option may help speed up some very large MPI runs by writing output to local files then reassembling at the end, rather than sending the output back to the master for writing-on-the-fly (acknowledgment: Robert Bergeron, NASA Ames)

  • cgnsdir=dir2
    allow the use of CGNS files instead of the standard grid/restart files; dir2 is the directory where the CGNS libraries are located; the directory should contain the file cgnslib_f.h as well as the subdirectory appropriate to the system you are running on (for example subdirectory LINUX/) with the library file libcgns.a in it

  • linux_compiler_flags=flag
    sets up to compile using special compiler flags for use on Linux operating systems only; flag is currently Intel, PG, Lahey, or Alpha (Intel is currently the default)

  • help
    print out the Install options

Note: the directory paths for either the mpichdir or cgnsdir options should be either absolute paths or paths relative to the installation directory; the use of ~ to denote a home directory is not allowed.

If -no_opt is not specified, various compiler optimization levels are used to speed execution but results in slower compilation.

If -mpichdir=dir1 is not used, then it is assumed "native" MPI is available, and will use a default location for the necessary MPI libraries.

If -single is not used, then double precision exectables will be created at the make [ ] command.

If -noredirect is not used, then input file redirection will be allowed, i.e. you can use: cfl3d_seq < filename.inp to tell CFL3D to use the input data in the file filename.inp. Otherwise, with the -noredirect option invoked, the input file must be named cfl3d.inp when running the code. Unfortunately, the SP2 and many Linux systems cannot deal with file redirection in many cases when MPI is used, so the -noredirect option needs to be added. Our current recommendation is: on the SP2 and on Linux systems, always install with -noredirect when using MPI, always name the input file cfl3d.inp, and never use file redirection (just type the executable name).

If -cgnsdir=dir2 is used, then you must download the free CGNS system from (CGNS Home Page). Compile CGNS according to the instructions. Using a CGNS file requires that the CFL3D input file contain the keyword icgns 1 (see New Features) in addition to having installed the code with the -cgnsdir option. It is the user's responsibility to download the CGNS software from the CGNS website and insure it is installed correctly in the user-specified directory dir2. NOTE: while you are free to specify the name of the directory dir2, please note that the CFL3D Install file makes the following assumptions about this directory: 1) that it contains a file called cgnslib_f.h and 2) that it contains a subdirectory with a specific name assigned by CGNS for your particular system, in which is located the file libcgns.a. Please insure that the subdirectory assigned by the CFL3D Install file matches the name of the subdirectory created by CGNS for your particular system. Also NOTE: if you would like to use CGNS but do not have a CGNS grid available, you can create one using the program plot3dg_to_cgns in the Tools/ directory (compiled using make cfl3d_tools).

NOTE FOR LINUX USERS: due to the variability of Linux installations, available compilers, etc., it is not possible to set FFLAGS, FTN, etc varables universally once Linux has been identified as the OS: the default flags are currently set for the Intel compiler. Note the default Fortran compiler for Linux is currently set as mpif77 - if this does not work, you will need to change this to a compiler that is available on your machine: e.g. ifc, pgf90, etc. For certain implementations of MPI on Linux you may need to use the -noredirect install option to turn off input file redirection.

A known problem exists for MPI on alphas using myrinet. The following 2 lines of code in main.F cause an error:

sysfile = 'rm -f stop'
call system(sysfile)

If you are running under these circumstances, you will need to comment out these 2 lines of code, and manually delete the "stop" file if it exists. prior to your run.

Standard installation on all MPPs (except for the SP2), Cray C90, and stand-alone workstations would simply be:

Install

This will create a makefile set up for optimized compilation, double precision, using native MPI libraries when needed. Note: the install script assumes some very basic locations for the MPI directories - you may need to alter these for your own particular system.

Standard installation on a Linux machine with Intel compiler would be:

Install -noredirect -linux_compiler_flags=Intel

The Install script works by querying the current machine for its achitecture, then sets up the various compilation flags based on the architecture, and creates a file called makefile by edititing the Makefile.in file and inserting the proper compiler flags. This eliminates the need for multiple makefiles that are typical of other versions of CFL3D.

To install the CFL3Dv6 system:

cd build

Install [options]

2 WSL下载安装与设置

参考:https://www.bilibili.com/read/cv15545635

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yyy_land

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值