/* Initialize MPI. */ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* Create a parallel netcdf-4 file. */ if ((res = nc_create_par(FILENAME, facc_type, comm, info, &ncid))) BAIL(res); /* The first case is two dimensional variables, no unlimited dimension */ /* Create two dimensions. */ if ((res = nc_def_dim(ncid, "d1", DIMSIZE2, dimids))) BAIL(res); if ((res = nc_def_dim(ncid, "d2", DIMSIZE, &dimids[1]))) BAIL(res); /* Create one var. */ if ((res = nc_def_var(ncid, "v1", NC_INT, NDIMS1, dimids, &nvid))) BAIL(res); if ((res = nc_enddef(ncid))) BAIL(res);