Each routine includes usual things it often has to do for a large geophysical model. this is different from the low order models. model_mod_check.f90 can be used to test these routines individually before you run it with filter. start with all defaults from other modules and add, in order the following routines:
1 | static_init_model() | read namelist to see how many fields are going to be read in for the state vector. use add_domain() to indicate which netcdf vars should be read. read in any auxiliary data needed by interpolation code (eg. topology). read template file to set grid locations. use get_domain_size() to compute model_size. |
2 | end_model() | deallocate any arrays allocated in static_init_model() |
3 | get_model_size() | return model_size computed in static_init_model() |
4 | shortest_time_between_assimilations() | return a namelist or a fixed value for the minimum model advance time. |
5 | read_model_time() | |
6 | write_model_time() | if the time is stored in the netcdf files, supply routines that can read and write it in the correct format. we have default routines that work if it matches what those routines expect: a time variable with an optional calendar variable. if none, it's fractional days. if the time variable is an array, read/write the last one. |
7 | get_state_meta_data() | call get_model_variable_indices() and get_state_kind() to figure out the i,j,k indices and which variable this offset is. use the i,j,k to compute the grid location and return it along with the quantity. |
now you can assim identity obs | ||
8 | model_interpolate() | where the bulk of the work will be. get the location and quantity of the observation. find the i,j,k indices which enclose that location, or search for the cell number. can compute i,j in a regular lat/lon grid, have to search in a deformed grid. if multiple vertical options, different ensemble members may result in more than a single level. use get_state() to get the ensemble-sized array of values for each offset into the state vector, and do interpolation to get an array of expected values. |
other obs | ||
9 | nc_write_model_atts() | can leave for later. eventually add grid info to the diag files for plotting. |
10 | convert_vertical_obs() | |
11 | convert_vertical_state() | if this model has a choice of multiple vertical coordinates (e.g. pressure, height, etc) add code here to convert between the possible verticals. |
12 | get_close_obs() | |
13 | get_close_state() | if you want to change the impact based on something other than the type or kind, put code here. should test for vertical and do the conversion on demand if it hasn't already been done. |
14 | pert_model_copies() | the default is to add gaussian noise to the entire model state. if you want to only perturb a single variable, or perturb it with different noise ranges you can add code here. used to generate an ensemble from a single model state for filter. |
15 | init_time() | |
16 | init_conditions() | |
17 | adv_1step() | generally not used in large geophysical models, but if you can generate a single model state without reading in a file, supply code in init_conditions. if you can advance the model via a subroutine, add the code to adv_1step. |
18 | nc_write_model_vars() | not currently called, leave it using the default routine. here for possible future implementation. |