Index: palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 2210)
+++ palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 2232)
@@ -20,6 +20,16 @@
 ! Current revisions:
 ! ------------------
+! Adjustments to new topography and surface concept
 ! 
-! 
+! Topograpyh height arrays (zu_s_inner, zw_w_inner) are defined locally, output
+! only if parallel netcdf. 
+!
+! Build interface for topography input: 
+! - open file in read-only mode
+! - read global attributes
+! - read variables
+!
+! Bugfix in xy output (land-surface case)
+!
 ! Former revisions:
 ! -----------------
@@ -198,5 +208,6 @@
  MODULE netcdf_interface
 
-    USE control_parameters, ONLY: max_masks, fl_max, var_fl_max, varnamelength
+    USE control_parameters,                                                    &
+        ONLY:  max_masks, fl_max, var_fl_max, varnamelength
     USE kinds
 #if defined( __netcdf )
@@ -397,4 +408,8 @@
     END INTERFACE netcdf_create_dim
 
+    INTERFACE netcdf_close_file
+       MODULE PROCEDURE netcdf_close_file
+    END INTERFACE netcdf_close_file
+
     INTERFACE netcdf_create_file
        MODULE PROCEDURE netcdf_create_file
@@ -409,14 +424,28 @@
     END INTERFACE netcdf_define_header
 
+    INTERFACE netcdf_get_attribute
+       MODULE PROCEDURE netcdf_get_attribute
+    END INTERFACE netcdf_get_attribute
+
+    INTERFACE netcdf_get_variable
+       MODULE PROCEDURE netcdf_get_variable_2d
+       MODULE PROCEDURE netcdf_get_variable_3d
+    END INTERFACE netcdf_get_variable
+
     INTERFACE netcdf_handle_error
        MODULE PROCEDURE netcdf_handle_error
     END INTERFACE netcdf_handle_error
 
+    INTERFACE netcdf_open_read_file
+       MODULE PROCEDURE netcdf_open_read_file
+    END INTERFACE netcdf_open_read_file
+
     INTERFACE netcdf_open_write_file
        MODULE PROCEDURE netcdf_open_write_file
     END INTERFACE netcdf_open_write_file
 
-    PUBLIC netcdf_create_file, netcdf_define_header, netcdf_handle_error,      &
-           netcdf_open_write_file
+    PUBLIC netcdf_create_file, netcdf_close_file, netcdf_define_header,        &
+           netcdf_handle_error, netcdf_get_attribute, netcdf_get_variable,     &
+           netcdf_open_read_file, netcdf_open_write_file
 
  CONTAINS
@@ -434,11 +463,12 @@
     USE control_parameters,                                                    &
         ONLY:  averaging_interval, averaging_interval_pr,                      &
-               data_output_pr,  domask,  dopr_n,        &
+               data_output_pr, domask, dopr_n,                                 &
                dopr_time_count, dopts_time_count, dots_time_count,             &
-               do2d, do2d_xz_time_count, do3d,                &
+               do2d, do2d_xz_time_count, do3d,                                 &
                do2d_yz_time_count, dt_data_output_av, dt_do2d_xy, dt_do2d_xz,  &
                dt_do2d_yz, dt_do3d, mask_size, do2d_xy_time_count,             &
-               do3d_time_count, domask_time_count, end_time, mask_i_global,    &
-               mask_j_global, mask_k_global, message_string, mid, ntdim_2d_xy, &
+               do3d_time_count, domask_time_count, end_time, land_surface,     &
+               lod, mask_size_l, mask_i, mask_i_global, mask_j, mask_j_global, &
+               mask_k_global, message_string, mid, ntdim_2d_xy,                &
                ntdim_2d_xz, ntdim_2d_yz, ntdim_3d, nz_do3d, prt_time_count,    &
                run_description_header, section, simulated_time,                &
@@ -452,10 +482,10 @@
 
     USE indices,                                                               &
-        ONLY:  nx, ny, nz ,nzb, nzt
+        ONLY:  nx, nxl, nxr, ny, nys, nyn, nz ,nzb, nzt
 
     USE kinds
 
     USE land_surface_model_mod,                                                &
-        ONLY: land_surface, lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs
+        ONLY: lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs
 
     USE pegrid
@@ -750,6 +780,7 @@
 !
 !--       In case of non-flat topography define 2d-arrays containing the height
-!--       information
-          IF ( TRIM( topography ) /= 'flat' )  THEN
+!--       information. Only for parallel netcdf output.
+          IF ( TRIM( topography ) /= 'flat'  .AND.                             &
+               netcdf_data_format > 4 )  THEN
 !
 !--          Define zusi = zu(nzb_s_inner)
@@ -992,27 +1023,28 @@
 !
 !--       In case of non-flat topography write height information
-          IF ( TRIM( topography ) /= 'flat' )  THEN
-
-             ALLOCATE( netcdf_data_2d(mask_size(mid,1),mask_size(mid,2)) )
-             netcdf_data_2d = zu_s_inner( mask_i_global(mid,:mask_size(mid,1)),&
-                                          mask_j_global(mid,:mask_size(mid,2)) )
-
-             nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),         &
-                                     id_var_zusi_mask(mid,av),    &
-                                     netcdf_data_2d,              &
-                                     start = (/ 1, 1 /),          &
-                                     count = (/ mask_size(mid,1), &
-                                                mask_size(mid,2) /) )
+          IF ( TRIM( topography ) /= 'flat'  .AND.                             &
+               netcdf_data_format > 4 )  THEN
+
+             ALLOCATE( netcdf_data_2d(mask_size_l(mid,1),mask_size_l(mid,2)) )
+             netcdf_data_2d = zu_s_inner( mask_i(mid,:mask_size_l(mid,1)),     &
+                                          mask_j(mid,:mask_size_l(mid,2)) )
+
+             nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),                      &
+                                     id_var_zusi_mask(mid,av),                 &
+                                     netcdf_data_2d,                           &
+                                     start = (/ 1, 1 /),                       &
+                                     count = (/ mask_size_l(mid,1),            &
+                                                mask_size_l(mid,2) /) )
              CALL netcdf_handle_error( 'netcdf_define_header', 505 )
 
-             netcdf_data_2d = zw_w_inner( mask_i_global(mid,:mask_size(mid,1)),&
-                                          mask_j_global(mid,:mask_size(mid,2)) )
-
-             nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),         &
-                                     id_var_zwwi_mask(mid,av),    &
-                                     netcdf_data_2d,              &
-                                     start = (/ 1, 1 /),          &
-                                     count = (/ mask_size(mid,1), &
-                                                mask_size(mid,2) /) )
+             netcdf_data_2d = zw_w_inner( mask_i(mid,:mask_size_l(mid,1)),     &
+                                          mask_j(mid,:mask_size_l(mid,2)) )
+
+             nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),                      &
+                                     id_var_zwwi_mask(mid,av),                 &
+                                     netcdf_data_2d,                           &
+                                     start = (/ 1, 1 /),                       &
+                                     count = (/ mask_size_l(mid,1),            &
+                                                mask_size_l(mid,2) /) )
              CALL netcdf_handle_error( 'netcdf_define_header', 506 )
 
@@ -1283,6 +1315,8 @@
 !
 !--       In case of non-flat topography define 2d-arrays containing the height
-!--       information
-          IF ( TRIM( topography ) /= 'flat' )  THEN
+!--       information. Only output 2d topography information in case of parallel
+!--       output.
+          IF ( TRIM( topography ) /= 'flat'  .AND.                             &
+               netcdf_data_format > 4 )  THEN
 !
 !--          Define zusi = zu(nzb_s_inner)
@@ -1542,22 +1576,4 @@
              CALL netcdf_handle_error( 'netcdf_define_header', 86 )
 
-!
-!--          In case of non-flat topography write height information
-             IF ( TRIM( topography ) /= 'flat' )  THEN
-
-                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), &
-                                        zu_s_inner(0:nx+1,0:ny+1), &
-                                        start = (/ 1, 1 /), &
-                                        count = (/ nx+2, ny+2 /) )
-                CALL netcdf_handle_error( 'netcdf_define_header', 419 )
-
-                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), &
-                                        zw_w_inner(0:nx+1,0:ny+1), &
-                                        start = (/ 1, 1 /), &
-                                        count = (/ nx+2, ny+2 /) )
-                CALL netcdf_handle_error( 'netcdf_define_header', 420 )
-
-             ENDIF
-
              IF ( land_surface )  THEN
 !
@@ -1568,4 +1584,57 @@
                 CALL netcdf_handle_error( 'netcdf_define_header', 86 )
              ENDIF
+
+          ENDIF
+!
+!--       In case of non-flat topography write height information. Only for
+!--       parallel netcdf output.
+          IF ( TRIM( topography ) /= 'flat'  .AND.                             &
+               netcdf_data_format > 4 )  THEN
+
+             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
+                                        zu_s_inner(nxl:nxr+1,nys:nyn),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
+             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
+                                        zu_s_inner(nxl:nxr,nys:nyn+1),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
+             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
+                                        zu_s_inner(nxl:nxr+1,nys:nyn+1),       &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
+             ELSE
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
+                                        zu_s_inner(nxl:nxr,nys:nyn),           &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
+             ENDIF
+             CALL netcdf_handle_error( 'netcdf_define_header', 419 )
+
+             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
+                                        zw_w_inner(nxl:nxr+1,nys:nyn),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
+             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
+                                        zw_w_inner(nxl:nxr,nys:nyn+1),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
+             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
+                                        zw_w_inner(nxl:nxr+1,nys:nyn+1),       &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
+             ELSE
+                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
+                                        zw_w_inner(nxl:nxr,nys:nyn),           &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
+             ENDIF
+             CALL netcdf_handle_error( 'netcdf_define_header', 420 )
 
           ENDIF
@@ -1841,6 +1910,6 @@
           IF ( land_surface )  THEN
 
-             ns_do = 0
-             DO WHILE ( section(ns_do+1,1) < nzs )
+             ns_do = 1
+             DO WHILE ( section(ns_do,1) /= -9999  .AND.  ns <= nzs )
                 ns_do = ns_do + 1
              ENDDO
@@ -1900,6 +1969,7 @@
 !
 !--       In case of non-flat topography define 2d-arrays containing the height
-!--       information
-          IF ( TRIM( topography ) /= 'flat' )  THEN
+!--       information. Only for parallel netcdf output.
+          IF ( TRIM( topography ) /= 'flat'  .AND.                             &
+               netcdf_data_format > 4  )  THEN
 !
 !--          Define zusi = zu(nzb_s_inner)
@@ -2211,23 +2281,57 @@
              DEALLOCATE( netcdf_data )
 
-!
-!--          In case of non-flat topography write height information
-             IF ( TRIM( topography ) /= 'flat' )  THEN
-
-                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), &
-                                        zu_s_inner(0:nx+1,0:ny+1), &
-                                        start = (/ 1, 1 /), &
-                                        count = (/ nx+2, ny+2 /) )
-                CALL netcdf_handle_error( 'netcdf_define_header', 427 )
-
-                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), &
-                                        zw_w_inner(0:nx+1,0:ny+1), &
-                                        start = (/ 1, 1 /), &
-                                        count = (/ nx+2, ny+2 /) )
-                CALL netcdf_handle_error( 'netcdf_define_header', 428 )
-
+          ENDIF
+
+!
+!--       In case of non-flat topography write height information. Only for 
+!--       parallel netcdf output.
+          IF ( TRIM( topography ) /= 'flat'  .AND.                             &
+               netcdf_data_format > 4  )  THEN
+
+             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
+                                        zu_s_inner(nxl:nxr+1,nys:nyn),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
+             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
+                                        zu_s_inner(nxl:nxr,nys:nyn+1),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
+             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
+                                        zu_s_inner(nxl:nxr+1,nys:nyn+1),       &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
+             ELSE
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
+                                        zu_s_inner(nxl:nxr,nys:nyn),           &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
              ENDIF
-
-
+             CALL netcdf_handle_error( 'netcdf_define_header', 427 )
+
+             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
+                                        zw_w_inner(nxl:nxr+1,nys:nyn),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
+             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
+                                        zw_w_inner(nxl:nxr,nys:nyn+1),         &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
+             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
+                                        zw_w_inner(nxl:nxr+1,nys:nyn+1),       &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
+             ELSE
+                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
+                                        zw_w_inner(nxl:nxr,nys:nyn),           &
+                                        start = (/ nxl+1, nys+1 /),            &
+                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
+             ENDIF
+             CALL netcdf_handle_error( 'netcdf_define_header', 428 )
 
           ENDIF
@@ -5337,4 +5441,173 @@
 ! Description:
 ! ------------
+!> Closes an existing netCDF file.
+!------------------------------------------------------------------------------!
+ 
+ SUBROUTINE netcdf_close_file( id, errno )
+#if defined( __netcdf )
+
+    USE pegrid
+
+    IMPLICIT NONE
+
+    INTEGER(iwp), INTENT(IN)           ::  errno     !< error number
+    INTEGER(iwp), INTENT(INOUT)        ::  id        !< file id
+
+    nc_stat = NF90_CLOSE( id )
+    CALL netcdf_handle_error( 'netcdf_close', errno )
+#endif
+ END SUBROUTINE netcdf_close_file
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Opens an existing netCDF file for reading only and gives back the id.
+!------------------------------------------------------------------------------!
+ 
+ SUBROUTINE netcdf_open_read_file( filename, id, errno )
+#if defined( __netcdf )
+
+    USE pegrid
+
+    IMPLICIT NONE
+
+    CHARACTER (LEN=*), INTENT(IN) ::  filename  !< filename
+    INTEGER(iwp), INTENT(IN)      ::  errno     !< error number
+    INTEGER(iwp), INTENT(INOUT)   ::  id        !< file id
+    LOGICAL                       ::  file_open = .FALSE.
+
+    nc_stat = NF90_OPEN( filename, NF90_NOWRITE, id )
+
+    CALL netcdf_handle_error( 'netcdf_open_read_file', errno )
+
+#endif
+ END SUBROUTINE netcdf_open_read_file
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Reads the global attributes of a file
+!------------------------------------------------------------------------------!
+ 
+ SUBROUTINE netcdf_get_attribute( id, attribute_name, value, global, errno, variable_name )
+#if defined( __netcdf )
+
+    USE pegrid
+
+    IMPLICIT NONE
+
+    CHARACTER(LEN=*)            ::  attribute_name   !< attribute name
+    CHARACTER(LEN=*), OPTIONAL  ::  variable_name    !< variable name 
+
+    INTEGER(iwp), INTENT(IN)    ::  errno            !< error number
+    INTEGER(iwp), INTENT(INOUT) ::  id               !< file id
+    INTEGER(iwp), INTENT(INOUT) ::  value            !< read value
+
+    INTEGER(iwp)                ::  id_var           !< variable id
+
+    LOGICAL, INTENT(IN) ::  global                   !< flag indicating global attributes
+
+!
+!-- Read global attribute
+    IF ( global )  THEN
+       nc_stat = NF90_GET_ATT( id, NF90_GLOBAL, TRIM( attribute_name ), value )
+       CALL netcdf_handle_error( 'netcdf_get_attribute global', errno )
+!
+!-- Read attributes referring to a single variable. Therefore, first inquire 
+!-- variable id
+    ELSE
+       nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
+       CALL netcdf_handle_error( 'netcdf_get_attribute', errno )
+       nc_stat = NF90_GET_ATT( id, id_var, TRIM( attribute_name ), value )
+       CALL netcdf_handle_error( 'netcdf_get_attribute', errno )       
+    ENDIF
+#endif
+ END SUBROUTINE netcdf_get_attribute
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Reads a 2D REAL variable of a file. Reading is done processor-wise, 
+!> i.e. each core reads its own domain, as well as in slices along x. 
+!------------------------------------------------------------------------------!
+ 
+ SUBROUTINE netcdf_get_variable_2d( id, variable_name, i, var, errno )
+#if defined( __netcdf )
+
+    USE indices
+    USE pegrid
+
+    IMPLICIT NONE
+
+    CHARACTER(LEN=*)              ::  variable_name   !< attribute name
+    INTEGER(iwp), INTENT(IN)      ::  errno           !< error number
+    INTEGER(iwp), INTENT(IN)      ::  i               !< index along x direction
+
+    INTEGER(iwp), INTENT(INOUT)   ::  id              !< file id
+
+    INTEGER(iwp)                  ::  id_var          !< variable id
+
+    REAL(wp), DIMENSION(nys:nyn), INTENT(INOUT) ::  var  !< variable to be read
+    REAL(wp) :: var_dum
+!
+!-- Inquire variable id
+    nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
+!
+!-- Get variable
+    nc_stat = NF90_GET_VAR( id, id_var, var(nys:nyn),                        &
+                            start = (/ i+1, nys+1 /),                          &
+                            count = (/ 1, nyn - nys + 1 /) )
+
+    CALL netcdf_handle_error( 'netcdf_get_variable', errno )
+#endif
+ END SUBROUTINE netcdf_get_variable_2d
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Reads a 3D INTEGER variable of a file. Reading is done processor-wise, 
+!> i.e. each core reads its own domain, as well as in slices along x. 
+!------------------------------------------------------------------------------!
+ 
+ SUBROUTINE netcdf_get_variable_3d( id, variable_name, i, j, var, errno )
+#if defined( __netcdf )
+
+    USE indices
+    USE pegrid
+
+    IMPLICIT NONE
+
+    CHARACTER(LEN=*)              ::  variable_name   !< attribute name
+    INTEGER(iwp), INTENT(IN)      ::  errno           !< error number
+    INTEGER(iwp), INTENT(IN)      ::  i               !< index along x direction
+    INTEGER(iwp), INTENT(IN)      ::  j               !< index along y direction
+
+    INTEGER(iwp), INTENT(INOUT)   ::  id              !< file id
+
+    INTEGER(iwp)                  ::  id_var          !< variable id
+    INTEGER(iwp)                  ::  id_z            !< id of z-dimension
+    INTEGER(iwp)                  ::  nz_file         !< number of grid-points in file
+
+    INTEGER(iwp), DIMENSION(nzb:nzt+1), INTENT(INOUT) ::  var  !< variable to be read
+!
+!-- Get dimension of z-axis
+    nc_stat = NF90_INQ_DIMID( id, "z", id_z )
+    nc_stat = NF90_INQUIRE_DIMENSION( id, id_z, len = nz_file )
+!
+!-- Inquire variable id
+    nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )
+!
+!-- Get variable
+    nc_stat = NF90_GET_VAR( id, id_var, var(0:nz_file-1),                  &
+                            start = (/ i+1, j+1, 1 /),                         &
+                            count = (/ 1, 1, nz_file /) )
+
+    CALL netcdf_handle_error( 'netcdf_get_variable', errno )
+#endif
+ END SUBROUTINE netcdf_get_variable_3d
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
 !> Opens an existing netCDF file for writing and gives back the id.
 !> The parallel flag has to be TRUE for parallel netCDF output support.
