8369a030c5f9c852fe9c9fee9c0b8f9a64de3373
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / convparm.c
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013,2014, by the GROMACS development team, led by
7  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8  * and including many others, as listed in the AUTHORS file in the
9  * top-level source directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37 /* This file is completely threadsafe - keep it that way! */
38 #include "gmxpre.h"
39
40 #include "config.h"
41
42 #include <math.h>
43 #include <string.h>
44
45 #include "gromacs/math/units.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/utility/smalloc.h"
48 #include "gromacs/legacyheaders/typedefs.h"
49 #include "gromacs/utility/fatalerror.h"
50 #include "topio.h"
51 #include "toputil.h"
52 #include "convparm.h"
53 #include "gromacs/legacyheaders/names.h"
54 #include "gpp_atomtype.h"
55 #include "gromacs/math/utilities.h"
56
57 static int round_check(real r, int limit, int ftype, const char *name)
58 {
59     int i;
60
61     if (r >= 0)
62     {
63         i = (int)(r + 0.5);
64     }
65     else
66     {
67         i = (int)(r - 0.5);
68     }
69
70     if (r-i > 0.01 || r-i < -0.01)
71     {
72         gmx_fatal(FARGS, "A non-integer value (%f) was supplied for '%s' in %s",
73                   r, name, interaction_function[ftype].longname);
74     }
75
76     if (i < limit)
77     {
78         gmx_fatal(FARGS, "Value of '%s' in %s is %d, which is smaller than the minimum of %d",
79                   name, interaction_function[ftype].longname, i, limit);
80     }
81
82     return i;
83 }
84
85 static void set_ljparams(int comb, double reppow, real v, real w,
86                          real *c6, real *c12)
87 {
88     if (comb == eCOMB_ARITHMETIC || comb == eCOMB_GEOM_SIG_EPS)
89     {
90         if (v >= 0)
91         {
92             *c6  = 4*w*pow(v, 6.0);
93             *c12 = 4*w*pow(v, reppow);
94         }
95         else
96         {
97             /* Interpret negative sigma as c6=0 and c12 with -sigma */
98             *c6  = 0;
99             *c12 = 4*w*pow(-v, reppow);
100         }
101     }
102     else
103     {
104         *c6  = v;
105         *c12 = w;
106     }
107 }
108
109 /* A return value of 0 means parameters were assigned successfully,
110  * returning -1 means this is an all-zero interaction that should not be added.
111  */
112 static int
113 assign_param(t_functype ftype, t_iparams *newparam,
114              real old[MAXFORCEPARAM], int comb, double reppow)
115 {
116     int      i, j;
117     real     tmp;
118     gmx_bool all_param_zero = TRUE;
119
120     /* Set to zero */
121     for (j = 0; (j < MAXFORCEPARAM); j++)
122     {
123         newparam->generic.buf[j] = 0.0;
124         /* If all parameters are zero we might not add some interaction types (selected below).
125          * We cannot apply this to ALL interactions, since many have valid reasons for having
126          * zero parameters (e.g. an index to a Cmap interaction, or LJ parameters), but
127          * we use it for angles and torsions that are typically generated automatically.
128          */
129         all_param_zero = (all_param_zero == TRUE) && fabs(old[j]) < GMX_REAL_MIN;
130     }
131
132     if (all_param_zero == TRUE)
133     {
134         if (IS_ANGLE(ftype) || IS_RESTRAINT_TYPE(ftype) || ftype == F_IDIHS ||
135             ftype == F_PDIHS || ftype == F_PIDIHS || ftype == F_RBDIHS || ftype == F_FOURDIHS)
136         {
137             return -1;
138         }
139     }
140
141     switch (ftype)
142     {
143         case F_G96ANGLES:
144             /* Post processing of input data: store cosine iso angle itself */
145             newparam->harmonic.rA  = cos(old[0]*DEG2RAD);
146             newparam->harmonic.krA = old[1];
147             newparam->harmonic.rB  = cos(old[2]*DEG2RAD);
148             newparam->harmonic.krB = old[3];
149             break;
150         case F_G96BONDS:
151             /* Post processing of input data: store square of length itself */
152             newparam->harmonic.rA  = sqr(old[0]);
153             newparam->harmonic.krA = old[1];
154             newparam->harmonic.rB  = sqr(old[2]);
155             newparam->harmonic.krB = old[3];
156             break;
157         case F_FENEBONDS:
158             newparam->fene.bm = old[0];
159             newparam->fene.kb = old[1];
160             break;
161         case F_RESTRBONDS:
162             newparam->restraint.lowA = old[0];
163             newparam->restraint.up1A = old[1];
164             newparam->restraint.up2A = old[2];
165             newparam->restraint.kA   = old[3];
166             newparam->restraint.lowB = old[4];
167             newparam->restraint.up1B = old[5];
168             newparam->restraint.up2B = old[6];
169             newparam->restraint.kB   = old[7];
170             break;
171         case F_TABBONDS:
172         case F_TABBONDSNC:
173         case F_TABANGLES:
174         case F_TABDIHS:
175             newparam->tab.table = round_check(old[0], 0, ftype, "table index");
176             newparam->tab.kA    = old[1];
177             newparam->tab.kB    = old[3];
178             break;
179         case F_CROSS_BOND_BONDS:
180             newparam->cross_bb.r1e = old[0];
181             newparam->cross_bb.r2e = old[1];
182             newparam->cross_bb.krr = old[2];
183             break;
184         case F_CROSS_BOND_ANGLES:
185             newparam->cross_ba.r1e = old[0];
186             newparam->cross_ba.r2e = old[1];
187             newparam->cross_ba.r3e = old[2];
188             newparam->cross_ba.krt = old[3];
189             break;
190         case F_UREY_BRADLEY:
191             newparam->u_b.thetaA  = old[0];
192             newparam->u_b.kthetaA = old[1];
193             newparam->u_b.r13A    = old[2];
194             newparam->u_b.kUBA    = old[3];
195             newparam->u_b.thetaB  = old[4];
196             newparam->u_b.kthetaB = old[5];
197             newparam->u_b.r13B    = old[6];
198             newparam->u_b.kUBB    = old[7];
199             break;
200         case F_QUARTIC_ANGLES:
201             newparam->qangle.theta = old[0];
202             for (i = 0; i < 5; i++)
203             {
204                 newparam->qangle.c[i] = old[i+1];
205             }
206             break;
207         case F_LINEAR_ANGLES:
208             newparam->linangle.aA    = old[0];
209             newparam->linangle.klinA = old[1];
210             newparam->linangle.aB    = old[2];
211             newparam->linangle.klinB = old[3];
212             break;
213         case F_BONDS:
214         case F_ANGLES:
215         case F_HARMONIC:
216         case F_IDIHS:
217             newparam->harmonic.rA  = old[0];
218             newparam->harmonic.krA = old[1];
219             newparam->harmonic.rB  = old[2];
220             newparam->harmonic.krB = old[3];
221             break;
222         case F_RESTRANGLES:
223             newparam->harmonic.rA  = old[0];
224             newparam->harmonic.krA = old[1];
225             break;
226         case F_MORSE:
227             newparam->morse.b0A    = old[0];
228             newparam->morse.cbA    = old[1];
229             newparam->morse.betaA  = old[2];
230             newparam->morse.b0B    = old[3];
231             newparam->morse.cbB    = old[4];
232             newparam->morse.betaB  = old[5];
233             break;
234         case F_CUBICBONDS:
235             newparam->cubic.b0    = old[0];
236             newparam->cubic.kb    = old[1];
237             newparam->cubic.kcub  = old[2];
238             break;
239         case F_CONNBONDS:
240             break;
241         case F_POLARIZATION:
242             newparam->polarize.alpha = old[0];
243             break;
244         case F_ANHARM_POL:
245             newparam->anharm_polarize.alpha = old[0];
246             newparam->anharm_polarize.drcut = old[1];
247             newparam->anharm_polarize.khyp  = old[2];
248             break;
249         case F_WATER_POL:
250             newparam->wpol.al_x   = old[0];
251             newparam->wpol.al_y   = old[1];
252             newparam->wpol.al_z   = old[2];
253             newparam->wpol.rOH    = old[3];
254             newparam->wpol.rHH    = old[4];
255             newparam->wpol.rOD    = old[5];
256             break;
257         case F_THOLE_POL:
258             newparam->thole.a      = old[0];
259             newparam->thole.alpha1 = old[1];
260             newparam->thole.alpha2 = old[2];
261             if ((old[1] > 0) && (old[2] > 0))
262             {
263                 newparam->thole.rfac = old[0]*pow(old[1]*old[2], -1.0/6.0);
264             }
265             else
266             {
267                 newparam->thole.rfac = 1;
268             }
269             break;
270         case F_BHAM:
271             newparam->bham.a = old[0];
272             newparam->bham.b = old[1];
273             newparam->bham.c = old[2];
274             break;
275         case F_LJ14:
276             set_ljparams(comb, reppow, old[0], old[1], &newparam->lj14.c6A, &newparam->lj14.c12A);
277             set_ljparams(comb, reppow, old[2], old[3], &newparam->lj14.c6B, &newparam->lj14.c12B);
278             break;
279         case F_LJC14_Q:
280             newparam->ljc14.fqq = old[0];
281             newparam->ljc14.qi  = old[1];
282             newparam->ljc14.qj  = old[2];
283             set_ljparams(comb, reppow, old[3], old[4], &newparam->ljc14.c6, &newparam->ljc14.c12);
284             break;
285         case F_LJC_PAIRS_NB:
286             newparam->ljcnb.qi = old[0];
287             newparam->ljcnb.qj = old[1];
288             set_ljparams(comb, reppow, old[2], old[3], &newparam->ljcnb.c6, &newparam->ljcnb.c12);
289             break;
290         case F_LJ:
291             set_ljparams(comb, reppow, old[0], old[1], &newparam->lj.c6, &newparam->lj.c12);
292             break;
293         case F_PDIHS:
294         case F_PIDIHS:
295         case F_ANGRES:
296         case F_ANGRESZ:
297             newparam->pdihs.phiA = old[0];
298             newparam->pdihs.cpA  = old[1];
299
300             /* Change 20100720: Amber occasionally uses negative multiplicities (mathematically OK),
301              * so I have changed the lower limit to -99 /EL
302              */
303             newparam->pdihs.phiB = old[3];
304             newparam->pdihs.cpB  = old[4];
305             /* If both force constants are zero there is no interaction. Return -1 to signal
306              * this entry should NOT be added.
307              */
308             if (fabs(newparam->pdihs.cpA) < GMX_REAL_MIN && fabs(newparam->pdihs.cpB) < GMX_REAL_MIN)
309             {
310                 return -1;
311             }
312
313             newparam->pdihs.mult = round_check(old[2], -99, ftype, "multiplicity");
314
315             break;
316         case F_RESTRDIHS:
317             newparam->pdihs.phiA = old[0];
318             newparam->pdihs.cpA  = old[1];
319             break;
320         case F_POSRES:
321             newparam->posres.fcA[XX]   = old[0];
322             newparam->posres.fcA[YY]   = old[1];
323             newparam->posres.fcA[ZZ]   = old[2];
324             newparam->posres.fcB[XX]   = old[3];
325             newparam->posres.fcB[YY]   = old[4];
326             newparam->posres.fcB[ZZ]   = old[5];
327             newparam->posres.pos0A[XX] = old[6];
328             newparam->posres.pos0A[YY] = old[7];
329             newparam->posres.pos0A[ZZ] = old[8];
330             newparam->posres.pos0B[XX] = old[9];
331             newparam->posres.pos0B[YY] = old[10];
332             newparam->posres.pos0B[ZZ] = old[11];
333             break;
334         case F_FBPOSRES:
335             newparam->fbposres.geom     = round_check(old[0], 0, ftype, "geometry");
336             if (!(newparam->fbposres.geom > efbposresZERO && newparam->fbposres.geom < efbposresNR))
337             {
338                 gmx_fatal(FARGS, "Invalid geometry for flat-bottomed position restraint.\n"
339                           "Expected number between 1 and %d. Found %d\n", efbposresNR-1,
340                           newparam->fbposres.geom);
341             }
342             newparam->fbposres.r        = old[1];
343             newparam->fbposres.k        = old[2];
344             newparam->fbposres.pos0[XX] = old[3];
345             newparam->fbposres.pos0[YY] = old[4];
346             newparam->fbposres.pos0[ZZ] = old[5];
347             break;
348         case F_DISRES:
349             newparam->disres.label = round_check(old[0], 0, ftype, "label");
350             newparam->disres.type  = round_check(old[1], 1, ftype, "type'");
351             newparam->disres.low   = old[2];
352             newparam->disres.up1   = old[3];
353             newparam->disres.up2   = old[4];
354             newparam->disres.kfac  = old[5];
355             break;
356         case F_ORIRES:
357             newparam->orires.ex    = round_check(old[0], 1, ftype, "experiment") - 1;
358             newparam->orires.label = round_check(old[1], 1, ftype, "label");
359             newparam->orires.power = round_check(old[2], 0, ftype, "power");
360             newparam->orires.c     = old[3];
361             newparam->orires.obs   = old[4];
362             newparam->orires.kfac  = old[5];
363             break;
364         case F_DIHRES:
365             newparam->dihres.phiA   = old[0];
366             newparam->dihres.dphiA  = old[1];
367             newparam->dihres.kfacA  = old[2];
368             newparam->dihres.phiB   = old[3];
369             newparam->dihres.dphiB  = old[4];
370             newparam->dihres.kfacB  = old[5];
371             break;
372         case F_RBDIHS:
373             for (i = 0; (i < NR_RBDIHS); i++)
374             {
375                 newparam->rbdihs.rbcA[i] = old[i];
376                 newparam->rbdihs.rbcB[i] = old[NR_RBDIHS+i];
377             }
378             break;
379         case F_CBTDIHS:
380             for (i = 0; (i < NR_CBTDIHS); i++)
381             {
382                 newparam->cbtdihs.cbtcA[i] = old[i];
383             }
384             break;
385         case F_FOURDIHS:
386             /* Read the dihedral parameters to temporary arrays,
387              * and convert them to the computationally faster
388              * Ryckaert-Bellemans form.
389              */
390             /* Use conversion formula for OPLS to Ryckaert-Bellemans: */
391             newparam->rbdihs.rbcA[0] = old[1]+0.5*(old[0]+old[2]);
392             newparam->rbdihs.rbcA[1] = 0.5*(3.0*old[2]-old[0]);
393             newparam->rbdihs.rbcA[2] = 4.0*old[3]-old[1];
394             newparam->rbdihs.rbcA[3] = -2.0*old[2];
395             newparam->rbdihs.rbcA[4] = -4.0*old[3];
396             newparam->rbdihs.rbcA[5] = 0.0;
397
398             newparam->rbdihs.rbcB[0] = old[NR_FOURDIHS+1]+0.5*(old[NR_FOURDIHS+0]+old[NR_FOURDIHS+2]);
399             newparam->rbdihs.rbcB[1] = 0.5*(3.0*old[NR_FOURDIHS+2]-old[NR_FOURDIHS+0]);
400             newparam->rbdihs.rbcB[2] = 4.0*old[NR_FOURDIHS+3]-old[NR_FOURDIHS+1];
401             newparam->rbdihs.rbcB[3] = -2.0*old[NR_FOURDIHS+2];
402             newparam->rbdihs.rbcB[4] = -4.0*old[NR_FOURDIHS+3];
403             newparam->rbdihs.rbcB[5] = 0.0;
404             break;
405         case F_CONSTR:
406         case F_CONSTRNC:
407             newparam->constr.dA = old[0];
408             newparam->constr.dB = old[1];
409             break;
410         case F_SETTLE:
411             newparam->settle.doh = old[0];
412             newparam->settle.dhh = old[1];
413             break;
414         case F_VSITE2:
415         case F_VSITE3:
416         case F_VSITE3FD:
417         case F_VSITE3OUT:
418         case F_VSITE4FD:
419         case F_VSITE4FDN:
420             newparam->vsite.a = old[0];
421             newparam->vsite.b = old[1];
422             newparam->vsite.c = old[2];
423             newparam->vsite.d = old[3];
424             newparam->vsite.e = old[4];
425             newparam->vsite.f = old[5];
426             break;
427         case F_VSITE3FAD:
428             newparam->vsite.a = old[1] * cos(DEG2RAD * old[0]);
429             newparam->vsite.b = old[1] * sin(DEG2RAD * old[0]);
430             newparam->vsite.c = old[2];
431             newparam->vsite.d = old[3];
432             newparam->vsite.e = old[4];
433             newparam->vsite.f = old[5];
434             break;
435         case F_VSITEN:
436             newparam->vsiten.n = round_check(old[0], 1, ftype, "number of atoms");
437             newparam->vsiten.a = old[1];
438             break;
439         case F_CMAP:
440             newparam->cmap.cmapA = old[0];
441             newparam->cmap.cmapB = old[1];
442             break;
443         case F_GB12:
444         case F_GB13:
445         case F_GB14:
446             newparam->gb.sar  = old[0];
447             newparam->gb.st   = old[1];
448             newparam->gb.pi   = old[2];
449             newparam->gb.gbr  = old[3];
450             newparam->gb.bmlt = old[4];
451             break;
452         default:
453             gmx_fatal(FARGS, "unknown function type %d in %s line %d",
454                       ftype, __FILE__, __LINE__);
455     }
456     return 0;
457 }
458
459 static int enter_params(gmx_ffparams_t *ffparams, t_functype ftype,
460                         real forceparams[MAXFORCEPARAM], int comb, real reppow,
461                         int start, gmx_bool bAppend)
462 {
463     t_iparams newparam;
464     int       type;
465     int       rc;
466
467     if ( (rc = assign_param(ftype, &newparam, forceparams, comb, reppow)) < 0)
468     {
469         /* -1 means this interaction is all-zero and should not be added */
470         return rc;
471     }
472
473     if (!bAppend)
474     {
475         for (type = start; (type < ffparams->ntypes); type++)
476         {
477             if (ffparams->functype[type] == ftype)
478             {
479                 if (F_GB13 == ftype)
480                 {
481                     /* Occasionally, the way the 1-3 reference distance is
482                      * computed can lead to non-binary-identical results, but I
483                      * don't know why. */
484                     if ((gmx_within_tol(newparam.gb.sar,  ffparams->iparams[type].gb.sar,  1e-6)) &&
485                         (gmx_within_tol(newparam.gb.st,   ffparams->iparams[type].gb.st,   1e-6)) &&
486                         (gmx_within_tol(newparam.gb.pi,   ffparams->iparams[type].gb.pi,   1e-6)) &&
487                         (gmx_within_tol(newparam.gb.gbr,  ffparams->iparams[type].gb.gbr,  1e-6)) &&
488                         (gmx_within_tol(newparam.gb.bmlt, ffparams->iparams[type].gb.bmlt, 1e-6)))
489                     {
490                         return type;
491                     }
492                 }
493                 else
494                 {
495                     if (memcmp(&newparam, &ffparams->iparams[type], (size_t)sizeof(newparam)) == 0)
496                     {
497                         return type;
498                     }
499                 }
500             }
501         }
502     }
503     else
504     {
505         type = ffparams->ntypes;
506     }
507     if (debug)
508     {
509         fprintf(debug, "copying newparam to ffparams->iparams[%d] (ntypes=%d)\n",
510                 type, ffparams->ntypes);
511     }
512     memcpy(&ffparams->iparams[type], &newparam, (size_t)sizeof(newparam));
513
514     ffparams->ntypes++;
515     ffparams->functype[type] = ftype;
516
517     return type;
518 }
519
520 static void append_interaction(t_ilist *ilist,
521                                int type, int nral, atom_id a[MAXATOMLIST])
522 {
523     int i, where1;
524
525     where1     = ilist->nr;
526     ilist->nr += nral+1;
527
528     ilist->iatoms[where1++] = type;
529     for (i = 0; (i < nral); i++)
530     {
531         ilist->iatoms[where1++] = a[i];
532     }
533 }
534
535 static void enter_function(t_params *p, t_functype ftype, int comb, real reppow,
536                            gmx_ffparams_t *ffparams, t_ilist *il,
537                            int *maxtypes,
538                            gmx_bool bNB, gmx_bool bAppend)
539 {
540     int     k, type, nr, nral, delta, start;
541
542     start = ffparams->ntypes;
543     nr    = p->nr;
544
545     for (k = 0; k < nr; k++)
546     {
547         if (*maxtypes <= ffparams->ntypes)
548         {
549             *maxtypes += 1000;
550             srenew(ffparams->functype, *maxtypes);
551             srenew(ffparams->iparams, *maxtypes);
552             if (debug)
553             {
554                 fprintf(debug, "%s, line %d: srenewed idef->functype and idef->iparams to %d\n",
555                         __FILE__, __LINE__, *maxtypes);
556             }
557         }
558         type = enter_params(ffparams, ftype, p->param[k].c, comb, reppow, start, bAppend);
559         /* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */
560         if (!bNB && type >= 0)
561         {
562             nral  = NRAL(ftype);
563             delta = nr*(nral+1);
564             srenew(il->iatoms, il->nr+delta);
565             append_interaction(il, type, nral, p->param[k].a);
566         }
567     }
568 }
569
570 void convert_params(int atnr, t_params nbtypes[],
571                     t_molinfo *mi, int comb, double reppow, real fudgeQQ,
572                     gmx_mtop_t *mtop)
573 {
574     int             i, j, maxtypes, mt;
575     unsigned long   flags;
576     gmx_ffparams_t *ffp;
577     gmx_moltype_t  *molt;
578     t_params       *plist;
579
580     maxtypes = 0;
581
582     ffp           = &mtop->ffparams;
583     ffp->ntypes   = 0;
584     ffp->atnr     = atnr;
585     ffp->functype = NULL;
586     ffp->iparams  = NULL;
587     ffp->reppow   = reppow;
588
589     enter_function(&(nbtypes[F_LJ]),  (t_functype)F_LJ,    comb, reppow, ffp, NULL,
590                    &maxtypes, TRUE, TRUE);
591     enter_function(&(nbtypes[F_BHAM]), (t_functype)F_BHAM,  comb, reppow, ffp, NULL,
592                    &maxtypes, TRUE, TRUE);
593
594     for (mt = 0; mt < mtop->nmoltype; mt++)
595     {
596         molt = &mtop->moltype[mt];
597         for (i = 0; (i < F_NRE); i++)
598         {
599             molt->ilist[i].nr     = 0;
600             molt->ilist[i].iatoms = NULL;
601
602             plist = mi[mt].plist;
603
604             flags = interaction_function[i].flags;
605             if ((i != F_LJ) && (i != F_BHAM) && ((flags & IF_BOND) ||
606                                                  (flags & IF_VSITE) ||
607                                                  (flags & IF_CONSTRAINT)))
608             {
609                 enter_function(&(plist[i]), (t_functype)i, comb, reppow,
610                                ffp, &molt->ilist[i],
611                                &maxtypes, FALSE, (i == F_POSRES  || i == F_FBPOSRES));
612             }
613         }
614     }
615     if (debug)
616     {
617         fprintf(debug, "%s, line %d: There are %d functypes in idef\n",
618                 __FILE__, __LINE__, ffp->ntypes);
619     }
620
621     ffp->fudgeQQ = fudgeQQ;
622 }