Like Adrian mentions, you will need to add some Pre-Logic code to the expression. From the field calculator:
1. Right click the field to calculate and in the Field calculator dialog, choose the appropriate Parser (ie, Python)
2. Place a check in the "Show Codeblock" box
3. In the Pre-Logic Script Code: section, add a def() that should look something like (I'm not totally certain about the exact logic desired, but this will get close I think):
def processInput(input1, input2, input3):
if input1 == "" or input2 == "":
return input3
else
return input1.strip() + "" + input2.strip() + "" + input3.strip()
4. In the box below the Pre-Logic script area, enter in the def() name and add your field parameters:
processInput( !LOCN!, !LOCD!, !LOCS!)
Order them appropriately.
edit: apologies as I'm showing strictly from the Field Calculator dialog, which does not specifically address the original question of a field calculation from within a model or python script. You will have to adapt this as needed.