New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
pack_c.c.old in branches/nemo_v3_3_beta/NEMOGCM/EXTERNAL/XMLIO_SERVER/src/IOSERVER – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/EXTERNAL/XMLIO_SERVER/src/IOSERVER/pack_c.c.old @ 2281

Last change on this file since 2281 was 2281, checked in by smasson, 13 years ago

set proper svn properties to all files...

  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1
2
3
4typedef int     INTEGER ;
5typedef double  REAL    ;
6typedef int     LOGICAL ;
7typedef char    CHARACTER ;
8
9int INTEGER_SIZE   = 4 ;
10int REAL_SIZE      = 8 ;
11int LOGICAL_SIZE   = 4 ;
12int CHARACTER_SIZE = 1 ;
13
14
15
16
17
18
19
20void packc_r_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
21{
22  int i ;
23 
24  for(i=0;i<(*size)*REAL_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
25}
26   
27void packc_i_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
28{
29  int i ;
30 
31  for(i=0;i<(*size)*INTEGER_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
32
33}
34
35void packc_l_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
36{
37  int i ;
38 
39  for(i=0;i<(*size)*LOGICAL_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
40}
41
42void packc_c_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size, int strsize)
43{
44  int i ;
45   printf("longueur de la chaine %i \n",strsize) ;
46  for(i=0;i<(*size)*CHARACTER_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
47}
48
49
50void unpackc_r_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
51{
52  int i ;
53
54  for(i=0;i<(*size)*REAL_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
55}
56   
57void unpackc_i_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
58{
59  int i ;
60 
61  for(i=0;i<(*size)*INTEGER_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
62
63}
64
65void unpackc_l_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
66{
67  int i ;
68 
69  for(i=0;i<(*size)*LOGICAL_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
70}
71
72void unpackc_c_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size,int strsize)
73{
74  int i ;
75 
76  for(i=0;i<(*size)*CHARACTER_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
77}
78
79void packc_field_(REAL* buffer, INTEGER* position, REAL* var,INTEGER * size)
80{
81  int i;
82  int s ;
83 
84  s=*size ;
85  buffer+=(*position) ;
86#pragma vdir nooverlap
87  for(i=0;i<s;i++) buffer[i]=var[i] ;
88  position+=s ;
89}
90
91void unpackc_field_(REAL* buffer, INTEGER* position, REAL* var,INTEGER* size)
92{
93  int i;
94  int s ;
95 
96  s=*size ;
97  buffer+=(*position) ;
98#pragma vdir nooverlap
99  for(i=0;i<s;i++) var[i]=buffer[i] ;
100  position+=s ;
101}
Note: See TracBrowser for help on using the repository browser.