Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Broadcasting a REAL number to another file

Status
Not open for further replies.

Vahid9

Technical User
Jul 28, 2016
23
0
0
CA
Hi,

I am modifying a large code called Perturbo. Here I attempt to describe what the problem is with a simple example. I understand that this information may not be enough.

The code has a module file called polar_dispersion.f90. I would like to broadcast the value of a REAL called conc (not part of the code) to this file. So I create another module file called screen.f90 in which I calculate the conc in a public subroutine called TF_k and broadcast conc to all the nodes. Conc is declared as REAL in TF_k and in polar_dispersion.f90. Conc has the correct value inside the screen.f90 but it is zero when printed in polar_dispersion.f90 when run serially. I also add a USE statement in polar_dispersion.f90 as

use screen, only: TF_k

In addition, when compiling the code, the sequence is "other files" screen.f90 polar_dispersion.f90 "some other files".

Any helpful tips would be appreciated.

Thanks,
Vahid
 
What exactly do you mean by broadcast? This means different things to different people.

1) Broadcast as in networking - send to different programs
2) Pass as a parameter to different routines using pipes or as command line parameters
3) Write to a file which is then read by other programs
 
With trial and error, I managed to resolve the issue. By broadcast I meant broadcast across nodes so that all the nodes running the code can see the parameter. I had to make the parameter global by adding a SAVE statement.

Anyhow, the issue is resolved but thank you xwb for taking the time to respond.

Best,
Vahid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top