WFL的安装

WFL的安装

一、下载WFl

在气象家园下载WFL库:
气象家园

或直接下载上传的文件:
WFL下载

二、安装WFI

解压安装包后,运行.exe
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

安装过程中不要修改安装路径,否则可能导致无法使用

三、环境配置

在vs2019中点击:工具 → \rightarrow 选项

在这里插入图片描述
在自己版本Fortran的lib和includes中加入路径,如果不知道版本可以全部添加。

  • 打开选项卡后依次点击:

Intel Compilers and Libraries → \rightarrow IFX Intel Fortran → \rightarrow Compilers

分别Win32和Win64中

在includes中添加:

C:\WFL\INTEL\include

在includes中添加:

C:\WFL\INTEL\lib
  • 依次点击:

Intel Compilers and Libraries → \rightarrow IFORT Intel Fortran Classic → \rightarrow Compilers

分别Win32和Win64中

在includes中添加:

C:\WFL\INTEL\include

在includes中添加:

C:\WFL\INTEL\lib

在这里插入图片描述

  • 运行WFL库代码

可能出现以下报错:

在这里插入图片描述

这是因为在不同的库中包含了相同的定义符号,这些符号的含义基本是相同的,所以我们可以保留其中之一即可

依次点击:项目 → \rightarrow 属性 → \rightarrow 配置属性 → \rightarrow 链接器 → \rightarrow 输入 → \rightarrow 忽略特定库

在这里插入图片描述

输入我们需要忽略的库名即可,用";"间隔。

WFL库就安装成功了

在之后的使用中如果不调用WFL库,可能会缺少某些函数,我们将刚才忽略的特定库改回来即可解决问题

  • 6
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
改进以下代码 currentpath = os.path.dirname(os.path.realpath(__file__)) time_date = '{}{}'.format(self.time_date,self.random_char(5)) contents = os.path.join(currentpath, time_date, self.ref.split('/')[-1]) ref = self.ref.split('/')[-1] private_token = self.gl.private_token path = "lib" if ref == "master": if os.path.exists(os.path.join(contents, self.name)): subprocess.call("rm -rf {} ".format(os.path.join(contents, self.name)), shell=True, cwd=contents) time.sleep(3) retcode = start.clone(int(self.project_id), ref, contents, private_token) if retcode == 0: start.clone_frontend(self.get_frontend()[0],self.get_frontend()[1], contents, private_token,self.get_frontend()[2] ) start.clone_abc(self.get_abc()[0], self.get_abc()[1], contents, private_token,"mc_abc") start.clone_model(start.get_clkrst()[0], start.get_clkrst()[1], contents, private_token,"clkrst") start.clone_model(start.get_ara()[0], start.get_ara()[1], contents, private_token,"ara") start.clone_model(start.get_wfl()[0], start.get_wfl()[1], contents, private_token,"wfl") subprocess.call("echo '*.t' >> {}".format(os.path.join(contents, self.name, ".gitignore")),shell=True) code = start.make_lib(os.path.join(contents, self.name)) rel, err = code.communicate() if "make: *** [main] Error 2" in err.decode('utf-8'): print("loading push error log") filename = os.path.join(contents, self.name, "error_make_log") subprocess.call("echo '' > {}".format(filename), shell=True, cwd=contents) start.error_make(filename, rel.decode('utf-8') ) start.error_make(filename, err.decode('utf-8') ) else: print("loading push libs") # start.push_lib(os.path.join(contents, self.name), path, ref)
06-01
以下是改进后的代码: ```python import os import time import subprocess class MyClass: def __init__(self, time_date, ref, project_id, private_token, name, frontend, abc, clkrst, ara, wfl): self.time_date = time_date self.ref = ref self.project_id = project_id self.private_token = private_token self.name = name self.frontend = frontend self.abc = abc self.clkrst = clkrst self.ara = ara self.wfl = wfl def random_char(self, y): # 生成随机字符串 pass def get_frontend(self): # 获取前端代码信息 pass def get_abc(self): # 获取abc代码信息 pass def get_clkrst(self): # 获取clkrst代码信息 pass def get_ara(self): # 获取ara代码信息 pass def get_wfl(self): # 获取wfl代码信息 pass def clone_repo(self): current_path = os.path.dirname(os.path.realpath(__file__)) time_date = '{}{}'.format(self.time_date, self.random_char(5)) contents = os.path.join(current_path, time_date, self.ref.split('/')[-1]) ref = self.ref.split('/')[-1] private_token = self.private_token path = "lib" if ref == "master": if os.path.exists(os.path.join(contents, self.name)): subprocess.call("rm -rf {} ".format(os.path.join(contents, self.name)), shell=True, cwd=contents) time.sleep(3) start = Start() # 实例化Start类 ret_code = start.clone(int(self.project_id), ref, contents, private_token) if ret_code == 0: start.clone_frontend(self.get_frontend()[0], self.get_frontend()[1], contents, private_token, self.get_frontend()[2]) start.clone_abc(self.get_abc()[0], self.get_abc()[1], contents, private_token, "mc_abc") start.clone_model(start.get_clkrst()[0], start.get_clkrst()[1], contents, private_token, "clkrst") start.clone_model(start.get_ara()[0], start.get_ara()[1], contents, private_token, "ara") start.clone_model(start.get_wfl()[0], start.get_wfl()[1], contents, private_token, "wfl") subprocess.call("echo '*.t' >> {}".format(os.path.join(contents, self.name, ".gitignore")), shell=True) code = start.make_lib(os.path.join(contents, self.name)) rel, err = code.communicate() if "make: *** [main] Error 2" in err.decode('utf-8'): print("loading push error log") filename = os.path.join(contents, self.name, "error_make_log") subprocess.call("echo '' > {}".format(filename), shell=True, cwd=contents) start.error_make(filename, rel.decode('utf-8')) start.error_make(filename, err.decode('utf-8')) else: print("loading push libs") # start.push_lib(os.path.join(contents, self.name), path, ref) ``` 这里对代码进行了一些改进: - 将获取当前路径和时间的代码合并到一起,使代码更加简洁。 - 将前端、abc、clkrst、ara和wfl的克隆操作集成到一个实例化Start类的方法中,使代码更加模块化。 - 将错误日志的处理和推送操作分别封装到Start类的方法中,使代码更加易于维护。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值