modflow6
modflow6 copied to clipboard
refactor: introduce model and exchange factories
- factor
Model/ExchangeFactorymodules out ofSimulationCreatemodule - add noop virtual PRT and SWF models and exchanges — allows cleaner templates, and virtual models/exchanges will be added anyway when SWF and PRT support parallel
- prep for templating for build-time model selection (see comments
TODO BEGIN/END TEMPLATING) - rename exchange create routines for templating
- move
typenameandfilenameup toBaseExchangeType - deduplicate model registration logic, this...
...was previously repeated for each model type, factor out a shared routine accepting proc pointersmodel => null() ! can be null for remote models if (model_ranks(n) == proc_id) then im = im + 1 write (iout, '(4x,2a,i0,a)') 'GWF6', ' model ', & n, ' will be created' call gwf_cr(fname, n, model_names(n)) model => GetNumericalModelFromList(basemodellist, im) model_loc_idx(n) = im end if call add_virtual_gwf_model(n, model_names(n), model) - consolidate add/create routines in virtual model types
- carved out of #1532
- step toward #1491
- after this, we can introduce fypp, add templates for
Model/Exchange/ConnectionFactory, and update meson files to generate source from templates