summaryrefslogtreecommitdiff
path: root/Donjon/src/MCRCAL.f90
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Donjon/src/MCRCAL.f90
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Donjon/src/MCRCAL.f90')
-rw-r--r--Donjon/src/MCRCAL.f9045
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