[Dart-dev] DART/branches Revision: 12633

dart at ucar.edu dart at ucar.edu
Tue Jun 5 14:29:01 MDT 2018


nancy at ucar.edu
2018-06-05 14:29:00 -0600 (Tue, 05 Jun 2018)
35
update this on my changes branch.




Modified: DART/branches/rma_trunk/assimilation_code/modules/utilities/netcdf_utilities_mod.f90
===================================================================
--- DART/branches/rma_trunk/assimilation_code/modules/utilities/netcdf_utilities_mod.f90	2018-06-05 20:26:18 UTC (rev 12632)
+++ DART/branches/rma_trunk/assimilation_code/modules/utilities/netcdf_utilities_mod.f90	2018-06-05 20:29:00 UTC (rev 12633)
@@ -6,21 +6,25 @@
 
 module netcdf_utilities_mod
 
-!>@todo FIXME: NEEDS MUCH MORE WORK.
+!> a module to streamline the code that calls netcdf routines. 
 !>
-!> start of a module to help streamline the code that
-!> calls netcdf routines.  usually adds error checking.
+!> calling code should NOT have to use the netcdf module, nor see
+!> any netcdf ID values, types, lengths, etc.  this code does error 
+!> checking and reports the offending call, filename, and user-supplied 
+!> context (often the 'routine' variable with the calling subroutine name).
 !> 
-!> also isolates as much access to the netcdf libs to routines
-!> inside this module.
+!> isolates access to the netcdf libs to routines inside this module.
 !>
-!> routines in this file are prefixed with nc_
+!> routines in this file are prefixed with nc_ and attempt to say
+!> in english what they do.  the intent is someone who does not know
+!> anything about netcdf can still use these.
 !>
-!> the intent is that these are simple routines that aren't trying to
-!> handle all possible options.  if you have complicated needs, write your
-!> own specialized routine, either here or in the calling code.
+!> these are simple routines that can't possibly handle all options.  
+!> if you have complicated needs, write your own specialized routine, 
+!> either here or in the calling code.
 !> for example, the 'put_var' routine here doesn't have start or count, 
 !> intentionally, for array entries.
+!>
 
 
 use types_mod, only : r4, r8, digits12, i2, i4, i8, PI, MISSING_R8, MISSING_I
@@ -37,6 +41,9 @@
           nc_add_attribute_to_variable,   &
           nc_get_attribute_from_variable, &
           nc_define_dimension,            &
+          nc_define_unlimited_dimension,  &
+          nc_get_dimension_size,          &
+          nc_define_character_variable,   &
           nc_define_integer_variable,     &
           nc_define_real_variable,        &
           nc_define_double_variable,      &
@@ -91,6 +98,11 @@
    module procedure nc_get_real_array_att_from_var
 end interface
 
+interface nc_define_character_variable
+   module procedure nc_define_var_char_1d
+   module procedure nc_define_var_char_Nd
+end interface
+
 interface nc_define_integer_variable
    module procedure nc_define_var_int_1d
    module procedure nc_define_var_int_Nd
@@ -107,10 +119,12 @@
 end interface
 
 interface nc_put_variable
+   module procedure nc_put_char_1d
    module procedure nc_put_single_int_1d
    module procedure nc_put_int_1d
    module procedure nc_put_single_real_1d
    module procedure nc_put_real_1d
+   module procedure nc_put_char_2d
    module procedure nc_put_int_2d
    module procedure nc_put_real_2d
    module procedure nc_put_int_3d
@@ -584,7 +598,7 @@
 
 !--------------------------------------------------------------------
 !--------------------------------------------------------------------
-! defining dimensions section
+! dimensions section
 
 subroutine nc_define_dimension(ncid, dimname, dimlen, context, filename)
 
@@ -603,7 +617,45 @@
 end subroutine nc_define_dimension
 
 !--------------------------------------------------------------------
+
+subroutine nc_define_unlimited_dimension(ncid, dimname, context, filename)
+
+integer,          intent(in) :: ncid
+character(len=*), intent(in) :: dimname
+character(len=*), intent(in), optional :: context
+character(len=*), intent(in), optional :: filename
+
+character(len=*), parameter :: routine = 'nc_define_unlimited_dimension'
+integer :: ret, dimid
+
+ret = nf90_def_dim(ncid, dimname, NF90_UNLIMITED, dimid)
+call nc_check(ret, routine, 'define unlimited dimension '//trim(dimname), context, filename, ncid)
+


More information about the Dart-dev mailing list