[Dart-dev] DART/branches Revision: 11749
dart at ucar.edu
dart at ucar.edu
Thu Jun 15 17:39:23 MDT 2017
hendric at ucar.edu
2017-06-15 17:39:19 -0600 (Thu, 15 Jun 2017)
77
can now run with multiple ensemble members and
fixing up print statements
Modified: DART/branches/rma_mmc/assimilation_code/modules/io/dart_time_io_mod.f90
===================================================================
--- DART/branches/rma_mmc/assimilation_code/modules/io/dart_time_io_mod.f90 2017-06-15 23:12:11 UTC (rev 11748)
+++ DART/branches/rma_mmc/assimilation_code/modules/io/dart_time_io_mod.f90 2017-06-15 23:39:19 UTC (rev 11749)
@@ -57,7 +57,6 @@
real(digits12) :: model_time, time_array(1)
integer, dimension(NF90_MAX_VAR_DIMS) :: dimIDs
-character(len=NF90_MAX_NAME) :: varname,dimname
character(len=256) :: file_calendar, dart_calendar
character(len=256) :: unitstring
@@ -163,7 +162,7 @@
endif
! This is the start of their calendar
- base_time = set_date(year, month, day, hour, minute, second)
+ base_time = set_date(year, month, day, hour, minute, second)
delta_time = set_time(seconds)
read_model_time = base_time + delta_time
@@ -208,8 +207,7 @@
real(digits12) :: model_time
integer, dimension(NF90_MAX_VAR_DIMS) :: dimIDs
-character(len=NF90_MAX_NAME) :: varname,dimname
-character(len=NF90_MAX_NAME) :: dart_calendar, file_calendar
+character (len=NF90_MAX_NAME) :: dart_calendar, file_calendar
! this is used in many error messages below. set it here, and
! don't reuse string3 here, please.
@@ -227,6 +225,15 @@
ios = nf90_Redef(ncid)
call nc_check(ios, "write_model_time", "redef")
+ ! check to see if there is a time dimension
+ ios = nf90_inq_dimid(ncid, "time", dimIds(1))
+
+ ! if time dimension does not exist create it
+ if (ios /= NF90_NOERR) then
+ call nc_check(nf90_def_dim(ncid, "time", nf90_unlimited, dimIds(1)), &
+ "write_model_time def_var dimension time")
+ endif
+
!>@todo NF90_UNLIMITED
ios = nf90_def_var(ncid, name="time", xtype=nf90_int, varid=VarID)
call nc_check(ios, "write_model_time", "time def_var")
@@ -295,7 +302,7 @@
! Since the time variable is known to have only 1 dimension, we know it is the first one.
-ios = nf90_inquire_dimension(ncid, dimids(1), len=ntimes)
+ios = nf90_inquire_dimension(ncid, dimIds(1), len=ntimes)
call nc_check(ios, 'write_model_time', 'inquire_dimension for time dimension')
! convert time to something that netCDF can store, fractional days
Modified: DART/branches/rma_mmc/assimilation_code/modules/io/io_filenames_mod.f90
===================================================================
--- DART/branches/rma_mmc/assimilation_code/modules/io/io_filenames_mod.f90 2017-06-15 23:12:11 UTC (rev 11748)
+++ DART/branches/rma_mmc/assimilation_code/modules/io/io_filenames_mod.f90 2017-06-15 23:39:19 UTC (rev 11749)
@@ -487,8 +487,8 @@
file_info%stage_metadata%copy_name( cnum) = trim(basename)
! check that the number of domains matches the size of file names provided
-if (get_num_domains() /= size(fnames(:),1)) then
- write(msgstring,'(A,I2,A,I2)') 'num domains ', get_num_domains(), &
+if (get_num_domains() > 1 ) then !.and. get_num_domains() /= size(fnames(:),1)) then
+ write(msgstring,'(A,I2,A,I2)') 'num_domains ', get_num_domains(), &
' /= size(fnames) : ', size(fnames(:),1)
call error_handler(E_ERR, 'set_explicit_file_metadata', msgstring, &
source, revision, revdate)
More information about the Dart-dev
mailing list