[Dart-dev] DART/branches Revision: 11704

dart at ucar.edu dart at ucar.edu
Thu Jun 8 10:26:33 MDT 2017


hendric at ucar.edu
2017-06-08 10:26:31 -0600 (Thu, 08 Jun 2017)
186
mpi version for reading single file restart files.
this tries to reuse the logic already in place in
direct_netcdf_mod but currently the model is crashing
after reading the first copy.




Modified: DART/branches/rma_par_single_file/assimilation_code/modules/assimilation/filter_mod.f90
===================================================================
--- DART/branches/rma_par_single_file/assimilation_code/modules/assimilation/filter_mod.f90	2017-06-08 03:47:55 UTC (rev 11703)
+++ DART/branches/rma_par_single_file/assimilation_code/modules/assimilation/filter_mod.f90	2017-06-08 16:26:31 UTC (rev 11704)
@@ -673,12 +673,12 @@
       endif
 
       ! we are going to advance the model - make sure we're doing single file output
-      if (.not. has_cycling) then
-         call error_handler(E_ERR,'filter:', &
-             'advancing the model inside filter and multiple file output not currently supported', &
-             source, revision, revdate, text2='support will be added in subsequent releases', &
-             text3='set "single_file_out=.true" for filter to advance the model, or advance the model outside filter')
-      endif
+      ! if (.not. has_cycling) then
+      !    call error_handler(E_ERR,'filter:', &
+      !        'advancing the model inside filter and multiple file output not currently supported', &
+      !        source, revision, revdate, text2='support will be added in subsequent releases', &
+      !        text3='set "single_file_out=.true" for filter to advance the model, or advance the model outside filter')
+      ! endif
 
       call trace_message('Ready to run model to advance data ahead in time', 'filter:', -1)
       call print_ens_time(state_ens_handle, 'Ensemble data time before advance')

Modified: DART/branches/rma_par_single_file/assimilation_code/modules/io/dart_time_io_mod.f90
===================================================================
--- DART/branches/rma_par_single_file/assimilation_code/modules/io/dart_time_io_mod.f90	2017-06-08 03:47:55 UTC (rev 11703)
+++ DART/branches/rma_par_single_file/assimilation_code/modules/io/dart_time_io_mod.f90	2017-06-08 16:26:31 UTC (rev 11704)
@@ -163,7 +163,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
@@ -213,7 +213,7 @@
 
 ! this is used in many error messages below.  set it here, and
 ! don't reuse string3 here, please.
-write(string3,*)'You may need to supply a model-specific "write_model_time()" to write the time.'
+write(string3,*)'You may need to supply a model-specific "default write_model_time()" to write the time.'
 
 ios = nf90_inq_varid(ncid, "time", VarID)
 
@@ -220,25 +220,32 @@
 ! if the file doesn't already have a "time" variable, we make one
 if (ios /= NF90_NOERR) then
 
-   call error_handler(E_MSG,'write_model_time','no time variable found in file', &
+   call error_handler(E_MSG,'default write_model_time','no time variable found in file', &
               source, revision, revdate, text2='creating one')
 
-   ! begin define mode
    ios = nf90_Redef(ncid)
-   call nc_check(ios, "write_model_time", "redef")
+   call nc_check(ios, "default write_model_time", "redef")
 
+   ! check to see if there is a time and date_str_length
+   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)), &
+        "default 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")
+   call nc_check(ios, "default write_model_time", "time def_var")
 
    ! define time attributes consistent with CF convention
    ios = nf90_put_att(ncid, VarID, "long_name", "valid time of the model state")
-   call nc_check(ios, "write_model_time", "time long_name")
+   call nc_check(ios, "default write_model_time", "time long_name")
 
    call get_calendar_string(dart_calendar)
    if (dart_calendar == 'NO_CALENDAR') then
       ios = nf90_put_att(ncid, VarID, "calendar", "none")
-      call nc_check(ios, "write_model_time", "calendar long_name")
+      call nc_check(ios, "default write_model_time", "calendar long_name")
 
       ! ncview (actually, probably udunits2) crashes or errors out or 
       ! displays misleading plot axes if you use 'days since ...' as the units.
@@ -245,22 +252,22 @@
       ! if you simply use 'days' it works much better.
 
       ios = nf90_put_att(ncid, VarID, "units", "days")
-      call nc_check(ios, "write_model_time", "units long_name")
+      call nc_check(ios, "default write_model_time", "units long_name")
 
    else if (dart_calendar == 'GREGORIAN') then
       ios = nf90_put_att(ncid, VarID, "calendar", "gregorian")
-      call nc_check(ios, "write_model_time", "calendar long_name")
+      call nc_check(ios, "default write_model_time", "calendar long_name")
 
       ios = nf90_put_att(ncid, VarID, "units", "days since 1601-01-01 00:00:00")
-      call nc_check(ios, "write_model_time", "units long_name")
+      call nc_check(ios, "default write_model_time", "units long_name")
    else


More information about the Dart-dev mailing list