{"id":223,"date":"2017-09-13T11:19:27","date_gmt":"2017-09-13T14:19:27","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=223"},"modified":"2017-09-13T11:19:27","modified_gmt":"2017-09-13T14:19:27","slug":"sort3-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/sort3-f\/","title":{"rendered":"sort3.f"},"content":{"rendered":"<pre>      SUBROUTINE SSORT (X, IY, N, KFLAG)\r\n      IMPLICIT NONE\r\nc\r\nc    Example of an Insertion Sort\r\nc\r\nC***BEGIN PROLOGUE  SSORT\r\nC***PURPOSE  Sort an array and make the same interchanges in\r\nC            an auxiliary array.  The array is sorted in\r\nC            decreasing order.\r\nC***TYPE      SINGLE PRECISION\r\nC***KEYWORDS  SORT, SORTING\r\nC\r\nC   Description of Parameters\r\nC      X - array of values to be sorted   (usually abscissas)\r\nC      IY - array to be carried with X (all swaps of X elements are\r\nC          matched in IY .  After the sort IY(J) contains the original\r\nC          postition of the value X(J) in the unsorted X array.\r\nC      N - number of values in array X to be sorted\r\nC      KFLAG - Not used in this implementation\r\nC\r\nC***REVISION HISTORY  (YYMMDD)\r\nC   950310  DATE WRITTEN\r\nC   John Mahaffy\r\nC***END PROLOGUE  SSORT\r\nC     .. Scalar Arguments ..\r\n      INTEGER KFLAG, N\r\nC     .. Array Arguments ..\r\n      REAL X(*)\r\n      INTEGER IY(*)\r\nC     .. Local Scalars ..\r\n      REAL TEMP\r\n      INTEGER I, J, K, ITEMP\r\nC     .. External Subroutines ..\r\nC     None\r\nC     .. Intrinsic Functions ..\r\nC     None\r\nC\r\nC***FIRST EXECUTABLE STATEMENT  SSORT\r\nC\r\n      DO 100 I=2,N\r\n         IF ( X(I).GT.X(I-1) ) THEN\r\n            DO 50 J=I-2,1,-1\r\n              IF(X(I).LT.X(J)) go to 70\r\n  50          CONTINUE\r\n            J=0\r\n  70        TEMP=X(I)\r\n            ITEMP=IY(I)\r\n            DO 90 K=I,J+2,-1\r\n              IY(K)=IY(K-1)\r\n  90          X(K)=X(K-1)\r\n            X(J+1)=TEMP\r\n            IY(J+1)=ITEMP\r\n         ENDIF\r\n  100 CONTINUE\r\n      RETURN\r\n      END<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SUBROUTINE SSORT (X, IY, N, KFLAG) IMPLICIT NONE c c Example of an Insertion Sort c C***BEGIN PROLOGUE SSORT C***PURPOSE Sort an array and make the same interchanges in C an auxiliary array. The array is sorted in C decreasing order. C***TYPE SINGLE PRECISION C***KEYWORDS SORT, SORTING C C Description of Parameters C X &#8211; [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-223","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=223"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/223\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/223\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}