VSCode配置Fortran并运行国际参考电离层2020模型(IRI2020)

2262 足球世界杯怎么画 | 2025-12-22 10:13:07

VSCode配置Fortran并运行国际参考电离层2020模型(IRI2020)

由于VSCode具有轻量、强大的代码编辑功能和丰富的插件生态系统,受到广大编程人员的青睐,在科学研究中也应用广泛。在电离层研究中,IRI模型可以计算出给定的地点、时间的电离层高度范围内电子密度、电子温度、离子温度和离子成分的月平均值。本文主要介绍了配置Fortran和运行IRI2020模型时出现的问题及解决方案。

一、VSCode配置Fortran

安装配置等步骤详见以下博客:

1、https://blog.csdn.net/wokaowokaowokao12345/article/details/127076563 2、https://zhuanlan.zhihu.com/p/524480747 3、https://blog.csdn.net/qq_24197463/article/details/89634794

下面是我配置IRI时的task.json,仅作参考。

{

"version": "2.0.0",

"command": "gfortran",

"args": [

"-g",

"${fileDirname}\\*.f*",

"-o",

"${workspaceRoot}\\${fileBasenameNoExtension}.exe"

],

"presentation": {

"echo": true,

"reveal": "always",

"focus": false,

"panel": "new",

"showReuseMessage": true,

"clear": false

}

}

二、运行国际参考电离层2020模型(IRI2020)

1、下载IRI2020源码,地址为:http://irimodel.org/ 直接运行iritest.for会出现以下错误: undefined reference to ‘read_ig_rz_’ undefined reference to ‘readapf10.7_’ undefined reference to ‘read_web_’ 错误的原因是因为它找不到这三个函数,这里需要我们添加上。

要添加函数需要的源文件,在这里我全加在了iritest.for中

2、下面是IRI模型程序中的输入项,可以根据自己的需求选择。

c user input of IRI input parameters

cccccccccccccccccccccccccccccccccccccc

c defaults for jf(1:50)

c jf(1)=.false. ! f=no electron densities (t)

c jf(2)=.false. ! f=no temperatures (t)

c jf(3)=.false. ! f=no ion composition (t)

jf(4)=.false. ! t=B0table f=other models (f)

jf(5)=.false. ! t=CCIR f=URSI foF2 model (f)

jf(6)=.false. ! t=DS95+DY85 f=RBV10+TBT15 (f)

c jf(7)=.false. ! t=tops f10.7<188 f=unlimited (t)

c jf(19)=.false. !F1 prob model only if foF1>0 and not NIGHT (t)

c jf(20)=.false. !standard F1 standard F1 plus L condition (t)

c (19,20) = (t,t) f1-prob, (t,f) f1-prob-L, (f,t) old F1, (f,f) no F1

c jf(21)=.false. ! t=ion drift computed f=not comp.(f)

c jf(22)=.false. ! ion densities in m-3 (t)

jf(23)=.false. ! t=AEROS/ISIS f=TTS Te with PF10.7 (f)

c jf(24)=.false. ! t=D-reg-IRI-1990 f=FT-2001 (t)

c jf(25)=.false. ! t=F107D from APF107.DAT f=user (t)

c jf(26)=.false. ! t=STORM model on f= off (t)

c jf(28)=.false. ! t=spread-F computed f=not comp. (f)

jf(29)=.false. ! t=old f=New Topside options (f)

jf(30)=.false. ! t=corr f=NeQuick topside (f)

C (29,30) = (t,t) IRIold, (f,t) IRIcor, (f,f) NeQuick, (t,f) COR2

c jf(31)=.false. ! t=B0ABT f=Gulyaeva (t)

c jf(32)=.false. ! t=F107_81 from APF107.DAT f=user (t)

jf(33)=.false. ! t=auroral boundary f=off (f)

c jf(34)=.false. ! t=messages on f= off (t)

jf(35)=.false. ! t=auroral E-storm model on f=off (f)

c jf(36)=.false. ! t=hmF2 w/out foF2_storm f=with (t)

c jf(37)=.false. ! t=topside w/out foF2_storm f=with (t)

c jf(38)=.false. ! t=WRITEs off in IRIFLIP f=on (t)

jf(39)=.false. ! t=M3000F2 model f=new hmF2 models (f)

c jf(40)=.false. ! t=AMTB-model, f=Shubin-COSMIC model (t)

c jf(41)=.false. ! t:COV=F10.7_386 f:COV=f(IG12) (t)

c jf(42)=.false. ! t/f=Te w/o PF10.7 dependance (t)

c jf(43)=.false. ! t= B0 model f= B0 user input (t)

c jf(44)=.false. ! t= B1 model f= B1 user input (t)

c jf(45)=.false. ! not used

c jf(46)=.false. ! not used

jf(47)=.false. ! t=CGM on f=CGM off (f)

c jf(48)=.false. ! t=Ti-Tru2021 f=Ti-Bil1981 (t)

IRI模型程序中的输出项:

WRITE(7,7117) XCOR,jne,xner,jtn,jti,jte,jio,jin,

& jih,jihe,jio2,jino,jicl,tec,itopp

7117 FORMAT(F7.1,I7,1x,F6.3,3I6,7I4,f6.1,i4)

这里给大家一个参考:https://www.ngui.cc/el/1105081.html?action=onClick