1 static char adSid[]=
"$Id: adStack.c,v 1.1 2017/07/24 21:18:32 drholdaw Exp $";
8 #define ONE_BLOCK_SIZE 16384 9 #ifndef STACK_SIZE_TRACING 10 #define STACK_SIZE_TRACING 1 29 #ifdef STACK_SIZE_TRACING 46 #ifdef STACK_SIZE_TRACING 57 if (nbChars <= nbmax) {
61 char *inx = x+(nbChars-nbmax) ;
71 int nbBlocks = (stack?-1:0) ;
76 printf(
"Out of memory (allocated %i blocks of %i bytes)\n",
108 #ifdef STACK_SIZE_TRACING 112 if (nbChars <= nbmax) {
116 char *tlx = x+nbChars ;
122 if (
curStack==
NULL) printf(
"Popping from an empty stack!!!\n") ;
127 unsigned int nbtail = tlx-x ;
149 if (nbChars <= nbmax) {
153 char *tlx = x+nbChars ;
158 if (
lookStack==
NULL) printf(
"Looking into an empty stack!!!") ;
163 unsigned int nbtail = tlx-x ;
465 long int a3,
b3, res3, res6, res9, res12 ;
468 a0 = (int)nbblocks%1000 ;
470 b0 = (int)blocksz%1000 ;
472 res0 = ((int)(nbunits%1000)) +
a0*
b0 ;
473 res3 = nbunits/1000 +
a3*
b0 +
a0*
b3 ;
475 res3 += ((
long int)(res0/1000)) ;
484 printf(
"%li ", res12) ;
487 if ((res9/100)>0 || printzeros) {
488 printf(
"%li",res9/100) ;
492 if ((res9/10)>0 || printzeros) {
493 printf(
"%li",res9/10) ;
497 if (res9>0 || printzeros) {
498 printf(
"%li ",res9) ;
501 if ((res6/100)>0 || printzeros) {
502 printf(
"%li",res6/100) ;
506 if ((res6/10)>0 || printzeros) {
507 printf(
"%li",res6/10) ;
511 if (res6>0 || printzeros) {
512 printf(
"%li ",res6) ;
515 if ((res3/100)>0 || printzeros) {
516 printf(
"%li",res3/100) ;
520 if ((res3/10)>0 || printzeros) {
521 printf(
"%li",res3/10) ;
525 if (res3>0 || printzeros) {
526 printf(
"%li ",res3) ;
529 if ((res0/100)>0 || printzeros) {
530 printf(
"%i",res0/100) ;
534 if ((res0/10)>0 || printzeros) {
535 printf(
"%i",res0/10) ;
543 printf(
" C Traffic: ") ;
549 printf(
" F Traffic: ") ;
555 printf(
" C+F Traffic: ") ;
564 int nbBlocks = (stack?-1:0) ;
567 stack = stack->
prev ;
571 printf(
" Stack size: ") ;
578 int nbBlocks = (stack?-1:0) ;
581 stack = stack->
prev ;
585 printf(
" Stack size at location %i : ", *
n) ;
592 int nbBlocks = (stack?-2:0) ;
596 stack = stack->
prev ;
601 stack = stack->
next ;
605 printf(
" Max Stack size (%i blocks): ", nbBlocks) ;
615 int nbBlocks = (stack?-1:0) ;
617 stack = stack->
prev ;
620 printf(
" Stack look at: ") ;
629 int totalNumChars = 60 ;
632 unsigned short int *st1 ;
633 printf(
"TOP OF C STACK : ") ;
634 while (totalNumChars>0 && stackTop>(stack->
contents)) {
637 st1 = (
unsigned short int *)stackTop ;
638 printf(
"%02X,",*st1%256) ;
641 while (totalNumChars>0 && stack->
prev) {
643 stack = stack->
prev ;
645 while (totalNumChars>0 && stackTop>(stack->
contents)) {
647 st1 = (
unsigned short int *)stackTop ;
648 printf(
"%02X,",*st1%256) ;
655 printf(
" || BOTTOM\n") ;
657 printf(
"NOTHING IN C STACK.\n") ;
665 stack = stack->
prev ;
674 void getbigcsizes_(
int *nbblocks,
int *remainder,
int *nbblockslook,
int *lookremainder) {
678 *nbblocks = (stack?-1:0) ;
680 stack = stack->
prev ;
689 *nbblockslook = -999 ;
690 *lookremainder = -999 ;
693 *nbblockslook = (stack?-1:0) ;
695 stack = stack->
prev ;
void popbooleanarray(char *x, int n)
l_size ! loop over number of fields ke do je do i
void lookbooleanarray(char *x, int n)
void popinteger16array_(void *x, unsigned int *n)
void pushbooleanarray_(char *x, unsigned int *n)
void printlookingplace_()
void printftrafficinc_(long int *mmfM, int *mmfsz, int *mmf)
void lookpointer4array(void *x, int n)
void poppointer4array(void *x, int n)
void lookcomplex4array(void *x, int n)
void popreal8array_(void *x, unsigned int *n)
void popcomplex16array_(void *x, unsigned int *n)
void popcomplex4array(void *x, int n)
static long int mmctrafficM
void popinteger4array(int *x, int n)
void pushcomplex4array(void *x, int n)
void popbooleanarray_(char *x, unsigned int *n)
void pushpointer4array(void *x, int n)
void popreal8array(double *x, int n)
void lookreal8array_(void *x, unsigned int *n)
void lookNarray(char *x, unsigned int nbChars)
void lookcomplex16array(void *x, int n)
void pushinteger4array_(void *x, unsigned int *n)
void pushbooleanarray(char *x, int n)
void pushcomplex32array_(void *x, unsigned int *n)
void popcharacterarray_(char *x, unsigned int *n)
void lookcomplex32array_(void *x, unsigned int *n)
void lookcharacterarray(char *x, int n)
void pushcharacterarray(char *x, int n)
*f90 *************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************! this routine is used to retrieve scalar boundary data for symmetric domain. subroutine MPP_GET_BOUNDARY_2D_(field, domain, ebuffer, sbuffer, wbuffer, nbuffer, flags, &position, complete, tile_count) type(domain2D), intent(in) ::domain MPP_TYPE_, intent(in) ::field(:,:) MPP_TYPE_, intent(inout), optional ::ebuffer(:), sbuffer(:), wbuffer(:), nbuffer(:) integer, intent(in), optional ::flags, position, tile_count logical, intent(in), optional ::complete MPP_TYPE_ ::field3D(size(field, 1), size(field, 2), 1) MPP_TYPE_, allocatable, dimension(:,:) ::ebuffer2D, sbuffer2D, wbuffer2D, nbuffer2D integer ::xcount, ycount integer ::ntile logical ::need_ebuffer, need_sbuffer, need_wbuffer, need_nbuffer integer(LONG_KIND), dimension(MAX_DOMAIN_FIELDS, MAX_TILES), save ::f_addrs=-9999 integer(LONG_KIND), dimension(4, MAX_DOMAIN_FIELDS, MAX_TILES), save ::b_addrs=-9999 integer, save ::bsize(4)=0, isize=0, jsize=0, ksize=0, pos, list=0, l_size=0, upflags integer ::buffer_size(4) integer ::max_ntile, tile, update_position, ishift, jshift logical ::do_update, is_complete, set_mismatch character(len=3) ::text MPP_TYPE_ ::d_type type(overlapSpec), pointer ::bound=> NULL() ntile
void lookinteger4array(int *x, int n)
static char * lookStackTop
void lookpointer8array(void *x, int n)
void popinteger4array_(void *x, unsigned int *n)
void popinteger16array(long long int *x, int n)
void pushinteger4array(int *x, int n)
void lookinteger16array(long long int *x, int n)
void lookreal8array(double *x, int n)
void lookcomplex8array_(void *x, unsigned int *n)
void pushcharacterarray_(char *x, unsigned int *n)
void pushpointer8array(void *x, int n)
void pushreal8array(double *x, int n)
void popinteger8array(long int *x, int n)
void lookreal32array_(void *x, unsigned int *n)
void pushreal4array(float *x, int n)
void pushreal32array_(void *x, unsigned int *n)
void popcomplex16array(void *x, int n)
void popreal16array_(void *x, unsigned int *n)
void lookcomplex8array(void *x, int n)
void pushcomplex16array_(void *x, unsigned int *n)
void pushinteger16array(long long int *x, int n)
int chcksum(char *contents, int len)
void popNarray(char *x, unsigned int nbChars)
void pushcomplex4array_(void *x, unsigned int *n)
void pushreal32array(void *x, int n)
static DoubleChainedBlock * lookStack
void pushcomplex32array(void *x, int n)
struct _doubleChainedBlock DoubleChainedBlock
void popreal32array(void *x, int n)
void lookcomplex16array_(void *x, unsigned int *n)
void popcomplex8array_(void *x, unsigned int *n)
void popcomplex32array(void *x, int n)
void pushinteger8array_(void *x, unsigned int *n)
void printtotaltraffic_(long int *mmfM, int *mmfsz, int *mmf)
void pushreal4array_(void *x, unsigned int *n)
void popreal16array(void *x, int n)
struct _doubleChainedBlock * prev
void pushinteger16array_(void *x, unsigned int *n)
void pushcomplex16array(void *x, int n)
void pushreal8array_(void *x, unsigned int *n)
void popcomplex32array_(void *x, unsigned int *n)
void pushinteger8array(long int *x, int n)
void getnbblocksinstack_(int *nbblocks)
void pushreal16array(void *x, int n)
void pushcomplex8array(void *x, int n)
void lookreal16array(void *x, int n)
void pushNarray(char *x, unsigned int nbChars)
void popinteger8array_(void *x, unsigned int *n)
void popreal32array_(void *x, unsigned int *n)
void lookinteger8array(long int *x, int n)
static long int mmctraffic
void lookcomplex32array(void *x, int n)
void lookreal16array_(void *x, unsigned int *n)
void lookinteger16array_(void *x, unsigned int *n)
void popreal4array_(void *x, unsigned int *n)
void lookreal4array_(void *x, unsigned int *n)
struct _doubleChainedBlock * next
static char * curStackTop
void lookinteger8array_(void *x, unsigned int *n)
void lookreal4array(float *x, int n)
void printtopplacenum_(int *n)
void lookinteger4array_(void *x, unsigned int *n)
void lookcomplex4array_(void *x, unsigned int *n)
void popcharacterarray(char *x, int n)
void getbigcsizes_(int *nbblocks, int *remainder, int *nbblockslook, int *lookremainder)
void lookcharacterarray_(char *x, unsigned int *n)
void popcomplex4array_(void *x, unsigned int *n)
void poppointer8array(void *x, int n)
void pushreal16array_(void *x, unsigned int *n)
static DoubleChainedBlock * curStack
void lookreal32array(void *x, int n)
void popcomplex8array(void *x, int n)
void printbigbytes(long int nbblocks, long int blocksz, long int nbunits)
void popreal4array(float *x, int n)
void lookbooleanarray_(char *x, unsigned int *n)
void pushcomplex8array_(void *x, unsigned int *n)