NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
cpmstabs.c
Go to the documentation of this file.
1 
5 #include "bufrlib.h"
6 #include "mstabs.h"
7 
44 void cpmstabs( f77int *pnmtb,
45  f77int *pibfxyn, char (*pcbscl)[4],
46  char (*pcbsref)[12], char (*pcbbw)[4],
47  char (*pcbunit)[14], char (*pcbmnem)[8],
48  char (*pcbelem)[120],
49  f77int *pnmtd,
50  f77int *pidfxyn, char (*pcdseq)[120],
51  char (*pcdmnem)[8], f77int *pndelem,
52  f77int *pidefxy, f77int *maxcd )
53 {
54 #ifdef DYNAMIC_ALLOCATION
55 
56  f77int ii, jj, idx;
57 
58  MSTABS_BASE(nmtb) = *pnmtb;
59  for ( ii = 0; ii < *pnmtb; ii++ ) {
60  MSTABS_BASE(ibfxyn)[ii] = pibfxyn[ii];
61  for ( jj = 0; jj < 4; jj++ ) {
62  MSTABS_BASE(cbscl)[ii][jj] = pcbscl[ii][jj];
63  MSTABS_BASE(cbbw)[ii][jj] = pcbbw[ii][jj];
64  }
65  for ( jj = 0; jj < 8; jj++ ) {
66  MSTABS_BASE(cbmnem)[ii][jj] = pcbmnem[ii][jj];
67  }
68  for ( jj = 0; jj < 12; jj++ ) {
69  MSTABS_BASE(cbsref)[ii][jj] = pcbsref[ii][jj];
70  }
71  for ( jj = 0; jj < 14; jj++ ) {
72  MSTABS_BASE(cbunit)[ii][jj] = pcbunit[ii][jj];
73  }
74  for ( jj = 0; jj < 120; jj++ ) {
75  MSTABS_BASE(cbelem)[ii][jj] = pcbelem[ii][jj];
76  }
77  }
78 
79  MSTABS_BASE(nmtd) = *pnmtd;
80  for ( ii = 0; ii < *pnmtd; ii++ ) {
81  MSTABS_BASE(idfxyn)[ii] = pidfxyn[ii];
82  MSTABS_BASE(ndelem)[ii] = pndelem[ii];
83  for ( jj = 0; jj < pndelem[ii]; jj++ ) {
84  idx = icvidx( &ii, &jj, maxcd );
85  MSTABS_BASE(idefxy)[idx] = pidefxy[idx];
86  }
87  for ( jj = 0; jj < 8; jj++ ) {
88  MSTABS_BASE(cdmnem)[ii][jj] = pcdmnem[ii][jj];
89  }
90  for ( jj = 0; jj < 120; jj++ ) {
91  MSTABS_BASE(cdseq)[ii][jj] = pcdseq[ii][jj];
92  }
93  }
94 #endif
95 
96 }
97 
Define signatures to enable a number of BUFRLIB subprograms to be called directly from C application ...
void cpmstabs(f77int *pnmtb, f77int *pibfxyn, char(*pcbscl)[4], char(*pcbsref)[12], char(*pcbbw)[4], char(*pcbunit)[14], char(*pcbmnem)[8], char(*pcbelem)[120], f77int *pnmtd, f77int *pidfxyn, char(*pcdseq)[120], char(*pcdmnem)[8], f77int *pndelem, f77int *pidefxy, f77int *maxcd)
This subroutine copies relevant information from the Fortran module MODA_MSTABS arrays to new arrays ...
Definition: cpmstabs.c:44
Define signatures and declare variables for internal storage of master Table B and Table D entries...
f77int icvidx(f77int *ii, f77int *jj, f77int *numjj)
C C SUBPROGRAM: ICVIDX C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: THIS ROUTINE COMPUTES ...
Definition: icvidx.c:41