Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3346798
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:20:46+00:00 2026-05-18T01:20:46+00:00

With FORTRAN 77 is it possible to perform a swap on two arrays, in

  • 0

With FORTRAN 77 is it possible to perform a swap on two arrays, in the same way swap works in c++?

I have two large arrays, e.g. v1 and v2, and would like to swap v1 and v2 at the end of each iteration such that v2 is always the last iteration and v1 is the working array. How does one do this in F77?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:20:47+00:00Added an answer on May 18, 2026 at 1:20 am

    If I get it, you want to do the following kind of thing:

    do while (i.LE.max_iter .AND. .NOT.converged)
      call sub_iter(v1, v2)
      call swap(v1,v2)
    enddo
    

    I would think this isn’t really feasible, since a nice way to do this would be to use pointers to switch between arrays, which are not available in Fortran 77.

    Can’t you just do a double call to a the subroutine in each iteration?

    do while (i.LE.max_iter .AND. .NOT.converged)
      call sub_iter(v1, v2)
      call sub_iter(v2, v1)
    enddo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using gfortran to compile FORTRAN 77 and would like to have DEBUG
is it possible some way to print in python in a fortran like way
Fortran: There are two large arrays of integers, the goal is to find out
We have a large solution in Visual Studio 2010 which comprises a Fortran exe
Is there a way to create variable size arrays in Fortran on the stack
I'm trying to integrate two Fortran 9x codes which contain data arrays with opposite
Is it currently possible to override the structure constructor in Fortran? I have seen
I had some fortran code that looked something like: subroutine foo(mx,my,mz) real pts(3,mx,my,mz) end
Possible Duplicate: postfix 'd+0' in Fortran real literal expressions I have this code line
I would like to call some functions from a Fortran shared library in Python.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.