Oasis3 4.0.2
imaxim.f
Go to the documentation of this file.
00001       FUNCTION imaxim (ka, kna)
00002 C****
00003 C               ******************************
00004 C               * OASIS FUNCTION  -  LEVEL T *
00005 C               * --------------     ------- *
00006 C               ******************************
00007 C
00008 C**** *imaxim*  - Search function
00009 C
00010 C     Purpose:
00011 C     -------
00012 C     Search the maximum of the elements of an integer array
00013 C
00014 C**   Interface:
00015 C     ---------
00016 C       *ii =*  *imaxim (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) imaxim, ka(kna)
00054 C
00055 C* ---------------------------- Poema verses ----------------------------
00056 C
00057 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00058 C
00059 C*    1. Find the maximum 
00060 C        ----------------
00061 C
00062       itemp = 0
00063       IF (kna .LT. 1) GO TO 110
00064       itemp = ka(1)
00065       IF (kna .LT. 2) GO TO 110
00066       DO 120 ja = 2, kna
00067         IF (ka(ja) .GT. itemp) itemp = ka(ja)
00068  120  CONTINUE
00069  110  CONTINUE
00070       imaxim = itemp
00071 C
00072 C*    2. End of routine
00073 C        --------------
00074 C
00075       RETURN
00076       END
 All Data Structures Namespaces Files Functions Variables Defines