diff --git a/assimilation_code/modules/utilities/utilities_mod.f90 b/assimilation_code/modules/utilities/utilities_mod.f90 index 6c21119fdd..cbe78ca498 100644 --- a/assimilation_code/modules/utilities/utilities_mod.f90 +++ b/assimilation_code/modules/utilities/utilities_mod.f90 @@ -38,7 +38,6 @@ module utilities_mod error_handler, & to_upper, & squeeze_out_blanks, & - nc_check, & ! remove this; moved to netcdf_utils next_file, & ! deprecate this logfileunit, & nmlfileunit, & @@ -1321,39 +1320,6 @@ subroutine set_tasknum (tasknum) end subroutine set_tasknum -!----------------------------------------------------------------------- - -!>@todo FIXME: remove this once all other code is calling -!>this from the netcdf_utilities_mod instead. - -subroutine nc_check(istatus, subr_name, context) - -use netcdf - -integer, intent (in) :: istatus -character(len=*), intent(in) :: subr_name -character(len=*), intent(in), optional :: context - -! if no error, nothing to do here. we are done. -if(istatus == nf90_noerr) return - - -! something wrong. construct an error string and call the handler. - -! context is optional, but is very useful if specified. -! if context + error code > 512, the assignment will truncate. -if (present(context) ) then - msgstring1 = trim(context) // ': ' // trim(nf90_strerror(istatus)) -else - msgstring1 = nf90_strerror(istatus) -endif - -! this does not return -call error_handler(E_ERR, 'nc_check', msgstring1, source, text2=subr_name) - -end subroutine nc_check - - !----------------------------------------------------------------------- !> convert a string to upper case *in place* diff --git a/assimilation_code/programs/compute_error/compute_error.f90 b/assimilation_code/programs/compute_error/compute_error.f90 index f4f1d326a0..9fe5fa69df 100644 --- a/assimilation_code/programs/compute_error/compute_error.f90 +++ b/assimilation_code/programs/compute_error/compute_error.f90 @@ -27,10 +27,10 @@ program compute_error use utilities_mod, only : initialize_utilities, & error_handler, nmlfileunit, E_MSG, E_ERR, & - find_namelist_in_file, nc_check, & + find_namelist_in_file, & check_namelist_read, finalize_utilities, & do_nml_file, do_nml_term - +use netcdf_utilities_mod, only : nc_check use netcdf implicit none diff --git a/models/NCOMMAS/model_mod.f90 b/models/NCOMMAS/model_mod.f90 index a7204391d5..f64d9e66cd 100644 --- a/models/NCOMMAS/model_mod.f90 +++ b/models/NCOMMAS/model_mod.f90 @@ -30,7 +30,7 @@ module model_mod use utilities_mod, only : register_module, error_handler, & E_ERR, E_WARN, E_MSG, logfileunit, get_unit, & - nc_check, do_output, to_upper, & + do_output, to_upper, & find_namelist_in_file, check_namelist_read, & open_file, file_exist, find_textfile_dims, & file_to_text @@ -44,6 +44,8 @@ module model_mod use random_seq_mod, only: random_seq_type, init_random_seq, random_gaussian +use netcdf_utilities_mod, only : nc_check + use typesizes use netcdf diff --git a/models/am2/model_mod.f90 b/models/am2/model_mod.f90 index 24261936a8..8a05928550 100644 --- a/models/am2/model_mod.f90 +++ b/models/am2/model_mod.f90 @@ -21,7 +21,7 @@ module model_mod use time_manager_mod, only : time_type, set_time, print_time, set_calendar_type, GREGORIAN use utilities_mod, only : open_file, close_file, find_namelist_in_file, check_namelist_read, & register_module, error_handler, file_exist, E_ERR, E_WARN, E_MSG, & - nmlfileunit, do_output, nc_check, do_nml_file, do_nml_term, logfileunit + nmlfileunit, do_output, do_nml_file, do_nml_term, logfileunit use mpi_utilities_mod, only : my_task_id, task_count use location_mod, only : location_type, get_close_maxdist_init, & get_close_obs_init, get_close_obs, set_location, & @@ -33,7 +33,7 @@ module model_mod get_index_for_type_of_obs, get_quantity_for_type_of_obs ! We'll need to add a kind_cloud_fraction to correspond to AM2 prog var use location_mod, only: VERTISSURFACE, VERTISLEVEL - + use netcdf_utilities_mod, only : nc_check implicit none private diff --git a/models/forced_barot/obs/obs_mod.f90 b/models/forced_barot/obs/obs_mod.f90 index 223068eec5..c31bdcf40a 100644 --- a/models/forced_barot/obs/obs_mod.f90 +++ b/models/forced_barot/obs/obs_mod.f90 @@ -17,7 +17,7 @@ module obs_mod use utilities_mod, only : file_exist, open_file, close_file, & register_module, error_handler, E_ERR, E_MSG, & nmlfileunit, find_namelist_in_file, & - check_namelist_read, nc_check, do_output + check_namelist_read, do_output implicit none private diff --git a/models/mpas_atm/mpas_dart_obs_preprocess.f90 b/models/mpas_atm/mpas_dart_obs_preprocess.f90 index 1bb8991b7f..68315475a0 100644 --- a/models/mpas_atm/mpas_dart_obs_preprocess.f90 +++ b/models/mpas_atm/mpas_dart_obs_preprocess.f90 @@ -32,7 +32,7 @@ program mpas_dart_obs_preprocess use types_mod, only : r8, missing_r8, earth_radius, RAD2DEG, DEG2RAD, i8 use utilities_mod, only : error_handler, E_MSG, find_namelist_in_file, & - check_namelist_read, nc_check, initialize_utilities, & + check_namelist_read, initialize_utilities, & finalize_utilities use time_manager_mod, only : time_type, operator(>=), operator(<), operator(>), operator(<=), & increment_time, decrement_time, operator(-), operator(+), & @@ -74,7 +74,6 @@ program mpas_dart_obs_preprocess cell_ok_to_interpolate, is_global_grid, & get_bdy_mask, get_cell_center_coords use ensemble_manager_mod, only : ensemble_type, init_ensemble_manager, end_ensemble_manager - use netcdf implicit none diff --git a/models/mpas_atm/update_bc.f90 b/models/mpas_atm/update_bc.f90 index 63c41d0f6a..1fad8858e9 100644 --- a/models/mpas_atm/update_bc.f90 +++ b/models/mpas_atm/update_bc.f90 @@ -23,7 +23,7 @@ program update_bc use types_mod, only : r8 use utilities_mod, only : initialize_utilities, finalize_utilities, & find_namelist_in_file, check_namelist_read, & - logfileunit, open_file, close_file, nc_check, & + logfileunit, open_file, close_file, & get_next_filename, E_ERR, error_handler use time_manager_mod, only : time_type, print_time, print_date, operator(-), & get_time, get_date, operator(/=) @@ -37,7 +37,7 @@ program update_bc use netcdf_utilities_mod, only : nc_open_file_readonly, & nc_open_file_readwrite, & - nc_get_dimension_size, & ! Ha + nc_get_dimension_size, & nc_close_file use netcdf diff --git a/models/mpas_ocn/model_mod_check.f90 b/models/mpas_ocn/model_mod_check.f90 index c55c814a19..ef6151d3a5 100644 --- a/models/mpas_ocn/model_mod_check.f90 +++ b/models/mpas_ocn/model_mod_check.f90 @@ -11,7 +11,7 @@ program model_mod_check !---------------------------------------------------------------------- use types_mod, only : r8, digits12, metadatalength, MISSING_R8, rad2deg -use utilities_mod, only : initialize_utilities, finalize_utilities, nc_check, & +use utilities_mod, only : initialize_utilities, finalize_utilities, & open_file, close_file, find_namelist_in_file, & check_namelist_read, nmlfileunit, do_nml_file, do_nml_term, & E_MSG, E_ERR, error_handler, get_unit @@ -44,7 +44,7 @@ program model_mod_check get_model_analysis_filename, analysis_file_to_statevector, & statevector_to_analysis_file, get_analysis_time, & write_model_time, get_grid_dims - +use netcdf_utilities_mod, only : nc_check use netcdf use typesizes diff --git a/models/pe2lyr/model_mod.f90 b/models/pe2lyr/model_mod.f90 index e2ff881cc8..a59b128d72 100644 --- a/models/pe2lyr/model_mod.f90 +++ b/models/pe2lyr/model_mod.f90 @@ -14,7 +14,7 @@ module model_mod use types_mod, only : r8, MISSING_R8 use time_manager_mod, only : time_type, set_time -use utilities_mod, only : file_exist, open_file, close_file, nc_check, & +use utilities_mod, only : file_exist, open_file, close_file, & register_module, error_handler, E_ERR, E_MSG use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian use location_mod, only : location_type, get_location, set_location, get_dist, & @@ -23,7 +23,7 @@ module model_mod use obs_kind_mod, only : QTY_U_WIND_COMPONENT, QTY_V_WIND_COMPONENT, & QTY_GEOPOTENTIAL_HEIGHT - +use netcdf_utilities_mod, only : nc_check use pe2lyr_mod, only : modelvars, modelvars_init, rk4 use spharmt_mod, only : sphere, getvrtdiv, spharm, spharmt_init, getuv diff --git a/models/rose/model_mod.f90 b/models/rose/model_mod.f90 index 0ade22ad83..9b108f96c5 100644 --- a/models/rose/model_mod.f90 +++ b/models/rose/model_mod.f90 @@ -25,10 +25,11 @@ module model_mod use utilities_mod, only : file_exist, open_file, close_file, & error_handler, E_ERR, E_MSG, E_WARN, nmlfileunit, & do_output, find_namelist_in_file, check_namelist_read, & - do_nml_file, do_nml_term, nc_check + do_nml_file, do_nml_term use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian use obs_kind_mod, only : QTY_U_WIND_COMPONENT, QTY_V_WIND_COMPONENT,& QTY_TEMPERATURE +use netcdf_utilities_mod, only : nc_check use typesizes use netcdf diff --git a/models/wrf_hydro/create_identity_streamflow_obs.f90 b/models/wrf_hydro/create_identity_streamflow_obs.f90 index edee0c5735..f39141eddb 100644 --- a/models/wrf_hydro/create_identity_streamflow_obs.f90 +++ b/models/wrf_hydro/create_identity_streamflow_obs.f90 @@ -18,7 +18,7 @@ program create_identity_streamflow_obs use location_mod, only : VERTISHEIGHT, location_type, get_location -use utilities_mod, only : nc_check, nmlfileunit, do_nml_file, do_nml_term, & +use utilities_mod, only : nmlfileunit, do_nml_file, do_nml_term, & initialize_utilities, finalize_utilities, & find_namelist_in_file, check_namelist_read, & error_handler, E_ERR, E_MSG, & @@ -47,7 +47,7 @@ program create_identity_streamflow_obs get_number_of_links use sort_mod, only : index_sort - +use netcdf_utilities_mod, only : nc_check use netcdf implicit none diff --git a/observations/forward_operators/obs_def_GRACE_mod.f90 b/observations/forward_operators/obs_def_GRACE_mod.f90 index 6cdee992cb..042bb9b421 100644 --- a/observations/forward_operators/obs_def_GRACE_mod.f90 +++ b/observations/forward_operators/obs_def_GRACE_mod.f90 @@ -66,13 +66,12 @@ module obs_def_GRACE_mod use utilities_mod, only : register_module, E_ERR, E_MSG, error_handler, & check_namelist_read, find_namelist_in_file, & nmlfileunit, do_output, do_nml_file, do_nml_term, & - nc_check, file_exist, is_longitude_between + file_exist, is_longitude_between use assim_model_mod, only : interpolate use ensemble_manager_mod, only : ensemble_type use obs_def_utilities_mod, only : track_status - use typesizes use netcdf diff --git a/observations/obs_converters/USGS/convert_streamflow.f90 b/observations/obs_converters/USGS/convert_streamflow.f90 index f6de317363..86e2edb31c 100644 --- a/observations/obs_converters/USGS/convert_streamflow.f90 +++ b/observations/obs_converters/USGS/convert_streamflow.f90 @@ -17,7 +17,7 @@ program convert_streamflow use location_mod, only : VERTISHEIGHT -use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & +use utilities_mod, only : initialize_utilities, finalize_utilities, & nmlfileunit, do_nml_file, do_nml_term, & find_namelist_in_file, check_namelist_read, & error_handler, E_ERR, E_MSG, find_textfile_dims, & @@ -39,7 +39,7 @@ program convert_streamflow use obs_utilities_mod, only : getvar_real, getvar_int, get_or_fill_QC, add_obs_to_seq, & create_3d_obs, getvar_int, getdimlen, set_missing_name - +use netcdf_utilities_mod, only : nc_check use netcdf implicit none diff --git a/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 b/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 index 476dae517e..d6276a9845 100644 --- a/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 +++ b/observations/obs_converters/utilities/obs_seq_utilities_mod.f90 @@ -11,7 +11,7 @@ module obs_seq_utilities_mod use types_mod, only : r8, MISSING_R8, MISSING_I -use utilities_mod, only : nc_check, E_MSG, E_ERR, error_handler +use utilities_mod, only : E_MSG, E_ERR, error_handler use obs_def_mod, only : obs_def_type, set_obs_def_time, set_obs_def_kind, & set_obs_def_error_variance, set_obs_def_location, & get_obs_def_time, get_obs_def_location, & @@ -46,7 +46,6 @@ module obs_seq_utilities_mod destroy_obs, destroy_obs_sequence, & get_num_key_range, get_obs_key - use netcdf implicit none