MONC
Functions/Subroutines
netcdf_misc_mod Module Reference

NetCDF misc functionality which can be shared between modules that work with NetCDF files. More...

Functions/Subroutines

subroutine, public check_netcdf_status (status, found_flag)
 Will check a NetCDF status and write to log_log error any decoded statuses. Can be used to decode whether a dimension or variable exists within the NetCDF data file. More...
 

Detailed Description

NetCDF misc functionality which can be shared between modules that work with NetCDF files.

Function/Subroutine Documentation

◆ check_netcdf_status()

subroutine, public netcdf_misc_mod::check_netcdf_status ( integer, intent(in)  status,
logical, intent(out), optional  found_flag 
)

Will check a NetCDF status and write to log_log error any decoded statuses. Can be used to decode whether a dimension or variable exists within the NetCDF data file.

Parameters
statusThe NetCDF status flag
foundFlagWhether the field has been found or not

Definition at line 19 of file netcdf_misc.F90.

19  integer, intent(in) :: status
20  logical, intent(out), optional :: found_flag
21 
22  if (present(found_flag)) then
23  found_flag = status /= nf90_ebaddim .and. status /= nf90_enotatt .and. status /= nf90_enotvar
24  if (.not. found_flag) return
25  end if
26 
27  if (status /= nf90_noerr) then
28  call log_log(log_error, "NetCDF returned error code of "//trim(nf90_strerror(status)))
29  end if
Here is the call graph for this function:
Here is the caller graph for this function: