[Dart-dev] DART/branches Revision: 12631

dart at ucar.edu dart at ucar.edu
Tue Jun 5 14:22:44 MDT 2018


nancy at ucar.edu
2018-06-05 14:22:44 -0600 (Tue, 05 Jun 2018)
207
add support for things the wrf diagnostic writes needed,
including defining the unlimited dim, adding 4d arrays,
and differentiating between single and double precision
(since wrf is often compiled r8=r4).




Modified: DART/branches/recam/assimilation_code/modules/utilities/netcdf_utilities_mod.f90
===================================================================
--- DART/branches/recam/assimilation_code/modules/utilities/netcdf_utilities_mod.f90	2018-06-05 20:21:49 UTC (rev 12630)
+++ DART/branches/recam/assimilation_code/modules/utilities/netcdf_utilities_mod.f90	2018-06-05 20:22:44 UTC (rev 12631)
@@ -37,6 +37,7 @@
           nc_add_attribute_to_variable,   &
           nc_get_attribute_from_variable, &
           nc_define_dimension,            &
+          nc_define_unlimited_dimension,  &
           nc_define_integer_variable,     &
           nc_define_real_variable,        &
           nc_define_double_variable,      &
@@ -64,8 +65,10 @@
 interface nc_add_global_attribute
    module procedure nc_add_global_char_att
    module procedure nc_add_global_int_att
-   module procedure nc_add_global_real_att
-   module procedure nc_add_global_real_array_att
+   module procedure nc_add_global_float_att
+   module procedure nc_add_global_double_att
+   module procedure nc_add_global_float_array_att
+   module procedure nc_add_global_double_array_att
 end interface
 
 interface nc_get_global_attribute
@@ -79,8 +82,10 @@
    module procedure nc_add_char_att_to_var
    module procedure nc_add_int_array_att_to_var
    module procedure nc_add_int_att_to_var
-   module procedure nc_add_real_att_to_var
-   module procedure nc_add_real_array_att_to_var
+   module procedure nc_add_float_att_to_var
+   module procedure nc_add_double_att_to_var
+   module procedure nc_add_float_array_att_to_var
+   module procedure nc_add_double_array_att_to_var
 end interface
 
 interface nc_get_attribute_from_variable
@@ -115,13 +120,15 @@
    module procedure nc_put_real_2d
    module procedure nc_put_int_3d
    module procedure nc_put_real_3d
+   module procedure nc_put_int_4d
+   module procedure nc_put_real_4d
 end interface
 
 interface nc_get_variable
+   module procedure nc_get_short_1d
    module procedure nc_get_single_int_1d
+   module procedure nc_get_int_1d
    module procedure nc_get_single_real_1d
-   module procedure nc_get_short_1d
-   module procedure nc_get_int_1d
    module procedure nc_get_real_1d
    module procedure nc_get_short_2d
    module procedure nc_get_int_2d
@@ -129,6 +136,8 @@
    module procedure nc_get_short_3d
    module procedure nc_get_int_3d
    module procedure nc_get_real_3d
+   module procedure nc_get_int_4d
+   module procedure nc_get_real_4d
 end interface
 
 interface nc_get_variable_size
@@ -254,40 +263,76 @@
 
 !--------------------------------------------------------------------
 
-subroutine nc_add_global_real_att(ncid, attname, val, context, filename)
+subroutine nc_add_global_float_att(ncid, attname, val, context, filename)
 
 integer,          intent(in) :: ncid
 character(len=*), intent(in) :: attname
-real(r8),         intent(in) :: val
+real(r4),         intent(in) :: val
 character(len=*), intent(in), optional :: context
 character(len=*), intent(in), optional :: filename
 
-character(len=*), parameter :: routine = 'nc_add_global_real_att'
+character(len=*), parameter :: routine = 'nc_add_global_float_att'
 integer :: ret
 
 ret = nf90_put_att(ncid, NF90_GLOBAL, attname, val)
 call nc_check(ret, routine, 'adding the global attribute: '//trim(attname), context, filename, ncid)
 
-end subroutine nc_add_global_real_att
+end subroutine nc_add_global_float_att
 
 !--------------------------------------------------------------------
 
-subroutine nc_add_global_real_array_att(ncid, attname, val, context, filename)
+subroutine nc_add_global_double_att(ncid, attname, val, context, filename)
 
 integer,          intent(in) :: ncid
 character(len=*), intent(in) :: attname
-real(r8),         intent(in) :: val(:)
+real(digits12),   intent(in) :: val
 character(len=*), intent(in), optional :: context
 character(len=*), intent(in), optional :: filename
 


More information about the Dart-dev mailing list