16 subroutine ezspline_save1_r8(spline_o, filename, ier, &
21 type(EZspline1_r8) :: spline_o
22 character*(*) :: filename
25 integer,
intent(out) :: ier
30 character*(*),
intent(in),
OPTIONAL :: SPL_NAME
34 logical,
intent(in),
OPTIONAL :: FULLSAVE
36 integer ncid, ifail, in0, in1
38 character(2),
parameter :: real8=
'R8'
39 character(3),
parameter :: int=
'INT'
42 logical :: fullsv,imodify
45 if(spline_o%isReady /= 1)
then
50 in0 =
size(spline_o%fspl,1)
51 in1 =
size(spline_o%fspl,2)
53 if(
present(spl_name))
then
54 call ezspline_spl_name_chk(spl_name,ier)
61 if(
present(fullsave))
then
68 call cdfopn(ncid, filename,
'w')
71 call cdfopn(ncid, filename,
'v')
80 call ezspline_defvar(ncid, trim(zpre)//
'n1', dimlens, int, imodify, ier)
81 call ezspline_defvar(ncid, trim(zpre)//
'klookup1', dimlens, int, imodify, ier)
82 call ezspline_defvar(ncid, trim(zpre)//
'isHermite', dimlens, int, imodify, ier)
83 call ezspline_defvar(ncid, trim(zpre)//
'isLinear', dimlens, int, imodify, ier)
84 call ezspline_defvar(ncid, trim(zpre)//
'isReady', dimlens, int, imodify, ier)
86 call ezspline_defvar(ncid, trim(zpre)//
'ibctype1', dimlens, int, imodify, ier)
87 dimlens = (/spline_o%n1, 1, 1/)
88 call ezspline_defvar(ncid, trim(zpre)//
'x1', dimlens, real8, imodify, ier)
90 call ezspline_defvar(ncid, trim(zpre)//
'bcval1min', dimlens, real8, imodify, ier)
91 call ezspline_defvar(ncid, trim(zpre)//
'bcval1max', dimlens, real8, imodify, ier)
95 dimlens = (/spline_o%n1, 1, 1/)
97 call ezspline_defvar(ncid, trim(zpre)//
'f', dimlens, real8, imodify, ier)
100 call ezspline_defvar(ncid, trim(zpre)//
'x1min', dimlens, real8, imodify, ier)
101 call ezspline_defvar(ncid, trim(zpre)//
'x1max', dimlens, real8, imodify, ier)
102 call ezspline_defvar(ncid, trim(zpre)//
'ilin1', dimlens, int, imodify, ier)
103 dimlens = (/spline_o%n1, 4, 1/)
104 call ezspline_defvar(ncid, trim(zpre)//
'x1pkg', dimlens, real8, imodify, ier)
105 dimlens = (/2, spline_o%n1, 1/)
106 call ezspline_defvar(ncid, trim(zpre)//
'fspl', dimlens, real8, imodify, ier)
110 call cdfputvar(ncid, trim(zpre)//
'n1', spline_o%n1, ifail)
111 call cdfputvar(ncid, trim(zpre)//
'klookup1', spline_o%klookup1, ifail)
112 call cdfputvar(ncid, trim(zpre)//
'isHermite', spline_o%isHermite, ifail)
113 call cdfputvar(ncid, trim(zpre)//
'isLinear', spline_o%isLinear, ifail)
114 call cdfputvar(ncid, trim(zpre)//
'isReady', spline_o%isReady, ifail)
115 call cdfputvar(ncid, trim(zpre)//
'ibctype1', spline_o%ibctype1, ifail)
116 call cdfputvar(ncid, trim(zpre)//
'x1', spline_o%x1, ifail)
117 call cdfputvar(ncid, trim(zpre)//
'bcval1min', spline_o%bcval1min, ifail)
118 call cdfputvar(ncid, trim(zpre)//
'bcval1max', spline_o%bcval1max, ifail)
124 if(spline_o%isReady == 1)
then
126 call cdfputvar(ncid, trim(zpre)//
'f', spline_o%fspl(1,:), ifail)
128 call cdfputvar(ncid, trim(zpre)//
'x1min', spline_o%x1min, ifail)
129 call cdfputvar(ncid, trim(zpre)//
'x1max', spline_o%x1max, ifail)
130 call cdfputvar(ncid, trim(zpre)//
'ilin1', spline_o%ilin1, ifail)
131 call cdfputvar(ncid, trim(zpre)//
'x1pkg', spline_o%x1pkg, ifail)
132 call cdfputvar(ncid, trim(zpre)//
'fspl', spline_o%fspl, ifail)
140 if(ifail /=0) ier = 17
143 end subroutine ezspline_save1_r8
150 subroutine ezspline_save2_r8(spline_o, filename, ier, &
155 type(EZspline2_r8) :: spline_o
156 character*(*) :: filename
159 integer,
intent(out) :: ier
164 character*(*),
intent(in),
OPTIONAL :: SPL_NAME
168 logical,
intent(in),
OPTIONAL :: FULLSAVE
170 integer ncid, ifail, in0, in1, in2
172 character(2),
parameter :: real8=
'R8'
173 character(3),
parameter :: int=
'INT'
176 logical :: fullsv,imodify
179 if(spline_o%isReady /= 1)
then
184 in0 =
size(spline_o%fspl,1)
185 in1 =
size(spline_o%fspl,2)
186 in2 =
size(spline_o%fspl,3)
188 if(
present(spl_name))
then
189 call ezspline_spl_name_chk(spl_name,ier)
196 if(
present(fullsave))
then
203 call cdfopn(ncid, filename,
'w')
206 call cdfopn(ncid, filename,
'v')
214 dimlens = (/1, 1, 1/)
215 call ezspline_defvar(ncid, trim(zpre)//
'n1', dimlens, int, imodify, ier)
216 call ezspline_defvar(ncid, trim(zpre)//
'n2', dimlens, int, imodify, ier)
217 call ezspline_defvar(ncid, trim(zpre)//
'klookup1', dimlens, int, imodify, ier)
218 call ezspline_defvar(ncid, trim(zpre)//
'klookup2', dimlens, int, imodify, ier)
219 call ezspline_defvar(ncid, trim(zpre)//
'isHermite', dimlens, int, imodify, ier)
220 call ezspline_defvar(ncid, trim(zpre)//
'isLinear', dimlens, int, imodify, ier)
221 call ezspline_defvar(ncid, trim(zpre)//
'isHybrid', dimlens, int, imodify, ier)
222 call ezspline_defvar(ncid, trim(zpre)//
'isReady', dimlens, int, imodify, ier)
223 dimlens = (/2, 1, 1/)
224 call ezspline_defvar(ncid, trim(zpre)//
'hspline', dimlens, int, imodify, ier)
225 dimlens = (/2, 1, 1/)
226 call ezspline_defvar(ncid, trim(zpre)//
'ibctype1', dimlens, int, imodify, ier)
227 call ezspline_defvar(ncid, trim(zpre)//
'ibctype2', dimlens, int, imodify, ier)
228 dimlens = (/spline_o%n1, 1, 1/)
229 call ezspline_defvar(ncid, trim(zpre)//
'x1', dimlens, real8, imodify, ier)
230 dimlens = (/spline_o%n2, 1, 1/)
231 call ezspline_defvar(ncid, trim(zpre)//
'x2', dimlens, real8, imodify, ier)
232 dimlens = (/in2, 1, 1/)
233 call ezspline_defvar(ncid, trim(zpre)//
'bcval1min', dimlens, real8, imodify, ier)
234 call ezspline_defvar(ncid, trim(zpre)//
'bcval1max', dimlens, real8, imodify, ier)
235 dimlens = (/in1, 1, 1/)
236 call ezspline_defvar(ncid, trim(zpre)//
'bcval2min', dimlens, real8, imodify, ier)
237 call ezspline_defvar(ncid, trim(zpre)//
'bcval2max', dimlens, real8, imodify, ier)
241 dimlens = (/in1, in2, 1/)
243 call ezspline_defvar(ncid, trim(zpre)//
'f', dimlens, real8, imodify, ier)
245 dimlens = (/1, 1, 1/)
246 call ezspline_defvar(ncid, trim(zpre)//
'x1min', dimlens, real8, imodify, ier)
247 call ezspline_defvar(ncid, trim(zpre)//
'x1max', dimlens, real8, imodify, ier)
248 call ezspline_defvar(ncid, trim(zpre)//
'ilin1', dimlens, int, imodify, ier)
249 call ezspline_defvar(ncid, trim(zpre)//
'x2min', dimlens, real8, imodify, ier)
250 call ezspline_defvar(ncid, trim(zpre)//
'x2max', dimlens, real8, imodify, ier)
251 call ezspline_defvar(ncid, trim(zpre)//
'ilin2', dimlens, int, imodify, ier)
252 dimlens = (/spline_o%n1, 4, 1/)
253 call ezspline_defvar(ncid, trim(zpre)//
'x1pkg', dimlens, real8, imodify, ier)
254 dimlens = (/spline_o%n2, 4, 1/)
255 call ezspline_defvar(ncid, trim(zpre)//
'x2pkg', dimlens, real8, imodify, ier)
256 dimlens = (/in0, in1, in2/)
257 call ezspline_defvar(ncid, trim(zpre)//
'fspl', dimlens, real8, imodify, ier)
261 call cdfputvar(ncid, trim(zpre)//
'n1', spline_o%n1, ifail)
262 call cdfputvar(ncid, trim(zpre)//
'n2', spline_o%n2, ifail)
263 call cdfputvar(ncid, trim(zpre)//
'klookup1', spline_o%klookup1, ifail)
264 call cdfputvar(ncid, trim(zpre)//
'klookup2', spline_o%klookup2, ifail)
265 call cdfputvar(ncid, trim(zpre)//
'isHermite', spline_o%isHermite, ifail)
266 call cdfputvar(ncid, trim(zpre)//
'isLinear', spline_o%isLinear, ifail)
267 call cdfputvar(ncid, trim(zpre)//
'isHybrid', spline_o%isHybrid, ifail)
268 call cdfputvar(ncid, trim(zpre)//
'isReady', spline_o%isReady, ifail)
269 call cdfputvar(ncid, trim(zpre)//
'hspline', spline_o%hspline, ifail)
270 call cdfputvar(ncid, trim(zpre)//
'ibctype1', spline_o%ibctype1, ifail)
271 call cdfputvar(ncid, trim(zpre)//
'ibctype2', spline_o%ibctype2, ifail)
272 call cdfputvar(ncid, trim(zpre)//
'x1', spline_o%x1, ifail)
273 call cdfputvar(ncid, trim(zpre)//
'x2', spline_o%x2, ifail)
274 call cdfputvar(ncid, trim(zpre)//
'bcval1min', spline_o%bcval1min, ifail)
275 call cdfputvar(ncid, trim(zpre)//
'bcval1max', spline_o%bcval1max, ifail)
276 call cdfputvar(ncid, trim(zpre)//
'bcval2min', spline_o%bcval2min, ifail)
277 call cdfputvar(ncid, trim(zpre)//
'bcval2max', spline_o%bcval2max, ifail)
283 if(spline_o%isReady == 1)
then
285 call cdfputvar(ncid, trim(zpre)//
'f', spline_o%fspl(1,:,:), ifail)
287 call cdfputvar(ncid, trim(zpre)//
'x1min', spline_o%x1min, ifail)
288 call cdfputvar(ncid, trim(zpre)//
'x1max', spline_o%x1max, ifail)
289 call cdfputvar(ncid, trim(zpre)//
'ilin1', spline_o%ilin1, ifail)
290 call cdfputvar(ncid, trim(zpre)//
'x2min', spline_o%x2min, ifail)
291 call cdfputvar(ncid, trim(zpre)//
'x2max', spline_o%x2max, ifail)
292 call cdfputvar(ncid, trim(zpre)//
'ilin2', spline_o%ilin2, ifail)
293 call cdfputvar(ncid, trim(zpre)//
'x1pkg', spline_o%x1pkg, ifail)
294 call cdfputvar(ncid, trim(zpre)//
'x2pkg', spline_o%x2pkg, ifail)
295 call cdfputvar(ncid, trim(zpre)//
'fspl', spline_o%fspl, ifail)
303 if(ifail /=0) ier = 17
306 end subroutine ezspline_save2_r8
318 subroutine ezspline_save3_r8(spline_o, filename, ier, &
323 type(EZspline3_r8) :: spline_o
324 character*(*) :: filename
327 integer,
intent(out) :: ier
332 character*(*),
intent(in),
OPTIONAL :: SPL_NAME
336 logical,
intent(in),
OPTIONAL :: FULLSAVE
338 integer ncid, ifail, in0, in1, in2, in3
340 character(2),
parameter :: real8=
'R8'
341 character(3),
parameter :: int=
'INT'
344 logical :: fullsv,imodify
347 if(spline_o%isReady /= 1)
then
352 in0 =
size(spline_o%fspl,1)
353 in1 =
size(spline_o%fspl,2)
354 in2 =
size(spline_o%fspl,3)
355 in3 =
size(spline_o%fspl,4)
357 if(
present(spl_name))
then
358 call ezspline_spl_name_chk(spl_name,ier)
365 if(
present(fullsave))
then
372 call cdfopn(ncid, filename,
'w')
375 call cdfopn(ncid, filename,
'v')
383 dimlens = (/1, 1, 1/)
384 call ezspline_defvar(ncid, trim(zpre)//
'n1', dimlens, int, imodify, ier)
385 call ezspline_defvar(ncid, trim(zpre)//
'n2', dimlens, int, imodify, ier)
386 call ezspline_defvar(ncid, trim(zpre)//
'n3', dimlens, int, imodify, ier)
387 call ezspline_defvar(ncid, trim(zpre)//
'klookup1', dimlens, int, imodify, ier)
388 call ezspline_defvar(ncid, trim(zpre)//
'klookup2', dimlens, int, imodify, ier)
389 call ezspline_defvar(ncid, trim(zpre)//
'klookup3', dimlens, int, imodify, ier)
390 call ezspline_defvar(ncid, trim(zpre)//
'isHermite', dimlens, int, imodify, ier)
391 call ezspline_defvar(ncid, trim(zpre)//
'isLinear', dimlens, int, imodify, ier)
392 call ezspline_defvar(ncid, trim(zpre)//
'isHybrid', dimlens, int, imodify, ier)
393 call ezspline_defvar(ncid, trim(zpre)//
'isReady', dimlens, int, imodify, ier)
394 dimlens = (/3, 1, 1/)
395 call ezspline_defvar(ncid, trim(zpre)//
'hspline', dimlens, int, imodify, ier)
396 dimlens = (/2, 1, 1/)
397 call ezspline_defvar(ncid, trim(zpre)//
'ibctype1', dimlens, int, imodify, ier)
398 call ezspline_defvar(ncid, trim(zpre)//
'ibctype2', dimlens, int, imodify, ier)
399 call ezspline_defvar(ncid, trim(zpre)//
'ibctype3', dimlens, int, imodify, ier)
400 dimlens = (/spline_o%n1, 1, 1/)
401 call ezspline_defvar(ncid, trim(zpre)//
'x1', dimlens, real8, imodify, ier)
402 dimlens = (/spline_o%n2, 1, 1/)
403 call ezspline_defvar(ncid, trim(zpre)//
'x2', dimlens, real8, imodify, ier)
404 dimlens = (/spline_o%n3, 1, 1/)
405 call ezspline_defvar(ncid, trim(zpre)//
'x3', dimlens, real8, imodify, ier)
406 dimlens = (/in2, in3, 1/)
407 call ezspline_defvar(ncid, trim(zpre)//
'bcval1min', dimlens, real8, imodify, ier)
408 call ezspline_defvar(ncid, trim(zpre)//
'bcval1max', dimlens, real8, imodify, ier)
409 dimlens = (/in1, in3, 1/)
410 call ezspline_defvar(ncid, trim(zpre)//
'bcval2min', dimlens, real8, imodify, ier)
411 call ezspline_defvar(ncid, trim(zpre)//
'bcval2max', dimlens, real8, imodify, ier)
412 dimlens = (/in1, in2, 1/)
413 call ezspline_defvar(ncid, trim(zpre)//
'bcval3min', dimlens, real8, imodify, ier)
414 call ezspline_defvar(ncid, trim(zpre)//
'bcval3max', dimlens, real8, imodify, ier)
418 dimlens = (/in1, in2, in3/)
420 call ezspline_defvar(ncid, trim(zpre)//
'f', dimlens, real8, imodify, ier)
422 dimlens = (/1, 1, 1/)
423 call ezspline_defvar(ncid, trim(zpre)//
'x1min', dimlens, real8, imodify, ier)
424 call ezspline_defvar(ncid, trim(zpre)//
'x1max', dimlens, real8, imodify, ier)
425 call ezspline_defvar(ncid, trim(zpre)//
'ilin1', dimlens, int, imodify, ier)
426 call ezspline_defvar(ncid, trim(zpre)//
'x2min', dimlens, real8, imodify, ier)
427 call ezspline_defvar(ncid, trim(zpre)//
'x2max', dimlens, real8, imodify, ier)
428 call ezspline_defvar(ncid, trim(zpre)//
'ilin2', dimlens, int, imodify, ier)
429 call ezspline_defvar(ncid, trim(zpre)//
'x3min', dimlens, real8, imodify, ier)
430 call ezspline_defvar(ncid, trim(zpre)//
'x3max', dimlens, real8, imodify, ier)
431 call ezspline_defvar(ncid, trim(zpre)//
'ilin3', dimlens, int, imodify, ier)
432 dimlens = (/spline_o%n1, 4, 1/)
433 call ezspline_defvar(ncid, trim(zpre)//
'x1pkg', dimlens, real8, imodify, ier)
434 dimlens = (/spline_o%n2, 4, 1/)
435 call ezspline_defvar(ncid, trim(zpre)//
'x2pkg', dimlens, real8, imodify, ier)
436 dimlens = (/spline_o%n3, 4, 1/)
437 call ezspline_defvar(ncid, trim(zpre)//
'x3pkg', dimlens, real8, imodify, ier)
438 dimlens = (/in0*in1, in2, in3/)
439 call ezspline_defvar(ncid, trim(zpre)//
'fspl', dimlens, real8, imodify, ier)
443 call cdfputvar(ncid, trim(zpre)//
'n1', spline_o%n1, ifail)
444 call cdfputvar(ncid, trim(zpre)//
'n2', spline_o%n2, ifail)
445 call cdfputvar(ncid, trim(zpre)//
'n3', spline_o%n3, ifail)
446 call cdfputvar(ncid, trim(zpre)//
'klookup1', spline_o%klookup1, ifail)
447 call cdfputvar(ncid, trim(zpre)//
'klookup2', spline_o%klookup2, ifail)
448 call cdfputvar(ncid, trim(zpre)//
'klookup3', spline_o%klookup3, ifail)
449 call cdfputvar(ncid, trim(zpre)//
'isHermite', spline_o%isHermite, ifail)
450 call cdfputvar(ncid, trim(zpre)//
'isLinear', spline_o%isLinear, ifail)
451 call cdfputvar(ncid, trim(zpre)//
'isHybrid', spline_o%isHybrid, ifail)
452 call cdfputvar(ncid, trim(zpre)//
'isReady', spline_o%isReady, ifail)
453 call cdfputvar(ncid, trim(zpre)//
'hspline', spline_o%hspline, ifail)
454 call cdfputvar(ncid, trim(zpre)//
'ibctype1', spline_o%ibctype1, ifail)
455 call cdfputvar(ncid, trim(zpre)//
'ibctype2', spline_o%ibctype2, ifail)
456 call cdfputvar(ncid, trim(zpre)//
'ibctype3', spline_o%ibctype3, ifail)
457 call cdfputvar(ncid, trim(zpre)//
'x1', spline_o%x1, ifail)
458 call cdfputvar(ncid, trim(zpre)//
'x2', spline_o%x2, ifail)
459 call cdfputvar(ncid, trim(zpre)//
'x3', spline_o%x3, ifail)
460 call cdfputvar(ncid, trim(zpre)//
'bcval1min', spline_o%bcval1min, ifail)
461 call cdfputvar(ncid, trim(zpre)//
'bcval1max', spline_o%bcval1max, ifail)
462 call cdfputvar(ncid, trim(zpre)//
'bcval2min', spline_o%bcval2min, ifail)
463 call cdfputvar(ncid, trim(zpre)//
'bcval2max', spline_o%bcval2max, ifail)
464 call cdfputvar(ncid, trim(zpre)//
'bcval3min', spline_o%bcval3min, ifail)
465 call cdfputvar(ncid, trim(zpre)//
'bcval3max', spline_o%bcval3max, ifail)
471 if(spline_o%isReady == 1)
then
473 call cdfputvar(ncid, trim(zpre)//
'f', spline_o%fspl(1,:,:,:), ifail)
475 call cdfputvar(ncid, trim(zpre)//
'x1min', spline_o%x1min, ifail)
476 call cdfputvar(ncid, trim(zpre)//
'x1max', spline_o%x1max, ifail)
477 call cdfputvar(ncid, trim(zpre)//
'ilin1', spline_o%ilin1, ifail)
478 call cdfputvar(ncid, trim(zpre)//
'x2min', spline_o%x2min, ifail)
479 call cdfputvar(ncid, trim(zpre)//
'x2max', spline_o%x2max, ifail)
480 call cdfputvar(ncid, trim(zpre)//
'ilin2', spline_o%ilin2, ifail)
481 call cdfputvar(ncid, trim(zpre)//
'x3min', spline_o%x3min, ifail)
482 call cdfputvar(ncid, trim(zpre)//
'x3max', spline_o%x3max, ifail)
483 call cdfputvar(ncid, trim(zpre)//
'ilin3', spline_o%ilin3, ifail)
484 call cdfputvar(ncid, trim(zpre)//
'x1pkg', spline_o%x1pkg, ifail)
485 call cdfputvar(ncid, trim(zpre)//
'x2pkg', spline_o%x2pkg, ifail)
486 call cdfputvar(ncid, trim(zpre)//
'x3pkg', spline_o%x3pkg, ifail)
487 call ezspline_cdfput3(ncid, trim(zpre)//
'fspl', spline_o%fspl, &
488 in0*in1, in2, in3, ifail)
496 if(ifail /=0) ier = 17
499 end subroutine ezspline_save3_r8
508 subroutine ezspline_save1_r4(spline_o, filename, ier, &
513 type(EZspline1_r4) :: spline_o
514 character*(*) :: filename
517 integer,
intent(out) :: ier
522 character*(*),
intent(in),
OPTIONAL :: SPL_NAME
526 logical,
intent(in),
OPTIONAL :: FULLSAVE
528 integer ncid, ifail, in0, in1
530 character(2),
parameter :: real4=
'R4'
531 character(3),
parameter :: int=
'INT'
534 logical :: fullsv,imodify
537 if(spline_o%isReady /= 1)
then
542 in0 =
size(spline_o%fspl,1)
543 in1 =
size(spline_o%fspl,2)
545 if(
present(spl_name))
then
546 call ezspline_spl_name_chk(spl_name,ier)
553 if(
present(fullsave))
then
560 call cdfopn(ncid, filename,
'w')
563 call cdfopn(ncid, filename,
'v')
571 dimlens = (/1, 1, 1/)
572 call ezspline_defvar(ncid, trim(zpre)//
'n1', dimlens, int, imodify, ier)
573 call ezspline_defvar(ncid, trim(zpre)//
'klookup1', dimlens, int, imodify, ier)
574 call ezspline_defvar(ncid, trim(zpre)//
'isHermite', dimlens, int, imodify, ier)
575 call ezspline_defvar(ncid, trim(zpre)//
'isLinear', dimlens, int, imodify, ier)
576 call ezspline_defvar(ncid, trim(zpre)//
'isReady', dimlens, int, imodify, ier)
577 dimlens = (/2, 1, 1/)
578 call ezspline_defvar(ncid, trim(zpre)//
'ibctype1', dimlens, int, imodify, ier)
579 dimlens = (/spline_o%n1, 1, 1/)
580 call ezspline_defvar(ncid, trim(zpre)//
'x1', dimlens, real4, imodify, ier)
581 dimlens = (/1, 1, 1/)
582 call ezspline_defvar(ncid, trim(zpre)//
'bcval1min', dimlens, real4, imodify, ier)
583 call ezspline_defvar(ncid, trim(zpre)//
'bcval1max', dimlens, real4, imodify, ier)
587 dimlens = (/spline_o%n1, 1, 1/)
589 call ezspline_defvar(ncid, trim(zpre)//
'f', dimlens, real4, imodify, ier)
591 dimlens = (/1, 1, 1/)
592 call ezspline_defvar(ncid, trim(zpre)//
'x1min', dimlens, real4, imodify, ier)
593 call ezspline_defvar(ncid, trim(zpre)//
'x1max', dimlens, real4, imodify, ier)
594 call ezspline_defvar(ncid, trim(zpre)//
'ilin1', dimlens, int, imodify, ier)
595 dimlens = (/spline_o%n1, 4, 1/)
596 call ezspline_defvar(ncid, trim(zpre)//
'x1pkg', dimlens, real4, imodify, ier)
597 dimlens = (/2, spline_o%n1, 1/)
598 call ezspline_defvar(ncid, trim(zpre)//
'fspl', dimlens, real4, imodify, ier)
602 call cdfputvar(ncid, trim(zpre)//
'n1', spline_o%n1, ifail)
603 call cdfputvar(ncid, trim(zpre)//
'klookup1', spline_o%klookup1, ifail)
604 call cdfputvar(ncid, trim(zpre)//
'isHermite', spline_o%isHermite, ifail)
605 call cdfputvar(ncid, trim(zpre)//
'isLinear', spline_o%isLinear, ifail)
606 call cdfputvar(ncid, trim(zpre)//
'isReady', spline_o%isReady, ifail)
607 call cdfputvar(ncid, trim(zpre)//
'ibctype1', spline_o%ibctype1, ifail)
608 call cdfputvar(ncid, trim(zpre)//
'x1', spline_o%x1, ifail)
609 call cdfputvar(ncid, trim(zpre)//
'bcval1min', spline_o%bcval1min, ifail)
610 call cdfputvar(ncid, trim(zpre)//
'bcval1max', spline_o%bcval1max, ifail)
616 if(spline_o%isReady == 1)
then
618 call cdfputvar(ncid, trim(zpre)//
'f', spline_o%fspl(1,:), ifail)
620 call cdfputvar(ncid, trim(zpre)//
'x1min', spline_o%x1min, ifail)
621 call cdfputvar(ncid, trim(zpre)//
'x1max', spline_o%x1max, ifail)
622 call cdfputvar(ncid, trim(zpre)//
'ilin1', spline_o%ilin1, ifail)
623 call cdfputvar(ncid, trim(zpre)//
'x1pkg', spline_o%x1pkg, ifail)
624 call cdfputvar(ncid, trim(zpre)//
'fspl', spline_o%fspl, ifail)
632 if(ifail /=0) ier = 17
635 end subroutine ezspline_save1_r4
642 subroutine ezspline_save2_r4(spline_o, filename, ier, &
647 type(EZspline2_r4) :: spline_o
648 character*(*) :: filename
651 integer,
intent(out) :: ier
656 character*(*),
intent(in),
OPTIONAL :: SPL_NAME
660 logical,
intent(in),
OPTIONAL :: FULLSAVE
662 integer ncid, ifail, in0, in1, in2
664 character(2),
parameter :: real4=
'R4'
665 character(3),
parameter :: int=
'INT'
668 logical :: fullsv,imodify
671 if(spline_o%isReady /= 1)
then
676 in0 =
size(spline_o%fspl,1)
677 in1 =
size(spline_o%fspl,2)
678 in2 =
size(spline_o%fspl,3)
680 if(
present(spl_name))
then
681 call ezspline_spl_name_chk(spl_name,ier)
688 if(
present(fullsave))
then
695 call cdfopn(ncid, filename,
'w')
698 call cdfopn(ncid, filename,
'v')
706 dimlens = (/1, 1, 1/)
707 call ezspline_defvar(ncid, trim(zpre)//
'n1', dimlens, int, imodify, ier)
708 call ezspline_defvar(ncid, trim(zpre)//
'n2', dimlens, int, imodify, ier)
709 call ezspline_defvar(ncid, trim(zpre)//
'klookup1', dimlens, int, imodify, ier)
710 call ezspline_defvar(ncid, trim(zpre)//
'klookup2', dimlens, int, imodify, ier)
711 call ezspline_defvar(ncid, trim(zpre)//
'isHermite', dimlens, int, imodify, ier)
712 call ezspline_defvar(ncid, trim(zpre)//
'isLinear', dimlens, int, imodify, ier)
713 call ezspline_defvar(ncid, trim(zpre)//
'isHybrid', dimlens, int, imodify, ier)
714 call ezspline_defvar(ncid, trim(zpre)//
'isReady', dimlens, int, imodify, ier)
715 dimlens = (/2, 1, 1/)
716 call ezspline_defvar(ncid, trim(zpre)//
'hspline', dimlens, int, imodify, ier)
717 dimlens = (/2, 1, 1/)
718 call ezspline_defvar(ncid, trim(zpre)//
'ibctype1', dimlens, int, imodify, ier)
719 call ezspline_defvar(ncid, trim(zpre)//
'ibctype2', dimlens, int, imodify, ier)
720 dimlens = (/spline_o%n1, 1, 1/)
721 call ezspline_defvar(ncid, trim(zpre)//
'x1', dimlens, real4, imodify, ier)
722 dimlens = (/spline_o%n2, 1, 1/)
723 call ezspline_defvar(ncid, trim(zpre)//
'x2', dimlens, real4, imodify, ier)
724 dimlens = (/in2, 1, 1/)
725 call ezspline_defvar(ncid, trim(zpre)//
'bcval1min', dimlens, real4, imodify, ier)
726 call ezspline_defvar(ncid, trim(zpre)//
'bcval1max', dimlens, real4, imodify, ier)
727 dimlens = (/in1, 1, 1/)
728 call ezspline_defvar(ncid, trim(zpre)//
'bcval2min', dimlens, real4, imodify, ier)
729 call ezspline_defvar(ncid, trim(zpre)//
'bcval2max', dimlens, real4, imodify, ier)
733 dimlens = (/in1, in2, 1/)
735 call ezspline_defvar(ncid, trim(zpre)//
'f', dimlens, real4, imodify, ier)
737 dimlens = (/1, 1, 1/)
738 call ezspline_defvar(ncid, trim(zpre)//
'x1min', dimlens, real4, imodify, ier)
739 call ezspline_defvar(ncid, trim(zpre)//
'x1max', dimlens, real4, imodify, ier)
740 call ezspline_defvar(ncid, trim(zpre)//
'ilin1', dimlens, int, imodify, ier)
741 call ezspline_defvar(ncid, trim(zpre)//
'x2min', dimlens, real4, imodify, ier)
742 call ezspline_defvar(ncid, trim(zpre)//
'x2max', dimlens, real4, imodify, ier)
743 call ezspline_defvar(ncid, trim(zpre)//
'ilin2', dimlens, int, imodify, ier)
744 dimlens = (/spline_o%n1, 4, 1/)
745 call ezspline_defvar(ncid, trim(zpre)//
'x1pkg', dimlens, real4, imodify, ier)
746 dimlens = (/spline_o%n2, 4, 1/)
747 call ezspline_defvar(ncid, trim(zpre)//
'x2pkg', dimlens, real4, imodify, ier)
748 dimlens = (/in0, in1, in2/)
749 call ezspline_defvar(ncid, trim(zpre)//
'fspl', dimlens, real4, imodify, ier)
753 call cdfputvar(ncid, trim(zpre)//
'n1', spline_o%n1, ifail)
754 call cdfputvar(ncid, trim(zpre)//
'n2', spline_o%n2, ifail)
755 call cdfputvar(ncid, trim(zpre)//
'klookup1', spline_o%klookup1, ifail)
756 call cdfputvar(ncid, trim(zpre)//
'klookup2', spline_o%klookup2, ifail)
757 call cdfputvar(ncid, trim(zpre)//
'isHermite', spline_o%isHermite, ifail)
758 call cdfputvar(ncid, trim(zpre)//
'isLinear', spline_o%isLinear, ifail)
759 call cdfputvar(ncid, trim(zpre)//
'isHybrid', spline_o%isHybrid, ifail)
760 call cdfputvar(ncid, trim(zpre)//
'isReady', spline_o%isReady, ifail)
761 call cdfputvar(ncid, trim(zpre)//
'hspline', spline_o%hspline, ifail)
762 call cdfputvar(ncid, trim(zpre)//
'ibctype1', spline_o%ibctype1, ifail)
763 call cdfputvar(ncid, trim(zpre)//
'ibctype2', spline_o%ibctype2, ifail)
764 call cdfputvar(ncid, trim(zpre)//
'x1', spline_o%x1, ifail)
765 call cdfputvar(ncid, trim(zpre)//
'x2', spline_o%x2, ifail)
766 call cdfputvar(ncid, trim(zpre)//
'bcval1min', spline_o%bcval1min, ifail)
767 call cdfputvar(ncid, trim(zpre)//
'bcval1max', spline_o%bcval1max, ifail)
768 call cdfputvar(ncid, trim(zpre)//
'bcval2min', spline_o%bcval2min, ifail)
769 call cdfputvar(ncid, trim(zpre)//
'bcval2max', spline_o%bcval2max, ifail)
775 if(spline_o%isReady == 1)
then
777 call cdfputvar(ncid, trim(zpre)//
'f', spline_o%fspl(1,:,:), ifail)
779 call cdfputvar(ncid, trim(zpre)//
'x1min', spline_o%x1min, ifail)
780 call cdfputvar(ncid, trim(zpre)//
'x1max', spline_o%x1max, ifail)
781 call cdfputvar(ncid, trim(zpre)//
'ilin1', spline_o%ilin1, ifail)
782 call cdfputvar(ncid, trim(zpre)//
'x2min', spline_o%x2min, ifail)
783 call cdfputvar(ncid, trim(zpre)//
'x2max', spline_o%x2max, ifail)
784 call cdfputvar(ncid, trim(zpre)//
'ilin2', spline_o%ilin2, ifail)
785 call cdfputvar(ncid, trim(zpre)//
'x1pkg', spline_o%x1pkg, ifail)
786 call cdfputvar(ncid, trim(zpre)//
'x2pkg', spline_o%x2pkg, ifail)
787 call cdfputvar(ncid, trim(zpre)//
'fspl', spline_o%fspl, ifail)
795 if(ifail /=0) ier = 17
798 end subroutine ezspline_save2_r4
810 subroutine ezspline_save3_r4(spline_o, filename, ier, &
815 type(EZspline3_r4) :: spline_o
816 character*(*) :: filename
819 integer,
intent(out) :: ier
824 character*(*),
intent(in),
OPTIONAL :: SPL_NAME
828 logical,
intent(in),
OPTIONAL :: FULLSAVE
830 integer ncid, ifail, in0, in1, in2, in3
832 character(2),
parameter :: real4=
'R4'
833 character(3),
parameter :: int=
'INT'
836 logical :: fullsv,imodify
839 if(spline_o%isReady /= 1)
then
844 in0 =
size(spline_o%fspl,1)
845 in1 =
size(spline_o%fspl,2)
846 in2 =
size(spline_o%fspl,3)
847 in3 =
size(spline_o%fspl,4)
849 if(
present(spl_name))
then
850 call ezspline_spl_name_chk(spl_name,ier)
857 if(
present(fullsave))
then
864 call cdfopn(ncid, filename,
'w')
867 call cdfopn(ncid, filename,
'v')
875 dimlens = (/1, 1, 1/)
876 call ezspline_defvar(ncid, trim(zpre)//
'n1', dimlens, int, imodify, ier)
877 call ezspline_defvar(ncid, trim(zpre)//
'n2', dimlens, int, imodify, ier)
878 call ezspline_defvar(ncid, trim(zpre)//
'n3', dimlens, int, imodify, ier)
879 call ezspline_defvar(ncid, trim(zpre)//
'klookup1', dimlens, int, imodify, ier)
880 call ezspline_defvar(ncid, trim(zpre)//
'klookup2', dimlens, int, imodify, ier)
881 call ezspline_defvar(ncid, trim(zpre)//
'klookup3', dimlens, int, imodify, ier)
882 call ezspline_defvar(ncid, trim(zpre)//
'isHermite', dimlens, int, imodify, ier)
883 call ezspline_defvar(ncid, trim(zpre)//
'isLinear', dimlens, int, imodify, ier)
884 call ezspline_defvar(ncid, trim(zpre)//
'isHybrid', dimlens, int, imodify, ier)
885 call ezspline_defvar(ncid, trim(zpre)//
'isReady', dimlens, int, imodify, ier)
886 dimlens = (/3, 1, 1/)
887 call ezspline_defvar(ncid, trim(zpre)//
'hspline', dimlens, int, imodify, ier)
888 dimlens = (/2, 1, 1/)
889 call ezspline_defvar(ncid, trim(zpre)//
'ibctype1', dimlens, int, imodify, ier)
890 call ezspline_defvar(ncid, trim(zpre)//
'ibctype2', dimlens, int, imodify, ier)
891 call ezspline_defvar(ncid, trim(zpre)//
'ibctype3', dimlens, int, imodify, ier)
892 dimlens = (/spline_o%n1, 1, 1/)
893 call ezspline_defvar(ncid, trim(zpre)//
'x1', dimlens, real4, imodify, ier)
894 dimlens = (/spline_o%n2, 1, 1/)
895 call ezspline_defvar(ncid, trim(zpre)//
'x2', dimlens, real4, imodify, ier)
896 dimlens = (/spline_o%n3, 1, 1/)
897 call ezspline_defvar(ncid, trim(zpre)//
'x3', dimlens, real4, imodify, ier)
898 dimlens = (/in2, in3, 1/)
899 call ezspline_defvar(ncid, trim(zpre)//
'bcval1min', dimlens, real4, imodify, ier)
900 call ezspline_defvar(ncid, trim(zpre)//
'bcval1max', dimlens, real4, imodify, ier)
901 dimlens = (/in1, in3, 1/)
902 call ezspline_defvar(ncid, trim(zpre)//
'bcval2min', dimlens, real4, imodify, ier)
903 call ezspline_defvar(ncid, trim(zpre)//
'bcval2max', dimlens, real4, imodify, ier)
904 dimlens = (/in1, in2, 1/)
905 call ezspline_defvar(ncid, trim(zpre)//
'bcval3min', dimlens, real4, imodify, ier)
906 call ezspline_defvar(ncid, trim(zpre)//
'bcval3max', dimlens, real4, imodify, ier)
910 dimlens = (/in1, in2, in3/)
912 call ezspline_defvar(ncid, trim(zpre)//
'f', dimlens, real4, imodify, ier)
914 dimlens = (/1, 1, 1/)
915 call ezspline_defvar(ncid, trim(zpre)//
'x1min', dimlens, real4, imodify, ier)
916 call ezspline_defvar(ncid, trim(zpre)//
'x1max', dimlens, real4, imodify, ier)
917 call ezspline_defvar(ncid, trim(zpre)//
'ilin1', dimlens, int, imodify, ier)
918 call ezspline_defvar(ncid, trim(zpre)//
'x2min', dimlens, real4, imodify, ier)
919 call ezspline_defvar(ncid, trim(zpre)//
'x2max', dimlens, real4, imodify, ier)
920 call ezspline_defvar(ncid, trim(zpre)//
'ilin2', dimlens, int, imodify, ier)
921 call ezspline_defvar(ncid, trim(zpre)//
'x3min', dimlens, real4, imodify, ier)
922 call ezspline_defvar(ncid, trim(zpre)//
'x3max', dimlens, real4, imodify, ier)
923 call ezspline_defvar(ncid, trim(zpre)//
'ilin3', dimlens, int, imodify, ier)
924 dimlens = (/spline_o%n1, 4, 1/)
925 call ezspline_defvar(ncid, trim(zpre)//
'x1pkg', dimlens, real4, imodify, ier)
926 dimlens = (/spline_o%n2, 4, 1/)
927 call ezspline_defvar(ncid, trim(zpre)//
'x2pkg', dimlens, real4, imodify, ier)
928 dimlens = (/spline_o%n3, 4, 1/)
929 call ezspline_defvar(ncid, trim(zpre)//
'x3pkg', dimlens, real4, imodify, ier)
930 dimlens = (/in0*in1, in2, in3/)
931 call ezspline_defvar(ncid, trim(zpre)//
'fspl', dimlens, real4, imodify, ier)
935 call cdfputvar(ncid, trim(zpre)//
'n1', spline_o%n1, ifail)
936 call cdfputvar(ncid, trim(zpre)//
'n2', spline_o%n2, ifail)
937 call cdfputvar(ncid, trim(zpre)//
'n3', spline_o%n3, ifail)
938 call cdfputvar(ncid, trim(zpre)//
'klookup1', spline_o%klookup1, ifail)
939 call cdfputvar(ncid, trim(zpre)//
'klookup2', spline_o%klookup2, ifail)
940 call cdfputvar(ncid, trim(zpre)//
'klookup3', spline_o%klookup3, ifail)
941 call cdfputvar(ncid, trim(zpre)//
'isHermite', spline_o%isHermite, ifail)
942 call cdfputvar(ncid, trim(zpre)//
'isLinear', spline_o%isLinear, ifail)
943 call cdfputvar(ncid, trim(zpre)//
'isHybrid', spline_o%isHybrid, ifail)
944 call cdfputvar(ncid, trim(zpre)//
'isReady', spline_o%isReady, ifail)
945 call cdfputvar(ncid, trim(zpre)//
'hspline', spline_o%hspline, ifail)
946 call cdfputvar(ncid, trim(zpre)//
'ibctype1', spline_o%ibctype1, ifail)
947 call cdfputvar(ncid, trim(zpre)//
'ibctype2', spline_o%ibctype2, ifail)
948 call cdfputvar(ncid, trim(zpre)//
'ibctype3', spline_o%ibctype3, ifail)
949 call cdfputvar(ncid, trim(zpre)//
'x1', spline_o%x1, ifail)
950 call cdfputvar(ncid, trim(zpre)//
'x2', spline_o%x2, ifail)
951 call cdfputvar(ncid, trim(zpre)//
'x3', spline_o%x3, ifail)
952 call cdfputvar(ncid, trim(zpre)//
'bcval1min', spline_o%bcval1min, ifail)
953 call cdfputvar(ncid, trim(zpre)//
'bcval1max', spline_o%bcval1max, ifail)
954 call cdfputvar(ncid, trim(zpre)//
'bcval2min', spline_o%bcval2min, ifail)
955 call cdfputvar(ncid, trim(zpre)//
'bcval2max', spline_o%bcval2max, ifail)
956 call cdfputvar(ncid, trim(zpre)//
'bcval3min', spline_o%bcval3min, ifail)
957 call cdfputvar(ncid, trim(zpre)//
'bcval3max', spline_o%bcval3max, ifail)
963 if(spline_o%isReady == 1)
then
965 call cdfputvar(ncid, trim(zpre)//
'f', spline_o%fspl(1,:,:,:), ifail)
967 call cdfputvar(ncid, trim(zpre)//
'x1min', spline_o%x1min, ifail)
968 call cdfputvar(ncid, trim(zpre)//
'x1max', spline_o%x1max, ifail)
969 call cdfputvar(ncid, trim(zpre)//
'ilin1', spline_o%ilin1, ifail)
970 call cdfputvar(ncid, trim(zpre)//
'x2min', spline_o%x2min, ifail)
971 call cdfputvar(ncid, trim(zpre)//
'x2max', spline_o%x2max, ifail)
972 call cdfputvar(ncid, trim(zpre)//
'ilin2', spline_o%ilin2, ifail)
973 call cdfputvar(ncid, trim(zpre)//
'x3min', spline_o%x3min, ifail)
974 call cdfputvar(ncid, trim(zpre)//
'x3max', spline_o%x3max, ifail)
975 call cdfputvar(ncid, trim(zpre)//
'ilin3', spline_o%ilin3, ifail)
976 call cdfputvar(ncid, trim(zpre)//
'x1pkg', spline_o%x1pkg, ifail)
977 call cdfputvar(ncid, trim(zpre)//
'x2pkg', spline_o%x2pkg, ifail)
978 call cdfputvar(ncid, trim(zpre)//
'x3pkg', spline_o%x3pkg, ifail)
979 call ezspline_cdfput3(ncid, trim(zpre)//
'fspl', spline_o%fspl, &
980 in0*in1, in2, in3, ifail)
988 if(ifail /=0) ier = 17
991 end subroutine ezspline_save3_r4
993 subroutine ezspline_spl_name_chk(spl_name,ier)
994 character*(*),
intent(in) :: spl_name
995 integer,
intent(out) :: ier
998 integer :: ic,ilen,indx
999 character*63 :: zlegal = &
1000 '0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
1004 ilen = len(trim(spl_name))
1008 else if(ilen.gt.20)
then
1011 indx=index(zlegal,spl_name(1:1))
1016 indx=index(zlegal,spl_name(ic:ic))
1017 if(indx.le.0) ier=52
1022 end subroutine ezspline_spl_name_chk
1024 subroutine ezspline_defvar(ncid, name, dimlens, ztype, imodify, ier)
1031 integer,
intent(in) :: ncid
1032 character*(*),
intent(in) :: name
1033 integer,
intent(in) :: dimlens(3)
1034 character*(*),
intent(in) :: ztype
1035 logical,
intent(in) :: imodify
1037 integer,
intent(inout) :: ier
1041 character*10 :: ztype_loc
1042 integer :: dimlens_loc(3),id1,id2,ii
1043 integer :: ifail,ivarid
1046 if(.not.imodify)
then
1050 call cdfdefvar(ncid, name, dimlens, ztype, ifail)
1051 if(ifail.ne.0) ier=42
1055 ifail = nf_inq_varid(ncid, name, ivarid)
1060 call cdfdefvar(ncid, name, dimlens, ztype, ifail)
1061 if(ifail.ne.0) ier=42
1067 call cdfinqvar(ncid, name, dimlens_loc, ztype_loc, ifail)
1068 if(ztype.ne.ztype_loc)
then
1073 id1=max(1,dimlens(ii))
1074 id2=max(1,dimlens_loc(ii))
1075 if(id1.ne.id2) ier=53
1085 end subroutine ezspline_defvar