SWIM redesign and swimpy
Michel Wortmann
15 March 2024
-std=f95
(see Makefile
)goto, data, pause
real
type (dp
)use X, only : ...
intend(in/out/inout)
intent
swim.f95
→ hydrotope.f95
use <module>, only: ...
hydrotope.f95
← utilities.f95
subroutine hydrotope_open_files(input_dir, output_path)
use utilities, only : open_file
character(len=*), intent(in) :: input_dir
character(len=*), intent(out) :: output_path
namelist
(.bsn, .cod, swim.conf...)
! comments are allowed too
&snow_parameters
prcor = 1.0,
snow1 = 0.0,
ulmax0 = 1.0,
rnew = 0.08,
tmelt0 = 0.0,
bsnowmodule = .true.,
/
&soil_parameters
ab = 0.02083,
nn = 10,
psp = 0.5,
rtn = 0.15,
/
call read_real_column(file_id, "reference_elev", &
reference_elev, default=0)
Michels-MBP:$ ./swim -h
+ . . . . . . . . . . . . . . . . . . . . . . . . . . +
. .
. . //////// \\ \\ // || || || .
. / \ \\ \\ \\ // || ||\\//|| .
. / \ \\\\\\\ \\ //\\ // || || \/ || .
. /~~~~~\ // \\// \\// || || || .
. (~~~~~~~) /////// \\ \\ || || || .
. \~~~~~/ -------------------------------------- .
. ----- Soil and Water Integrated Model .
. .
. * v2021.1 * .
+ . . . . . . . . . . . . . . . . . . . . . . . . . . +
usage: swim [options] [parameter-nml]
parameter-nml path to the parameter namelist
options:
-h, --help show this help message
-v, --version print version
-d, --defaults [module] print default parameters
-o, --output-variables print available output variables
debug, info, warn, error
call log_debug(source, message,
[log, i1, i2, int, real, ints, reals])
call log_info / log_warn / log_error(...
input/output.nml
&file
name = "<string>"
space = "(catchment | subbasin | hydrotope |
subbasin_label | hydrotope_label)"
time = "(daily | monthly | annual)"
variables = "<list of output variable names>"
[format = "(csv (default) | bin)"]
/
&file
...