Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pure function composeMapping(mapping1,mapping2) result(newMapping)
- !compose two mappings a la mapping1(mapping2(x)) function notation.
- use env_kindtypes, only: si
- implicit none
- !!! Dummy arguments !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- integer (si),intent(in) :: mapping1(:)
- integer (si),intent(in) :: mapping2(:)
- !!! End dummary arguments !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !return value
- integer (si),allocatable :: newMapping(:)
- !local variables
- integer (si) :: i
- allocate(newMapping(size(mapping2)))
- do i=1,size(mapping2)
- newMapping(i) = mapping1(mapping2(i))
- enddo
- endfunction composemapping
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement