compare metout's SOLR outputs to drlam's solar spectral radiation outputs

55 views
Skip to first unread message

Morgan Fleming

unread,
Nov 18, 2025, 10:32:43 PM11/18/25
to NicheMapR

Hi all, 

I am using the NicheMapR micro_era5() function to calculate microclimate variables for a set of points. I am playing around with extracting spectral solar radiation using lamb = 1. I noticed that the hourly values obtained from the drlam output differ from what I expected based on the documentation and my interpretation of the parameters.

Here is a simplified example of my workflow:

micro <- micro_era5(
  loc = c(longitude, latitude),
  dstart = "01/05/1963",
  dfinish = "30/05/1963",
  dem.res = 100,
  Usrhyt = 2,
  lamb = 1,          # wavelength-specific solar radiation
  IUV = 1,           # includes diffuse UV
  spatial = file_path,
  minshade = 0,
  maxshade = 50,
  runshade = 1
)

I plan to later to extract the SOLR, and UV, NIR, and VIS range of spectral bands and sum them for each day to get total daily energy received. The issue I am having is interpreting the raw hourly values produced for these variables. 

i’ve attached a file showing the outputs of metout$SOLR and micro$drlam combined into a single table. The table has columns for the DOY and TIME from both outputs, the SOLR values, individual spectral bands from drlam (e.g., 290–315 nm shown here), and a total column summing all wavelength bands (290–4000 nm). 

When I sum the wavelength-specific irradiance (drlam) across the UV, VIS, and NIR ranges, the totals are much lower than the corresponding SOLR values (see last column in attached file). And in some hourly records, the drlam band values are zero during daylight hours when SOLR is clearly non-zero, and vise versa. I am having trouble reasoning why this would be the case, as I would expect that the "nighttime" hours (i.e. 0's) would be the same for both SOLR and drlam values.

From the documentation, my understanding is:

  • SOLR includes terrain shading, topography, and atmospheric attenuation. And SOLR is always zero in the metout output when the zenith angle of the sun is 90 (the sun is below the horizon).
  • drlam (with lamb = 1) represents atmospherically attenuated beam + diffuse radiation, without terrain shadows.

  • I believe that these outputs are in UTC timezone by default, even though my location is in AZ, USA.


My main questions are:

  1. Should the summed drlam output across wavelengths be expected to match SOLR during daylight hours? Or is there something I am misinterpreting? Maybe the units are different. 

  2. Are there other settings or considerations that could affect the magnitude of drlam values relative to SOLR?

I just want to make sure I have a grasp on how these values are related and differ before I proceed. I am not very familiar with spectral solar radiation, so perhaps I am misinterpreting something obvious. 


Thanks in advance!

Morgan

metout_solr_and_drlam_merge.pdf

NicheMapR

unread,
Nov 19, 2025, 8:05:37 PM11/19/25
to NicheMapR
Dear Morgan,

Thanks for pointing this out - the outputs of the wavelength-specific values are not set up properly for when the simulation starts from a different time to midnight which is why you see them out of alignment. I'll need to fix that. As far as the integration across wavelengths is concerned, this is done via the trapezoid rule - e.g.:
for(n in 1:length(wavelength)){
       integrated_direct(n)= integrated_direct (n-1)+(((wavelength(n)-wavelength(n-1))*direct(n-1))+(0.5*( wavelength (n)- wavelength (n1))*( direct (n)- direct (n-1))))
}
and the final value of  integrated_direct would be the total.

All the best,
Mike

Morgan Fleming

unread,
Jan 29, 2026, 10:23:36 AMJan 29
to NicheMapR

Hi Mike,

Thank you for your quick response earlier—I really appreciate it, and apologies for the slow follow-up. This project got pushed aside during the end-of-year rush, but I’m now picking it back up.

You mentioned that the wavelength-specific outputs become misaligned when the simulation doesn’t start from midnight and that this is something that needs fixing. In the meantime, is there a recommended way to run micro_era5() so that it effectively starts at midnight UTC, so drlam aligns properly with SOLR? Would manually adjusting dstart or shifting the hourly outputs be the best workaround until a fix is implemented?

Also, for integrating across wavelengths, would you recommend implementing the trapezoid rule manually in R, or is there an existing NicheMapR approach you’d suggest?

Thanks again for your help!
Morgan

NicheMapR

unread,
Jan 30, 2026, 9:15:16 PMJan 30
to NicheMapR
Hi Morgan,
No worries - I'd just manually adjust the start time to midnight and use that formula I included for integrating it. I'm in the field right now so have limited time to sort it out myself but thanks for the reminder!
All the best,
Mike

Fleming, Morgan

unread,
Jan 31, 2026, 8:20:46 PMJan 31
to NicheMapR
Thanks, Mike! I'll give it a try!

--
You received this message because you are subscribed to a topic in the Google Groups "NicheMapR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nichemapr/trSfQGED_GA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nichemapr+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/nichemapr/47dbb205-4a36-4bb1-b574-f3d2ed724eabn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages