Open hkershaw-brown opened 2 years ago
dart_time_io_mod.f90 uses its own local has_unlimited rather than the state_structure_mod domain%has_unlimited
In create_and_open_state_output
, only 'time' (lower case) can be the unlimited dimension.
If you have an unlimited dimension in the state_structure_mod, e.g. WRF has 'Time' this gets created as a limited dimension.
This means that your created netcdf files have a different netcdf dimension structure than your model files.
has_unlimited
is a property of the state_stucture%domain, but it is (can be) different between netcdf files because of create_and_open_state_output. I think this is why dart_time_io_mod is querying the netcdf file rather than the state_structure (see comment above).
There is also domain%variable(ivar)%var_has_unlim
which is per variable, set but never used.
This is a hard coded 0 however, there is a integer, parameter :: SINGLE_IO_TASK_ID = 0
in the module.
local_model_mod_will_write_state_variables
initialize_single_file_io
(ens_handle, file_handle) should you be using ens_handle%my_pe rather than my_task_id for this routine? Maybe it does not matter. Similarly for read_single_file
:
https://github.com/NCAR/DART/blob/cc1da67976feb3b092ac9eae7388f6181ef33154/assimilation_code/modules/io/direct_netcdf_mod.f90#L536-L538perfect_model_obs has namelist options:
single_file_in
single_file_out
but the number of copies is hardcoded at 1 when initializing the filenames https://github.com/NCAR/DART/blob/ba00b2c5c89ead8e27cd6436276c90eb00ddd48b/assimilation_code/programs/perfect_model_obs/perfect_model_obs.f90#L287
and the ens_size is fixed at 1: https://github.com/NCAR/DART/blob/ba00b2c5c89ead8e27cd6436276c90eb00ddd48b/assimilation_code/programs/perfect_model_obs/perfect_model_obs.f90#L166
what is the single_file_in/out for in perfect_model_obs?
we need to rename the file format that puts all the ensemble members plus inflation copies, mean, sd, etc in a single netcdf file (that dart dictates the format of).
we called it "single file" but as you point out that's confusing for the situation where there is only 1 member involved. the code is going to expect to read a netcdf file with specific dimension names and variable names.
other suggestions for this format? combination file, combined file, dart format file, ???
I think my question is even more simple than that, do we need single_file_in as a namelist option for perfect_model_obs? I think it only every runs with 1 copy, but am I missing something?
yes, because even though there is always only 1 input and output file, this item toggles on and off the dart netcdf format file vs a model netcdf file.
the namelist variable name is confusing because we called dart format files "single file" no matter how many members are in it.
yeah I get it, just thinking about refactoring. Maybe it would be better to have the file describe itself as 'dart format'
if the dart file had a global attribute to indicate it was "dart format" that would be good -- make it more self-describing. then maybe a namelist item wouldn't be needed. that would be nice.
but we'd have to think about how the code could use it. it might need to open the file, look for the attribute and then decide whether to use the state structure setup info from the model's static_init_model or the dart defined format to read the file. i'm not clear if there is an order of things that works however.
it would be nice if the i/o code could use the state structure for reading a dart format file but with all the members in a single netcdf variable i don't know if it can.
assert_restart_names_initialized
is printing the error message from assert_file_info_initialized
add_domain_blank is not blank (just a state vector) it has 3 dimensions: location, member, time. The are appropriate for lorenz_X style models, but not necessarily appropriate for anything else.
state%domain(dom_id)%unique_dim_names(1) = 'location'
state%domain(dom_id)%unique_dim_names(2) = 'member'
state%domain(dom_id)%unique_dim_names(3) = 'time'
The 'member' dimension for the single file IO - again blending state_structure & IO (which are not the same, but currently are in the same state_structure).
diagnostic structure in the code but not used at all half used? https://github.com/NCAR/DART/blob/924182f29ce23f2a4e4c53aa57cc7d00fdccf374/assimilation_code/modules/io/state_structure_mod.f90#L131-L135
Note this routines comment says is is depreciated
https://github.com/NCAR/DART/blob/f193ab47f8079445f3a58c848a2b54469c130a84/assimilation_code/modules/io/state_structure_mod.f90#L131-L135
Then Used with a comment "may not be needed"
Then domain = 1 is hardcoded anyway https://github.com/NCAR/DART/blob/f193ab47f8079445f3a58c848a2b54469c130a84/assimilation_code/modules/io/direct_netcdf_mod.f90#L2266-L2273
Notes for state IO
read_variables is public and is used by mpas_atm/update_bc.f90
out of date comments in state_vector_iod_mod.f90 (e.g reference to construct_file_name_in() which no longer exists)
io_filenames_mod has a bunch of references to diagnostic files which no longer exist
io_filanmes_mod is doing a bunch of netcdf variable checking
stages_to_write is in state_vector_io_mod - more sense to have this info in io_fileaames_mod?
see #283 for round robin assumption
write_augmented_state - why the restriction on
! if there is only one timestep in your input file insert the mean and sd if requested
NO COPY BACK variables vs. per-ensemble static data.
perturb_single_instance with NO_COPY_BACK (see #276)
perfect_model_obs - should this have single_file_in/out namelist options?
Marlee is working on the state stucture (see #106)
clamp_or_fail is in some model_mods, but not used at all https://github.com/NCAR/DART/issues/404#issuecomment-1894552566
diagnostic structure in the code but not
used at allhalf used see https://github.com/NCAR/DART/issues/359#issuecomment-2293486652? https://github.com/NCAR/DART/blob/924182f29ce23f2a4e4c53aa57cc7d00fdccf374/assimilation_code/modules/io/state_structure_mod.f90#L131-L135assuming unlimited dimension is by domain
assuming only 1 unlimited dimension
assuming 1d,2d,or 3d variables