## 7.5. Subroutine EXEDIT3 – 3D

The listing below shows the contents of the file EXEDIT3.F90, used to store the maximum momentum over time for all cells in the problem, except Euler. The example is for Autodyn-3D

    SUBROUTINE EXEDIT3

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

          ! 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 mdgrid3
          USE ranges
          USE kindef
          USE cycvar
          USE wrapup
          USE subdef

          IMPLICIT NONE

          INTEGER (INT4) ::      I,      J,     k,       NS,    IJK
          REAL (REAL8)  ::    MOM, RES_VEL,  MASS

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

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

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

          ! INITIALIZATION OF ARRAYS
    	  IF (NCYCLE == 1) THEN
    		! LOOP OVER ALL PARTS
    		DO NS = 1, NUMSUB
    			NSUB = NS
    			CALL GETSUB3
    			! LOOP OVER ALL CELLS
    			DO I = 1,IMAX
    				DO J = 1,JMAX
    				DO K = 1,KMAX
    					IJK          = IJKSET3(I,J,K)
    					VAR01(IJK)   = - BIG
    					VAR02(IJK)   = - BIG
    				ENDDO
    				END DO
    			END DO
    		END DO ! END LOOP ON PARTS
    	  END IF

          ! GET MAXIMUM MOMENTUM
          ! LOOP OVER ALL PARTS
          IF (NCYCLE > 1) THEN
    		DO NS = 1, NUMSUB
    			NSUB = NS
    			CALL GETSUB3
    			! LOOP OVER ALL CELLS
    			DO I = 1,IMAX
    				DO J = 1,JMAX
    				DO K = 1,KMAX
    					! GET MAXIMUM MOMENTUM FOR EACH CELL
    					IJK = IJKSET3(I,J,K)

    					! SET-UP POINTER TO MULTI-MATERIAL ARRAYS
    					ML => MTSUB(IJK)%V(1:NUMMLV)
    					MASS = ML(NCMS)

    					RES_VEL = SQRT ( UXN(IJK)*UXN(IJK) + &
    							  UYN(IJK)*UYN(IJK) + &
      UZN(IJK)*UZN(IJK) )

    						MOM = MASS*RES_VEL
    					IF(MOM >= VAR01(IJK)) THEN
    						VAR01(IJK) = MOM
    						VAR02(IJK) = TIME
    					END IF
    				END DO
    			END DO
    			END DO
    	! END LOOP ON PARTS
    		END DO

          END IF

          RETURN

          END SUBROUTINE EXEDIT

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