diff --git a/src/neasyf.f90 b/src/neasyf.f90 index 866133c..d52a11b 100644 --- a/src/neasyf.f90 +++ b/src/neasyf.f90 @@ -1119,7 +1119,8 @@ subroutine neasyf_write_integer_int8_rank_0(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -1204,8 +1205,11 @@ subroutine neasyf_write_integer_int8_rank_0(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start) @@ -1258,7 +1262,8 @@ subroutine neasyf_write_integer_int8_rank_1(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -1347,8 +1352,11 @@ subroutine neasyf_write_integer_int8_rank_1(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -1402,7 +1410,8 @@ subroutine neasyf_write_integer_int8_rank_2(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -1491,8 +1500,11 @@ subroutine neasyf_write_integer_int8_rank_2(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -1546,7 +1558,8 @@ subroutine neasyf_write_integer_int8_rank_3(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -1635,8 +1648,11 @@ subroutine neasyf_write_integer_int8_rank_3(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -1690,7 +1706,8 @@ subroutine neasyf_write_integer_int8_rank_4(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -1779,8 +1796,11 @@ subroutine neasyf_write_integer_int8_rank_4(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -1834,7 +1854,8 @@ subroutine neasyf_write_integer_int8_rank_5(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -1923,8 +1944,11 @@ subroutine neasyf_write_integer_int8_rank_5(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -1978,7 +2002,8 @@ subroutine neasyf_write_integer_int8_rank_6(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2067,8 +2092,11 @@ subroutine neasyf_write_integer_int8_rank_6(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -2122,7 +2150,8 @@ subroutine neasyf_write_integer_int8_rank_7(parent_id, name, values, dim_ids, di , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2211,8 +2240,11 @@ subroutine neasyf_write_integer_int8_rank_7(parent_id, name, values, dim_ids, di if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -2265,7 +2297,8 @@ subroutine neasyf_write_integer_int16_rank_0(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2350,8 +2383,11 @@ subroutine neasyf_write_integer_int16_rank_0(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start) @@ -2404,7 +2440,8 @@ subroutine neasyf_write_integer_int16_rank_1(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2493,8 +2530,11 @@ subroutine neasyf_write_integer_int16_rank_1(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -2548,7 +2588,8 @@ subroutine neasyf_write_integer_int16_rank_2(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2637,8 +2678,11 @@ subroutine neasyf_write_integer_int16_rank_2(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -2692,7 +2736,8 @@ subroutine neasyf_write_integer_int16_rank_3(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2781,8 +2826,11 @@ subroutine neasyf_write_integer_int16_rank_3(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -2836,7 +2884,8 @@ subroutine neasyf_write_integer_int16_rank_4(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -2925,8 +2974,11 @@ subroutine neasyf_write_integer_int16_rank_4(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -2980,7 +3032,8 @@ subroutine neasyf_write_integer_int16_rank_5(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3069,8 +3122,11 @@ subroutine neasyf_write_integer_int16_rank_5(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -3124,7 +3180,8 @@ subroutine neasyf_write_integer_int16_rank_6(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3213,8 +3270,11 @@ subroutine neasyf_write_integer_int16_rank_6(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -3268,7 +3328,8 @@ subroutine neasyf_write_integer_int16_rank_7(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3357,8 +3418,11 @@ subroutine neasyf_write_integer_int16_rank_7(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -3411,7 +3475,8 @@ subroutine neasyf_write_integer_int32_rank_0(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3496,8 +3561,11 @@ subroutine neasyf_write_integer_int32_rank_0(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start) @@ -3550,7 +3618,8 @@ subroutine neasyf_write_integer_int32_rank_1(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3639,8 +3708,11 @@ subroutine neasyf_write_integer_int32_rank_1(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -3694,7 +3766,8 @@ subroutine neasyf_write_integer_int32_rank_2(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3783,8 +3856,11 @@ subroutine neasyf_write_integer_int32_rank_2(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -3838,7 +3914,8 @@ subroutine neasyf_write_integer_int32_rank_3(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -3927,8 +4004,11 @@ subroutine neasyf_write_integer_int32_rank_3(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -3982,7 +4062,8 @@ subroutine neasyf_write_integer_int32_rank_4(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4071,8 +4152,11 @@ subroutine neasyf_write_integer_int32_rank_4(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -4126,7 +4210,8 @@ subroutine neasyf_write_integer_int32_rank_5(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4215,8 +4300,11 @@ subroutine neasyf_write_integer_int32_rank_5(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -4270,7 +4358,8 @@ subroutine neasyf_write_integer_int32_rank_6(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4359,8 +4448,11 @@ subroutine neasyf_write_integer_int32_rank_6(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -4414,7 +4506,8 @@ subroutine neasyf_write_integer_int32_rank_7(parent_id, name, values, dim_ids, d , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4503,8 +4596,11 @@ subroutine neasyf_write_integer_int32_rank_7(parent_id, name, values, dim_ids, d if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -4557,7 +4653,8 @@ subroutine neasyf_write_real_real32_rank_0(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4642,8 +4739,11 @@ subroutine neasyf_write_real_real32_rank_0(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start) @@ -4696,7 +4796,8 @@ subroutine neasyf_write_real_real32_rank_1(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4785,8 +4886,11 @@ subroutine neasyf_write_real_real32_rank_1(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -4840,7 +4944,8 @@ subroutine neasyf_write_real_real32_rank_2(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -4929,8 +5034,11 @@ subroutine neasyf_write_real_real32_rank_2(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -4984,7 +5092,8 @@ subroutine neasyf_write_real_real32_rank_3(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5073,8 +5182,11 @@ subroutine neasyf_write_real_real32_rank_3(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -5128,7 +5240,8 @@ subroutine neasyf_write_real_real32_rank_4(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5217,8 +5330,11 @@ subroutine neasyf_write_real_real32_rank_4(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -5272,7 +5388,8 @@ subroutine neasyf_write_real_real32_rank_5(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5361,8 +5478,11 @@ subroutine neasyf_write_real_real32_rank_5(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -5416,7 +5536,8 @@ subroutine neasyf_write_real_real32_rank_6(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5505,8 +5626,11 @@ subroutine neasyf_write_real_real32_rank_6(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -5560,7 +5684,8 @@ subroutine neasyf_write_real_real32_rank_7(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5649,8 +5774,11 @@ subroutine neasyf_write_real_real32_rank_7(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -5703,7 +5831,8 @@ subroutine neasyf_write_real_real64_rank_0(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5788,8 +5917,11 @@ subroutine neasyf_write_real_real64_rank_0(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start) @@ -5842,7 +5974,8 @@ subroutine neasyf_write_real_real64_rank_1(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -5931,8 +6064,11 @@ subroutine neasyf_write_real_real64_rank_1(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -5986,7 +6122,8 @@ subroutine neasyf_write_real_real64_rank_2(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -6075,8 +6212,11 @@ subroutine neasyf_write_real_real64_rank_2(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -6130,7 +6270,8 @@ subroutine neasyf_write_real_real64_rank_3(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -6219,8 +6360,11 @@ subroutine neasyf_write_real_real64_rank_3(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -6274,7 +6418,8 @@ subroutine neasyf_write_real_real64_rank_4(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -6363,8 +6508,11 @@ subroutine neasyf_write_real_real64_rank_4(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -6418,7 +6566,8 @@ subroutine neasyf_write_real_real64_rank_5(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -6507,8 +6656,11 @@ subroutine neasyf_write_real_real64_rank_5(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -6562,7 +6714,8 @@ subroutine neasyf_write_real_real64_rank_6(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -6651,8 +6804,11 @@ subroutine neasyf_write_real_real64_rank_6(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -6706,7 +6862,8 @@ subroutine neasyf_write_real_real64_rank_7(parent_id, name, values, dim_ids, dim , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -6795,8 +6952,11 @@ subroutine neasyf_write_real_real64_rank_7(parent_id, name, values, dim_ids, dim if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -6849,7 +7009,8 @@ subroutine neasyf_write_character_rank_0(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR !> Name of the variable character(len=*), intent(in) :: name !> NetCDF ID of the parent group/file @@ -6918,8 +7079,11 @@ subroutine neasyf_write_character_rank_0(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start) @@ -6972,7 +7136,8 @@ subroutine neasyf_write_character_rank_1(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7061,8 +7226,11 @@ subroutine neasyf_write_character_rank_1(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -7116,7 +7284,8 @@ subroutine neasyf_write_character_rank_2(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7205,8 +7374,11 @@ subroutine neasyf_write_character_rank_2(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -7260,7 +7432,8 @@ subroutine neasyf_write_character_rank_3(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7349,8 +7522,11 @@ subroutine neasyf_write_character_rank_3(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -7404,7 +7580,8 @@ subroutine neasyf_write_character_rank_4(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7493,8 +7670,11 @@ subroutine neasyf_write_character_rank_4(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -7548,7 +7728,8 @@ subroutine neasyf_write_character_rank_5(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7637,8 +7818,11 @@ subroutine neasyf_write_character_rank_5(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -7692,7 +7876,8 @@ subroutine neasyf_write_character_rank_6(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7781,8 +7966,11 @@ subroutine neasyf_write_character_rank_6(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) @@ -7836,7 +8024,8 @@ subroutine neasyf_write_character_rank_7(parent_id, name, values, dim_ids, dim_n , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR use netcdf, only : NF90_EDIMMETA !> Name of the variable character(len=*), intent(in) :: name @@ -7925,8 +8114,11 @@ subroutine neasyf_write_character_rank_7(parent_id, name, values, dim_ids, dim_n if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if status = nf90_put_var(parent_id, var_id, values, start, count, stride, map) diff --git a/src/neasyf.in.f90 b/src/neasyf.in.f90 index 9a2e43e..513df94 100644 --- a/src/neasyf.in.f90 +++ b/src/neasyf.in.f90 @@ -543,7 +543,8 @@ subroutine neasyf_write_${clean(TYPE_NAME)}$_rank_${RANK}$(parent_id, name, valu , par_access & ) use netcdf, only : nf90_inq_varid, nf90_def_var, nf90_put_var, nf90_put_att, & - NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access + NF90_ENOTVAR, nf90_def_dim, nf90_inq_dimid, nf90_var_par_access, & + NF90_ENOPAR, NF90_NOERR #:if not (RANK == 0 and TYPE_NAME.startswith("character")) use netcdf, only : NF90_EDIMMETA #:endif @@ -665,8 +666,11 @@ subroutine neasyf_write_${clean(TYPE_NAME)}$_rank_${RANK}$(parent_id, name, valu if (present(par_access)) then status = nf90_var_par_access(parent_id, var_id, par_access) - call neasyf_error(status, parent_id, var=name, varid=var_id, & - message="setting parallel access") + ! Ignore errors from trying to set access property on non-parallel files + if (.not. (status == NF90_NOERR .or. status == NF90_ENOPAR)) then + call neasyf_error(status, parent_id, var=name, varid=var_id, & + message="setting parallel access") + end if end if #:if RANK == 0 diff --git a/tests/test_read.pf b/tests/test_read.pf index c57554b..5307856 100644 --- a/tests/test_read.pf +++ b/tests/test_read.pf @@ -35,7 +35,7 @@ contains integer, parameter :: NX = 5 real, dimension(NX), parameter :: expected_data = [55.5, 44.4, 33.3, 22.2, 11.1] real, dimension(NX) :: read_data - integer :: x_dim_id, var_id + integer :: x_dim_id call neasyf_dim(file_id, "x", dim_size=NX, dimid=x_dim_id) call neasyf_write(file_id, "data", expected_data, [x_dim_id]) @@ -54,7 +54,7 @@ contains integer :: i real, dimension(nx, ny), parameter :: expected_data = reshape([(i, i=1, nx*ny)], shape(expected_data)) real, dimension(nx, ny) :: read_data - integer :: x_dim_id, y_dim_id, var_id + integer :: x_dim_id, y_dim_id call neasyf_dim(file_id, "x", dim_size=nx, dimid=x_dim_id) call neasyf_dim(file_id, "y", dim_size=ny, dimid=y_dim_id) @@ -74,7 +74,7 @@ contains integer :: i real, dimension(nx, ny), parameter :: expected_data = reshape([(i, i=1, nx*ny)], shape(expected_data)) real, dimension(nx - 2) :: read_data - integer :: x_dim_id, y_dim_id, var_id + integer :: x_dim_id, y_dim_id call neasyf_dim(file_id, "x", dim_size=nx, dimid=x_dim_id) call neasyf_dim(file_id, "y", dim_size=ny, dimid=y_dim_id) @@ -92,7 +92,6 @@ contains subroutine test_read_scalar_character character(len=*), parameter :: expected_data = "some words" character(len=len(expected_data)) :: read_data - integer :: var_id call neasyf_write(file_id, "data", values="some words") call neasyf_close(file_id) diff --git a/tests/test_write.pf b/tests/test_write.pf index f1a6695..81a674d 100644 --- a/tests/test_write.pf +++ b/tests/test_write.pf @@ -113,7 +113,7 @@ contains integer :: i real, dimension(nx, nt), parameter :: read_data = reshape([(i, i=1, nx*nt)], shape(read_data)) real, dimension(nx, nt) :: expected_data - integer :: x_dim_id, y_dim_id, var_id + integer :: x_dim_id, var_id call neasyf_dim(file_id, "x", dim_size=nx, dimid=x_dim_id) call neasyf_dim(file_id, "t", unlimited=.true.) @@ -167,6 +167,25 @@ contains @assertEqual(expected_data, read_data) end subroutine test_write_1d_dim_names + @test + subroutine test_write_1d_serial_with_par_access + integer, parameter :: NX = 5 + real, dimension(NX), parameter :: read_data = [55.5, 44.4, 33.3, 22.2, 11.1] + real, dimension(NX) :: expected_data + integer :: var_id + + call neasyf_dim(file_id, "x", dim_size=NX) + call neasyf_write(file_id, "data", read_data, dim_names=["x"], par_access=1) + call neasyf_close(file_id) + + call neasyf_error(nf90_open(temp_file, NF90_NOWRITE, file_id)) + call neasyf_error(nf90_inq_varid(file_id, "data", var_id)) + call neasyf_error(nf90_get_var(file_id, var_id, expected_data)) + call neasyf_close(file_id) + + @assertEqual(expected_data, read_data) + end subroutine test_write_1d_serial_with_par_access + @test subroutine test_write_2d_dim_names integer, parameter :: nx = 5, ny = 3 @@ -195,7 +214,7 @@ contains real, dimension(nx, nt), parameter :: read_data = reshape([(i, i=1, nx*nt)], shape(read_data)) real, dimension(nx, nt) :: expected_data integer, parameter :: expected_deflate_level = 1 - integer :: x_dim_id, y_dim_id, var_id, deflate_level + integer :: x_dim_id, var_id, deflate_level logical :: shuffle call neasyf_dim(file_id, "x", dim_size=nx, dimid=x_dim_id) @@ -226,7 +245,7 @@ contains real, dimension(nx, nt), parameter :: read_data = reshape([(i, i=1, nx*nt)], shape(read_data)) real, dimension(nx, nt) :: expected_data integer, parameter :: expected_deflate_level = 1 - integer :: x_dim_id, y_dim_id, var_id, deflate_level + integer :: x_dim_id, var_id, deflate_level logical :: shuffle call neasyf_dim(file_id, "x", dim_size=nx, dimid=x_dim_id)