-
Notifications
You must be signed in to change notification settings - Fork 6
/
mo_netcdf.f90
3450 lines (2718 loc) · 109 KB
/
mo_netcdf.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!> \file mo_netcdf.f90
!> \brief NetCDF Fortran 90 interface wrapper.
!> \details A thin wrapper around the NetCDF Fortran 90 interface.
!> There are currently 3 derived types provided:
!> 1. NcDataset
!> 2. NcDimension
!> 3. NcVariable
!>
!> This is a fork on 12.12.2016 of David Schaefer's mo_netcdf module at https://github.com/schaefed/mo_netcdf
!> This version can be used with netCDF3 instead of netCDF4 using the preprocessor flag -DNETCDF3.
!> The original module supports in its current version more netCDF4-specific features such as groups,
!> which are incompatible with netCDF3.
!> \authors David Schaefer
!> \date Jun 2015
module mo_netcdf
! This module provides a thin wrapper around the NetCDF Fortran 90 interface,
! following a somehow object-oriented approach.
! Written David Schaefer, Jun 2015
! Modified Matthias Cuntz, Jan 2016 - no automatic allocation of left-hand-side (e.g. PGI Fortran rev 15.9)
! Stephan Thober, Oct 2016 - count->cnt
! Matthias Cuntz, Nov 2016 - NETCDF3
! Matthias Cuntz, Jan 2017 - getNoDimensions on NcDataset,
! i.e. getNoDimension->getNoDimension_variable, and new getNoDimension_dataset
! Matthias Cuntz, Oct 2017 - netCDF creation mode flag in initNcDataset
! License
! -------
! This file is part of the JAMS Fortran package, distributed under the MIT License.
!
! Copyright (c) 2015-2017 David Schaefer, Matthias Cuntz - mc (at) macu (dot) de
!
! Permission is hereby granted, free of charge, to any person obtaining a copy
! of this software and associated documentation files (the "Software"), to deal
! in the Software without restriction, including without limitation the rights
! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! copies of the Software, and to permit persons to whom the Software is
! furnished to do so, subject to the following conditions:
!
! The above copyright notice and this permission notice shall be included in all
! copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
! SOFTWARE.
use mo_kind, only: i1, i2, i4, sp, dp
use netcdf, only: &
nf90_open, nf90_close, nf90_strerror, nf90_def_dim, nf90_def_var, &
nf90_put_var, nf90_get_var, nf90_put_att, nf90_get_att, &
nf90_inquire, nf90_inq_dimid, nf90_inquire_dimension, &
nf90_inq_varid, nf90_inquire_variable, nf90_inquire_attribute, &
NF90_OPEN, NF90_CREATE, NF90_WRITE, NF90_NOWRITE, &
NF90_BYTE, NF90_SHORT, NF90_INT, NF90_FLOAT, NF90_DOUBLE, &
NF90_FILL_BYTE, NF90_FILL_SHORT, NF90_FILL_INT, NF90_FILL_FLOAT, NF90_FILL_DOUBLE, &
NF90_NOERR, NF90_UNLIMITED, NF90_GLOBAL, nf90_redef, nf90_enddef
#ifndef __NETCDF3__
use netcdf, only: NF90_NETCDF4, nf90_inq_varids, nf90_def_var_fill
#else
use netcdf, only: NF90_64BIT_OFFSET
#endif
implicit none
! --------------------------------------------------------------------------------------
!
! NAME
! NcDataset
!
! PURPOSE
!> \brief Provides basic file modification functionality
!> \details Bound to this derived type is the basic file level create/retrieve
!> functionality, i.e. functions/subroutines to create/retrieve
!> dimensions, variables and global attributes.
!> Files created by this derived type and its procedures are NF90_NETCDF4 by default
!> but this can be set with cmode keyword.
!> The supported modes are:
!> r: read
!> w: write/create
!< a: alter
!
! INTENT(IN)
!> \param[in] "character(*) :: fname"
!> \param[in] "character(1) :: mode"
!
! INTENT(IN), OPTIONAL
!> \param[in] "integer(i4) :: cmode - The creation mode flag for mode 'r'.
!> The following flags should be used:
!> NF90_NETCDF4, NF90_64BIT_OFFSET, NF90_CLASSIC_MODEL,
!> or any combinatin with NF90_CLOBBER, etc."
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return "type(NcDataset)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! --------------------------------------------------------------------------------------
type NcDataset
character(256) :: fname !> Filename of the opened dataset
character(1) :: mode !> File open mode
integer(i4) :: id !> NetCDF id
contains
procedure, public :: initNcDataset
procedure, public :: getNoVariables
procedure, public :: getVariableIds
procedure, public :: getVariables
procedure, private :: setGlobalAttributeChar
procedure, private :: setGlobalAttributeI8
procedure, private :: setGlobalAttributeI16
procedure, private :: setGlobalAttributeI32
procedure, private :: setGlobalAttributeF32
procedure, private :: setGlobalAttributeF64
procedure, private :: getGlobalAttributeChar
procedure, private :: getGlobalAttributeI8
procedure, private :: getGlobalAttributeI16
procedure, private :: getGlobalAttributeI32
procedure, private :: getGlobalAttributeF32
procedure, private :: getGlobalAttributeF64
! -----------------------------------------------------------------------------------
!
! NAME
! getNoDimensions
!
! PURPOSE
!> \brief Retrieve the number of dimensions
!> \details Return the number of dimensions associated with netcdf file
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "integer(i4)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author Matthias Cuntz
! \date Jan 2017
!
! -----------------------------------------------------------------------------------
procedure, public :: getNoDimensions => getNoDimensions_dataset
procedure, private :: getDimensionByName
procedure, private :: getDimensionById
procedure, private :: setVariableScalar
procedure, private :: setVariableWithDimTypes
procedure, private :: setVariableWithDimNames
procedure, private :: setVariableWithDimIds
procedure, private :: getVariableByName
! -----------------------------------------------------------------------------------
!
! NAME
! hasVariable
!
! PURPOSE
!> \brief Check if variable exists
!> \details Returns true if a variable with the given name exists, false
!> otherwise.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return "logical"
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: hasVariable
! -----------------------------------------------------------------------------------
!
! NAME
! hasDimension
!
! PURPOSE
!> \brief Check if dimension exists
!> \details Returns true if a dimension with the given name exists, false
!> otherwise.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return "logical"
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: hasDimension
! -----------------------------------------------------------------------------------
!
! NAME
! getUnlimitedDimension
!
! PURPOSE
!> \brief Return the unlimited dimension of the dataset
!> \details Returns the NcDimension derived type of the unlimited dimension.
!> The program will teminate abruptly if no such dimension exists.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return "logical"
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: getUnlimitedDimension
! -----------------------------------------------------------------------------------
!
! NAME
! isUnlimited
!
! PURPOSE
!> \brief Check if the dataset is unlimited
!> \details Returns true if the dataset contains an unlimited dimension,
!> false otherwise.
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return "logical"
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: isUnlimited => isDatasetUnlimited
! -----------------------------------------------------------------------------------
!
! NAME
! close
!
! PURPOSE
!> \brief Close the datset
!> \details Close the NetCDF datset. The program will teminate abruptly if
!> the file cannot be closed correctly.
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! None
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: close
! -----------------------------------------------------------------------------------
!
! NAME
! setDimension
!
! PURPOSE
!> \brief Create a new dimension
!> \details Create a new dimension of given length. A length < 0 indicates an
!> unlimited dimension. The program will teminate abruptly if the
!> dimension cannot be created.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!> \param[in] "integer(i4) :: length"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return NcDimension
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: setDimension
! -----------------------------------------------------------------------------------
!
! NAME
! setAttribute
!
! PURPOSE
!> \brief Create a new global Attribute
!> \details Create a new global attribute from given name and value.
!> The program will teminate abruptly if the attribute cannot be
!> created.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!> \param[in] "character(*)/integer(i4)/real(sp)/real(dp) :: value"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! None
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
generic, public :: setAttribute => &
setGlobalAttributeChar, &
setGlobalAttributeI8, &
setGlobalAttributeI16, &
setGlobalAttributeI32, &
setGlobalAttributeF32, &
setGlobalAttributeF64
! -----------------------------------------------------------------------------------
!
! NAME
! getAttribute
!
! PURPOSE
!> \brief Retrieve global attribute value
!> \details Retrieve the value for a global attribute specified by its name.
!> The program will teminate abruptly if the attribute does not
!> exist.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
!> \param[out] "character(*)/integer(i4)/real(sp)/real(dp) :: value"
!
! RETURN
! None
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
generic, public :: getAttribute => &
getGlobalAttributeChar, &
getGlobalAttributeI8, &
getGlobalAttributeI16, &
getGlobalAttributeI32, &
getGlobalAttributeF32, &
getGlobalAttributeF64
! -----------------------------------------------------------------------------------
!
! NAME
! getDimension
!
! PURPOSE
!> \brief Retrieve NcDimension
!> \details Retrieve the NcDimension derived type for the dimension specified by
!> its name or id. The program will terminate abruptly if no such
!> dimension exists.
!
! INTENT(IN)
!> \param[in] "character(*)/integer(i4) :: name/id"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return NcDimension
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
generic, public :: getDimension => &
getDimensionById, &
getDimensionByName
! -----------------------------------------------------------------------------------
!
! NAME
! setVariable
!
! PURPOSE
!> \brief Create a NetCDF variable
!> \details Create a NetCDF Variable with given name, data type and dimensions.
!> All optional arguments to the nf90_def_var function are supported.
!> The program will teminate abruptly if the variable cannot be
!> created.
!> Supported data types and their string encodings:
!> NF90_BYTE -> "i8"
!> NF90_SHORT -> "i16"
!> NF90_INT -> "i32"
!> NF90_FLOAT -> "f32"
!> NF90_DOUBLE -> "f64"
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!> \param[in] "character(3) :: dtype"
!
! INTENT(IN), OPTIONAL
!> \param[in] "integer(i4)/character(*)/type(NcDataset) :: dimensions(:)"
!> \param[in] "logical :: contiguous"
!> \param[in] "integer(i4) :: chunksizes(:)"
!> \param[in] "integer(i4) :: deflate_level"
!> \param[in] "logical :: shuffle"
!> \param[in] "logical :: fletcher32"
!> \param[in] "integer(i4) :: endianess"
!> \param[in] "integer(i4) :: cache_size"
!> \param[in] "integer(i4) :: cache_nelems"
!> \param[in] "integer(i4) :: cache_preemption"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return NcVariable
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
generic, public :: setVariable => &
setVariableScalar, &
setVariableWithDimNames, &
setVariableWithDimTypes, &
setVariableWithDimIds
! -----------------------------------------------------------------------------------
!
! NAME
! getVariable
!
! PURPOSE
!> \brief Retrieve NcVariable
!> \details Retrieve the NcVariable derived type for the variable specified by its
!> name. The program will teminate abruptly if no such dimension
!> exists.
!
! INTENT(IN)
!> \param[in] "character(*) :: name"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return NcVariable
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
generic, public :: getVariable => &
getVariableByName
end type NcDataset
interface NcDataset
procedure newNcDataset
end interface NcDataset
! --------------------------------------------------------------------------------------
!
! NAME
! NcDimension
!
! PURPOSE
!> \brief Provides the dimension access functionality
!> \details Bound to this derived type is some necessary inquire functionality.
!> This type is not to be instantiated directly! Use the
!> getDimension/setDimension functions of a NcDataset instance as a
!> "constructor".
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! None
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! --------------------------------------------------------------------------------------
type NcDimension
integer(i4) :: id !> The NetCDF dimension id
type(NcDataset) :: parent !> The dimension's parent
contains
procedure, public :: initNcDimension
procedure, public :: getName => getDimensionName
! -----------------------------------------------------------------------------------
!
! NAME
! getLength
!
! PURPOSE
!> \brief Retrieve the dimension length
!> \details Return the length of the dimension
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "integer(i4)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: getLength => getDimensionLength
! -----------------------------------------------------------------------------------
!
! NAME
! isUnlimited
!
! PURPOSE
!> \brief Check if the dimension is unlimited
!> \details Returns true if the dimension is unlimited, false otherwise.
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
!> \return "logical"
!
! EXAMPLE
! See test file
!
! HISTORY
!> \author David Schaefer
!> \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: isUnlimited => isUnlimitedDimension
end type NcDimension
interface NcDimension
procedure newNcDimension
end interface NcDimension
interface operator (==)
procedure equalNcDimensions
end interface operator (==)
! --------------------------------------------------------------------------------------
!
! NAME
! NcVariable
!
! PURPOSE
!> \brief Provides the variable releated read/write functionality
!> \details Bound to this derived type is the main variable related NetCDF
!> functionality, i.e. reading/writing data and attributes, as well
!> as some inquire procedures.
!> This type is not to be instatiated directly, instead the
!> getVariable/setVariable functions of a NcDataset instance should
!> be used as a "constructor".
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! None
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! --------------------------------------------------------------------------------------
type NcVariable
integer(i4) :: id !> Variable id
type(NcDataset) :: parent !> The variables's parent
! character(256) :: name !> Variable name
contains
procedure, public :: initNcVariable
procedure, public :: getName => getVariableName
procedure, private :: setVariableAttributeChar
procedure, private :: setVariableAttributeI8
procedure, private :: setVariableAttributeI16
procedure, private :: setVariableAttributeI32
procedure, private :: setVariableAttributeF32
procedure, private :: setVariableAttributeF64
procedure, private :: getVariableAttributeChar
procedure, private :: getVariableAttributeI8
procedure, private :: getVariableAttributeI16
procedure, private :: getVariableAttributeI32
procedure, private :: getVariableAttributeF32
procedure, private :: getVariableAttributeF64
procedure, private :: putDataScalarI8
procedure, private :: putData1dI8
procedure, private :: putData2dI8
procedure, private :: putData3dI8
procedure, private :: putData4dI8
procedure, private :: putData5dI8
procedure, private :: putDataScalarI16
procedure, private :: putData1dI16
procedure, private :: putData2dI16
procedure, private :: putData3dI16
procedure, private :: putData4dI16
procedure, private :: putData5dI16
procedure, private :: putDataScalarI32
procedure, private :: putData1dI32
procedure, private :: putData2dI32
procedure, private :: putData3dI32
procedure, private :: putData4dI32
procedure, private :: putData5dI32
procedure, private :: putDataScalarF32
procedure, private :: putData1dF32
procedure, private :: putData2dF32
procedure, private :: putData3dF32
procedure, private :: putData4dF32
procedure, private :: putData5dF32
procedure, private :: putDataScalarF64
procedure, private :: putData1dF64
procedure, private :: putData2dF64
procedure, private :: putData3dF64
procedure, private :: putData4dF64
procedure, private :: putData5dF64
procedure, private :: getDataScalarI8
procedure, private :: getData1dI8
procedure, private :: getData2dI8
procedure, private :: getData3dI8
procedure, private :: getData4dI8
procedure, private :: getData5dI8
procedure, private :: getDataScalarI16
procedure, private :: getData1dI16
procedure, private :: getData2dI16
procedure, private :: getData3dI16
procedure, private :: getData4dI16
procedure, private :: getData5dI16
procedure, private :: getDataScalarI32
procedure, private :: getData1dI32
procedure, private :: getData2dI32
procedure, private :: getData3dI32
procedure, private :: getData4dI32
procedure, private :: getData5dI32
procedure, private :: getDataScalarF32
procedure, private :: getData1dF32
procedure, private :: getData2dF32
procedure, private :: getData3dF32
procedure, private :: getData4dF32
procedure, private :: getData5dF32
procedure, private :: getDataScalarF64
procedure, private :: getData1dF64
procedure, private :: getData2dF64
procedure, private :: getData3dF64
procedure, private :: getData4dF64
procedure, private :: getData5dF64
procedure, private :: setVariableFillValueI8
procedure, private :: setVariableFillValueI16
procedure, private :: setVariableFillValueI32
procedure, private :: setVariableFillValueF32
procedure, private :: setVariableFillValueF64
procedure, private :: getVariableFillValueI8
procedure, private :: getVariableFillValueI16
procedure, private :: getVariableFillValueI32
procedure, private :: getVariableFillValueF32
procedure, private :: getVariableFillValueF64
! -----------------------------------------------------------------------------------
!
! NAME
! getNoDimensions
!
! PURPOSE
!> \brief Retrieve the number of dimensions
!> \details Return the number of dimensions associated with variable
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "integer(i4)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: getNoDimensions => getNoDimensions_variable
! -----------------------------------------------------------------------------------
!
! NAME
! getDimensions
!
! PURPOSE
!> \brief Retrieve the variable dimensions
!> \details Return the ids of the dimensions associated with variable.
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "integer(i4), alloctable, dimension(:)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: getDimensions => getVariableDimensions
! -----------------------------------------------------------------------------------
!
! NAME
! getShape
!
! PURPOSE
!> \brief Retrieve the shape of the variable
!> \details Return the shape of the variable.
!
! INTENT(IN)
! None
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "integer(i4), alloctable, dimension(:)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: getShape => getVariableShape
! -----------------------------------------------------------------------------------
!
! NAME
! getDtype
!
! PURPOSE
!> \brief Retrieve the variable data type
!> \details Return the encoded data type of the variable.
!> Data type encodeings
!> "i8" -> NF90_BYTE
!> "i16" -> NF90_SHORT
!> "i32" -> NF90_INT
!> "f32" -> NF90_FLOAT
!> "f64" -> NF90_DOUBLE
!
! INTENT(IN)
! None
! INTENT(IN), OPTIONAL
!> \param[in] "logical, optional :: jams" if true, return JAMS kind notation: "i1","i2","i4","sp","dp"
!> if true, return: "i8","i16","i32","f32","f64"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "character(3)"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015
!
! -----------------------------------------------------------------------------------
procedure, public :: getDtype => getVariableDtype
! -----------------------------------------------------------------------------------
!
! NAME
! hasAttribute
!
! PURPOSE
!> \brief Check if attribute exists
!> \details Returns true if an attribute with the given name exists, false
!> otherwise.
!
! INTENT(IN)
! \param[in] "character(*) :: name"
!
! INTENT(INOUT)
! None
!
! INTENT(OUT)
! None
!
! RETURN
! \return "logical"
!
! EXAMPLE
! See test file
!
! HISTORY
! \author David Schaefer
! \date June 2015