Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Small tidy up of version export code

  • Loading branch information...
commit 6ea85b14be89a9e4d437be67afd8faa3ad8acf4a 1 parent 94e3540
@adamreeve adamreeve authored
Showing with 23 additions and 16 deletions.
  1. +2 −1  src/FieldExport.c
  2. +21 −15 src/field_IO_routines.f90
View
3  src/FieldExport.c
@@ -1460,12 +1460,13 @@ int FieldExport_EndComponent( const int handle )
}
else if( session->type == EXPORT_TYPE_FILE )
{
- return FieldExport_FPrintf( &session->fileSession, "\n" );
+ return FieldExport_FPrintf( &session->fileSession, "\n" );
}
else
{
return FIELD_EXPORT_ERROR_UNKNOWN_TYPE;
}
+ /* Shouldn't get to here */
return FIELD_EXPORT_ERROR_UNKNOWN_TYPE;
}
View
36 src/field_IO_routines.f90
@@ -974,16 +974,20 @@ END FUNCTION FIELD_IO_DERIVATIVE_INFO
!
!> Use the element version information to calcualte the derivative index of a given nodal derivative for an element
- FUNCTION FIELD_IO_ELEMENT_DERIVATIVE_INDEX(ELEMENT, DERIVATIVE_NUMBER, NODE_NUMBER)
+ FUNCTION FIELD_IO_ELEMENT_DERIVATIVE_INDEX(ELEMENT, DERIVATIVE_NUMBER, NODE_NUMBER, ERR, ERROR)
!Argument variables
TYPE(DOMAIN_ELEMENT_TYPE), INTENT(IN) :: ELEMENT !<The element to calculate the derivative index for
INTEGER(INTG), INTENT(IN) :: DERIVATIVE_NUMBER !<The number of the derivative to calcualte
INTEGER(INTG), INTENT(IN) :: NODE_NUMBER !<The local element node number
+ INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
+ TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Return variable
- INTEGER(INTG) :: FIELD_IO_ELEMENT_DERIVATIVE_INDEX !<On return, the calculated deritave index
+ INTEGER(INTG) :: FIELD_IO_ELEMENT_DERIVATIVE_INDEX !<On return, the calculated derative index
!Local Variables
INTEGER(INTG) :: VERSION_NUMBER,NUMBER_OF_DERIVATIVES
+ CALL ENTERS("FIELD_IO_ELEMENT_DERIVATIVE_INDEX", ERR, ERROR, *999)
+
VERSION_NUMBER=ELEMENT%ELEMENT_DERIVATIVES(2, DERIVATIVE_NUMBER, NODE_NUMBER)
NUMBER_OF_DERIVATIVES=ELEMENT%BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
FIELD_IO_ELEMENT_DERIVATIVE_INDEX=(VERSION_NUMBER-1)*NUMBER_OF_DERIVATIVES + &
@@ -991,6 +995,8 @@ FUNCTION FIELD_IO_ELEMENT_DERIVATIVE_INDEX(ELEMENT, DERIVATIVE_NUMBER, NODE_NUMB
CALL EXITS("FIELD_IO_ELEMENT_DERIVATIVE_INDEX")
RETURN
+999 CALL ERRORS("FIELD_IO_ELEMENT_DERIVATIVE_INDEX",ERR,ERROR)
+ CALL EXITS("FIELD_IO_ELEMENT_DERIVATIVE_INDEX")
END FUNCTION FIELD_IO_ELEMENT_DERIVATIVE_INDEX
!
@@ -2840,7 +2846,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -2865,7 +2871,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -2890,7 +2896,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -2915,7 +2921,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -2942,7 +2948,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -2967,7 +2973,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -2992,7 +2998,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -3017,7 +3023,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -3044,7 +3050,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -3069,7 +3075,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -3094,7 +3100,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -3119,7 +3125,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn)=BASIS%NUMBER_OF_DERIVATIVES(NODE_NUMBER)
DO mm = 1, NUMBER_OF_DERIVATIVES(NODE_NUMBER)
ELEMENT_DERIVATIVES(nn)=FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,NODE_NUMBER,ERR,ERROR)
ENDDO
ENDDO
ENDDO
@@ -3134,7 +3140,7 @@ SUBROUTINE FIELD_IO_EXPORT_ELEMENTAL_GROUP_HEADER_FORTRAN( global_number, MAX_NO
NUMBER_OF_DERIVATIVES(nn) = BASIS%NUMBER_OF_DERIVATIVES(nn)
DO mm=1,NUMBER_OF_DERIVATIVES(nn)
ELEMENT_DERIVATIVES(derivativeIndex) = FIELD_IO_ELEMENT_DERIVATIVE_INDEX( &
- & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,nn)
+ & DOMAIN_ELEMENTS%ELEMENTS(GROUP_LOCAL_NUMBER(comp_idx)),mm,nn,ERR,ERROR)
derivativeIndex = derivativeIndex + 1
ENDDO !mm
ENDDO !nn
Please sign in to comment.
Something went wrong with that request. Please try again.