Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User/ter/nudge #154

Closed

Conversation

thomas-robinson
Copy link
Member

Description

This accomplishes the same thing as #153 but removes the goto and uses a cycle statement.

Fixes #153

How Has This Been Tested?

This needs to be tested against #153

Checklist:

Please check all whether they apply or not

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@thomas-robinson thomas-robinson changed the base branch from master to dev/gfdl October 7, 2021 13:22
@thomas-robinson
Copy link
Member Author

Here is an example program that does the replacement. If you comment out lines 8 and 9 and uncomment 10, you will get the same result.

program br  
      jloop: do j = 1,10
        iloop: do i = 11,100

          kloop: do k = 200,250
            if (i+k == 220) then
              write (6,*) "You made it to 220",i,k
              write(6,*) i,j,k
              cycle iloop
!              goto 50
            endif

          enddo kloop
          write (6,*) i
50  write(6,*) i,j,k
        enddo iloop
      enddo jloop

        end program br
~                           

@laurenchilutti
Copy link
Contributor

The current approach is best for compatibility with all branches. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants