HPSCTerrSys / TSMP

Terrestrial Systems Modelling Platform (TSMP or TerrSysMP)
https://www.terrsysmp.org/
Other
23 stars 14 forks source link

Refactor TSMP-PDAF observation reading subroutines #157

Closed jjokella closed 1 year ago

jjokella commented 1 year ago

Observation reading subroutines in TSMP-PDAF (bldsva/intf_DA/pdaf1_1/framework/mod_read_obs.F90) contain multiple duplicate / slightly changed code blocks.

First, subroutines will be "aligned", i.e. slight changes will be adapted such that the routines are as similar as possible without changing functionality.

Second, subroutines that have essentially the same functionality are merged and duplicate subroutines removed.

Generic ParFlow observation reading routine

https://github.com/HPSCTerrSys/TSMP/blob/1921ebd363b16f0ddcd5ec3798609f6d63b61bf9/bldsva/intf_DA/pdaf1_1/framework/mod_read_obs.F90#L50-L137

jjokella commented 1 year ago

Steps in refactoring

*multi:-subroutines: Array of observation errors

Difference between read_obs_nc_* and read_obs_nc_multi_* is that an array of observation errors is read. However also in the multi subroutines this is optional, which is why these subroutines are unnecessary and will be removed

multiscalar-subroutines: dim_nx, dim_ny, var_id

More investigation into the usage of array var_id_obs_nc needed. Only used for local filters.

Manual entry: https://sdlts.pages.jsc.fz-juelich.de/tsmp_manual/input_obs.html#multiscalar-data-assimilation

multiscalar_files-subroutines: Array of observation errors

This can be removed in the same way the multi-subroutines have been removed.

jjokella commented 1 year ago

In the end everything has been refactored to only one observation routine: read_obs_nc.