source: CPL/oasis3/trunk/src/mod/oasis3/src/blasnew.f @ 1677

Last change on this file since 1677 was 1677, checked in by aclsce, 12 years ago

Imported oasis3 (tag ipslcm5a) from cvs server to svn server (igcmg project).

File size: 4.4 KB
Line 
1      SUBROUTINE blasnew (pfild ,kmsize, kfield, pmcoeff, kaux, kaddr,
2     $                    kasize, pacoeff, ksiztot, paux)
3C****
4C               *****************************
5C               * OASIS ROUTINE  -  LEVEL 3 *
6C               * -------------     ------- *
7C               *****************************
8C
9C**** *blasnew* - Stupid blas routine
10C
11C     Purpose:
12C     -------
13C     Do linear combination of fields with given coefficients
14C     after interpolation
15C
16C**   Interface:
17C     ---------
18C       *CALL*  *blasnew (pfild ,kmsize, kfield, pmcoeff, kaux, kaddr,
19C                         kasize, pacoeff, ksiztot, paux)*
20C
21C     Input:
22C     -----
23C                pfild   : field array to be modified (real 1D)
24C                kmsize  : size of the field array (integer)
25C                kfield  : field identificator number (integer)
26C                pmcoeff : field multiplicative coefficient (real)
27C                kaux    : number of combined auxilary fields (integer)
28C                kaddr   : pointer for auxilary fields (integer 1D)
29C                kasize  : size of auxilary fields (integer 1D)
30C                pacoeff : auxilary field multiplicative coefficient (real 1D)
31C                ksiztot : total size of work memory used (integer)
32C                paux    : global work array (real 1D)
33C               
34C     Output:
35C     ------
36C                pfild   : new field array (real 1D)
37C
38C     Workspace:
39C     ---------
40C     None
41C
42C     Externals:
43C     ---------
44C     None
45C
46C     Reference:
47C     ---------
48C     See OASIS manual (1995)
49C
50C     History:
51C     -------
52C       Version   Programmer     Date      Description
53C       -------   ----------     ----      ----------- 
54C       2.0       L. Terray      95/10/01  created
55C       2.3       S. Valcke      99/04/30  added: printing levels
56C
57C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58C
59C* ---------------------------- Include files ---------------------------
60C
61      USE mod_kinds_oasis
62      USE mod_unit
63      USE mod_printing
64C
65C* ---------------------------- Argument declarations -------------------
66C
67      REAL (kind=ip_realwp_p) pfild(kmsize)
68      REAL (kind=ip_realwp_p) paux(ksiztot), pacoeff(kaux)
69      INTEGER (kind=ip_intwp_p) kaddr(0:kaux), kasize(0:kaux)
70C
71C* ---------------------------- Local declarations ----------------------
72C
73      INTEGER (kind=ip_intwp_p) istop
74      LOGICAL llchk
75C
76C* ---------------------------- Poema verses ----------------------------
77C
78C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79C
80C*    1. Initialization
81C        --------------
82C
83      IF (nlogprt .GE. 2) THEN
84          WRITE (UNIT = nulou,FMT = *) ' '
85          WRITE (UNIT = nulou,FMT = *) ' '
86          WRITE (UNIT = nulou,FMT = *) 
87     $    '           ROUTINE blasnew  -  Level 3'
88          WRITE (UNIT = nulou,FMT = *) 
89     $    '           ***************     *******'
90          WRITE (UNIT = nulou,FMT = *) ' '
91          WRITE (UNIT = nulou,FMT = *) 
92     $    ' Do linear combination of fields'
93          WRITE (UNIT = nulou,FMT = *) ' after interpolation '
94          WRITE (UNIT = nulou,FMT = *) ' '
95          WRITE (UNIT = nulou,FMT = *) ' '
96      ENDIF
97      istop = 0
98C
99C* Check all auxilary fields have same dimensions as current field
100C
101      DO 110 jc = 1, kaux
102        llchk = (kasize(jc) - kmsize) .EQ. 0
103        IF (.NOT. llchk) THEN
104            CALL prtout ('WARNING!!!
105     $          Pb in combining field number =', kfield, 2)
106            CALL prtout ('Different size for auxilary field number =',
107     $          jc, 2)
108            istop = istop + 1
109        ENDIF
110 110  CONTINUE
111      IF (istop .GT. 0) CALL HALTE('STOP in blasnew')
112C
113C
114C*    2. Linear combination
115C        ------------------
116C
117C* Multiply current field by main coefficient
118C
119      DO 210 ja = 1, kmsize
120        pfild(ja) = pmcoeff * pfild(ja)
121 210  CONTINUE
122C
123C* Combine with other fields if required
124C
125      IF (kaux .GE. 1) THEN
126          DO 220 jc = 1, kaux
127            DO 230 ja = 1, kmsize
128              pfild(ja) = pfild(ja) + pacoeff(jc) *
129     $                    paux(kaddr(jc)+ja-1)
130 230        CONTINUE
131 220      CONTINUE
132      ENDIF
133C
134C
135C*    3. End of routine
136C        --------------
137C
138      IF (nlogprt .GE. 2) THEN
139          WRITE (UNIT = nulou,FMT = *) ' '
140          WRITE (UNIT = nulou,FMT = *) 
141     $    '          --------- End of routine blasnew ---------'
142          CALL FLUSH (nulou)
143      ENDIF
144      RETURN
145      END
Note: See TracBrowser for help on using the repository browser.