For that pair of words (ES año vs. PT ano) this works, but note the correspondence gets really messy, it depends on the etymology of the word. A quick run-down would be:
Origin
Spanish
Portuguese
Example
Late Latin */nj/
/ɲ/ ⟨ñ⟩
/ɲ/ ⟨nh⟩
Latin balneum → baneum → *banjʊ̃ → ES baño, PT banho “bath”
Latin /gn/ [ŋn]
/ɲ/ ⟨ñ⟩
/ɲ/ ⟨nh⟩
can’t recall an example both kept, but Latin agnum → PT anho /ɲ/ “lamb” (archaic)
Latin /n:/
/ɲ/ ⟨ñ⟩
/n/ ⟨n⟩
Latin annum → ES año, PT ano “year”
Then for Latin intervocalic /n/ Spanish simply keeps it. Portuguese initially converts it into vowel nasalisation, but then changes it further on, it’s a bit messy:
For ES “ano” anus and PT “ânus” anus this doesn’t work, though. Portuguese didn’t inherit the word, but reborrowed it. And perhaps to avoid making it sound like “ano” (year), kept the Latin nominative ending. (If the word was inherited it would end as *ão or something like this.)
I was going to say, if Portuguese is like Spanish, it’s “anus” without the tilde over the n, right?
For that pair of words (ES año vs. PT ano) this works, but note the correspondence gets really messy, it depends on the etymology of the word. A quick run-down would be:
Then for Latin intervocalic /n/ Spanish simply keeps it. Portuguese initially converts it into vowel nasalisation, but then changes it further on, it’s a bit messy:
For ES “ano” anus and PT “ânus” anus this doesn’t work, though. Portuguese didn’t inherit the word, but reborrowed it. And perhaps to avoid making it sound like “ano” (year), kept the Latin nominative ending. (If the word was inherited it would end as *ão or something like this.)
Portuguese doesn’t really have a tilde, but that’s what the h following an n (or an L) is there to indicate
It does have a tilde but it’s mostly used over vowels, to represent nasalisation; e.g.
For /ɲ/ (the phoneme written “ñ” in Spanish) it’s as you said, though: it’s spelled “nh” instead.