## 7.4. Subroutine EXEDIT - 2D

The listing below shows the contents of the file EXEDIT.F90, used to store the maximum pressure over time for all cells in the problem. The example is for Autodyn-2D but 3D would be analogous by simply including logic for the K index.

    SUBROUTINE EXEDIT

          ! ************************************************************************

          ! THIS IS A USER SUPPLIED SUBROUTINE WHICH CAN BE USED TO PROVIDE
          ! SPECIAL CUSTOM EDITING. THE FREQUENCY AT WHICH THIS SUBROUTINE
          ! IS CALLED IS DEFINED THROUGH INPUT (GLOBAL-EDIT-USER). WHEN
          ! REQUESTED, IT IS CALLED BY THE EDIT PROCESSOR AT THE END OF A
          ! COMPUTATIONAL CYCLE. THE ROUTINE IS CALLED BEFORE ANY OTHER
          ! TYPES OF STANDARD EDITS ARE CALLED FOR THAT CYCLE (EG. PRINT,
          ! SAVE, HISTORY, DISPLAY, ETC), SO IT MAY ALSO BE USED TO SET UP
          ! DATA TO BE PROCESSED BY OTHER EDIT TYPES.

          ! ************************************************************************

          USE mdgrid
          USE ranges
          USE kindef
          USE cycvar
          USE wrapup
          USE subdef

          IMPLICIT NONE

          INTEGER (INT4) ::      I,      J,     NS,    IJK
          REAL (REAL8)  ::       PRESSURE

          ! ************************************************************************

          ! THIS SUBROUTINE ATTAINS MAXIMUM PRESSURE FOR EACH CELL (2D)
    	  !
    	  !     VAR01    ARRAY STORING MAXIMUM PRESSURE
    	  !     VAR02    ARRAY STORING TIME WHEN MAXIMUM PRESSURE OCCURS

          ! ************************************************************************

          ! INITIALIZATION OF ARRAYS
    	  IF (NCYCLE == 1) THEN
    		! LOOP OVER ALL PARTS
    		DO NS = 1, NUMSUB

    			NSUB = NS
    CALL GETSUB
    			! LOOP OVER ALL CELLS
    			DO I = 1,IMAX
    				DO J = 1,JMAX
    					IJK          = IJSET(I,J)
    					VAR01(IJK)   = - BIG
    					VAR02(IJK)   = - BIG
    				! END LOOP ON CELLS
    				END DO
    			END DO

    		! END LOOP ON PARTS
    		END DO
    	  END IF

          ! GET MAXIMUM PRESSURE
          ! LOOP OVER ALL PARTS
          IF (NCYCLE > 1) THEN
    		DO NS = 1, NUMSUB
    			IF (NS/=NSUB) THEN
    			NSUB = NS
    			CALL GETSUB
    			END IF

    			! LOOP OVER ALL CELLS
    			DO I = 1,IMAX
    				DO J = 1,JMAX

    			! GET MAXIMUM PRESSURE FOR EACH CELL
    					IJK = IJSET(I,J)
    					PRESSURE = PN(IJK)
    					IF(PRESSURE >= VAR01(IJK)) THEN
    						VAR01(IJK) = PRESSURE
    						VAR02(IJK) = TIME
    					END IF

    			!	END LOOP ON CELLS
    				END DO
    			END DO

    		! END LOOP ON PARTS
    		END DO

    	  END IF

          RETURN

          END SUBROUTINE EXEDIT

Release 18.2 - © ANSYS, Inc. All rights reserved.