Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Broadcasting a REAL number to another file

Broadcasting a REAL number to another file

Broadcasting a REAL number to another file


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.


RE: Broadcasting a REAL number to another file

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

RE: Broadcasting a REAL number to another file

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.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close