! 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_FORTRAN_ENV , ONLY : RT => REAL32 , INT64 , INT8
USE IEEE_ARITHMETIC , ONLY : IS_NAN => IEEE_IS_NAN , IS_FINITE => IEEE_IS_FINITE
USE RANDOM , ONLY : RANDOM_UNIT_VECTORS
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


  
  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 AXY, ONLY: NEW_MODEL_CONFIG
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    INTEGER, INTENT(IN) :: ADN
    LOGICAL, INTENT(IN) :: ADE_PRESENT
    INTEGER, INTENT(IN) :: ADE
    LOGICAL, INTENT(IN) :: ANE_PRESENT
    INTEGER, INTENT(IN) :: ANE
    LOGICAL, INTENT(IN) :: ADS_PRESENT
    INTEGER, INTENT(IN) :: ADS
    LOGICAL, INTENT(IN) :: ANS_PRESENT
    INTEGER, INTENT(IN) :: ANS
    LOGICAL, INTENT(IN) :: ADO_PRESENT
    INTEGER, INTENT(IN) :: ADO
    INTEGER, INTENT(IN) :: MDN
    LOGICAL, INTENT(IN) :: MDE_PRESENT
    INTEGER, INTENT(IN) :: MDE
    LOGICAL, INTENT(IN) :: MNE_PRESENT
    INTEGER, INTENT(IN) :: MNE
    LOGICAL, INTENT(IN) :: MDS_PRESENT
    INTEGER, INTENT(IN) :: MDS
    LOGICAL, INTENT(IN) :: MNS_PRESENT
    INTEGER, INTENT(IN) :: MNS
    INTEGER, INTENT(IN) :: MDO
    LOGICAL, INTENT(IN) :: NUM_THREADS_PRESENT
    INTEGER, 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, CONFIG) BIND(C)
    USE AXY, ONLY: NEW_FIT_CONFIG
    USE AXY, ONLY: MODEL_CONFIG
    IMPLICIT NONE
    INTEGER, INTENT(IN) :: NM
    INTEGER, INTENT(IN) :: NA
    TYPE(MODEL_CONFIG), INTENT(INOUT) :: CONFIG
  
    CALL NEW_FIT_CONFIG(NM, NA, CONFIG)
  END SUBROUTINE C_NEW_FIT_CONFIG
  

  
  SUBROUTINE C_INIT_MODEL(CONFIG, MODEL_DIM_1, MODEL, SEED_PRESENT, SEED) BIND(C)
    USE AXY, ONLY: INIT_MODEL
    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(INOUT), DIMENSION(MODEL_DIM_1) :: MODEL
    LOGICAL, INTENT(IN) :: SEED_PRESENT
    INTEGER, INTENT(IN) :: SEED
  
    IF (SEED_PRESENT) THEN
      CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL, SEED=SEED)
    ELSE
      CALL INIT_MODEL(CONFIG=CONFIG, MODEL=MODEL)
    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, INTENT(IN), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER, 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, 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, INTENT(OUT) :: INFO
  
    CALL CHECK_SHAPE(CONFIG, MODEL, AX, AXI, SIZES, X, XI, Y, INFO)
  END SUBROUTINE C_CHECK_SHAPE
  

  
  SUBROUTINE C_COMPUTE_BATCHES(NUM_BATCHES, NA, NM, SIZES_DIM_1, SIZES, BATCHA_STARTS_DIM_1, BATCHA_STARTS, BATCHA_ENDS_DIM_1, BATC&
&HA_ENDS, BATCHM_STARTS_DIM_1, BATCHM_STARTS, BATCHM_ENDS_DIM_1, BATCHM_ENDS, INFO) BIND(C)
    USE AXY, ONLY: COMPUTE_BATCHES
    IMPLICIT NONE
    INTEGER, INTENT(IN) :: NUM_BATCHES
    INTEGER(KIND=INT64), INTENT(IN) :: NA
    INTEGER(KIND=INT64), INTENT(IN) :: NM
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER, INTENT(IN), DIMENSION(SIZES_DIM_1) :: SIZES
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHA_STARTS_DIM_1
    INTEGER, INTENT(OUT), DIMENSION(BATCHA_STARTS_DIM_1) :: BATCHA_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHA_ENDS_DIM_1
    INTEGER, INTENT(OUT), DIMENSION(BATCHA_ENDS_DIM_1) :: BATCHA_ENDS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHM_STARTS_DIM_1
    INTEGER, INTENT(OUT), DIMENSION(BATCHM_STARTS_DIM_1) :: BATCHM_STARTS
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: BATCHM_ENDS_DIM_1
    INTEGER, INTENT(OUT), DIMENSION(BATCHM_ENDS_DIM_1) :: BATCHM_ENDS
    INTEGER, INTENT(INOUT) :: INFO
  
    CALL COMPUTE_BATCHES(NUM_BATCHES, NA, NM, SIZES, BATCHA_STARTS, BATCHA_ENDS, BATCHM_STARTS, BATCHM_ENDS, INFO)
  END SUBROUTINE C_COMPUTE_BATCHES
  

  
  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(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) :: AXI_DIM_1
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: AXI_DIM_2
    INTEGER, 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, 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(OUT), 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(OUT), DIMENSION(X_DIM_1,X_DIM_2) :: X
  
    CALL EMBED(CONFIG, MODEL, AXI, XI, AX, X)
  END SUBROUTINE C_EMBED
  

  
  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(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) :: 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, 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, INTENT(INOUT) :: INFO
  
    CALL EVALUATE(CONFIG, MODEL, AX, AY, SIZES, X, Y, A_STATES, M_STATES, INFO)
  END SUBROUTINE C_EVALUATE
  

  
  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) 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, 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
    REAL(KIND=RT), INTENT(OUT), DIMENSION(GRAD_DIM_1) :: GRAD
  
    CALL BASIS_GRADIENT(CONFIG, MODEL, Y, X, AX, SIZES, M_STATES, A_STATES, AY, GRAD)
  END SUBROUTINE C_BASIS_GRADIENT
  

  
  SUBROUTINE C_EMBEDDING_GRADIENT(MDE, MNE, 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) BIND(C)
    USE AXY, ONLY: EMBEDDING_GRADIENT
    IMPLICIT NONE
    INTEGER, INTENT(IN) :: MDE
    INTEGER, INTENT(IN) :: MNE
    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, 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
  
    CALL EMBEDDING_GRADIENT(MDE, MNE, INT_INPUTS, GRAD, EMBEDDING_GRAD)
  END SUBROUTINE C_EMBEDDING_GRADIENT
  

  
  SUBROUTINE C_MODEL_GRADIENT(CONFIG, MODEL_DIM_1, MODEL, AX_DIM_1, AX_DIM_2, AX, AXI_DIM_1, AXI_DIM_2, AXI, AY_DIM_1, AY_DIM_2, AY&
&, 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_GRADIE&
&NT, MODEL_GRAD_DIM_1, MODEL_GRAD, INFO, AY_GRADIENT_DIM_1, AY_GRADIENT_DIM_2, AY_GRADIENT, Y_GRADIENT_DIM_1, Y_GRADIENT_DIM_2, Y_G&
&RADIENT, 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_STATES_PRES&
&ENT, A_STATES_DIM_1, A_STATES_DIM_2, A_STATES_DIM_3, A_STATES, M_STATES_PRESENT, M_STATES_DIM_1, M_STATES_DIM_2, M_STATES_DIM_3, M&
&_STATES) BIND(C)
    USE AXY, ONLY: MODEL_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) :: 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, 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(INOUT), DIMENSION(AY_DIM_1,AY_DIM_2) :: AY
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER, 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, 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
    REAL(KIND=RT), INTENT(OUT), DIMENSION(MODEL_GRAD_DIM_1) :: MODEL_GRAD
    INTEGER, 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
    LOGICAL, INTENT(IN) :: A_STATES_PRESENT
    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
    LOGICAL, INTENT(IN) :: M_STATES_PRESENT
    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
  
    IF (A_STATES_PRESENT) THEN
      IF (M_STATES_PRESENT) THEN
        CALL MODEL_GRADIENT(CONFIG=CONFIG, MODEL=MODEL, AX=AX, AXI=AXI, AY=AY, SIZES=SIZES, X=X, XI=XI, Y=Y, YW=YW, SUM_SQUARED_GRA&
&DIENT=SUM_SQUARED_GRADIENT, MODEL_GRAD=MODEL_GRAD, INFO=INFO, AY_GRADIENT=AY_GRADIENT, Y_GRADIENT=Y_GRADIENT, A_GRADS=A_GRADS, M_G&
&RADS=M_GRADS, A_STATES=A_STATES, M_STATES=M_STATES)
      ELSE
        CALL MODEL_GRADIENT(CONFIG=CONFIG, MODEL=MODEL, AX=AX, AXI=AXI, AY=AY, SIZES=SIZES, X=X, XI=XI, Y=Y, YW=YW, SUM_SQUARED_GRA&
&DIENT=SUM_SQUARED_GRADIENT, MODEL_GRAD=MODEL_GRAD, INFO=INFO, AY_GRADIENT=AY_GRADIENT, Y_GRADIENT=Y_GRADIENT, A_GRADS=A_GRADS, M_G&
&RADS=M_GRADS, A_STATES=A_STATES)
      END IF
    ELSE
      IF (M_STATES_PRESENT) THEN
        CALL MODEL_GRADIENT(CONFIG=CONFIG, MODEL=MODEL, AX=AX, AXI=AXI, AY=AY, SIZES=SIZES, X=X, XI=XI, Y=Y, YW=YW, SUM_SQUARED_GRA&
&DIENT=SUM_SQUARED_GRADIENT, MODEL_GRAD=MODEL_GRAD, INFO=INFO, AY_GRADIENT=AY_GRADIENT, Y_GRADIENT=Y_GRADIENT, A_GRADS=A_GRADS, M_G&
&RADS=M_GRADS, M_STATES=M_STATES)
      ELSE
        CALL MODEL_GRADIENT(CONFIG=CONFIG, MODEL=MODEL, AX=AX, AXI=AXI, AY=AY, SIZES=SIZES, X=X, XI=XI, Y=Y, YW=YW, SUM_SQUARED_GRA&
&DIENT=SUM_SQUARED_GRADIENT, MODEL_GRAD=MODEL_GRAD, INFO=INFO, AY_GRADIENT=AY_GRADIENT, Y_GRADIENT=Y_GRADIENT, A_GRADS=A_GRADS, M_G&
&RADS=M_GRADS)
      END IF
    END IF
  END SUBROUTINE C_MODEL_GRADIENT
  

  
  SUBROUTINE C_NORMALIZE_DATA(CONFIG, MODEL_DIM_1, MODEL, AX_DIM_1, AX_DIM_2, AX, AXI_DIM_1, AXI_DIM_2, AXI, AY_DIM_1, AY_DIM_2, AY&
&, 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, 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, AY_RESCALE_DIM_1, AY_&
&RESCALE, 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_&
&RESCALE_DIM_1, Y_RESCALE_DIM_2, Y_RESCALE, A_STATES_DIM_1, A_STATES_DIM_2, A_STATES_DIM_3, A_STATES, 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, 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) :: 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, 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(INOUT), DIMENSION(AY_DIM_1,AY_DIM_2) :: AY
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER, 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, 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(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_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_RESCALE_DIM_1
    REAL(KIND=RT), INTENT(INOUT), DIMENSION(AY_RESCALE_DIM_1) :: AY_RESCALE
    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_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_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) :: 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, INTENT(INOUT) :: INFO
  
    CALL NORMALIZE_DATA(CONFIG, MODEL, AX, AXI, AY, SIZES, X, XI, Y, YW, AX_RESCALE, AXI_SHIFT, AXI_RESCALE, AY_RESCALE, X_RESCALE,&
& XI_SHIFT, XI_RESCALE, Y_RESCALE, A_STATES, A_EMB_VECS, M_EMB_VECS, A_OUT_VECS, 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, 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_GRADIENT, 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_G&
&RADS_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_LENGTHS_DIM_1, A_LENGTH&
&S_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_STATE_TEMP, M_STATE_TEM&
&P_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_EVA&
&L_RANK, TOTAL_GRAD_RANK) BIND(C)
    USE AXY, ONLY: CONDITION_MODEL
    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(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, 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) :: 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, 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, INTENT(IN) :: NUM_THREADS
    INTEGER, 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, 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, INTENT(INOUT), DIMENSION(M_ORDER_DIM_1,M_ORDER_DIM_2) :: M_ORDER
    INTEGER, INTENT(INOUT) :: TOTAL_EVAL_RANK
    INTEGER, INTENT(INOUT) :: TOTAL_GRAD_RANK
  
    CALL CONDITION_MODEL(CONFIG, MODEL, MODEL_GRAD_MEAN, MODEL_GRAD_CURV, AX, AXI, AY, AY_GRADIENT, X, XI, Y, Y_GRADIENT, NUM_THREA&
&DS, FIT_STEP, A_STATES, M_STATES, A_GRADS, M_GRADS, A_LENGTHS, M_LENGTHS, A_STATE_TEMP, M_STATE_TEMP, A_ORDER, M_ORDER, TOTAL_EVAL&
&_RANK, TOTAL_GRAD_RANK)
  END SUBROUTINE C_CONDITION_MODEL
  

  
  SUBROUTINE C_MINIMIZE_MSE(CONFIG, MODEL_DIM_1, MODEL, RWORK_DIM_1, RWORK, IWORK_DIM_1, IWORK, 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, STEP&
&S, RECORD_PRESENT, RECORD_DIM_1, RECORD_DIM_2, RECORD, SUM_SQUARED_ERROR, INFO) BIND(C)
    USE AXY, ONLY: MINIMIZE_MSE
    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, INTENT(INOUT), DIMENSION(IWORK_DIM_1) :: IWORK
    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, INTENT(IN), DIMENSION(AXI_DIM_1,AXI_DIM_2) :: AXI
    INTEGER(KIND=SELECTED_INT_KIND(18)), INTENT(IN) :: SIZES_DIM_1
    INTEGER, 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, 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(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, INTENT(IN) :: STEPS
    LOGICAL, 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(OUT), DIMENSION(RECORD_DIM_1,RECORD_DIM_2) :: RECORD
    REAL(KIND=RT), INTENT(OUT) :: SUM_SQUARED_ERROR
    INTEGER, INTENT(OUT) :: INFO
  
    IF (RECORD_PRESENT) THEN
      CALL MINIMIZE_MSE(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, AX=AX, AXI=AXI, SIZES=SIZES, X=X, XI=XI, Y=Y, YW=YW, &
&STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUARED_ERROR, INFO=INFO, RECORD=RECORD)
    ELSE
      CALL MINIMIZE_MSE(CONFIG=CONFIG, MODEL=MODEL, RWORK=RWORK, IWORK=IWORK, AX=AX, AXI=AXI, SIZES=SIZES, X=X, XI=XI, Y=Y, YW=YW, &
&STEPS=STEPS, SUM_SQUARED_ERROR=SUM_SQUARED_ERROR, INFO=INFO)
    END IF
  END SUBROUTINE C_MINIMIZE_MSE
  
END MODULE C_AXY

