NCEPLIBS-g2 4.0.0
Loading...
Searching...
No Matches
g2aec.F90
Go to the documentation of this file.
1
4
36subroutine aecpack(fld,width,height,idrstmpl,cpack,lcpack)
37
38 use, intrinsic :: iso_c_binding, only: c_size_t
39 implicit none
40
41 integer,intent(in) :: width,height
42 real,intent(in) :: fld(width*height)
43 character(len=1),intent(out) :: cpack(*)
44 integer,intent(inout) :: idrstmpl(*)
45 integer,intent(inout) :: lcpack
46 integer(c_size_t) :: width_c, height_c
47 integer :: ret
48
49 interface
50 function g2c_aecpackd(fld, width, height, idrstmpl, cpack, lcpack) bind(c)
51 use, intrinsic :: iso_c_binding
52 real(kind=c_double), intent(in):: fld(*)
53 integer(c_size_t), value, intent(in) :: width, height
54 integer(c_int), intent(inout) :: idrstmpl(*)
55 character(kind=c_char), intent(out) :: cpack(*)
56 integer(c_int), intent(out) :: lcpack
57 integer(c_int) :: g2c_aecpackd
58 end function g2c_aecpackd
59 function g2c_aecpackf(fld, width, height, idrstmpl, cpack, lcpack) bind(c)
60 use, intrinsic :: iso_c_binding
61 real(kind=c_float), intent(in):: fld(*)
62 integer(c_size_t), value, intent(in) :: width, height
63 integer(c_int), intent(inout) :: idrstmpl(*)
64 character(kind=c_char), intent(out) :: cpack(*)
65 integer(c_int), intent(out) :: lcpack
66 integer(c_int) :: g2c_aecpackf
67 end function g2c_aecpackf
68 end interface
69
70 width_c = width
71 height_c = height
72
73#if KIND==4
74 ret = g2c_aecpackf(fld, width_c, height_c, idrstmpl, cpack, lcpack)
75#else
76 ret = g2c_aecpackd(fld, width_c, height_c, idrstmpl, cpack, lcpack)
77#endif
78
79end subroutine
80
94subroutine aecunpack(cpack,len,idrstmpl,ndpts,fld)
95
96 use, intrinsic :: iso_c_binding, only: c_size_t
97 implicit none
98
99 character(len=1),intent(in) :: cpack(len)
100 integer,intent(in) :: ndpts,len
101 integer,intent(in) :: idrstmpl(*)
102 real,intent(out) :: fld(ndpts)
103 integer(c_size_t) :: ndpts_c, len_c
104 integer :: ret
105
106 interface
107 function g2c_aecunpackd(cpack, len, idrstmpl, ndpts, fld) bind(c)
108 use, intrinsic :: iso_c_binding
109 implicit none
110 integer(c_size_t), value, intent(in) :: len
111 integer(c_size_t), value, intent(in) :: ndpts
112 character(kind=c_char), intent(in) :: cpack(*)
113 integer(c_int), intent(in) :: idrstmpl(*)
114 real(kind=c_double), intent(out) :: fld(*)
115 integer(c_int) :: g2c_aecunpackd
116 end function g2c_aecunpackd
117 function g2c_aecunpackf(cpack, len, idrstmpl, ndpts, fld) bind(c)
118 use, intrinsic :: iso_c_binding
119 implicit none
120 integer(c_size_t), value, intent(in) :: len
121 integer(c_size_t), value, intent(in) :: ndpts
122 character(kind=c_char), intent(in) :: cpack(*)
123 integer(c_int), intent(in) :: idrstmpl(*)
124 real(kind=c_float), intent(out) :: fld(*)
125 integer(c_int) :: g2c_aecunpackf
126 end function g2c_aecunpackf
127 end interface
128
129 len_c = len
130 ndpts_c = ndpts
131#if KIND==4
132 ret = g2c_aecunpackf(cpack, len_c, idrstmpl, ndpts_c, fld)
133#else
134 ret = g2c_aecunpackd(cpack, len_c, idrstmpl, ndpts_c, fld)
135#endif
136
137end subroutine aecunpack
subroutine aecpack(fld, width, height, idrstmpl, cpack, lcpack)
Pack a data field into a AEC code stream as defined in Data Representation Template 5....
Definition g2aec.F90:37
subroutine aecunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field from a AEC code stream as defined in Data Representation Template 5....
Definition g2aec.F90:95