! DO NOT EDIT THIS FILE ! But edit variable.f90 and scripts/generate.py ! Compiling and running is taken care of by the Makefile ## helper functions <% def rank(var): """the number of dimensions""" return len(var["shape"]) def shape(var): # convert dims to strings dims = (str(dim) for dim in var["shape"]) return ",".join(dims) %> %for i, var in enumerate(variables): case( ${i+1}) %if rank(var) > 0: if (associated(s%${var["name"]})) deallocate(s%${var["name"]}) allocate(s%${var["name"]}(${shape(var)})) %endif %endfor !directions for vi vim: filetype=fortran : syntax=fortran