Skip to content

User/ter/nudge#154

Closed
thomas-robinson wants to merge 1 commit into
NOAA-GFDL:dev/gfdlfrom
thomas-robinson:user/ter/nudge
Closed

User/ter/nudge#154
thomas-robinson wants to merge 1 commit into
NOAA-GFDL:dev/gfdlfrom
thomas-robinson:user/ter/nudge

Conversation

@thomas-robinson
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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