Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • MPR MPR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Want to get a introduction to object-oriented programming with Python? Join this free course on August 18/19. Register now! 🐍

  • CHS
  • MPRMPR
  • Issues
  • #26
Closed
Open
Created Aug 08, 2018 by Robert Schweppe@ottorOwner

Allow differently dimensioned data arrays for a transfer function

Enable the following mpr.nml:

&mainconfig
out_filename = "super_flexible_now.nc"
dim_name_alias(:,1) = "x1", "x2", "x3"
dim_name_alias(:,2) = "y1", "y2", "y3"
dim_name_alias(:,3) = "z1", "z2", "z3"
/

&Data_Arrays
names(1) = "D1"
from_file(1) = "D1.nc"
! dims "x1", "y1", "z3" 

names(2) = "D2"
from_file(1) = "D2.nc"
! dims "z1", "x1", "y2"

names(3) = "D3"
from_file(1) = "D3.nc"
! dims "y3", "z2"

names(4) = "D_final"
transfer_funcs(4) = "something_with_3_args"
from_data_arrays(1:3,4) = "D1", "D2", "D3"
/

At subroutine check_data_arrays of data array D_final, the following should happen:

  • define the outer union of all dimensions at the highest resolution. Let's say that x1 has higher resolution than x2 than x3, it would be: x1, y1, z1
  • check for all data_arrays, whether they have the same order of their dim_aliases (e.g. x,y,z or z,x,y) -> if not, transpose to the order to which to conform to would need the least transpose operations (in this case x,y,z)
  • check for all data_arrays, whether they have the same number of dim_aliases -> if not, broadcast
  • check for all data_arrays, whether all dimensions have the same bounds (within one dim_alias group) -> if not, trim to inner union
  • check for all data_arrays, whether all dimensions have the same vector (within one dim_alias group) -> if not, resample to intersect of all vector items

Effectively, this would rearrange:

  • D1 to D4 with x1,y1,z1, requiring a resample of z3 to z1
  • D2 to D5 with x1,y1,z1, requiring a transpose of z1,x1,y2 to x1,y2,z1 and a resample of y2 to y1
  • D3 to D6 with x1,y1,z1, requiring a broadcast of y3,z2 to x1,y3,z2 and a resample of y3 to y1 and z2 to z1

resample and trim functionality is already contained in the get_weights and upscale procedures. broadcast and transpose would require new procedures. The concatenate functionality should of course be preserved.

Assignee
Assign to
Time tracking