[Dart-dev] DART/branches Revision: 12559

dart at ucar.edu dart at ucar.edu
Thu Apr 26 10:41:59 MDT 2018


nancy at ucar.edu
2018-04-26 10:41:59 -0600 (Thu, 26 Apr 2018)
264
fix a logical/integer mismatch in netcdf utils.  i'd prefer NOT to
pass netcdf id numbers out of the netcdf utils if possible.  use names
in all the calls for dims and vars.

added a check for single_file_io, and fail if present.  the multi-file
code is working.




Modified: DART/branches/rma_fill_inf/assimilation_code/modules/utilities/netcdf_utilities_mod.f90
===================================================================
--- DART/branches/rma_fill_inf/assimilation_code/modules/utilities/netcdf_utilities_mod.f90	2018-04-25 16:46:09 UTC (rev 12558)
+++ DART/branches/rma_fill_inf/assimilation_code/modules/utilities/netcdf_utilities_mod.f90	2018-04-26 16:41:59 UTC (rev 12559)
@@ -917,11 +917,19 @@
 
 !--------------------------------------------------------------------
 
+!>@todo FIXME:
+! routines like this are NOT encouraged!!!  
+! i'm trying to hide netcdf id numbers so the caller doesn't have to 
+! bookkeep them.  i use dim names or var names in all other calls 
+! and look up the id here to use it.
+!
+! (i see this routine is not public, so good.)
+
 function nc_get_dimension_id(ncid, dimname)
 
 integer,          intent(in) :: ncid
 character(len=*), intent(in) :: dimname
-logical                      :: nc_get_dimension_id
+integer                      :: nc_get_dimension_id
 
 character(len=*), parameter :: routine = 'nc_get_dimension_id'
 integer :: ret, dimid

Modified: DART/branches/rma_fill_inf/assimilation_code/programs/fill_inflation_restart/fill_inflation_restart.f90
===================================================================
--- DART/branches/rma_fill_inf/assimilation_code/programs/fill_inflation_restart/fill_inflation_restart.f90	2018-04-25 16:46:09 UTC (rev 12558)
+++ DART/branches/rma_fill_inf/assimilation_code/programs/fill_inflation_restart/fill_inflation_restart.f90	2018-04-26 16:41:59 UTC (rev 12559)
@@ -70,6 +70,11 @@
 ! The namelist variables
 !------------------------------------------------------------------
 
+!>@todo FIXME:
+! input num_ens could = 1
+! and output num_ens could be 4, and only the ones being used could
+! be written.
+
 logical                       :: single_file = .false.
 integer                       :: num_ens = 2 !#! {prior,posterior}_inf_{mean,sd}
 character(len=256)            :: input_state_files(MAX_FILES)  = 'null'
@@ -122,10 +127,8 @@
 call check_namelist_read(iunit, io, "fill_inflation_restart_nml")
 
 !----------------------------------------------------------------------
-! Calling static_init_assim_model() is required for all tests.
-! It also calls static_init_model(), so there is no need to explicitly call
-! that. Furthermore, the low-order models have no check in them to prevent
-! static_init_model() from being called twice, so it BOMBS if you call both.
+! Calling static_init_assim_model() is required, which also calls
+! static_init_model(), so there is no need to explicitly call it.
 !----------------------------------------------------------------------
 
 call static_init_assim_model()
@@ -134,18 +137,6 @@
 ! initialization code, model size
 !----------------------------------------------------------------------
 
-if (verbose) then
-   string1 = 'To suppress the detailed list of the variables that comprise the DART state'
-   string2 = 'set "verbose = .FALSE." in the fill_inflation_restart_nml namelist.'
-   !todo: add print statement
-   do idomain = 1,get_num_domains()
-      call state_structure_info(idomain)
-   enddo
-else
-   string1 = 'To print a detailed list of the variables that comprise the DART state'
-   string2 = 'set "verbose = .TRUE." in the fill_inflation_restart_nml namelist.'
-endif
-
 model_size = get_model_size()
 
 !----------------------------------------------------------------------
@@ -165,7 +156,9 @@
 file_array_output = RESHAPE(output_state_files, (/num_ens,  num_domains/))
 
 if(single_file) then
-file_array_output = file_array_input
+  call error_handler(E_ERR, 'fill_inflation_restart: ', 'single_file not yet supported', &
+                     source, revision, revdate)
+  file_array_output = file_array_input
 endif
 
 ! Test the read portion.
@@ -214,7 +207,7 @@
 call read_state(ens_handle, file_info_input, read_time_from_file, model_time)
 
 if(single_file) then
-   call nc_insert_varialble('filter_input.nc', varname='prior_inf_mean', copynum=1)
+   call nc_insert_variable('filter_input.nc', varname='prior_inf_mean', copynum=1)
    return
 else
 
@@ -305,7 +298,7 @@
 
 !> initialize modules that need it
 
-subroutine nc_insert_varialble(filename, varname, copynum)
+subroutine nc_insert_variable(filename, varname, copynum)
 character(len=*), intent(in) :: filename


More information about the Dart-dev mailing list