Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to call Fortran subfunction in NCL

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to call the Fortran subfunction in NCL. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

1. Steps:

Note:

① stub declares the format of variables

② so files can be understood as a medium that NCL can read.

C NCLFORTSTART

Subroutine F1 (x, y, z)

Integer

Real

C NCLEND

Or:

C NCLFORTSTART

Function f2 (x, y, z)

Integer

Real

C NCLEND

③ abc is the "introduction" to the calling function, telling NCL that we are going to call Fortran

two。 Demonstration:

A) prepare the subfunction to be called in advance, write it in Fortran, and save it as ex01.F90:

B) write the variable declaration for the F90 file and save it as ex01.stub:

C) follow the steps, add the Fortran function call declaration and invoke the subfunction in the NCL script:

D) run:

① first generates the so file: WRAPIT ex01.stub ex01.f90

② runs ncl:ncl ex01.ncl

At first, y has no value, it is initialized by the new function, and finally output to the screen, you can see that the experiment is successful.

This is how to call the Fortran subfunction in the NCL shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report