I am trying to figure out the correct methodology for setting a user derived type variable at runtime based on some user input. The following would be a very simply example of two user derived types: One and Two.
type One integer :: ivalue=0 end type One type Two integer :: ivalue=0 end type Two
How would I go about setting a variable,x, to a specific user derived type based on user input. Pseudocode would be something along the lines of
if userinput = 1, then set x to type One
elseif userinput =2, then set x to type Two