summaryrefslogtreecommitdiff
path: root/Ganlib/src/LCMPCL.f
blob: 667e03ad7b3a3e4601c28d728a30fd62fa49e588 (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
46
47
48
49
*DECK LCMPCL
      SUBROUTINE LCMPCL(IPLIST,ISET,ILONG,HDATA)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Copy a character variable from memory into a table.
*
*Copyright:
* Copyright (C) 2000 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): A. Hebert
*
*Parameters: input
* IPLIST  address of the table.
* ISET    position of the block in the list.
* ILONG   dimension of the character variable.
* HDATA   character variable.
*
*-----------------------------------------------------------------------
*
      USE GANLIB
*----
*  SUBROUTINE ARGUMENTS
*----
      TYPE(C_PTR) IPLIST
      INTEGER ISET,ILONG
      CHARACTER*(*) HDATA(*)
*----
*  LOCAL VARIABLES
*----
      TYPE(C_PTR) JPLIST
      INTEGER, ALLOCATABLE, DIMENSION(:) :: IDATA
*
      ILEN=(LEN(HDATA(1))+3)/4
      IF(ILEN.GT.100) CALL XABORT('LCMPCL: ILEN OVERFLOW.')
      ALLOCATE(IDATA(ILEN))
      JPLIST=LCMLIL(IPLIST,ISET,ILONG)
      DO JSET=1,ILONG
         READ(HDATA(JSET),'(100A4)') (IDATA(I),I=1,ILEN)
         CALL LCMPDL(JPLIST,JSET,ILEN,3,IDATA)
      ENDDO
      DEALLOCATE(IDATA)
      RETURN
      END