source: LMDZ4/trunk/libf/bibio/nf95_put_var_m.F90 @ 2060

Last change on this file since 2060 was 1279, checked in by Laurent Fairhead, 15 years ago

Merged LMDZ4-dev branch changes r1241:1278 into the trunk
Running trunk and LMDZ4-dev in LMDZOR configuration on local
machine (sequential) and SX8 (4-proc) yields identical results
(restart and restartphy are identical binarily)
Log history from r1241 to r1278 is available by switching to
source:LMDZ4/branches/LMDZ4-dev-20091210

File size: 8.1 KB
Line 
1! $Id$
2module nf95_put_var_m
3
4  implicit none
5
6  interface nf95_put_var
7     module procedure nf95_put_var_FourByteReal, nf95_put_var_FourByteInt, &
8          nf95_put_var_1D_FourByteReal, nf95_put_var_1D_FourByteInt, &
9          nf95_put_var_2D_FourByteReal, nf95_put_var_3D_FourByteReal, &
10          nf95_put_var_4D_FourByteReal
11!!$     module procedure nf95_put_var_1D_FourByteReal, &
12!!$          nf95_put_var_2D_FourByteReal, nf95_put_var_3D_FourByteReal, &
13!!$          nf95_put_var_4D_FourByteReal, nf90_put_var_1D_EightByteReal, &
14!!$          nf90_put_var_3D_EightByteReal
15  end interface
16
17  private
18  public nf95_put_var
19
20contains
21
22  subroutine nf95_put_var_FourByteReal(ncid, varid, values, start, ncerr)
23
24    use netcdf, only: nf90_put_var
25    use handle_err_m, only: handle_err
26
27    integer, intent( in) :: ncid, varid
28    real, intent( in) :: values
29    integer, dimension(:), optional, intent( in) :: start
30    integer, intent(out), optional:: ncerr
31
32    ! Variable local to the procedure:
33    integer ncerr_not_opt
34
35    !-------------------
36
37    ncerr_not_opt = nf90_put_var(ncid, varid, values, start)
38    if (present(ncerr)) then
39       ncerr = ncerr_not_opt
40    else
41       call handle_err("nf95_put_var_FourByteReal", ncerr_not_opt, ncid, &
42            varid)
43    end if
44
45  end subroutine nf95_put_var_FourByteReal
46
47  !***********************
48
49  subroutine nf95_put_var_FourByteInt(ncid, varid, values, start, ncerr)
50
51    use netcdf, only: nf90_put_var
52    use handle_err_m, only: handle_err
53
54    integer, intent( in) :: ncid, varid
55    integer, intent( in) :: values
56    integer, dimension(:), optional, intent( in) :: start
57    integer, intent(out), optional:: ncerr
58
59    ! Variable local to the procedure:
60    integer ncerr_not_opt
61
62    !-------------------
63
64    ncerr_not_opt = nf90_put_var(ncid, varid, values, start)
65    if (present(ncerr)) then
66       ncerr = ncerr_not_opt
67    else
68       call handle_err("nf95_put_var_FourByteInt", ncerr_not_opt, ncid, &
69            varid)
70    end if
71
72  end subroutine nf95_put_var_FourByteInt
73
74  !***********************
75
76  subroutine nf95_put_var_1D_FourByteReal(ncid, varid, values, start, count, &
77       stride, map, ncerr)
78
79    use netcdf, only: nf90_put_var
80    use handle_err_m, only: handle_err
81
82    integer,                         intent(in) :: ncid, varid
83    real, intent(in) :: values(:)
84    integer, dimension(:), optional, intent(in) :: start, count, 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, stride, &
93         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, count, &
106       stride, map, ncerr)
107
108    use netcdf, only: nf90_put_var
109    use handle_err_m, only: handle_err
110
111    integer,                         intent(in) :: ncid, varid
112    integer, intent(in) :: values(:)
113    integer, dimension(:), optional, intent(in) :: start, count, stride, map
114    integer, intent(out), optional:: ncerr
115
116    ! Variable local to the procedure:
117    integer ncerr_not_opt
118
119    !-------------------
120
121    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, &
122         map)
123    if (present(ncerr)) then
124       ncerr = ncerr_not_opt
125    else
126       call handle_err("nf95_put_var_1D_FourByteInt", ncerr_not_opt, ncid, &
127            varid)
128    end if
129
130  end subroutine nf95_put_var_1D_FourByteInt
131
132  !***********************
133
134  subroutine nf95_put_var_2D_FourByteReal(ncid, varid, values, start, count, &
135       stride, map, ncerr)
136
137    use netcdf, only: nf90_put_var
138    use handle_err_m, only: handle_err
139
140    integer,                         intent( in) :: ncid, varid
141    real, intent( in) :: values(:, :)
142    integer, dimension(:), optional, intent( in) :: start, count, stride, map
143    integer, intent(out), optional:: ncerr
144
145    ! Variable local to the procedure:
146    integer ncerr_not_opt
147
148    !-------------------
149
150    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, &
151         map)
152    if (present(ncerr)) then
153       ncerr = ncerr_not_opt
154    else
155       call handle_err("nf95_put_var_2D_FourByteReal", ncerr_not_opt, ncid, &
156            varid)
157    end if
158
159  end subroutine nf95_put_var_2D_FourByteReal
160
161  !***********************
162
163  subroutine nf95_put_var_3D_FourByteReal(ncid, varid, values, start, count, &
164       stride, map, ncerr)
165
166    use netcdf, only: nf90_put_var
167    use handle_err_m, only: handle_err
168
169    integer,                         intent( in) :: ncid, varid
170    real, intent( in) :: values(:, :, :)
171    integer, dimension(:), optional, intent( in) :: start, count, stride, map
172    integer, intent(out), optional:: ncerr
173
174    ! Variable local to the procedure:
175    integer ncerr_not_opt
176
177    !-------------------
178
179    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, &
180         map)
181    if (present(ncerr)) then
182       ncerr = ncerr_not_opt
183    else
184       call handle_err("nf95_put_var_3D_FourByteReal", ncerr_not_opt, ncid, &
185            varid)
186    end if
187
188  end subroutine nf95_put_var_3D_FourByteReal
189
190  !***********************
191
192  subroutine nf95_put_var_4D_FourByteReal(ncid, varid, values, start, count, &
193       stride, map, ncerr)
194
195    use netcdf, only: nf90_put_var
196    use handle_err_m, only: handle_err
197
198    integer,                         intent( in) :: ncid, varid
199    real, intent( in) :: values(:, :, :, :)
200    integer, dimension(:), optional, intent( in) :: start, count, stride, map
201    integer, intent(out), optional:: ncerr
202
203    ! Variable local to the procedure:
204    integer ncerr_not_opt
205
206    !-------------------
207
208    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, &
209         map)
210    if (present(ncerr)) then
211       ncerr = ncerr_not_opt
212    else
213       call handle_err("nf95_put_var_4D_FourByteReal", ncerr_not_opt, ncid, &
214            varid)
215    end if
216
217  end subroutine nf95_put_var_4D_FourByteReal
218
219  !***********************
220
221!!$  subroutine nf90_put_var_1D_EightByteReal(ncid, varid, values, start, count, &
222!!$       stride, map, ncerr)
223!!$
224!!$    use typesizes, only: eightByteReal
225!!$    use netcdf, only: nf90_put_var
226!!$    use handle_err_m, only: handle_err
227!!$
228!!$    integer,                         intent( in) :: ncid, varid
229!!$    real (kind = EightByteReal),     intent( in) :: values(:)
230!!$    integer, dimension(:), optional, intent( in) :: start, count, stride, map
231!!$    integer, intent(out), optional:: ncerr
232!!$
233!!$    ! Variable local to the procedure:
234!!$    integer ncerr_not_opt
235!!$
236!!$    !-------------------
237!!$
238!!$    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, &
239!!$         map)
240!!$    if (present(ncerr)) then
241!!$       ncerr = ncerr_not_opt
242!!$    else
243!!$       call handle_err("nf95_put_var_1D_eightByteReal", ncerr_not_opt, ncid, &
244!!$            varid)
245!!$    end if
246!!$
247!!$  end subroutine nf90_put_var_1D_EightByteReal
248!!$
249!!$  !***********************
250!!$
251!!$  subroutine nf90_put_var_3D_EightByteReal(ncid, varid, values, start, count, &
252!!$       stride, map, ncerr)
253!!$
254!!$    use typesizes, only: eightByteReal
255!!$    use netcdf, only: nf90_put_var
256!!$    use handle_err_m, only: handle_err
257!!$
258!!$    integer,                         intent( in) :: ncid, varid
259!!$    real (kind = EightByteReal),     intent( in) :: values(:, :, :)
260!!$    integer, dimension(:), optional, intent( in) :: start, count, stride, map
261!!$    integer, intent(out), optional:: ncerr
262!!$
263!!$    ! Variable local to the procedure:
264!!$    integer ncerr_not_opt
265!!$
266!!$    !-------------------
267!!$
268!!$    ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count, stride, &
269!!$         map)
270!!$    if (present(ncerr)) then
271!!$       ncerr = ncerr_not_opt
272!!$    else
273!!$       call handle_err("nf95_put_var_3D_eightByteReal", ncerr_not_opt, ncid, &
274!!$            varid)
275!!$    end if
276!!$
277!!$  end subroutine nf90_put_var_3D_EightByteReal
278
279end module nf95_put_var_m
Note: See TracBrowser for help on using the repository browser.