Oasis3 4.0.2
iminim.f
Go to the documentation of this file.
00001       FUNCTION iminim (ka, kna)
00002 C****
00003 C               ******************************
00004 C               * OASIS FUNCTION  -  LEVEL T *
00005 C               * --------------     ------- *
00006 C               ******************************
00007 C
00008 C**** *iminim*  - Search function
00009 C
00010 C     Purpose:
00011 C     -------
00012 C     Search the minimum of the elements of an integer array
00013 C
00014 C**   Interface:
00015 C     ---------
00016 C       *ii =*  *iminim (ka, kna)*
00017 C
00018 C     Input:
00019 C     -----
00020 C                ka     : array to be searched (integer 1D)
00021 C                kna    : array dimension (integer)
00022 C
00023 C     Output:
00024 C     ------
00025 C     None
00026 C
00027 C     Workspace:
00028 C     ---------
00029 C     None
00030 C
00031 C     Externals:
00032 C     ---------
00033 C     None
00034 C
00035 C     Reference:
00036 C     ---------
00037 C     See OASIS manual (1995)
00038 C
00039 C     History:
00040 C     -------
00041 C       Version   Programmer     Date      Description
00042 C       -------   ----------     ----      -----------  
00043 C       2.0       L. Terray      95/09/01  created
00044 C
00045 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00046 C
00047 C* ---------------------------- Include files ---------------------------
00048 C
00049       USE mod_unit
00050 C
00051 C* ---------------------------- Argument declarations -------------------
00052 C
00053       INTEGER (kind=ip_intwp_p) iminim, ka(kna)
00054 C
00055 C* ---------------------------- Poema verses ----------------------------
00056 C
00057 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00058 C
00059 C
00060 C*    1. Find the minimum 
00061 C        ----------------
00062 C
00063       itemp = 0
00064       IF (kna .LT. 1) GO TO 110
00065       itemp = ka(1)
00066       IF (kna .LT. 2) GO TO 110
00067       DO 100 ja = 2, kna
00068         IF (ka(ja) .LT. itemp) itemp = ka(ja)
00069  100  CONTINUE
00070  110  CONTINUE
00071       iminim = itemp
00072 C
00073       RETURN
00074       END
 All Data Structures Namespaces Files Functions Variables Defines