add mo_dag based on daglib by Jacob Williams

This MR adds a Directed Acyclic Graph implementation motivated by the routing module of mHM. All other changes beside mo_dag are related to the new routing routines.

  • add mo_dag: Directed Acyclic Graph implementation

  • mo_datetime updates

    • add <step>_start, next_new_<step> and previous_new_<step> where step can be year/month/week/day/hour/minute
    • add add and sub for in-place addition and subtraction of timedelta
    • faster date/time comparison (no intermediate type instances)
  • mo_grid updates

    • added dist_latlon, is_lat_coord and is_lon_coord to public routines
    • added id_matrix (full matrix of cell ids), cell_id (cell id from indices) and closest_cell_id (cell id closest to given coordinates) to grid class
    • better aux-coord finding when creating grid from netcdf
  • mo_grid_io updates

    • add t_bounds to input_dataset to store values of the consecutive time bounds
    • faster time-stamp comparison
    • add time_index method to input_dataset to find index containing the given time-stamp (start time excluding, end time including in the bounds)
    • add grid_init_var to input_dataset%init to initialize grid directly from a given variable (shortcut)
    • add coordinates to output variables when writing (was missing before)
  • mo_grid_scaler updates

    • renamed regridder to scaler_t to be consistent with naming
    • added no_scaling mode when source and target grid have the same resolution (only do flipping and masking if required)
    • fixed 2d downscale methods (where using wrong grid for indices in data before)
  • mo_io updates

    • use plain read(u,*) in loadtxt to read floats
  • mo_utils updates

    • add optval as helper function for most data types to set default values from optional values (internal_val = optval(val, default))
    • add support for i8 integers in swap
    • use i8 integers for indices in flip and flipped to support big arrays
  • CI/CMake updates

    • added language C to CMake project to catch error when NetCDF is linked against HDF5 (e.g. libnetcdf 4.9.3 on conda forge (Pull Request)) and triggers the FindHDF5 script of CMake which tries to compile a test C program
    • cleaned up compile flags in CMake
    • added explicit support for IntelLLVM
    • add debug jobs for all intel compilers in CI
Edited by Sebastian Müller

Merge request reports

Loading