1 /* zzdynoac.f -- translated by f2c (version 19980913).
2    You must link the resulting object file with the libraries:
3 	-lf2c -lm   (in that order)
4 */
5 
6 #include "f2c.h"
7 
8 /* Table of constant values */
9 
10 static integer c__32 = 32;
11 static integer c__1 = 1;
12 
13 /* $Procedure ZZDYNOAC ( Fetch optional array, character frame variable ) */
zzdynoac_(char * frname,integer * frcode,char * item,integer * maxn,integer * n,char * values,logical * found,ftnlen frname_len,ftnlen item_len,ftnlen values_len)14 /* Subroutine */ int zzdynoac_(char *frname, integer *frcode, char *item,
15 	integer *maxn, integer *n, char *values, logical *found, ftnlen
16 	frname_len, ftnlen item_len, ftnlen values_len)
17 {
18     extern /* Subroutine */ int chkin_(char *, ftnlen), errch_(char *, char *,
19 	     ftnlen, ftnlen), repmc_(char *, char *, char *, char *, ftnlen,
20 	    ftnlen, ftnlen, ftnlen), repmi_(char *, char *, integer *, char *,
21 	     ftnlen, ftnlen, ftnlen);
22     char dtype[1];
23     extern integer rtrim_(char *, ftnlen);
24     extern logical failed_(void);
25     integer codeln, nameln;
26     char kvname[32], cdestr[32];
27     integer itemln, reqnam;
28     extern /* Subroutine */ int chkout_(char *, ftnlen);
29     extern logical return_(void);
30     integer reqnum;
31     extern /* Subroutine */ int intstr_(integer *, char *, ftnlen), dtpool_(
32 	    char *, logical *, integer *, char *, ftnlen, ftnlen), setmsg_(
33 	    char *, ftnlen), errint_(char *, integer *, ftnlen), sigerr_(char
34 	    *, ftnlen), gcpool_(char *, integer *, integer *, integer *, char
35 	    *, logical *, ftnlen, ftnlen);
36 
37 /* $ Abstract */
38 
39 /*     SPICE Private routine intended solely for the support of SPICE */
40 /*     routines.  Users should not call this routine directly due */
41 /*     to the volatile nature of this routine. */
42 
43 /*     Look up optional array-valued character frame kernel variable. */
44 /*     The frame name or frame ID may be used as part of the variable's */
45 /*     name. */
46 
47 /*     If the kernel variable is not present, or if the variable */
48 /*     has the wrong data type or size, set the FOUND flag to .FALSE. */
49 
50 /* $ Disclaimer */
51 
52 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
53 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
54 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
55 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
56 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
57 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
58 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
59 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
60 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
61 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
62 
63 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
64 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
65 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
66 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
67 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
68 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
69 
70 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
71 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
72 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
73 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
74 
75 /* $ Required_Reading */
76 
77 /*     None. */
78 
79 /* $ Keywords */
80 
81 /*     FRAMES */
82 /*     KERNEL */
83 /*     PRIVATE */
84 /*     UTILITY */
85 
86 /* $ Declarations */
87 /* $ Abstract */
88 
89 /*     Include file zzdyn.inc */
90 
91 /*     SPICE private file intended solely for the support of SPICE */
92 /*     routines.  Users should not include this file directly due */
93 /*     to the volatile nature of this file */
94 
95 /*     The parameters defined below are used by the SPICELIB dynamic */
96 /*     frame subsystem. */
97 
98 /* $ Disclaimer */
99 
100 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
101 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
102 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
103 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
104 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
105 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
106 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
107 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
108 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
109 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
110 
111 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
112 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
113 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
114 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
115 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
116 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
117 
118 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
119 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
120 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
121 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
122 
123 /* $ Parameters */
124 
125 /*     This file declares parameters required by the dynamic */
126 /*     frame routines of the SPICELIB frame subsystem. */
127 
128 /* $ Restrictions */
129 
130 /*     The parameter BDNMLN is this routine must be kept */
131 /*     consistent with the parameter MAXL defined in */
132 
133 /*        zzbodtrn.inc */
134 
135 
136 /* $ Author_and_Institution */
137 
138 /*     N.J. Bachman    (JPL) */
139 
140 /* $ Literature_References */
141 
142 /*     None. */
143 
144 /* $ Version */
145 
146 /* -    SPICELIB Version 1.1.0, 12-JAN-2005 (NJB) */
147 
148 /*        Parameters KWX, KWY, KWZ renamed to KVX, KVY, KVZ. */
149 
150 /* -    SPICELIB Version 1.0.0, 22-DEC-2004 (NJB) */
151 
152 /* -& */
153 
154 /*     String length parameters */
155 /*     ======================== */
156 
157 
158 /*     Kernel variable name length.  This parameter must be */
159 /*     kept consistent with the parameter MAXLEN used in the */
160 /*     POOL umbrella routine. */
161 
162 
163 /*     Length of a character kernel pool datum. This parameter must be */
164 /*     kept consistent with the parameter MAXCHR used in the POOL */
165 /*     umbrella routine. */
166 
167 
168 /*     Reference frame name length.  This parameter must be */
169 /*     kept consistent with the parameter WDSIZE used in the */
170 /*     FRAMEX umbrella routine. */
171 
172 
173 /*     Body name length.  This parameter is used to provide a level */
174 /*     of indirection so the dynamic frame source code doesn't */
175 /*     have to change if the name of this SPICELIB-scope parameter */
176 /*     is changed.  The value MAXL used here is defined in the */
177 /*     INCLUDE file */
178 
179 /*        zzbodtrn.inc */
180 
181 /*     Current value of MAXL = 36 */
182 
183 
184 /*     Numeric parameters */
185 /*     =================================== */
186 
187 /*     The parameter MAXCOF is the maximum number of polynomial */
188 /*     coefficients that may be used to define an Euler angle */
189 /*     in an "Euler frame" definition */
190 
191 
192 /*     The parameter LBSEP is the default angular separation limit for */
193 /*     the vectors defining a two-vector frame.  The angular separation */
194 /*     of the vectors must differ from Pi and 0 by at least this amount. */
195 
196 
197 /*     The parameter QEXP is used to determine the width of */
198 /*     the interval DELTA used for the discrete differentiation */
199 /*     of velocity in the routines ZZDYNFRM, ZZDYNROT, and their */
200 /*     recursive analogs.  This parameter is appropriate for */
201 /*     64-bit IEEE double precision numbers; when SPICELIB */
202 /*     is hosted on platforms where longer mantissas are supported, */
203 /*     this parameter (and hence this INCLUDE file) will become */
204 /*     platform-dependent. */
205 
206 /*     The choice of QEXP is based on heuristics.  It's believed to */
207 /*     be a reasonable choice obtainable without expensive computation. */
208 
209 /*     QEXP is the largest power of 2 such that */
210 
211 /*        1.D0 + 2**QEXP  =  1.D0 */
212 
213 /*     Given an epoch T0 at which a discrete derivative is to be */
214 /*     computed, this choice provides a value of DELTA that usually */
215 /*     contributes no round-off error in the computation of the function */
216 /*     evaluation epochs */
217 
218 /*        T0 +/- DELTA */
219 
220 /*     while providing the largest value of DELTA having this form that */
221 /*     causes the order of the error term O(DELTA**2) in the quadratric */
222 /*     function approximation to round to zero.  Note that the error */
223 /*     itself will normally be small but doesn't necessarily round to */
224 /*     zero.  Note also that the small function approximation error */
225 /*     is not a measurement of the error in the discrete derivative */
226 /*     itself. */
227 
228 /*     For ET values T0 > 2**27 seconds past J2000, the value of */
229 /*     DELTA will be set to */
230 
231 /*        T0 * 2**QEXP */
232 
233 /*     For smaller values of T0, DELTA should be set to 1.D0. */
234 
235 
236 /*     Frame kernel parameters */
237 /*     ======================= */
238 
239 /*     Parameters relating to kernel variable names (keywords) start */
240 /*     with the letters */
241 
242 /*        KW */
243 
244 /*     Parameters relating to kernel variable values start with the */
245 /*     letters */
246 
247 /*        KV */
248 
249 
250 /*     Generic parameters */
251 /*     --------------------------------- */
252 
253 /*     Token used to build the base frame keyword: */
254 
255 
256 /*     Frame definition style parameters */
257 /*     --------------------------------- */
258 
259 /*     Token used to build the frame definition style keyword: */
260 
261 
262 /*     Token indicating parameterized dynamic frame. */
263 
264 
265 /*     Freeze epoch parameters */
266 /*     --------------------------------- */
267 
268 /*     Token used to build the freeze epoch keyword: */
269 
270 
271 /*     Rotation state parameters */
272 /*     --------------------------------- */
273 
274 /*     Token used to build the rotation state keyword: */
275 
276 
277 /*     Token indicating rotating rotation state: */
278 
279 
280 /*     Token indicating inertial rotation state: */
281 
282 
283 /*     Frame family parameters */
284 /*     --------------------------------- */
285 
286 /*     Token used to build the frame family keyword: */
287 
288 
289 /*     Token indicating mean equator and equinox of date frame. */
290 
291 
292 /*     Token indicating mean ecliptic and equinox of date frame. */
293 
294 
295 /*     Token indicating true equator and equinox of date frame. */
296 
297 
298 /*     Token indicating two-vector frame. */
299 
300 
301 /*     Token indicating Euler frame. */
302 
303 
304 /*     "Of date" frame family parameters */
305 /*     --------------------------------- */
306 
307 /*     Token used to build the precession model keyword: */
308 
309 
310 /*     Token used to build the nutation model keyword: */
311 
312 
313 /*     Token used to build the obliquity model keyword: */
314 
315 
316 /*     Mathematical models used to define "of date" frames will */
317 /*     likely accrue over time.  We will simply assign them */
318 /*     numbers. */
319 
320 
321 /*     Token indicating the Lieske earth precession model: */
322 
323 
324 /*     Token indicating the IAU 1980 earth nutation model: */
325 
326 
327 /*     Token indicating the IAU 1980 earth mean obliqity of */
328 /*     date model.  Note the name matches that of the preceding */
329 /*     nutation model---this is intentional.  The keyword */
330 /*     used in the kernel variable definition indicates what */
331 /*     kind of model is being defined. */
332 
333 
334 /*     Two-vector frame family parameters */
335 /*     --------------------------------- */
336 
337 /*     Token used to build the vector axis keyword: */
338 
339 
340 /*     Tokens indicating axis values: */
341 
342 
343 /*     Prefixes used for primary and secondary vector definition */
344 /*     keywords: */
345 
346 
347 /*     Token used to build the vector definition keyword: */
348 
349 
350 /*     Token indicating observer-target position vector: */
351 
352 
353 /*     Token indicating observer-target velocity vector: */
354 
355 
356 /*     Token indicating observer-target near point vector: */
357 
358 
359 /*     Token indicating constant vector: */
360 
361 
362 /*     Token used to build the vector observer keyword: */
363 
364 
365 /*     Token used to build the vector target keyword: */
366 
367 
368 /*     Token used to build the vector frame keyword: */
369 
370 
371 /*     Token used to build the vector aberration correction keyword: */
372 
373 
374 /*     Token used to build the constant vector specification keyword: */
375 
376 
377 /*     Token indicating rectangular coordinates used to */
378 /*     specify constant vector: */
379 
380 
381 /*     Token indicating latitudinal coordinates used to */
382 /*     specify constant vector: */
383 
384 
385 /*     Token indicating RA/DEC coordinates used to */
386 /*     specify constant vector: */
387 
388 
389 /*     Token used to build the cartesian vector literal keyword: */
390 
391 
392 /*     Token used to build the constant vector latitude keyword: */
393 
394 
395 /*     Token used to build the constant vector longitude keyword: */
396 
397 
398 /*     Token used to build the constant vector right ascension keyword: */
399 
400 
401 /*     Token used to build the constant vector declination keyword: */
402 
403 
404 /*     Token used to build the angular separation tolerance keyword: */
405 
406 
407 /*     See the section "Physical unit parameters" below for additional */
408 /*     parameters applicable to two-vector frames. */
409 
410 
411 /*     Euler frame family parameters */
412 /*     --------------------------------- */
413 
414 /*     Token used to build the epoch keyword: */
415 
416 
417 /*     Token used to build the Euler axis sequence keyword: */
418 
419 
420 /*     Tokens used to build the Euler angle coefficients keywords: */
421 
422 
423 /*     See the section "Physical unit parameters" below for additional */
424 /*     parameters applicable to Euler frames. */
425 
426 
427 /*     Physical unit parameters */
428 /*     --------------------------------- */
429 
430 /*     Token used to build the units keyword: */
431 
432 
433 /*     Token indicating radians: */
434 
435 
436 /*     Token indicating degrees: */
437 
438 
439 /*     End of include file zzdyn.inc */
440 
441 /* $ Brief_I/O */
442 
443 /*     VARIABLE  I/O  DESCRIPTION */
444 /*     --------  ---  ------------------------------------------------- */
445 /*     FRNAME     I   Frame name. */
446 /*     FRCODE     I   Frame ID code. */
447 /*     ITEM       I   Item associated with frame definition. */
448 /*     N          O   Number of returned values. */
449 /*     VALUES     O   Output kernel variable. */
450 /*     FOUND      O   "Found" flag. */
451 
452 /* $ Detailed_Input */
453 
454 /*     FRNAME         is the name of the reference frame with which */
455 /*                    the requested variable is associated. */
456 
457 /*     FRCODE         is the frame ID code of the reference frame with */
458 /*                    which the requested variable is associated. */
459 
460 /*     ITEM           is a string identifying the specific datum */
461 /*                    to be fetched.  The kernel variable name */
462 /*                    has the form */
463 
464 /*                       FRAME_<frame ID code>_<ITEM> */
465 
466 /*                    or */
467 
468 /*                       FRAME_<frame name>_<ITEM> */
469 
470 /*                    The former of the two names takes precedence: */
471 /*                    this routine will look for a character variable */
472 /*                    of that name first. */
473 
474 /* $ Detailed_Output */
475 
476 /*     N              is the number of values returned in the array */
477 /*                    VALUES. */
478 
479 /*     VALUES         are the values associated with the requested */
480 /*                    array-valued, character kernel variable. The */
481 /*                    kernel variable name of the form */
482 
483 /*                       FRAME_<frame ID code>_<ITEM> */
484 
485 /*                    will be looked up first; if this variable */
486 /*                    is found and has character type, the associated */
487 /*                    values will be returned.  If this variable is */
488 /*                    not found, the variable */
489 
490 /*                       FRAME_<frame name>_<ITEM> */
491 
492 /*                    will be looked up.  If a character variable */
493 /*                    having that name is found, the associated */
494 /*                    values will be returned. */
495 
496 /*                    VALUES is not defined if the requested kernel */
497 /*                    variable is not found. */
498 
499 /*     FOUND          is a logical flag indicating whether the requested */
500 /*                    kernel variable was found.  If the search described */
501 /*                    above (in the detailed description of the output */
502 /*                    argument VALUES) is successful, FOUND is set to */
503 /*                    .TRUE.; otherwise FOUND is set to .FALSE. */
504 
505 /* $ Parameters */
506 
507 /*     See zzdyn.inc. */
508 
509 /* $ Exceptions */
510 
511 /*     1) If both the frame-ID-based and frame-name-based forms of the */
512 /*        requested kernel variable name have length greater than KVNMLN, */
513 /*        the error SPICE(VARNAMETOOLONG) will be signaled. */
514 
515 /*     2) If kernel variable matching one form of the requested kernel */
516 /*        variable names is found, but that variable has numeric data */
517 /*        type, the error SPICE(BADVARIABLETYPE) will be signaled. */
518 
519 /*     3) If kernel variable matching one form of the requested kernel */
520 /*        variable names is found, but that variable has more than MAXN */
521 /*        associated values, the error SPICE(BADVARIABLESIZE) will be */
522 /*        signaled. */
523 
524 /*     4) If kernel variable matching one form of the requested kernel */
525 /*        variable names is found, but that variable has more than MAXN */
526 /*        associated values, the error SPICE(BADVARIABLESIZE) will be */
527 /*        signaled. */
528 
529 /* $ Files */
530 
531 /*     1) Kernel variables fetched by this routine are normally */
532 /*        introduced into the kernel pool by loading one or more */
533 /*        frame kernels.  See the Frames Required Reading for */
534 /*        details. */
535 
536 /* $ Particulars */
537 
538 /*     This routine centralizes logic for kernel variable lookups that */
539 /*     must be performed by the SPICELIB frame subsystem.  This routine */
540 /*     is meant to look up array-valued character variables whose */
541 /*     presence is optional.  For required array character variables, */
542 /*     use ZZDYNVAC. */
543 
544 /*     As indicated above, the requested kernel variable may have a name */
545 /*     of the form */
546 
547 /*        FRAME_<frame ID code>_<ITEM> */
548 
549 /*     or */
550 
551 /*        FRAME_<frame name>_<ITEM> */
552 
553 /*     Because most frame definition keywords have the first form, this */
554 /*     routine looks for a name of that form first. */
555 
556 /*     Note that although this routine considers the two forms of the */
557 /*     names to be synonymous, from the point of view of the kernel pool */
558 /*     data structure, these names are distinct.  Hence kernel variables */
559 /*     having names of both forms, but having possibly different */
560 /*     attributes, can be simultaneously present in the kernel pool. */
561 /*     Intentional use of this kernel pool feature is discouraged. */
562 
563 /* $ Examples */
564 
565 /*     See ZZDYNFRM. */
566 
567 /* $ Restrictions */
568 
569 /*     1) This is a SPICE private routine; the routine is subject */
570 /*        to change without notice.  User applications should not */
571 /*        call this routine. */
572 
573 /*     2) A scalar-valued kernel variable matching the "ID code form" */
574 /*        of the requested kernel variable name could potentially mask a */
575 /*        array-valued kernel variable matching the "name form" of the */
576 /*        requested name.  This problem can be prevented by sensible */
577 /*        frame kernel design. */
578 
579 /* $ Author_and_Institution */
580 
581 /*     N.J. Bachman    (JPL) */
582 
583 /* $ Literature_References */
584 
585 /*     None. */
586 
587 /* $ Version */
588 
589 /* -    SPICELIB Version 1.0.0, 18-DEC-2004 (NJB) */
590 
591 /* -& */
592 
593 /*     SPICELIB functions */
594 
595 
596 /*     Local Parameters */
597 
598 
599 /*     TEMPLN is the length of the keyword template, minus */
600 /*     the sum of the lengths of the two substitution markers ('#'). */
601 
602 
603 /*     Local Variables */
604 
605 
606 /*     Standard SPICE error handling */
607 
608     if (return_()) {
609 	return 0;
610     }
611     chkin_("ZZDYNOAC", (ftnlen)8);
612 
613 /*     Nothing found yet. */
614 
615     *found = FALSE_;
616 
617 /*     Prepare to check the name of the kernel variable we're about */
618 /*     to look up. */
619 
620 /*     Convert the frame code to a string. */
621 
622     intstr_(frcode, cdestr, (ftnlen)32);
623     if (failed_()) {
624 	chkout_("ZZDYNOAC", (ftnlen)8);
625 	return 0;
626     }
627 
628 /*     Get the lengths of the input frame code, name and item. */
629 /*     Compute the length of the ID-based kernel variable name; */
630 /*     check this length against the maximum allowed value.  If */
631 /*     the name is too long, proceed to look up the form of the */
632 /*     kernel variable name based on the frame name. */
633 
634     codeln = rtrim_(cdestr, (ftnlen)32);
635     nameln = rtrim_(frname, frname_len);
636     itemln = rtrim_(item, item_len);
637     reqnum = codeln + itemln + 7;
638     if (reqnum <= 32) {
639 
640 /*        First try looking for a kernel variable including the frame ID */
641 /*        code. */
642 
643 /*        Note the template is */
644 
645 /*            'FRAME_#_#' */
646 
647 	repmi_("FRAME_#_#", "#", frcode, kvname, (ftnlen)9, (ftnlen)1, (
648 		ftnlen)32);
649 	repmc_(kvname, "#", item, kvname, (ftnlen)32, (ftnlen)1, item_len, (
650 		ftnlen)32);
651 	dtpool_(kvname, found, n, dtype, (ftnlen)32, (ftnlen)1);
652     } else {
653 
654 /*        The ID-based name is too long. We can't find the variable if */
655 /*        we can't look it up. */
656 
657 	*found = FALSE_;
658     }
659     if (! (*found)) {
660 
661 /*        We need to look up the frame name-based kernel variable. */
662 /*        Determine the length of the name of this variable; make */
663 /*        sure it's not too long. */
664 
665 	reqnam = nameln + itemln + 7;
666 	if (reqnam > 32 && reqnum > 32) {
667 
668 /*           Both forms of the name are too long. */
669 
670 	    setmsg_("Kernel variable FRAME_#_# has length #; kernel variable"
671 		    " FRAME_#_# has length #; maximum allowed length is #.  N"
672 		    "either variable could be searched for in the kernel pool"
673 		    " due to these name length errors.", (ftnlen)200);
674 	    errint_("#", frcode, (ftnlen)1);
675 	    errch_("#", item, (ftnlen)1, item_len);
676 	    errint_("#", &reqnum, (ftnlen)1);
677 	    errch_("#", frname, (ftnlen)1, frname_len);
678 	    errch_("#", item, (ftnlen)1, item_len);
679 	    errint_("#", &reqnam, (ftnlen)1);
680 	    errint_("#", &c__32, (ftnlen)1);
681 	    sigerr_("SPICE(VARNAMETOOLONG)", (ftnlen)21);
682 	    chkout_("ZZDYNOAC", (ftnlen)8);
683 	    return 0;
684 	} else if (reqnam > 32) {
685 
686 /*           We couldn't find the variable having the ID-based name, */
687 /*           and the frame name-based variable name is too long to */
688 /*           look up. */
689 
690 	    chkout_("ZZDYNOAC", (ftnlen)8);
691 	    return 0;
692 	}
693 
694 /*        Now try looking for a kernel variable including the frame */
695 /*        name. */
696 
697 	repmc_("FRAME_#_#", "#", frname, kvname, (ftnlen)9, (ftnlen)1,
698 		frname_len, (ftnlen)32);
699 	repmc_(kvname, "#", item, kvname, (ftnlen)32, (ftnlen)1, item_len, (
700 		ftnlen)32);
701 	dtpool_(kvname, found, n, dtype, (ftnlen)32, (ftnlen)1);
702 	if (! (*found)) {
703 
704 /*           The FOUND flag is set appropriately. */
705 
706 	    chkout_("ZZDYNOAC", (ftnlen)8);
707 	    return 0;
708 	}
709     }
710 
711 /*     Getting to this point means we found a kernel variable. The name */
712 /*     of the variable is KVNAME.  The data type is DTYPE and the */
713 /*     cardinality is N. */
714 
715 /*     Rather than using BADKPV, we check the data type and cardinality */
716 /*     of the kernel variable in-line so we can create a more detailed */
717 /*     error message if need be. */
718 
719     if (*(unsigned char *)dtype == 'N') {
720 	setmsg_("The kernel variable # has used to define frame # was expect"
721 		"ed to have character data type but in fact has numeric data "
722 		"type.  Usually this type of problem is due to an error in a "
723 		"frame definition provided in a frame kernel.", (ftnlen)223);
724 	errch_("#", kvname, (ftnlen)1, (ftnlen)32);
725 	errch_("#", frname, (ftnlen)1, frname_len);
726 	sigerr_("SPICE(BADVARIABLETYPE)", (ftnlen)22);
727 	chkout_("ZZDYNOAC", (ftnlen)8);
728 	return 0;
729     }
730     if (*n > *maxn) {
731 	setmsg_("The kernel variable # has used to define frame # was expect"
732 		"ed to have size not exceeding # but in fact has size #. Usua"
733 		"lly this type of problem is due to an error in a frame defin"
734 		"ition provided in a frame kernel.", (ftnlen)212);
735 	errch_("#", kvname, (ftnlen)1, (ftnlen)32);
736 	errch_("#", frname, (ftnlen)1, frname_len);
737 	errint_("#", maxn, (ftnlen)1);
738 	errint_("#", n, (ftnlen)1);
739 	sigerr_("SPICE(BADVARIABLESIZE)", (ftnlen)22);
740 	chkout_("ZZDYNOAC", (ftnlen)8);
741 	return 0;
742     }
743 
744 /*     Look up the kernel variable. */
745 
746     gcpool_(kvname, &c__1, maxn, n, values, found, (ftnlen)32, values_len);
747     if (! (*found)) {
748 	setmsg_("Variable # not found after DTPOOL indicated it was present "
749 		"in pool.", (ftnlen)67);
750 	errch_("#", kvname, (ftnlen)1, (ftnlen)32);
751 	sigerr_("SPICE(BUG)", (ftnlen)10);
752 	chkout_("ZZDYNOAC", (ftnlen)8);
753 	return 0;
754     }
755     chkout_("ZZDYNOAC", (ftnlen)8);
756     return 0;
757 } /* zzdynoac_ */
758 
759