[Dart-dev] DART/branches Revision: 11779

dart at ucar.edu dart at ucar.edu
Wed Jun 28 15:56:04 MDT 2017


hendric at ucar.edu
2017-06-28 15:56:02 -0600 (Wed, 28 Jun 2017)
137

if running with single file IO you must have a member dimension in
your state file. printing out a simple error message to warn users.




Modified: DART/branches/rma_par_single_file/assimilation_code/modules/io/direct_netcdf_mod.f90
===================================================================
--- DART/branches/rma_par_single_file/assimilation_code/modules/io/direct_netcdf_mod.f90	2017-06-28 20:19:57 UTC (rev 11778)
+++ DART/branches/rma_par_single_file/assimilation_code/modules/io/direct_netcdf_mod.f90	2017-06-28 21:56:02 UTC (rev 11779)
@@ -485,7 +485,7 @@
 logical, optional,    intent(in)    :: pert_from_single_copy !> reading single file and perturbing
 
 ! NetCDF IO variables
-integer                               :: my_ncid, varid, TimeDimID, ret 
+integer                               :: my_ncid, varid, TimeDimID, MemDimID, ret 
 character     (len=NF90_MAX_NAME    ) :: fname, varname, copyname
 integer, dimension(NF90_MAX_VAR_DIMS) :: dim_lengths
 integer, dimension(NF90_MAX_VAR_DIMS) :: dim_start_point
@@ -525,6 +525,13 @@
 ret = nf90_open(fname, NF90_NOWRITE, my_ncid)
 call nc_check(ret, 'read_single_file: nf90_open', fname)
 
+ret = nf90_inq_dimid(my_ncid, "member", MemDimID)
+if (ret /= NF90_NOERR) then
+   call error_handler(E_ERR,'direct_netcdf_mod:', &
+         'If using single_file_in/single_file_out = .true. ', &
+          source, revision, revdate, text2='you must have a member dimension in your input/output file.')
+endif
+
 ret = nf90_inq_dimid(my_ncid, "time", TimeDimID)
 call nc_check(ret, 'read_single_file', 'inq_varid time : '//trim(fname))
 


More information about the Dart-dev mailing list