<% def element0(var): """find the first element array""" parts = ["lbound(s%%%s, %d)" % (var["name"], i+1) for i in range(var["rank"])] if var["rank"] > 0: txt = "(" + ",".join(parts) + ")" else: txt = "" return txt %> %for var in variables: case("${var['name']}") %if var['rank'] > 0: call c_f_pointer(xptr, x_${var['rank']}d_${var['type']}_ptr, shape(spointer%${var["name"]})) %else: call c_f_pointer(xptr, x_${var['rank']}d_${var['type']}_ptr) ! skip shape in case of rank 0 %endif spointer%${var["name"]}${dimstr(":"*var['rank'])} = x_${var['rank']}d_${var['type']}_ptr %endfor ## vim: filetype=mako