Ignore:
Timestamp:
Oct 4, 2017 8:26:59 AM (7 years ago)
Author:
raasch
Message:

upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny; no output if redundant ghost layer data to NetCDF files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/netcdf_interface_mod.f90

    r2302 r2512  
    2525! -----------------
    2626! $Id$
     27! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny
     28! no output of ghost layer data any more
     29!
     30! 2302 2017-07-03 14:07:20Z suehring
    2731! Reading of 3D topography using NetCDF data type NC_BYTE
    2832!
     
    13071311!
    13081312!--       Define x-axis (for scalar position)
    1309           CALL netcdf_create_dim( id_set_3d(av), 'x', nx+2, id_dim_x_3d(av),   &
     1313          CALL netcdf_create_dim( id_set_3d(av), 'x', nx+1, id_dim_x_3d(av),   &
    13101314                                  73 )
    13111315          CALL netcdf_create_var( id_set_3d(av), (/ id_dim_x_3d(av) /), 'x',   &
     
    13141318!
    13151319!--       Define x-axis (for u position)
    1316           CALL netcdf_create_dim( id_set_3d(av), 'xu', nx+2, id_dim_xu_3d(av), &
     1320          CALL netcdf_create_dim( id_set_3d(av), 'xu', nx+1, id_dim_xu_3d(av), &
    13171321                                  358 )
    13181322          CALL netcdf_create_var( id_set_3d(av), (/ id_dim_xu_3d(av) /), 'xu', &
     
    13211325!
    13221326!--       Define y-axis (for scalar position)
    1323           CALL netcdf_create_dim( id_set_3d(av), 'y', ny+2, id_dim_y_3d(av),   &
     1327          CALL netcdf_create_dim( id_set_3d(av), 'y', ny+1, id_dim_y_3d(av),   &
    13241328                                  76 )
    13251329          CALL netcdf_create_var( id_set_3d(av), (/ id_dim_y_3d(av) /), 'y',   &
     
    13281332!
    13291333!--       Define y-axis (for v position)
    1330           CALL netcdf_create_dim( id_set_3d(av), 'yv', ny+2, id_dim_yv_3d(av), &
     1334          CALL netcdf_create_dim( id_set_3d(av), 'yv', ny+1, id_dim_yv_3d(av), &
    13311335                                  361 )
    13321336          CALL netcdf_create_var( id_set_3d(av), (/ id_dim_yv_3d(av) /), 'yv', &
     
    15371541!
    15381542!--          Write data for x (shifted by +dx/2) and xu axis
    1539              ALLOCATE( netcdf_data(0:nx+1) )
    1540 
    1541              DO  i = 0, nx+1
     1543             ALLOCATE( netcdf_data(0:nx) )
     1544
     1545             DO  i = 0, nx
    15421546                netcdf_data(i) = ( i + 0.5 ) * dx
    15431547             ENDDO
     
    15451549             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_x_3d(av),  &
    15461550                                     netcdf_data, start = (/ 1 /),    &
    1547                                      count = (/ nx+2 /) )
     1551                                     count = (/ nx+1 /) )
    15481552             CALL netcdf_handle_error( 'netcdf_define_header', 83 )
    15491553
    1550              DO  i = 0, nx+1
     1554             DO  i = 0, nx
    15511555                netcdf_data(i) = i * dx
    15521556             ENDDO
     
    15541558             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_xu_3d(av), &
    15551559                                     netcdf_data, start = (/ 1 /),    &
    1556                                      count = (/ nx+2 /) )
     1560                                     count = (/ nx+1 /) )
    15571561             CALL netcdf_handle_error( 'netcdf_define_header', 385 )
    15581562
     
    15611565!
    15621566!--          Write data for y (shifted by +dy/2) and yv axis
    1563              ALLOCATE( netcdf_data(0:ny+1) )
    1564 
    1565              DO  i = 0, ny+1
     1567             ALLOCATE( netcdf_data(0:ny) )
     1568
     1569             DO  i = 0, ny
    15661570                netcdf_data(i) = ( i + 0.5_wp ) * dy
    15671571             ENDDO
     
    15691573             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_y_3d(av),  &
    15701574                                     netcdf_data, start = (/ 1 /),    &
    1571                                      count = (/ ny+2 /) )
     1575                                     count = (/ ny+1 /) )
    15721576             CALL netcdf_handle_error( 'netcdf_define_header', 84 )
    15731577
    1574              DO  i = 0, ny+1
     1578             DO  i = 0, ny
    15751579                netcdf_data(i) = i * dy
    15761580             ENDDO
     
    15781582             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_yv_3d(av), &
    15791583                                     netcdf_data, start = (/ 1 /),    &
    1580                                      count = (/ ny+2 /))
     1584                                     count = (/ ny+1 /))
    15811585             CALL netcdf_handle_error( 'netcdf_define_header', 387 )
    15821586
     
    16121616               netcdf_data_format > 4 )  THEN
    16131617
    1614              IF ( nxr == nx  .AND.  nyn /= ny )  THEN
    1615                 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
    1616                                         zu_s_inner(nxl:nxr+1,nys:nyn),         &
    1617                                         start = (/ nxl+1, nys+1 /),            &
    1618                                         count = (/ nxr-nxl+2, nyn-nys+1 /) )
    1619              ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
    1620                 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
    1621                                         zu_s_inner(nxl:nxr,nys:nyn+1),         &
    1622                                         start = (/ nxl+1, nys+1 /),            &
    1623                                         count = (/ nxr-nxl+1, nyn-nys+2 /) )
    1624              ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
    1625                 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
    1626                                         zu_s_inner(nxl:nxr+1,nys:nyn+1),       &
    1627                                         start = (/ nxl+1, nys+1 /),            &
    1628                                         count = (/ nxr-nxl+2, nyn-nys+2 /) )
    1629              ELSE
     1618!             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
     1619!                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
     1620!                                        zu_s_inner(nxl:nxr+1,nys:nyn),         &
     1621!                                        start = (/ nxl+1, nys+1 /),            &
     1622!                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
     1623!             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
     1624!                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
     1625!                                        zu_s_inner(nxl:nxr,nys:nyn+1),         &
     1626!                                        start = (/ nxl+1, nys+1 /),            &
     1627!                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
     1628!             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
     1629!                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
     1630!                                        zu_s_inner(nxl:nxr+1,nys:nyn+1),       &
     1631!                                        start = (/ nxl+1, nys+1 /),            &
     1632!                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
     1633!             ELSE
    16301634                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av),     &
    16311635                                        zu_s_inner(nxl:nxr,nys:nyn),           &
    16321636                                        start = (/ nxl+1, nys+1 /),            &
    16331637                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
    1634              ENDIF
     1638!             ENDIF
    16351639             CALL netcdf_handle_error( 'netcdf_define_header', 419 )
    16361640
    1637              IF ( nxr == nx  .AND.  nyn /= ny )  THEN
    1638                 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
    1639                                         zw_w_inner(nxl:nxr+1,nys:nyn),         &
    1640                                         start = (/ nxl+1, nys+1 /),            &
    1641                                         count = (/ nxr-nxl+2, nyn-nys+1 /) )
    1642              ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
    1643                 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
    1644                                         zw_w_inner(nxl:nxr,nys:nyn+1),         &
    1645                                         start = (/ nxl+1, nys+1 /),            &
    1646                                         count = (/ nxr-nxl+1, nyn-nys+2 /) )
    1647              ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
    1648                 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
    1649                                         zw_w_inner(nxl:nxr+1,nys:nyn+1),       &
    1650                                         start = (/ nxl+1, nys+1 /),            &
    1651                                         count = (/ nxr-nxl+2, nyn-nys+2 /) )
    1652              ELSE
     1641!             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
     1642!                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
     1643!                                        zw_w_inner(nxl:nxr+1,nys:nyn),         &
     1644!                                        start = (/ nxl+1, nys+1 /),            &
     1645!                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
     1646!             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
     1647!                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
     1648!                                        zw_w_inner(nxl:nxr,nys:nyn+1),         &
     1649!                                        start = (/ nxl+1, nys+1 /),            &
     1650!                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
     1651!             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
     1652!                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
     1653!                                        zw_w_inner(nxl:nxr+1,nys:nyn+1),       &
     1654!                                        start = (/ nxl+1, nys+1 /),            &
     1655!                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
     1656!             ELSE
    16531657                nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av),     &
    16541658                                        zw_w_inner(nxl:nxr,nys:nyn),           &
    16551659                                        start = (/ nxl+1, nys+1 /),            &
    16561660                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
    1657              ENDIF
     1661!             ENDIF
    16581662             CALL netcdf_handle_error( 'netcdf_define_header', 420 )
    16591663
     
    19611965!
    19621966!--       Define x-axis (for scalar position)
    1963           CALL netcdf_create_dim( id_set_xy(av), 'x', nx+2, id_dim_x_xy(av),   &
     1967          CALL netcdf_create_dim( id_set_xy(av), 'x', nx+1, id_dim_x_xy(av),   &
    19641968                                  113 )
    19651969          CALL netcdf_create_var( id_set_xy(av), (/ id_dim_x_xy(av) /), 'x',   &
     
    19681972!
    19691973!--       Define x-axis (for u position)
    1970           CALL netcdf_create_dim( id_set_xy(av), 'xu', nx+2,                   &
     1974          CALL netcdf_create_dim( id_set_xy(av), 'xu', nx+1,                   &
    19711975                                  id_dim_xu_xy(av), 388 )
    19721976          CALL netcdf_create_var( id_set_xy(av), (/ id_dim_xu_xy(av) /), 'xu', &
     
    19751979!
    19761980!--       Define y-axis (for scalar position)
    1977           CALL netcdf_create_dim( id_set_xy(av), 'y', ny+2, id_dim_y_xy(av),   &
     1981          CALL netcdf_create_dim( id_set_xy(av), 'y', ny+1, id_dim_y_xy(av),   &
    19781982                                  116 )
    19791983          CALL netcdf_create_var( id_set_xy(av), (/ id_dim_y_xy(av) /), 'y',   &
     
    19821986!
    19831987!--       Define y-axis (for scalar position)
    1984           CALL netcdf_create_dim( id_set_xy(av), 'yv', ny+2,                   &
     1988          CALL netcdf_create_dim( id_set_xy(av), 'yv', ny+1,                   &
    19851989                                  id_dim_yv_xy(av), 364 )
    19861990          CALL netcdf_create_var( id_set_xy(av), (/ id_dim_yv_xy(av) /), 'yv', &
     
    22552259!
    22562260!--          Write data for x (shifted by +dx/2) and xu axis
    2257              ALLOCATE( netcdf_data(0:nx+1) )
    2258 
    2259              DO  i = 0, nx+1
     2261             ALLOCATE( netcdf_data(0:nx) )
     2262
     2263             DO  i = 0, nx
    22602264                netcdf_data(i) = ( i + 0.5_wp ) * dx
    22612265             ENDDO
     
    22632267             nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_x_xy(av), &
    22642268                                     netcdf_data, start = (/ 1 /),   &
    2265                                      count = (/ nx+2 /) )
     2269                                     count = (/ nx+1 /) )
    22662270             CALL netcdf_handle_error( 'netcdf_define_header', 127 )
    22672271
    2268              DO  i = 0, nx+1
     2272             DO  i = 0, nx
    22692273                netcdf_data(i) = i * dx
    22702274             ENDDO
     
    22722276             nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_xu_xy(av), &
    22732277                                     netcdf_data, start = (/ 1 /),    &
    2274                                      count = (/ nx+2 /) )
     2278                                     count = (/ nx+1 /) )
    22752279             CALL netcdf_handle_error( 'netcdf_define_header', 367 )
    22762280
     
    22812285             ALLOCATE( netcdf_data(0:ny+1) )
    22822286
    2283              DO  i = 0, ny+1
     2287             DO  i = 0, ny
    22842288                netcdf_data(i) = ( i + 0.5_wp ) * dy
    22852289             ENDDO
     
    22872291             nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_y_xy(av), &
    22882292                                     netcdf_data, start = (/ 1 /),   &
    2289                                      count = (/ ny+2 /))
     2293                                     count = (/ ny+1 /))
    22902294             CALL netcdf_handle_error( 'netcdf_define_header', 128 )
    22912295
    2292              DO  i = 0, ny+1
     2296             DO  i = 0, ny
    22932297                netcdf_data(i) = i * dy
    22942298             ENDDO
     
    22962300             nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_yv_xy(av), &
    22972301                                     netcdf_data, start = (/ 1 /),    &
    2298                                      count = (/ ny+2 /))
     2302                                     count = (/ ny+1 /))
    22992303             CALL netcdf_handle_error( 'netcdf_define_header', 368 )
    23002304
     
    23092313               netcdf_data_format > 4  )  THEN
    23102314
    2311              IF ( nxr == nx  .AND.  nyn /= ny )  THEN
    2312                 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
    2313                                         zu_s_inner(nxl:nxr+1,nys:nyn),         &
    2314                                         start = (/ nxl+1, nys+1 /),            &
    2315                                         count = (/ nxr-nxl+2, nyn-nys+1 /) )
    2316              ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
    2317                 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
    2318                                         zu_s_inner(nxl:nxr,nys:nyn+1),         &
    2319                                         start = (/ nxl+1, nys+1 /),            &
    2320                                         count = (/ nxr-nxl+1, nyn-nys+2 /) )
    2321              ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
    2322                 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
    2323                                         zu_s_inner(nxl:nxr+1,nys:nyn+1),       &
    2324                                         start = (/ nxl+1, nys+1 /),            &
    2325                                         count = (/ nxr-nxl+2, nyn-nys+2 /) )
    2326              ELSE
     2315!             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
     2316!                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
     2317!                                        zu_s_inner(nxl:nxr+1,nys:nyn),         &
     2318!                                        start = (/ nxl+1, nys+1 /),            &
     2319!                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
     2320!             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
     2321!                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
     2322!                                        zu_s_inner(nxl:nxr,nys:nyn+1),         &
     2323!                                        start = (/ nxl+1, nys+1 /),            &
     2324!                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
     2325!             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
     2326!                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
     2327!                                        zu_s_inner(nxl:nxr+1,nys:nyn+1),       &
     2328!                                        start = (/ nxl+1, nys+1 /),            &
     2329!                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
     2330!             ELSE
    23272331                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av),     &
    23282332                                        zu_s_inner(nxl:nxr,nys:nyn),           &
    23292333                                        start = (/ nxl+1, nys+1 /),            &
    23302334                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
    2331              ENDIF
     2335!             ENDIF
    23322336             CALL netcdf_handle_error( 'netcdf_define_header', 427 )
    23332337
    2334              IF ( nxr == nx  .AND.  nyn /= ny )  THEN
    2335                 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
    2336                                         zw_w_inner(nxl:nxr+1,nys:nyn),         &
    2337                                         start = (/ nxl+1, nys+1 /),            &
    2338                                         count = (/ nxr-nxl+2, nyn-nys+1 /) )
    2339              ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
    2340                 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
    2341                                         zw_w_inner(nxl:nxr,nys:nyn+1),         &
    2342                                         start = (/ nxl+1, nys+1 /),            &
    2343                                         count = (/ nxr-nxl+1, nyn-nys+2 /) )
    2344              ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
    2345                 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
    2346                                         zw_w_inner(nxl:nxr+1,nys:nyn+1),       &
    2347                                         start = (/ nxl+1, nys+1 /),            &
    2348                                         count = (/ nxr-nxl+2, nyn-nys+2 /) )
    2349              ELSE
     2338!             IF ( nxr == nx  .AND.  nyn /= ny )  THEN
     2339!                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
     2340!                                        zw_w_inner(nxl:nxr+1,nys:nyn),         &
     2341!                                        start = (/ nxl+1, nys+1 /),            &
     2342!                                        count = (/ nxr-nxl+2, nyn-nys+1 /) )
     2343!             ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
     2344!                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
     2345!                                        zw_w_inner(nxl:nxr,nys:nyn+1),         &
     2346!                                        start = (/ nxl+1, nys+1 /),            &
     2347!                                        count = (/ nxr-nxl+1, nyn-nys+2 /) )
     2348!             ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
     2349!                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
     2350!                                        zw_w_inner(nxl:nxr+1,nys:nyn+1),       &
     2351!                                        start = (/ nxl+1, nys+1 /),            &
     2352!                                        count = (/ nxr-nxl+2, nyn-nys+2 /) )
     2353!             ELSE
    23502354                nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av),     &
    23512355                                        zw_w_inner(nxl:nxr,nys:nyn),           &
    23522356                                        start = (/ nxl+1, nys+1 /),            &
    23532357                                        count = (/ nxr-nxl+1, nyn-nys+1 /) )
    2354              ENDIF
     2358!             ENDIF
    23552359             CALL netcdf_handle_error( 'netcdf_define_header', 428 )
    23562360
     
    26842688!
    26852689!--       Define x-axis (for scalar position)
    2686           CALL netcdf_create_dim( id_set_xz(av), 'x', nx+2, id_dim_x_xz(av),   &
     2690          CALL netcdf_create_dim( id_set_xz(av), 'x', nx+1, id_dim_x_xz(av),   &
    26872691                                  150 )
    26882692          CALL netcdf_create_var( id_set_xz(av), (/ id_dim_x_xz(av) /), 'x',   &
     
    26912695!
    26922696!--       Define x-axis (for u position)
    2693           CALL netcdf_create_dim( id_set_xz(av), 'xu', nx+2, id_dim_xu_xz(av), &
     2697          CALL netcdf_create_dim( id_set_xz(av), 'xu', nx+1, id_dim_xu_xz(av), &
    26942698                                  372 )
    26952699          CALL netcdf_create_var( id_set_xz(av), (/ id_dim_xu_xz(av) /), 'xu', &
     
    29402944!
    29412945!--          Write data for x (shifted by +dx/2) and xu axis
    2942              ALLOCATE( netcdf_data(0:nx+1) )
    2943 
    2944              DO  i = 0, nx+1
     2946             ALLOCATE( netcdf_data(0:nx) )
     2947
     2948             DO  i = 0, nx
    29452949                netcdf_data(i) = ( i + 0.5_wp ) * dx
    29462950             ENDDO
     
    29482952             nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_x_xz(av), &
    29492953                                     netcdf_data, start = (/ 1 /),   &
    2950                                      count = (/ nx+2 /) )
     2954                                     count = (/ nx+1 /) )
    29512955             CALL netcdf_handle_error( 'netcdf_define_header', 165 )
    29522956
    2953              DO  i = 0, nx+1
     2957             DO  i = 0, nx
    29542958                netcdf_data(i) = i * dx
    29552959             ENDDO
     
    29572961             nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_xu_xz(av), &
    29582962                                     netcdf_data, start = (/ 1 /),    &
    2959                                      count = (/ nx+2 /) )
     2963                                     count = (/ nx+1 /) )
    29602964             CALL netcdf_handle_error( 'netcdf_define_header', 377 )
    29612965
     
    33373341!
    33383342!--       Define y-axis (for scalar position)
    3339           CALL netcdf_create_dim( id_set_yz(av), 'y', ny+2, id_dim_y_yz(av),   &
     3343          CALL netcdf_create_dim( id_set_yz(av), 'y', ny+1, id_dim_y_yz(av),   &
    33403344                                  189 )
    33413345          CALL netcdf_create_var( id_set_yz(av), (/ id_dim_y_yz(av) /), 'y',   &
     
    33443348!
    33453349!--       Define y-axis (for v position)
    3346           CALL netcdf_create_dim( id_set_yz(av), 'yv', ny+2, id_dim_yv_yz(av), &
     3350          CALL netcdf_create_dim( id_set_yz(av), 'yv', ny+1, id_dim_yv_yz(av), &
    33473351                                  380 )
    33483352          CALL netcdf_create_var( id_set_yz(av), (/ id_dim_yv_yz(av) /), 'yv', &
     
    35923596!
    35933597!--          Write data for y (shifted by +dy/2) and yv axis
    3594              ALLOCATE( netcdf_data(0:ny+1) )
    3595 
    3596              DO  j = 0, ny+1
     3598             ALLOCATE( netcdf_data(0:ny) )
     3599
     3600             DO  j = 0, ny
    35973601                netcdf_data(j) = ( j + 0.5_wp ) * dy
    35983602             ENDDO
     
    36003604             nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_y_yz(av), &
    36013605                                     netcdf_data, start = (/ 1 /),   &
    3602                                      count = (/ ny+2 /) )
     3606                                     count = (/ ny+1 /) )
    36033607             CALL netcdf_handle_error( 'netcdf_define_header', 204 )
    36043608
    3605              DO  j = 0, ny+1
     3609             DO  j = 0, ny
    36063610                netcdf_data(j) = j * dy
    36073611             ENDDO
     
    36093613             nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_yv_yz(av), &
    36103614                                     netcdf_data, start = (/ 1 /),    &
    3611                                      count = (/ ny+2 /) )
     3615                                     count = (/ ny+1 /) )
    36123616             CALL netcdf_handle_error( 'netcdf_define_header', 384 )
    36133617
Note: See TracChangeset for help on using the changeset viewer.