! This automatically generated Fortran wrapper file allows codes
! written in Fortran to be called directly from C and translates all
! C-style arguments into expected Fortran-style arguments (with
! assumed size, local type declarations, etc.).


MODULE C_AXY
USE ISO_C_BINDING , ONLY : C_BOOL
USE ISO_FORTRAN_ENV , ONLY : RT => REAL32 , INT64 , INT32 , INT8
USE IEEE_ARITHMETIC , ONLY : IS_NAN => IEEE_IS_NAN , IS_FINITE => IEEE_IS_FINITE
USE RANDOM , ONLY : SEED_RANDOM , RANDOM_INTEGER , RANDOM_REAL , RANDOM_UNIT_VECTORS , INITIALIZE_ITERATOR , INDEX_TO_PAIR , PAIR_T&
&O_INDEX , GET_NEXT_INDEX
USE SORT_AND_SELECT , ONLY : ARGSORT , ARGSELECT
USE MATRIX_OPERATIONS , ONLY : GEMM , ORTHOGONALIZE , RADIALIZE , LEAST_SQUARES
  IMPLICIT NONE


  INTERFACE
    FUNCTION OMP_GET_MAX_THREADS()
      INTEGER :: OMP_GET_MAX_THREADS
    END FUNCTION OMP_GET_MAX_THREADS
    FUNCTION OMP_GET_THREAD_NUM()
      INTEGER :: OMP_GET_THREAD_NUM
    END FUNCTION OMP_GET_THREAD_NUM
  END INTERFACE

CONTAINS


  ! Getter and setter for CLOCK_RATE.
  SUBROUTINE AXY_GET_CLOCK_RATE(CLOCK_RATE_LOCAL) BIND(C)
    USE AXY, ONLY: CLOCK_RATE
    INTEGER(KIND=INT64) :: CLOCK_RATE_LOCAL
    CLOCK_RATE_LOCAL = CLOCK_RATE
  END SUBROUTINE AXY_GET_CLOCK_RATE
  SUBROUTINE AXY_SET_CLOCK_RATE(CLOCK_RATE_LOCAL) BIND(C)
    USE AXY, ONLY: CLOCK_RATE
    INTEGER(KIND=INT64) :: CLOCK_RATE_LOCAL
    CLOCK_RATE = CLOCK_RATE_LOCAL
  END SUBROUTINE AXY_SET_CLOCK_RATE

  ! Getter and setter for CLOCK_MAX.
  SUBROUTINE AXY_GET_CLOCK_MAX(CLOCK_MAX_LOCAL) BIND(C)
    USE AXY, ONLY: CLOCK_MAX
    INTEGER(KIND=INT64) :: CLOCK_MAX_LOCAL
    CLOCK_MAX_LOCAL = CLOCK_MAX
  END SUBROUTINE AXY_GET_CLOCK_MAX
  SUBROUTINE AXY_SET_CLOCK_MAX(CLOCK_MAX_LOCAL) BIND(C)
    USE AXY, ONLY: CLOCK_MAX
    INTEGER(KIND=INT64) :: CLOCK_MAX_LOCAL
    CLOCK_MAX = CLOCK_MAX_LOCAL
  END SUBROUTINE AXY_SET_CLOCK_MAX

  ! Getter and setter for ZERO.
  SUBROUTINE AXY_GET_ZERO(ZERO_LOCAL) BIND(C)
    USE AXY, ONLY: ZERO
    INTEGER(KIND=INT64) :: ZERO_LOCAL
    ZERO_LOCAL = ZERO
  END SUBROUTINE AXY_GET_ZERO

  ! Getter and setter for ONE.
  SUBROUTINE AXY_GET_ONE(ONE_LOCAL) BIND(C)
    USE AXY, ONLY: ONE
    INTEGER(KIND=INT64) :: ONE_LOCAL
    ONE_LOCAL = ONE
  END SUBROUTINE AXY_GET_ONE

  ! Getter and setter for TWO.
  SUBROUTINE AXY_GET_TWO(TWO_LOCAL) BIND(C)
    USE AXY, ONLY: TWO
    INTEGER(KIND=INT64) :: TWO_LOCAL
    TWO_LOCAL = TWO
  END SUBROUTINE AXY_GET_TWO

  
  SUBROUTINE C_NEW_MODEL_CONFIG(ADN, ADE_PRESENT, ADE, ANE_PRESENT, ANE, ADS_PRESENT, ADS, ANS_PRESENT, ANS, ADO_PRESENT, ADO, MDN,&
& MDE_PRESENT, MDE, MNE_PRESENT, MNE, MDS_PRESENT, MDS, MNS_PRESENT, MNS, MDO, NUM_THREADS_PRESENT, NUM_THREADS, CONFIG) BIND(C)
    USE ISO_C_BINDING, ONLY: C_BOOL
    USE AXY, ONLY: NEW_MODEL_CONFIG
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    INTEGER(KIND=INT32), INTENT(IN) :: ADN
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: ADE_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: ADE
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: ANE_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: ANE
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: ADS_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: ADS
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: ANS_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: ANS
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: ADO_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: ADO
    INTEGER(KIND=INT32), INTENT(IN) :: MDN
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: MDE_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: MDE
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: MNE_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: MNE
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: MDS_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: MDS
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: MNS_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: MNS
    INTEGER(KIND=INT32), INTENT(IN) :: MDO
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: NUM_THREADS_PRESENT
    INTEGER(KIND=INT32), INTENT(IN) :: NUM_THREADS
    TYPE(MODEL_CONFIG), INTENT(OUT) :: CONFIG
  
    IF (ADE_PRESENT) THEN
      IF (ANE_PRESENT) THEN
        IF (ADS_PRESENT) THEN
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO&
&)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE&
&)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE&
&)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADS=ADS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        ELSE
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE&
&)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANE=ANE)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        END IF
      ELSE
        IF (ADS_PRESENT) THEN
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADS=ADS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        ELSE
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADE=ADE)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        END IF
      END IF
    ELSE
      IF (ANE_PRESENT) THEN
        IF (ADS_PRESENT) THEN
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE&
&)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADS=ADS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        ELSE
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANE=ANE)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        END IF
      ELSE
        IF (ADS_PRESENT) THEN
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE&
&)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADS=ADS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        ELSE
          IF (ANS_PRESENT) THEN
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS&
&)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ANS=ANS)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          ELSE
            IF (ADO_PRESENT) THEN
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS&
&)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, ADO=ADO)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            ELSE
              IF (MDE_PRESENT) THEN
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THR&
&EADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDE=MDE)
                      END IF
                    END IF
                  END IF
                END IF
              ELSE
                IF (MNE_PRESENT) THEN
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_&
&THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNE=MNE)
                      END IF
                    END IF
                  END IF
                ELSE
                  IF (MDS_PRESENT) THEN
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDS=MDS, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDS=MDS, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDS=MDS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MDS=MDS)
                      END IF
                    END IF
                  ELSE
                    IF (MNS_PRESENT) THEN
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNS=MNS, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, MNS=MNS)
                      END IF
                    ELSE
                      IF (NUM_THREADS_PRESENT) THEN
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG, NUM_THREADS=NUM_THREADS)
                      ELSE
                        CALL NEW_MODEL_CONFIG(ADN=ADN, MDN=MDN, MDO=MDO, CONFIG=CONFIG)
                      END IF
                    END IF
                  END IF
                END IF
              END IF
            END IF
          END IF
        END IF
      END IF
    END IF
  END SUBROUTINE C_NEW_MODEL_CONFIG
  

  
  SUBROUTINE C_NEW_FIT_CONFIG(NM, NA_PRESENT, NA, NMT_PRESENT, NMT, NAT_PRESENT, NAT, ADI_PRESENT, ADI, MDI_PRESENT, MDI, SEED_PRES&
&ENT, SEED, CONFIG) BIND(C)
    USE ISO_C_BINDING, ONLY: C_BOOL
    USE AXY, ONLY: NEW_FIT_CONFIG
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    INTEGER(KIND=INT64), INTENT(IN) :: NM
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: NA_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: NA
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: NMT_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: NMT
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: NAT_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: NAT
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: ADI_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: ADI
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: MDI_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: MDI
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: SEED_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: SEED
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
  
    IF (NA_PRESENT) THEN
      IF (NMT_PRESENT) THEN
        IF (NAT_PRESENT) THEN
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, NAT=NAT)
              END IF
            END IF
          END IF
        ELSE
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NMT=NMT)
              END IF
            END IF
          END IF
        END IF
      ELSE
        IF (NAT_PRESENT) THEN
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, NAT=NAT)
              END IF
            END IF
          END IF
        ELSE
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NA=NA)
              END IF
            END IF
          END IF
        END IF
      END IF
    ELSE
      IF (NMT_PRESENT) THEN
        IF (NAT_PRESENT) THEN
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, NAT=NAT)
              END IF
            END IF
          END IF
        ELSE
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NMT=NMT)
              END IF
            END IF
          END IF
        END IF
      ELSE
        IF (NAT_PRESENT) THEN
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, NAT=NAT)
              END IF
            END IF
          END IF
        ELSE
          IF (ADI_PRESENT) THEN
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, ADI=ADI, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, ADI=ADI, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, ADI=ADI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, ADI=ADI)
              END IF
            END IF
          ELSE
            IF (MDI_PRESENT) THEN
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, MDI=MDI, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, MDI=MDI)
              END IF
            ELSE
              IF (SEED_PRESENT) THEN
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG, SEED=SEED)
              ELSE
                CALL NEW_FIT_CONFIG(NM=NM, CONFIG=CONFIG)
              END IF
            END IF
          END IF
        END IF
      END IF
    END IF
  END SUBROUTINE C_NEW_FIT_CONFIG
  

  
  SUBROUTINE C_INIT_MODEL(CONFIG, MODEL_DIM_1, MODEL, SEED_PRESENT, SEED, INITIAL_SHIFT_RANGE_PRESENT, INITIAL_SHIFT_RANGE, INITIAL&
&_OUTPUT_SCALE_PRESENT, INITIAL_OUTPUT_SCALE) BIND(C)
    USE ISO_C_BINDING, ONLY: C_BOOL
    USE AXY, ONLY: INIT_MODEL
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(MODEL_DIM_1) :: MODEL
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: SEED_PRESENT
    INTEGER(KIND=INT64), INTENT(IN) :: SEED
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: INITIAL_SHIFT_RANGE_PRESENT
    REAL(KIND=RT), INTENT(IN) :: INITIAL_SHIFT_RANGE
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: INITIAL_OUTPUT_SCALE_PRESENT
    REAL(KIND=RT), INTENT(IN) :: INITIAL_OUTPUT_SCALE
  
    IF (SEED_PRESENT) THEN
      IF (INITIAL_SHIFT_RANGE_PRESENT) THEN
        IF (INITIAL_OUTPUT_SCALE_PRESENT) THEN
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, SEED=SEED, INITIAL_SHIFT_RANGE=INITIAL_SHIFT_RANGE, INITIAL_OUTPUT_SCALE=INIT&
&IAL_OUTPUT_SCALE)
        ELSE
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, SEED=SEED, INITIAL_SHIFT_RANGE=INITIAL_SHIFT_RANGE)
        END IF
      ELSE
        IF (INITIAL_OUTPUT_SCALE_PRESENT) THEN
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, SEED=SEED, INITIAL_OUTPUT_SCALE=INITIAL_OUTPUT_SCALE)
        ELSE
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, SEED=SEED)
        END IF
      END IF
    ELSE
      IF (INITIAL_SHIFT_RANGE_PRESENT) THEN
        IF (INITIAL_OUTPUT_SCALE_PRESENT) THEN
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, INITIAL_SHIFT_RANGE=INITIAL_SHIFT_RANGE, INITIAL_OUTPUT_SCALE=INITIAL_OUTPUT_&
&SCALE)
        ELSE
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, INITIAL_SHIFT_RANGE=INITIAL_SHIFT_RANGE)
        END IF
      ELSE
        IF (INITIAL_OUTPUT_SCALE_PRESENT) THEN
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, INITIAL_OUTPUT_SCALE=INITIAL_OUTPUT_SCALE)
        ELSE
          CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL)
        END IF
      END IF
    END IF
  END SUBROUTINE C_INIT_MODEL
  

  
  SUBROUTINE C_CHECK_SHAPE(CONFIG, MODEL_DIM_1, MODEL, AX_DIM_1, AX_DIM_2, AX, AXI_DIM_1, AXI_DIM_2, AXI, SIZES_DIM_1, SIZES, X_DIM&
&_1, X_DIM_2, X, XI_DIM_1, XI_DIM_2, XI, Y_DIM_1, Y_DIM_2, Y, INFO) BIND(C)
    USE AXY, ONLY: CHECK_SHAPE
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(IN) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_DIM_1,XI_DIM_2) :: XI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=INT32), INTENT(OUT) :: INFO
  
    CALL CHECK_SHAPE(CONFIG, MODEL, AX, AXI, SIZES, X, XI, Y, INFO)
  END SUBROUTINE C_CHECK_SHAPE
  

  
  SUBROUTINE C_COMPUTE_BATCHES(CONFIG, NA, NM, SIZES_DIM_1, SIZES, BATCHA_STARTS_DIM_1, BATCHA_STARTS, BATCHA_ENDS_DIM_1, BATCHA_EN&
&DS, AGG_STARTS_DIM_1, AGG_STARTS, FIX_STARTS_DIM_1, FIX_STARTS, BATCHM_STARTS_DIM_1, BATCHM_STARTS, BATCHM_ENDS_DIM_1, BATCHM_ENDS&
&, JOINT, INFO) BIND(C)
    USE ISO_FORTRAN_ENV, ONLY: INT64
    USE AXY, ONLY: COMPUTE_BATCHES
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(IN) :: CONFIG
    INTEGER(KIND=INT64), INTENT(IN) :: NA
    INTEGER(KIND=INT64), INTENT(IN) :: NM
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(OUT) :: BATCHA_STARTS_DIM_1
    INTEGER(KIND=INT64), ALLOCATABLE, SAVE, DIMENSION(:) :: BATCHA_STARTS_LOCAL
    INTEGER(KIND=INT64), INTENT(OUT) :: BATCHA_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(OUT) :: BATCHA_ENDS_DIM_1
    INTEGER(KIND=INT64), ALLOCATABLE, SAVE, DIMENSION(:) :: BATCHA_ENDS_LOCAL
    INTEGER(KIND=INT64), INTENT(OUT) :: BATCHA_ENDS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(OUT) :: AGG_STARTS_DIM_1
    INTEGER(KIND=INT64), ALLOCATABLE, SAVE, DIMENSION(:) :: AGG_STARTS_LOCAL
    INTEGER(KIND=INT64), INTENT(OUT) :: AGG_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(OUT) :: FIX_STARTS_DIM_1
    INTEGER(KIND=INT64), ALLOCATABLE, SAVE, DIMENSION(:) :: FIX_STARTS_LOCAL
    INTEGER(KIND=INT64), INTENT(OUT) :: FIX_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(OUT) :: BATCHM_STARTS_DIM_1
    INTEGER(KIND=INT64), ALLOCATABLE, SAVE, DIMENSION(:) :: BATCHM_STARTS_LOCAL
    INTEGER(KIND=INT64), INTENT(OUT) :: BATCHM_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(OUT) :: BATCHM_ENDS_DIM_1
    INTEGER(KIND=INT64), ALLOCATABLE, SAVE, DIMENSION(:) :: BATCHM_ENDS_LOCAL
    INTEGER(KIND=INT64), INTENT(OUT) :: BATCHM_ENDS
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: JOINT
    INTEGER(KIND=INT32), INTENT(INOUT) :: INFO
  
    CALL COMPUTE_BATCHES(CONFIG, NA, NM, SIZES, BATCHA_STARTS_LOCAL, BATCHA_ENDS_LOCAL, AGG_STARTS_LOCAL, FIX_STARTS_LOCAL, BATCHM_&
&STARTS_LOCAL, BATCHM_ENDS_LOCAL, JOINT, INFO)
    
    BATCHA_STARTS_DIM_1 = SIZE(BATCHA_STARTS_LOCAL,1)
    BATCHA_STARTS = LOC(BATCHA_STARTS_LOCAL(1))
    
    BATCHA_ENDS_DIM_1 = SIZE(BATCHA_ENDS_LOCAL,1)
    BATCHA_ENDS = LOC(BATCHA_ENDS_LOCAL(1))
    
    AGG_STARTS_DIM_1 = SIZE(AGG_STARTS_LOCAL,1)
    AGG_STARTS = LOC(AGG_STARTS_LOCAL(1))
    
    FIX_STARTS_DIM_1 = SIZE(FIX_STARTS_LOCAL,1)
    FIX_STARTS = LOC(FIX_STARTS_LOCAL(1))
    
    BATCHM_STARTS_DIM_1 = SIZE(BATCHM_STARTS_LOCAL,1)
    BATCHM_STARTS = LOC(BATCHM_STARTS_LOCAL(1))
    
    BATCHM_ENDS_DIM_1 = SIZE(BATCHM_ENDS_LOCAL,1)
    BATCHM_ENDS = LOC(BATCHM_ENDS_LOCAL(1))
  END SUBROUTINE C_COMPUTE_BATCHES
  

  
  SUBROUTINE C_FETCH_DATA(CONFIG, AGG_ITERATORS_IN_DIM_1, AGG_ITERATORS_IN_DIM_2, AGG_ITERATORS_IN, AX_IN_DIM_1, AX_IN_DIM_2, AX_IN&
&, AX_DIM_1, AX_DIM_2, AX, AXI_IN_DIM_1, AXI_IN_DIM_2, AXI_IN, AXI_DIM_1, AXI_DIM_2, AXI, SIZES_IN_DIM_1, SIZES_IN, SIZES_DIM_1, SI&
&ZES, X_IN_DIM_1, X_IN_DIM_2, X_IN, X_DIM_1, X_DIM_2, X, XI_IN_DIM_1, XI_IN_DIM_2, XI_IN, XI_DIM_1, XI_DIM_2, XI, Y_IN_DIM_1, Y_IN_&
&DIM_2, Y_IN, Y_DIM_1, Y_DIM_2, Y, YW_IN_DIM_1, YW_IN_DIM_2, YW_IN, YW_DIM_1, YW_DIM_2, YW, NA, NM) BIND(C)
    USE AXY, ONLY: FETCH_DATA
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(AGG_ITERATORS_IN_DIM_1,AGG_ITERATORS_IN_DIM_2) :: AGG_ITERATORS_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(AX_IN_DIM_1,AX_IN_DIM_2) :: AX_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_IN_DIM_1,AXI_IN_DIM_2) :: AXI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_IN_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_IN_DIM_1) :: SIZES_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(X_IN_DIM_1,X_IN_DIM_2) :: X_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_IN_DIM_1,XI_IN_DIM_2) :: XI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(XI_DIM_1,XI_DIM_2) :: XI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_IN_DIM_1,Y_IN_DIM_2) :: Y_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(YW_IN_DIM_1,YW_IN_DIM_2) :: YW_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(YW_DIM_1,YW_DIM_2) :: YW
    INTEGER(KIND=INT64), INTENT(OUT) :: NA
    INTEGER(KIND=INT64), INTENT(OUT) :: NM
  
    CALL FETCH_DATA(CONFIG, AGG_ITERATORS_IN, AX_IN, AX, AXI_IN, AXI, SIZES_IN, SIZES, X_IN, X, XI_IN, XI, Y_IN, Y, YW_IN, YW, NA, &
&NM)
  END SUBROUTINE C_FETCH_DATA
  

  
  SUBROUTINE C_EMBED(CONFIG, MODEL_DIM_1, MODEL, AXI_DIM_1, AXI_DIM_2, AXI, XI_DIM_1, XI_DIM_2, XI, AX_DIM_1, AX_DIM_2, AX, X_DIM_1&
&, X_DIM_2, X) BIND(C)
    USE AXY, ONLY: EMBED
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_DIM_1,XI_DIM_2) :: XI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
  
    CALL EMBED(CONFIG, MODEL, AXI, XI, AX, X)
  END SUBROUTINE C_EMBED
  

  
  SUBROUTINE C_NORMALIZE_INPUTS(CONFIG, MODEL_DIM_1, MODEL, AX_DIM_1, AX_DIM_2, AX, SIZES_DIM_1, SIZES, X_DIM_1, X_DIM_2, X, INFO) &
&BIND(C)
    USE AXY, ONLY: NORMALIZE_INPUTS
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(IN) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=INT32), INTENT(OUT) :: INFO
  
    CALL NORMALIZE_INPUTS(CONFIG, MODEL, AX, SIZES, X, INFO)
  END SUBROUTINE C_NORMALIZE_INPUTS
  

  
  SUBROUTINE C_EVALUATE(CONFIG, MODEL_DIM_1, MODEL, AX_DIM_1, AX_DIM_2, AX, AY_DIM_1, AY_DIM_2, AY, SIZES_DIM_1, SIZES, X_DIM_1, X_&
&DIM_2, X, Y_DIM_1, Y_DIM_2, Y, A_STATES_DIM_1, A_STATES_DIM_2, A_STATES_DIM_3, A_STATES, M_STATES_DIM_1, M_STATES_DIM_2, M_STATES_&
&DIM_3, M_STATES, INFO) BIND(C)
    USE AXY, ONLY: EVALUATE
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_2
    REAL(KIND=RT), INTENT(OUT), DIMENSION(AY_DIM_1,AY_DIM_2) :: AY
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(OUT), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_3
    REAL(KIND=RT), INTENT(OUT), DIMENSION(A_STATES_DIM_1,A_STATES_DIM_2,A_STATES_DIM_3) :: A_STATES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_3
    REAL(KIND=RT), INTENT(OUT), DIMENSION(M_STATES_DIM_1,M_STATES_DIM_2,M_STATES_DIM_3) :: M_STATES
    INTEGER(KIND=INT32), INTENT(INOUT) :: INFO
  
    CALL EVALUATE(CONFIG, MODEL, AX, AY, SIZES, X, Y, A_STATES, M_STATES, INFO)
  END SUBROUTINE C_EVALUATE
  

  
  SUBROUTINE C_EMBEDDING_GRADIENT(MDE, MNE, PAIRWISE, INT_INPUTS_DIM_1, INT_INPUTS_DIM_2, INT_INPUTS, GRAD_DIM_1, GRAD_DIM_2, GRAD,&
& EMBEDDING_GRAD_DIM_1, EMBEDDING_GRAD_DIM_2, EMBEDDING_GRAD, TEMP_GRAD_DIM_1, TEMP_GRAD_DIM_2, TEMP_GRAD, NT) BIND(C)
    USE AXY, ONLY: EMBEDDING_GRADIENT
    IMPLICIT NONE
    INTEGER(KIND=INT32), INTENT(IN) :: MDE
    INTEGER(KIND=INT32), INTENT(IN) :: MNE
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: PAIRWISE
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: INT_INPUTS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: INT_INPUTS_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(INT_INPUTS_DIM_1,INT_INPUTS_DIM_2) :: INT_INPUTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: GRAD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: GRAD_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(GRAD_DIM_1,GRAD_DIM_2) :: GRAD
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: EMBEDDING_GRAD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: EMBEDDING_GRAD_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(EMBEDDING_GRAD_DIM_1,EMBEDDING_GRAD_DIM_2) :: EMBEDDING_GRAD
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: TEMP_GRAD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: TEMP_GRAD_DIM_2
    REAL(KIND=RT), INTENT(OUT), DIMENSION(TEMP_GRAD_DIM_1,TEMP_GRAD_DIM_2) :: TEMP_GRAD
    INTEGER(KIND=INT64), INTENT(IN) :: NT
  
    CALL EMBEDDING_GRADIENT(MDE, MNE, PAIRWISE, INT_INPUTS, GRAD, EMBEDDING_GRAD, TEMP_GRAD, NT)
  END SUBROUTINE C_EMBEDDING_GRADIENT
  

  
  SUBROUTINE C_BASIS_GRADIENT(CONFIG, MODEL_DIM_1, MODEL, Y_DIM_1, Y_DIM_2, Y, X_DIM_1, X_DIM_2, X, AX_DIM_1, AX_DIM_2, AX, SIZES_D&
&IM_1, SIZES, M_STATES_DIM_1, M_STATES_DIM_2, M_STATES_DIM_3, M_STATES, A_STATES_DIM_1, A_STATES_DIM_2, A_STATES_DIM_3, A_STATES, A&
&Y_DIM_1, AY_DIM_2, AY, GRAD_DIM_1, GRAD_DIM_2, GRAD, NT, BATCHA_STARTS_DIM_1, BATCHA_STARTS, BATCHA_ENDS_DIM_1, BATCHA_ENDS, AGG_S&
&TARTS_DIM_1, AGG_STARTS, FIX_STARTS_DIM_1, FIX_STARTS, BATCHM_STARTS_DIM_1, BATCHM_STARTS, BATCHM_ENDS_DIM_1, BATCHM_ENDS) BIND(C)
    USE AXY, ONLY: BASIS_GRADIENT
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(IN) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_STATES_DIM_1,M_STATES_DIM_2,M_STATES_DIM_3) :: M_STATES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_STATES_DIM_1,A_STATES_DIM_2,A_STATES_DIM_3) :: A_STATES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AY_DIM_1,AY_DIM_2) :: AY
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: GRAD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: GRAD_DIM_2
    REAL(KIND=RT), INTENT(OUT), DIMENSION(GRAD_DIM_1,GRAD_DIM_2) :: GRAD
    INTEGER(KIND=INT32), INTENT(IN) :: NT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHA_STARTS_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(BATCHA_STARTS_DIM_1) :: BATCHA_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHA_ENDS_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(BATCHA_ENDS_DIM_1) :: BATCHA_ENDS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_STARTS_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AGG_STARTS_DIM_1) :: AGG_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: FIX_STARTS_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(FIX_STARTS_DIM_1) :: FIX_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHM_STARTS_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(BATCHM_STARTS_DIM_1) :: BATCHM_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHM_ENDS_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(BATCHM_ENDS_DIM_1) :: BATCHM_ENDS
  
    CALL BASIS_GRADIENT(CONFIG, MODEL, Y, X, AX, SIZES, M_STATES, A_STATES, AY, GRAD, NT, BATCHA_STARTS, BATCHA_ENDS, AGG_STARTS, F&
&IX_STARTS, BATCHM_STARTS, BATCHM_ENDS)
  END SUBROUTINE C_BASIS_GRADIENT
  

  
  SUBROUTINE C_MODEL_GRADIENT(CONFIG, MODEL_DIM_1, MODEL, AX_DIM_1, AX_DIM_2, AX, AXI_DIM_1, AXI_DIM_2, AXI, SIZES_DIM_1, SIZES, X_&
&DIM_1, X_DIM_2, X, XI_DIM_1, XI_DIM_2, XI, Y_DIM_1, Y_DIM_2, Y, YW_DIM_1, YW_DIM_2, YW, SUM_SQUARED_GRADIENT, MODEL_GRAD_DIM_1, MO&
&DEL_GRAD_DIM_2, MODEL_GRAD, INFO, AY_GRADIENT_DIM_1, AY_GRADIENT_DIM_2, AY_GRADIENT, Y_GRADIENT_DIM_1, Y_GRADIENT_DIM_2, Y_GRADIEN&
&T, A_GRADS_DIM_1, A_GRADS_DIM_2, A_GRADS_DIM_3, A_GRADS, M_GRADS_DIM_1, M_GRADS_DIM_2, M_GRADS_DIM_3, M_GRADS, A_EMB_TEMP_DIM_1, A&
&_EMB_TEMP_DIM_2, A_EMB_TEMP_DIM_3, A_EMB_TEMP, M_EMB_TEMP_DIM_1, M_EMB_TEMP_DIM_2, M_EMB_TEMP_DIM_3, M_EMB_TEMP) BIND(C)
    USE AXY, ONLY: MODEL_GRADIENT
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_DIM_1,XI_DIM_2) :: XI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(YW_DIM_1,YW_DIM_2) :: YW
    REAL(KIND=RT), INTENT(INOUT) :: SUM_SQUARED_GRADIENT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_GRAD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_GRAD_DIM_2
    REAL(KIND=RT), INTENT(OUT), DIMENSION(MODEL_GRAD_DIM_1,MODEL_GRAD_DIM_2) :: MODEL_GRAD
    INTEGER(KIND=INT32), INTENT(INOUT) :: INFO
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_GRADIENT_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_GRADIENT_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AY_GRADIENT_DIM_1,AY_GRADIENT_DIM_2) :: AY_GRADIENT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_GRADIENT_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_GRADIENT_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_GRADIENT_DIM_1,Y_GRADIENT_DIM_2) :: Y_GRADIENT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_GRADS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_GRADS_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_GRADS_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_GRADS_DIM_1,A_GRADS_DIM_2,A_GRADS_DIM_3) :: A_GRADS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_GRADS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_GRADS_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_GRADS_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_GRADS_DIM_1,M_GRADS_DIM_2,M_GRADS_DIM_3) :: M_GRADS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_EMB_TEMP_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_EMB_TEMP_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_EMB_TEMP_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_EMB_TEMP_DIM_1,A_EMB_TEMP_DIM_2,A_EMB_TEMP_DIM_3) :: A_EMB_TEMP
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_EMB_TEMP_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_EMB_TEMP_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_EMB_TEMP_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_EMB_TEMP_DIM_1,M_EMB_TEMP_DIM_2,M_EMB_TEMP_DIM_3) :: M_EMB_TEMP
  
    CALL MODEL_GRADIENT(CONFIG, MODEL, AX, AXI, SIZES, X, XI, Y, YW, SUM_SQUARED_GRADIENT, MODEL_GRAD, INFO, AY_GRADIENT, Y_GRADIEN&
&T, A_GRADS, M_GRADS, A_EMB_TEMP, M_EMB_TEMP)
  END SUBROUTINE C_MODEL_GRADIENT
  

  
  SUBROUTINE C_NORMALIZE_DATA(CONFIG, MODEL_DIM_1, MODEL, AGG_ITERATORS_DIM_1, AGG_ITERATORS_DIM_2, AGG_ITERATORS, AX_IN_DIM_1, AX_&
&IN_DIM_2, AX_IN, AXI_IN_DIM_1, AXI_IN_DIM_2, AXI_IN, SIZES_IN_DIM_1, SIZES_IN, X_IN_DIM_1, X_IN_DIM_2, X_IN, XI_IN_DIM_1, XI_IN_DI&
&M_2, XI_IN, Y_IN_DIM_1, Y_IN_DIM_2, Y_IN, YW_IN_DIM_1, YW_IN_DIM_2, YW_IN, AX_DIM_1, AX_DIM_2, AX, AXI_DIM_1, AXI_DIM_2, AXI, SIZE&
&S_DIM_1, SIZES, X_DIM_1, X_DIM_2, X, XI_DIM_1, XI_DIM_2, XI, Y_DIM_1, Y_DIM_2, Y, YW_DIM_1, YW_DIM_2, YW, AX_SHIFT_DIM_1, AX_SHIFT&
&, AX_RESCALE_DIM_1, AX_RESCALE_DIM_2, AX_RESCALE, AXI_SHIFT_DIM_1, AXI_SHIFT, AXI_RESCALE_DIM_1, AXI_RESCALE_DIM_2, AXI_RESCALE, A&
&Y_SHIFT_DIM_1, AY_SHIFT, X_SHIFT_DIM_1, X_SHIFT, X_RESCALE_DIM_1, X_RESCALE_DIM_2, X_RESCALE, XI_SHIFT_DIM_1, XI_SHIFT, XI_RESCALE&
&_DIM_1, XI_RESCALE_DIM_2, XI_RESCALE, Y_SHIFT_DIM_1, Y_SHIFT, Y_RESCALE_DIM_1, Y_RESCALE_DIM_2, Y_RESCALE, A_EMB_VECS_DIM_1, A_EMB&
&_VECS_DIM_2, A_EMB_VECS, M_EMB_VECS_DIM_1, M_EMB_VECS_DIM_2, M_EMB_VECS, A_OUT_VECS_DIM_1, A_OUT_VECS_DIM_2, A_OUT_VECS, A_STATES_&
&DIM_1, A_STATES_DIM_2, A_STATES_DIM_3, A_STATES, AY_DIM_1, AY_DIM_2, AY, INFO) BIND(C)
    USE AXY, ONLY: NORMALIZE_DATA
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(AGG_ITERATORS_DIM_1,AGG_ITERATORS_DIM_2) :: AGG_ITERATORS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_IN_DIM_1,AX_IN_DIM_2) :: AX_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_IN_DIM_1,AXI_IN_DIM_2) :: AXI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_IN_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_IN_DIM_1) :: SIZES_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_IN_DIM_1,X_IN_DIM_2) :: X_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_IN_DIM_1,XI_IN_DIM_2) :: XI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_IN_DIM_1,Y_IN_DIM_2) :: Y_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(YW_IN_DIM_1,YW_IN_DIM_2) :: YW_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(XI_DIM_1,XI_DIM_2) :: XI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(YW_DIM_1,YW_DIM_2) :: YW
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_SHIFT_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_SHIFT_DIM_1) :: AX_SHIFT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_RESCALE_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_RESCALE_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_RESCALE_DIM_1,AX_RESCALE_DIM_2) :: AX_RESCALE
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_SHIFT_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AXI_SHIFT_DIM_1) :: AXI_SHIFT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_RESCALE_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_RESCALE_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AXI_RESCALE_DIM_1,AXI_RESCALE_DIM_2) :: AXI_RESCALE
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_SHIFT_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AY_SHIFT_DIM_1) :: AY_SHIFT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_SHIFT_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_SHIFT_DIM_1) :: X_SHIFT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_RESCALE_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_RESCALE_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_RESCALE_DIM_1,X_RESCALE_DIM_2) :: X_RESCALE
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_SHIFT_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(XI_SHIFT_DIM_1) :: XI_SHIFT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_RESCALE_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_RESCALE_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(XI_RESCALE_DIM_1,XI_RESCALE_DIM_2) :: XI_RESCALE
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_SHIFT_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_SHIFT_DIM_1) :: Y_SHIFT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_RESCALE_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_RESCALE_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_RESCALE_DIM_1,Y_RESCALE_DIM_2) :: Y_RESCALE
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_EMB_VECS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_EMB_VECS_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_EMB_VECS_DIM_1,A_EMB_VECS_DIM_2) :: A_EMB_VECS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_EMB_VECS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_EMB_VECS_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_EMB_VECS_DIM_1,M_EMB_VECS_DIM_2) :: M_EMB_VECS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_OUT_VECS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_OUT_VECS_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_OUT_VECS_DIM_1,A_OUT_VECS_DIM_2) :: A_OUT_VECS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_3
    REAL(KIND=RT), INTENT(OUT), DIMENSION(A_STATES_DIM_1,A_STATES_DIM_2,A_STATES_DIM_3) :: A_STATES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_2
    REAL(KIND=RT), INTENT(OUT), DIMENSION(AY_DIM_1,AY_DIM_2) :: AY
    INTEGER(KIND=INT32), INTENT(INOUT) :: INFO
  
    CALL NORMALIZE_DATA(CONFIG, MODEL, AGG_ITERATORS, AX_IN, AXI_IN, SIZES_IN, X_IN, XI_IN, Y_IN, YW_IN, AX, AXI, SIZES, X, XI, Y, &
&YW, AX_SHIFT, AX_RESCALE, AXI_SHIFT, AXI_RESCALE, AY_SHIFT, X_SHIFT, X_RESCALE, XI_SHIFT, XI_RESCALE, Y_SHIFT, Y_RESCALE, A_EMB_VE&
&CS, M_EMB_VECS, A_OUT_VECS, A_STATES, AY, INFO)
  END SUBROUTINE C_NORMALIZE_DATA
  

  
  SUBROUTINE C_CONDITION_MODEL(CONFIG, MODEL_DIM_1, MODEL, MODEL_GRAD_MEAN_DIM_1, MODEL_GRAD_MEAN, MODEL_GRAD_CURV_DIM_1, MODEL_GRA&
&D_CURV, AX_DIM_1, AX_DIM_2, AX, AXI_DIM_1, AXI_DIM_2, AXI, AY_DIM_1, AY_DIM_2, AY, AY_GRADIENT_DIM_1, AY_GRADIENT_DIM_2, AY_GRADIE&
&NT, SIZES_DIM_1, SIZES, X_DIM_1, X_DIM_2, X, XI_DIM_1, XI_DIM_2, XI, Y_DIM_1, Y_DIM_2, Y, Y_GRADIENT_DIM_1, Y_GRADIENT_DIM_2, Y_GR&
&ADIENT, NUM_THREADS, FIT_STEP, A_STATES_DIM_1, A_STATES_DIM_2, A_STATES_DIM_3, A_STATES, M_STATES_DIM_1, M_STATES_DIM_2, M_STATES_&
&DIM_3, M_STATES, A_GRADS_DIM_1, A_GRADS_DIM_2, A_GRADS_DIM_3, A_GRADS, M_GRADS_DIM_1, M_GRADS_DIM_2, M_GRADS_DIM_3, M_GRADS, A_LEN&
&GTHS_DIM_1, A_LENGTHS_DIM_2, A_LENGTHS, M_LENGTHS_DIM_1, M_LENGTHS_DIM_2, M_LENGTHS, A_STATE_TEMP_DIM_1, A_STATE_TEMP_DIM_2, A_STA&
&TE_TEMP, M_STATE_TEMP_DIM_1, M_STATE_TEMP_DIM_2, M_STATE_TEMP, A_ORDER_DIM_1, A_ORDER_DIM_2, A_ORDER, M_ORDER_DIM_1, M_ORDER_DIM_2&
&, M_ORDER, TOTAL_EVAL_RANK, TOTAL_GRAD_RANK) BIND(C)
    USE AXY, ONLY: CONDITION_MODEL
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_GRAD_MEAN_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(MODEL_GRAD_MEAN_DIM_1) :: MODEL_GRAD_MEAN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_GRAD_CURV_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(MODEL_GRAD_CURV_DIM_1) :: MODEL_GRAD_CURV
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_DIM_1,AX_DIM_2) :: AX
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(AY_DIM_1,AY_DIM_2) :: AY
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_GRADIENT_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AY_GRADIENT_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(AY_GRADIENT_DIM_1,AY_GRADIENT_DIM_2) :: AY_GRADIENT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_DIM_1,XI_DIM_2) :: XI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_DIM_1,Y_DIM_2) :: Y
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_GRADIENT_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_GRADIENT_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_GRADIENT_DIM_1,Y_GRADIENT_DIM_2) :: Y_GRADIENT
    INTEGER(KIND=INT64), INTENT(IN) :: NUM_THREADS
    INTEGER(KIND=INT64), INTENT(IN) :: FIT_STEP
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATES_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_STATES_DIM_1,A_STATES_DIM_2,A_STATES_DIM_3) :: A_STATES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATES_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_STATES_DIM_1,M_STATES_DIM_2,M_STATES_DIM_3) :: M_STATES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_GRADS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_GRADS_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_GRADS_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_GRADS_DIM_1,A_GRADS_DIM_2,A_GRADS_DIM_3) :: A_GRADS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_GRADS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_GRADS_DIM_2
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_GRADS_DIM_3
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_GRADS_DIM_1,M_GRADS_DIM_2,M_GRADS_DIM_3) :: M_GRADS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_LENGTHS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_LENGTHS_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_LENGTHS_DIM_1,A_LENGTHS_DIM_2) :: A_LENGTHS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_LENGTHS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_LENGTHS_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_LENGTHS_DIM_1,M_LENGTHS_DIM_2) :: M_LENGTHS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATE_TEMP_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_STATE_TEMP_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(A_STATE_TEMP_DIM_1,A_STATE_TEMP_DIM_2) :: A_STATE_TEMP
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATE_TEMP_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_STATE_TEMP_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(M_STATE_TEMP_DIM_1,M_STATE_TEMP_DIM_2) :: M_STATE_TEMP
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_ORDER_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: A_ORDER_DIM_2
    INTEGER(KIND=INT32), INTENT(INOUT), DIMENSION(A_ORDER_DIM_1,A_ORDER_DIM_2) :: A_ORDER
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_ORDER_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: M_ORDER_DIM_2
    INTEGER(KIND=INT32), INTENT(INOUT), DIMENSION(M_ORDER_DIM_1,M_ORDER_DIM_2) :: M_ORDER
    INTEGER(KIND=INT32), INTENT(INOUT) :: TOTAL_EVAL_RANK
    INTEGER(KIND=INT32), INTENT(INOUT) :: TOTAL_GRAD_RANK
  
    CALL CONDITION_MODEL(CONFIG, MODEL, MODEL_GRAD_MEAN, MODEL_GRAD_CURV, AX, AXI, AY, AY_GRADIENT, SIZES, X, XI, Y, Y_GRADIENT, NU&
&M_THREADS, FIT_STEP, A_STATES, M_STATES, A_GRADS, M_GRADS, A_LENGTHS, M_LENGTHS, A_STATE_TEMP, M_STATE_TEMP, A_ORDER, M_ORDER, TOT&
&AL_EVAL_RANK, TOTAL_GRAD_RANK)
  END SUBROUTINE C_CONDITION_MODEL
  

  
  SUBROUTINE C_FIT_CHECK(CONFIG, MODEL_DIM_1, MODEL, RWORK_DIM_1, RWORK, IWORK_DIM_1, IWORK, LWORK_DIM_1, LWORK, AX_IN_DIM_1, AX_IN&
&_DIM_2, AX_IN, AXI_IN_DIM_1, AXI_IN_DIM_2, AXI_IN, SIZES_IN_DIM_1, SIZES_IN, X_IN_DIM_1, X_IN_DIM_2, X_IN, XI_IN_DIM_1, XI_IN_DIM_&
&2, XI_IN, Y_IN_DIM_1, Y_IN_DIM_2, Y_IN, YW_IN_DIM_1, YW_IN_DIM_2, YW_IN, YW_DIM_1, YW_DIM_2, YW, AGG_ITERATORS_DIM_1, AGG_ITERATOR&
&S_DIM_2, AGG_ITERATORS, STEPS, RECORD_PRESENT, RECORD_DIM_1, RECORD_DIM_2, RECORD, SUM_SQUARED_ERROR, INFO) BIND(C)
    USE ISO_C_BINDING, ONLY: C_BOOL
    USE AXY, ONLY: FIT_CHECK
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(IN) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: RWORK_DIM_1
    REAL(KIND=RT), INTENT(IN), DIMENSION(RWORK_DIM_1) :: RWORK
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: IWORK_DIM_1
    INTEGER(KIND=INT32), INTENT(IN), DIMENSION(IWORK_DIM_1) :: IWORK
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: LWORK_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(LWORK_DIM_1) :: LWORK
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(AX_IN_DIM_1,AX_IN_DIM_2) :: AX_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_IN_DIM_1,AXI_IN_DIM_2) :: AXI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_IN_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_IN_DIM_1) :: SIZES_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(X_IN_DIM_1,X_IN_DIM_2) :: X_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_IN_DIM_1,XI_IN_DIM_2) :: XI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(Y_IN_DIM_1,Y_IN_DIM_2) :: Y_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(YW_IN_DIM_1,YW_IN_DIM_2) :: YW_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(YW_DIM_1,YW_DIM_2) :: YW
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AGG_ITERATORS_DIM_1,AGG_ITERATORS_DIM_2) :: AGG_ITERATORS
    INTEGER(KIND=INT32), INTENT(IN) :: STEPS
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: RECORD_PRESENT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: RECORD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: RECORD_DIM_2
    REAL(KIND=RT), INTENT(IN), DIMENSION(RECORD_DIM_1,RECORD_DIM_2) :: RECORD
    REAL(KIND=RT), INTENT(IN) :: SUM_SQUARED_ERROR
    INTEGER(KIND=INT32), INTENT(OUT) :: INFO
  
    IF (RECORD_PRESENT) THEN
      CALL FIT_CHECK(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, LWORK=LWORK, AX_IN=AX_IN, AXI_IN=AXI_IN, SIZES_IN=SIZES_&
&IN, X_IN=X_IN, XI_IN=XI_IN, Y_IN=Y_IN, YW_IN=YW_IN, YW=YW, AGG_ITERATORS=AGG_ITERATORS, STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUARED&
&_ERROR, INFO=INFO, RECORD=RECORD)
    ELSE
      CALL FIT_CHECK(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, LWORK=LWORK, AX_IN=AX_IN, AXI_IN=AXI_IN, SIZES_IN=SIZES_&
&IN, X_IN=X_IN, XI_IN=XI_IN, Y_IN=Y_IN, YW_IN=YW_IN, YW=YW, AGG_ITERATORS=AGG_ITERATORS, STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUARED&
&_ERROR, INFO=INFO)
    END IF
  END SUBROUTINE C_FIT_CHECK
  

  
  SUBROUTINE C_FIT_MODEL(CONFIG, MODEL_DIM_1, MODEL, RWORK_DIM_1, RWORK, IWORK_DIM_1, IWORK, LWORK_DIM_1, LWORK, AX_IN_DIM_1, AX_IN&
&_DIM_2, AX_IN, AXI_IN_DIM_1, AXI_IN_DIM_2, AXI_IN, SIZES_IN_DIM_1, SIZES_IN, X_IN_DIM_1, X_IN_DIM_2, X_IN, XI_IN_DIM_1, XI_IN_DIM_&
&2, XI_IN, Y_IN_DIM_1, Y_IN_DIM_2, Y_IN, YW_IN_DIM_1, YW_IN_DIM_2, YW_IN, YW_DIM_1, YW_DIM_2, YW, AGG_ITERATORS_DIM_1, AGG_ITERATOR&
&S_DIM_2, AGG_ITERATORS, STEPS, RECORD_PRESENT, RECORD_DIM_1, RECORD_DIM_2, RECORD, SUM_SQUARED_ERROR, CONTINUING_PRESENT, CONTINUI&
&NG, INFO) BIND(C)
    USE ISO_C_BINDING, ONLY: C_BOOL
    USE AXY, ONLY: FIT_MODEL
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: MODEL_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(MODEL_DIM_1) :: MODEL
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: RWORK_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(RWORK_DIM_1) :: RWORK
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: IWORK_DIM_1
    INTEGER(KIND=INT32), INTENT(INOUT), DIMENSION(IWORK_DIM_1) :: IWORK
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: LWORK_DIM_1
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(LWORK_DIM_1) :: LWORK
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AX_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AX_IN_DIM_1,AX_IN_DIM_2) :: AX_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(AXI_IN_DIM_1,AXI_IN_DIM_2) :: AXI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_IN_DIM_1
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(SIZES_IN_DIM_1) :: SIZES_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: X_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(X_IN_DIM_1,X_IN_DIM_2) :: X_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: XI_IN_DIM_2
    INTEGER(KIND=INT64), INTENT(IN), DIMENSION(XI_IN_DIM_1,XI_IN_DIM_2) :: XI_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: Y_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(Y_IN_DIM_1,Y_IN_DIM_2) :: Y_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_IN_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(YW_IN_DIM_1,YW_IN_DIM_2) :: YW_IN
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: YW_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(YW_DIM_1,YW_DIM_2) :: YW
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AGG_ITERATORS_DIM_2
    INTEGER(KIND=INT64), INTENT(INOUT), DIMENSION(AGG_ITERATORS_DIM_1,AGG_ITERATORS_DIM_2) :: AGG_ITERATORS
    INTEGER(KIND=INT32), INTENT(IN) :: STEPS
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: RECORD_PRESENT
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: RECORD_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: RECORD_DIM_2
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(RECORD_DIM_1,RECORD_DIM_2) :: RECORD
    REAL(KIND=RT), INTENT(OUT) :: SUM_SQUARED_ERROR
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: CONTINUING_PRESENT
    LOGICAL(KIND=C_BOOL), INTENT(IN) :: CONTINUING
    INTEGER(KIND=INT32), INTENT(OUT) :: INFO
  
    IF (RECORD_PRESENT) THEN
      IF (CONTINUING_PRESENT) THEN
        CALL FIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, LWORK=LWORK, AX_IN=AX_IN, AXI_IN=AXI_IN, SIZES_IN=SIZE&
&S_IN, X_IN=X_IN, XI_IN=XI_IN, Y_IN=Y_IN, YW_IN=YW_IN, YW=YW, AGG_ITERATORS=AGG_ITERATORS, STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUAR&
&ED_ERROR, INFO=INFO, RECORD=RECORD, CONTINUING=CONTINUING)
      ELSE
        CALL FIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, LWORK=LWORK, AX_IN=AX_IN, AXI_IN=AXI_IN, SIZES_IN=SIZE&
&S_IN, X_IN=X_IN, XI_IN=XI_IN, Y_IN=Y_IN, YW_IN=YW_IN, YW=YW, AGG_ITERATORS=AGG_ITERATORS, STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUAR&
&ED_ERROR, INFO=INFO, RECORD=RECORD)
      END IF
    ELSE
      IF (CONTINUING_PRESENT) THEN
        CALL FIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, LWORK=LWORK, AX_IN=AX_IN, AXI_IN=AXI_IN, SIZES_IN=SIZE&
&S_IN, X_IN=X_IN, XI_IN=XI_IN, Y_IN=Y_IN, YW_IN=YW_IN, YW=YW, AGG_ITERATORS=AGG_ITERATORS, STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUAR&
&ED_ERROR, INFO=INFO, CONTINUING=CONTINUING)
      ELSE
        CALL FIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, LWORK=LWORK, AX_IN=AX_IN, AXI_IN=AXI_IN, SIZES_IN=SIZE&
&S_IN, X_IN=X_IN, XI_IN=XI_IN, Y_IN=Y_IN, YW_IN=YW_IN, YW=YW, AGG_ITERATORS=AGG_ITERATORS, STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUAR&
&ED_ERROR, INFO=INFO)
      END IF
    END IF
  END SUBROUTINE C_FIT_MODEL
  
END MODULE C_AXY

