@Guyute: I really approach my problem from the view that some event has caused my ED. I have had no tests because, my doctor told me my decline was age related at 37, and offered me no further assistance- but I have written about that ad nausea elsewhere on the forum- so please read those posts before deciding whether my conclusions are valid. I don't believe age is the cause and I've really been suffering from a sense of injustice since then. So I haven't wanted to go back to him, and besides I don't really think he knows how to treat the problem. To some extent although it seems you are improving, I get the impression your urologist doesn't really know either how to solve your problem.
I am loathe to make suggestions based on my limited understanding of the subject, because ultimately it is your health, and I wouldn't want to compromise it. However you say a number of things incidentally, which all tie up for me.
You say:"I woke up and actually had the capability to remember a dream. That hasn't happened in forever." I also take Vitamin D because the endo said I was a bit low.
At least whatever you are doing is having a positive effect, but I can't help feeling that there is a link between poor sleep, your circadian rhythms, the night shifts and erectile dysfunction and even low vitamin D.
The vitamin D problem is the easiest one to describe. You actually get a percentage of vitamin D from natural sunlight and UV rays stimulating its production in the skin. So if you have not had any sunlight for an extended period, your vitamin D levels could be low. There is also a link between vitamin D and testosterone production, and I have read a link where applying a vitamin D cream to the testicles increases testosterone. In my case I take cod liver oil- always have done for most of the last 10 years, and that is a good source, so I am hoping that I don't need additional vitamin D. So someone on permanent night shift not getting enough sun induced vitamin D makes sense.
The connection with your sleep and ED is a more tentative one for me, but I think there is evidence in the links I have already supplied- again I don't have time to research them again but....
The oxygenation thread talks about REM erections which are a mode during which the body replenishes the penis with oxygen to allow it to do its job during waking hours and when you potentially get round to sex. Similarly it is posited that REM sleep is when the brain lays down memories, effectively if you like during down time, when the brain is not required to be actively thinking. Perhaps the body does both essential maintenance jobs during your REM sleep phase. Dreams also occur during the REM state and we potentially remember dreams when we are woken up during the latter stages of REM, effectively we weave a waking narrative when we switch from the fractured nature of laying down memories to full consciousness.
I imagine REM is akin to the way a computer hard drive has various sectors where pieces of work are spread over the disk, so that when you do a "Defrag" of your disk drive, you bring those scattered elements together to create space so those previously utilised areas can be written over. When you remember a dream you are peering half awake into the REM world and often seeing discarded shards in real time. Your half conscious brain tries to make sense of them, so creates a story, which is the dream. OK, that is my interpretation- it could be total BS!
However your REM period is potentially compromised because you can't remember your dreams, (that was until now). So I would posit the theoretical supposition that both the oxygenation of the penis and your lack of dreams have been compromised by the failure of your body to go fully into that REM state. Yes you are getting sleep but it isn't of sufficient quality to restore all your physical systems.
Where the night shift comes into it, is that your body has circadian rhythms which rely on the release of hormones to tell the brain and body to enter the various modes or states which allow you to fall asleep in the first place and then go into REM and eventually wakefulness. Your body relies on outside cues from the environment, such as darkness to for example release the hormone melatonin which knocks you off to sleep. The same early morning light should be your cue to awake, that is if we were following the natural rhythm of getting up in the morning light and going to bed in darkness.
Your body also has an internal clock which effectively counts down the hours to when it expects you will be nodding off- at a predictable time for most people. Those people who are jet lagged are suffering from the fact that they are waking up in a different time zone and their internal clock has not got used to the different hours it is now expected to keep- in other words it takes an amount of time for your clock to adjust and in the meantime you feel awful.
In your case I tentatively propose that your body has become confused hormonally and doesn't know or has been forced to withdraw that injection of hormones which sends you into the REM state, therefore no dreams and no oxygenation of the penis. That is because during the time on your internal clock that it would be expected to be in REM, you are about your waking business (employment) and your body is full of cortisol the waking hormone. There is potentially a corollary explanation for someone who is releasing cortisol for stress reasons, and is therefore flooding out testosterone production. Similarly I wonder whether those on antidepressants flood out or diminish the effects of acetylcholine with serotonin. In other words there has to be a hormonal/neurotransmitter balance and if it is compromised, no wood. The hormone balance Guyute always refers to is between estrogen and testosterone, but this other theory (my own work btw
looks at the influence of other hormonal imbalances.
I freely admit I could have got much of the above wrong, but feel free to knock it down.