The two approaches are not the same: one has a dummy argument with assumed length, and one with deferred length. These mean entirely different things.
That said, in this case there three main differences:
- the actual argument for the second
func_name
must be allocatable/deferred length
- the second
func_name
is such that it must have an explicit interface available when being referenced; the first need only have an implicit interface (which you'll be giving anyway, right?)
- only in the second form can the dummy argument be passed on to an allocatable dummy
As to why there's little difference beyond that: the dummy argument is intent(in)
(and not a pointer). This means that you can't change its value, you can't (in the second) change the allocation status. Simply, there's no reason for using deferred length if you can't change any property (except in the case of passing to other intent(in)
allocatable/pointer dummies). Nearly any reference/use of the dummy argument will make can be done with either form.
Stick to using assumed-length when you can.
Finally, character length isn't a terribly special aspect to consider, so many of the points of a related question apply.