diff options
Diffstat (limited to 'Donjon/src/MCRCAL.f90')
| -rw-r--r-- | Donjon/src/MCRCAL.f90 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Donjon/src/MCRCAL.f90 b/Donjon/src/MCRCAL.f90 new file mode 100644 index 0000000..ca0eb30 --- /dev/null +++ b/Donjon/src/MCRCAL.f90 @@ -0,0 +1,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 |
