summaryrefslogtreecommitdiff
path: root/Donjon/src/MCRCAL.f90
blob: ca0eb30a88ba1dd91fc33057c5a0712bd48f901f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
INTEGER FUNCTION MCRCAL(NPAR,NCAL,MUPLET,MUBASE) RESULT(ICAL)
!
!-----------------------------------------------------------------------
!
!Purpose:
! find the position of an elementary calculation in a MPO file.
!
!Copyright:
! Copyright (C) 2022 Ecole Polytechnique de Montreal
!
!Author(s): A. Hebert
!
!Parameters: input
! NPAR    number of parameters.
! NCAL    number of elementary calculations in the PMAXS file.
! MUPLET  tuple used to identify an elementary calculation.
!
!Parameters: output
! ICAL    position of the elementary calculation (=0 if does not exist;
!         =-1 if more than one exists).
!
!-----------------------------------------------------------------------
!
  IMPLICIT NONE
  !----
  !  FUNCTION ARGUMENTS
  !----
  INTEGER NPAR,NCAL,MUPLET(NPAR),MUBASE(NPAR,NCAL)
  !----
  !  LOCAL VARIABLES
  !----
  INTEGER I,J,NFIND
  !
  ICAL=0
  NFIND=0
  DO I=1,NCAL
    DO J=1,NPAR
      IF(MUPLET(J).NE.MUBASE(J,I)) GO TO 10
    ENDDO
    ICAL=I
    NFIND=NFIND+1
    10 CONTINUE
  ENDDO
  IF(NFIND.GT.1) ICAL=-1
END FUNCTION MCRCAL