source: LMDZ5/tags/proto-testing-20131015/tools/Max_diff_nc_with_lib/NetCDF95/nf95_put_var.f90 @ 2300

Last change on this file since 2300 was 1795, checked in by Ehouarn Millour, 11 years ago

Version testing basee sur la r1794


Testing release based on r1794

File size: 10.0 KB
Line 
1module nf95_put_var_m
2
3  implicit none
4
5  interface nf95_put_var
6     module procedure nf95_put_var_FourByteReal, nf95_put_var_FourByteInt, &
7          nf95_put_var_1D_FourByteReal, nf95_put_var_1D_FourByteInt, &
8          nf95_put_var_1D_EightByteReal, nf95_put_var_2D_FourByteReal, &
9          nf95_put_var_2D_EightByteReal, nf95_put_var_3D_FourByteReal, &
10          nf95_put_var_3D_EightByteReal, nf95_put_var_4D_FourByteReal, &
11          nf95_put_var_4D_EightByteReal
12  end interface
13
14  private
15  public nf95_put_var
16
17contains
18
19  subroutine nf95_put_var_FourByteReal(ncid, varid, values, start, ncerr)
20
21    use typesizes, only: FourByteReal
22    use netcdf, only: nf90_put_var
23    use handle_err_m, only: handle_err
24
25    integer, intent(in) :: ncid, varid
26    real(kind = FourByteReal), intent(in) :: values
27    integer, dimension(:), optional, intent(in) :: start
28    integer, intent(out), optional:: ncerr
29
30    ! Variable local to the procedure:
31    integer ncerr_not_opt
32
33    !-------------------
34
35    ncerr_not_opt = nf90_put_var(ncid, varid, values, start)
36    if (present(ncerr)) then
37       ncerr = ncerr_not_opt
38    else
39       call handle_err("nf95_put_var_FourByteReal", ncerr_not_opt, ncid, &
40            varid)
41    end if
42
43  end subroutine nf95_put_var_FourByteReal
44
45  !***********************
46
47  subroutine nf95_put_var_FourByteInt(ncid, varid, values, start, ncerr)
48
49    use typesizes, only: FourByteInt
50    use netcdf, only: nf90_put_var
51    use handle_err_m, only: handle_err
52
53    integer, intent(in) :: ncid, varid
54    integer(kind = FourByteInt), intent(in) :: values
55    integer, dimension(:), optional, intent(in) :: start
56    integer, intent(out), optional:: ncerr
57
58    ! Variable local to the procedure:
59    integer ncerr_not_opt
60
61    !-------------------
62
63    ncerr_not_opt = nf90_put_var(ncid, varid, values, start)
64    if (present(ncerr)) then
65       ncerr = ncerr_not_opt
66    else
67       call handle_err("nf95_put_var_FourByteInt", ncerr_not_opt, ncid, &
68            varid)
69    end if
70
71  end subroutine nf95_put_var_FourByteInt
72
73  !***********************
74
75  subroutine nf95_put_var_1D_FourByteReal(ncid, varid, values, start, &
76       count_nc, stride, map, ncerr)
77
78    use typesizes, only: FourByteReal
79    use netcdf, only: nf90_put_var
80    use handle_err_m, only: handle_err
81
82    integer,                         intent(in) :: ncid, varid
83    real(kind = FourByteReal), intent(in) :: values(:)
84    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
85    integer, intent(out), optional:: ncerr
86
87    ! Variable local to the procedure:
88    integer ncerr_not_opt
89
90    !-------------------
91
92    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
93         stride, map)
94    if (present(ncerr)) then
95       ncerr = ncerr_not_opt
96    else
97       call handle_err("nf95_put_var_1D_FourByteReal", ncerr_not_opt, ncid, &
98            varid)
99    end if
100
101  end subroutine nf95_put_var_1D_FourByteReal
102
103  !***********************
104
105  subroutine nf95_put_var_1D_FourByteInt(ncid, varid, values, start, &
106       count_nc, stride, map, ncerr)
107
108    use typesizes, only: FourByteInt
109    use netcdf, only: nf90_put_var
110    use handle_err_m, only: handle_err
111
112    integer,                         intent(in) :: ncid, varid
113    integer(kind = FourByteInt), intent(in) :: values(:)
114    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
115    integer, intent(out), optional:: ncerr
116
117    ! Variable local to the procedure:
118    integer ncerr_not_opt
119
120    !-------------------
121
122    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
123         stride, map)
124    if (present(ncerr)) then
125       ncerr = ncerr_not_opt
126    else
127       call handle_err("nf95_put_var_1D_FourByteInt", ncerr_not_opt, ncid, &
128            varid)
129    end if
130
131  end subroutine nf95_put_var_1D_FourByteInt
132
133  !***********************
134
135  subroutine nf95_put_var_1D_EightByteReal(ncid, varid, values, start, &
136       count_nc, stride, map, ncerr)
137
138    use typesizes, only: eightByteReal
139    use netcdf, only: nf90_put_var
140    use handle_err_m, only: handle_err
141
142    integer,                         intent(in) :: ncid, varid
143    real (kind = EightByteReal),     intent(in) :: values(:)
144    integer, dimension(:), optional, intent(in):: start, count_nc, stride, map
145    integer, intent(out), optional:: ncerr
146
147    ! Variable local to the procedure:
148    integer ncerr_not_opt
149
150    !-------------------
151
152    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
153         stride, map)
154    if (present(ncerr)) then
155       ncerr = ncerr_not_opt
156    else
157       call handle_err("nf95_put_var_1D_eightByteReal", ncerr_not_opt, ncid, &
158            varid)
159    end if
160
161  end subroutine nf95_put_var_1D_EightByteReal
162
163  !***********************
164
165  subroutine nf95_put_var_2D_FourByteReal(ncid, varid, values, start, &
166       count_nc, stride, map, ncerr)
167
168    use typesizes, only: FourByteReal
169    use netcdf, only: nf90_put_var
170    use handle_err_m, only: handle_err
171
172    integer,                         intent(in) :: ncid, varid
173    real (kind = FourByteReal), intent(in) :: values(:, :)
174    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
175    integer, intent(out), optional:: ncerr
176
177    ! Variable local to the procedure:
178    integer ncerr_not_opt
179
180    !-------------------
181
182    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
183         stride, map)
184    if (present(ncerr)) then
185       ncerr = ncerr_not_opt
186    else
187       call handle_err("nf95_put_var_2D_FourByteReal", ncerr_not_opt, ncid, &
188            varid)
189    end if
190
191  end subroutine nf95_put_var_2D_FourByteReal
192
193  !***********************
194
195  subroutine nf95_put_var_2D_EightByteReal(ncid, varid, values, start, &
196       count_nc, stride, map, ncerr)
197
198    use typesizes, only: EightByteReal
199    use netcdf, only: nf90_put_var
200    use handle_err_m, only: handle_err
201
202    integer,                         intent(in) :: ncid, varid
203    real (kind = EightByteReal), intent(in) :: values(:, :)
204    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
205    integer, intent(out), optional:: ncerr
206
207    ! Variable local to the procedure:
208    integer ncerr_not_opt
209
210    !-------------------
211
212    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
213         stride, map)
214    if (present(ncerr)) then
215       ncerr = ncerr_not_opt
216    else
217       call handle_err("nf95_put_var_2D_EightByteReal", ncerr_not_opt, ncid, &
218            varid)
219    end if
220
221  end subroutine nf95_put_var_2D_EightByteReal
222
223  !***********************
224
225  subroutine nf95_put_var_3D_FourByteReal(ncid, varid, values, start, &
226       count_nc, stride, map, ncerr)
227
228    use typesizes, only: FourByteReal
229    use netcdf, only: nf90_put_var
230    use handle_err_m, only: handle_err
231
232    integer,                         intent(in) :: ncid, varid
233    real (kind = FourByteReal), intent(in) :: values(:, :, :)
234    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
235    integer, intent(out), optional:: ncerr
236
237    ! Variable local to the procedure:
238    integer ncerr_not_opt
239
240    !-------------------
241
242    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
243         stride, map)
244    if (present(ncerr)) then
245       ncerr = ncerr_not_opt
246    else
247       call handle_err("nf95_put_var_3D_FourByteReal", ncerr_not_opt, ncid, &
248            varid)
249    end if
250
251  end subroutine nf95_put_var_3D_FourByteReal
252
253  !***********************
254
255  subroutine nf95_put_var_3D_EightByteReal(ncid, varid, values, start, &
256       count_nc, stride, map, ncerr)
257
258    use typesizes, only: eightByteReal
259    use netcdf, only: nf90_put_var
260    use handle_err_m, only: handle_err
261
262    integer,                         intent(in) :: ncid, varid
263    real (kind = EightByteReal),     intent(in) :: values(:, :, :)
264    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
265    integer, intent(out), optional:: ncerr
266
267    ! Variable local to the procedure:
268    integer ncerr_not_opt
269
270    !-------------------
271
272    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
273         stride, map)
274    if (present(ncerr)) then
275       ncerr = ncerr_not_opt
276    else
277       call handle_err("nf95_put_var_3D_eightByteReal", ncerr_not_opt, ncid, &
278            varid)
279    end if
280
281  end subroutine nf95_put_var_3D_EightByteReal
282
283  !***********************
284
285  subroutine nf95_put_var_4D_FourByteReal(ncid, varid, values, start, &
286       count_nc, stride, map, ncerr)
287
288    use typesizes, only: FourByteReal
289    use netcdf, only: nf90_put_var
290    use handle_err_m, only: handle_err
291
292    integer,                         intent(in) :: ncid, varid
293    real (kind = FourByteReal), intent(in) :: values(:, :, :, :)
294    integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map
295    integer, intent(out), optional:: ncerr
296
297    ! Variable local to the procedure:
298    integer ncerr_not_opt
299
300    !-------------------
301
302    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
303         stride, map)
304    if (present(ncerr)) then
305       ncerr = ncerr_not_opt
306    else
307       call handle_err("nf95_put_var_4D_FourByteReal", ncerr_not_opt, ncid, &
308            varid)
309    end if
310
311  end subroutine nf95_put_var_4D_FourByteReal
312
313  !***********************
314
315  subroutine nf95_put_var_4D_EightByteReal(ncid, varid, values, start, &
316       count_nc, stride, map, ncerr)
317
318    use typesizes, only: EightByteReal
319    use netcdf, only: nf90_put_var
320    use handle_err_m, only: handle_err
321
322    integer, intent(in):: ncid, varid
323    real(kind = EightByteReal), intent(in):: values(:, :, :, :)
324    integer, dimension(:), optional, intent(in):: start, count_nc, stride, map
325    integer, intent(out), optional:: ncerr
326
327    ! Variable local to the procedure:
328    integer ncerr_not_opt
329
330    !-------------------
331
332    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, &
333         stride, map)
334    if (present(ncerr)) then
335       ncerr = ncerr_not_opt
336    else
337       call handle_err("nf95_put_var_4D_EightByteReal", ncerr_not_opt, ncid, &
338            varid)
339    end if
340
341  end subroutine nf95_put_var_4D_EightByteReal
342
343end module nf95_put_var_m
Note: See TracBrowser for help on using the repository browser.