NorESMhub / noresm2cmor

A command line tool for cmorizing NorESM output
http://noresmhub.github.io/noresm2cmor/
5 stars 16 forks source link

Error in daily output for cmorized variable od550aer #324

Closed oyvindseland closed 11 months ago

oyvindseland commented 1 year ago

Describe the error The od550 values daily are different than the raw output data and not consistent with monthly mean. It is possible that there is an error in the cmorization scripts.

Should be od550aer=DOD550/(DAYFOC+eps) (Eps=a small value)

Looks like od550aer=DOD550+DAYFOC. All experiments that have DOD500 as daily output have DAYFOC=1

Way to correct

Check if the error in the cmorization scripts is as suggested above. Correct scripts as given above. Since this involves a large number of experiments it is likely not possible to republish all so: Publish an errata that can also include how the users can correct for the error: od550aer=od550aer-1 if DAYFOC=1

adagj commented 1 year ago

@oyvindseland Thanks for creating an issue Øyvind. I think one of the teaching assistants tested if it was sufficient to subtract 1 from the data and my impression was that it wasn't, i.e. one month of daily data was still different from the monthly mean even if 1 was subtracted from the daily data. But I did not test myself, I just provided the raw data. Did you test?

oyvindseland commented 1 year ago

I only tested a number of single points not statistics and daily cmorized against daily raw data. I did not compare monthly against daily. However also in my test I do not get the identical number as in the raw data. The cmorized data has less decimals (realx4?)

YanchunHe commented 1 year ago

Hi Øyvind and Ada,

I see in the cmorization program, it does use something like

new_var=var/dayfoc

given dayfoc is greater than 1e-15, otherwise, set as missing value.

I also see there are other variables applying the same calculation:

abs550aer
ec550aer
od440aer
od550aer
od550aerh2o
od550bc
od550csaer
od550dust
od550lt1aer
od550oa
od550so4
od550ss
od870aer

Wondering if they are also "wrong"?

Could you test again with the above formula?

oyvindseland commented 1 year ago

No the monthly files are correct and the formula is fine.
The problem is daily files which seem to use a different formula

adagj commented 1 year ago

Hi, it says in the daily files that the od550aer is calculated as od550aer:original_name = "DOD550/DAYFOC"

while the monthly od550aer is calculated as od550aer:original_name = "DOD550"

so the methods differ. Can it be possible that dayfoc somehow is not used correctly?

oyvindseland commented 1 year ago

After looking through fields and trying to remember the settings I found that for od550 (any od550 and od440 and od 870) use the same model settting AEROCOM=.true.
AEROCOM=.true. automatically set dayfoc ==1 everywhere including output. That means that the dayfoc variable was never needed for the OD550AER and was not used for monthly fields. The good news is that the number of simulations with daily od550aer is quite small so it should be possible to redo them. For now the division should just be removed from the expression. I checked the output and dayfoc is indeed 1 so should not have created any problems, so that part I do not understand.

YanchunHe commented 1 year ago

OK, now I see the problem.

The daily odd550aer is indeed divided by DAYFOC twice.

First by dividing directly, and then divided again in the special post process during cmorization.

Can it be possible to recover it by multiple DAYFOC?

Otherwise, since there are not may daily od550aer, we can retract and redo cmorization.

oyvindseland commented 1 year ago

I think the easiest solution is to just retract and redo the cmorization. The part I do not understand though is that dayfoc == 1 in all the relevant simulations so it should not change the answer no matter how many divisions.

YanchunHe commented 1 year ago

I made a tes with redoing the cmorization:

/projects/NS9034K/CMIP6/.cmorout/NorESM2-LM/historical/v20221130/od550aer_AERday_NorESM2-LM_historical_r1i1p1f1_gn_20100101-20101231.nc

@adagj @oyvindseland Could you check if this looks right?

There are quite some daily od550aer, including:

NorESM2-MM

piClim-aer.r1i1p1f1
piClim-control.r1i1p1f1
piClim-4xCO2.r1i1p1f1

NorESM2-LM

amip.r1i1p1f1
historical.r1i1p1f1
ssp245.r3i1p1f1
ssp585.r1i1p1f1
ssp245.r1i1p1f1
ssp370.r1i1p1f1
ssp245.r2i1p1f1
ssp126.r1i1p1f1
piClim-aer.r1i1p1f1
piClim-2xVOC.r1i1p2f1
piClim-2xss.r1i1p2f1
histSST.r1i1p2f1
histSST-piNTCF.r1i1p1f1
histSST.r1i1p1f1
piClim-2xDMS.r1i1p1f1
histSST-piNTCF.r1i1p2f1
piClim-OC.r1i1p2f1
piClim-2xVOC.r1i1p1f1
ssp370SST.r1i1p1f1
piClim-CH4.r1i1p1f1
amip.r1i1p2f1
piClim-SO2.r1i1p2f1
ssp370SST-lowAer.r1i1p1f1
piClim-SO2.r1i1p1f1
piClim-NTCF.r1i1p2f1
piClim-2xdust.r1i1p2f1
piClim-2xdust.r1i1p1f1
piClim-2xDMS.r1i1p2f1
piClim-OC.r1i1p1f1
piClim-N2O.r1i1p1f1
piClim-BC.r1i1p1f1
histSST-piAer.r1i1p2f1
piClim-2xss.r1i1p1f1
histSST-piAer.r1i1p1f1
piClim-CH4.r1i1p2f1
piClim-BC.r1i1p2f1
piControl.r1i1p1f1
piClim-spAer-histaer.r1i1p2f1
piClim-histnat.r1i1p2f1
piClim-histnat.r2i1p1f1
piClim-histaer.r3i1p2f1
piClim-anthro.r1i1p1f1
piClim-histghg.r1i1p2f1
piClim-histall.r1i1p1f1
piClim-anthro.r1i1p2f1
piClim-histghg.r2i1p1f1
piClim-histall.r2i1p1f1
piClim-histghg.r3i1p1f1
piClim-ghg.r1i1p2f1
piClim-spAer-anthro.r1i1p1f1
piClim-histghg.r1i1p1f1
piClim-histaer.r2i1p1f1
piClim-histnat.r3i1p1f1
piClim-lu.r1i1p1f1
piClim-lu.r1i1p2f1
piClim-histaer.r3i1p1f1
piClim-aer.r1i1p2f1
piClim-4xCO2.r1i1p1f1
piClim-control.r1i1p1f1
piClim-histaer.r1i1p1f1
piClim-histnat.r1i1p1f1
piClim-histghg.r2i1p2f1
piClim-histall.r3i1p1f1
piClim-spAer-aer.r1i1p1f1
piClim-4xCO2.r1i1p2f1
amip-4xCO2.r1i1p2f1
amip-p4K.r1i1p2f1
piClim-O3.r1i1p2f1
piClim-spAer-aer.r1i1p2f1
piClim-control.r1i1p2f1
piClim-spAer-anthro.r1i1p2f1
piClim-N2O.r1i1p2f1
YanchunHe commented 1 year ago

Please retract all the daily od550aer_AERday, @monsieuralok

YanchunHe commented 1 year ago

AEROCOM=.true. automatically set dayfoc ==1 everywhere including output. That means that the dayfoc variable was never

Hi @oyvindseland, as I can see, for example, in the original raw output, the DAYFOC is not set as 1 but 0-1 for the LM historical run, as shown in the attached figure.

Therefore, I would think the od550aer should be divided by dayfoc at least once, for daily output.

Screenshot 2023-06-16 at 15 38 52
monsieuralok commented 1 year ago

@YanchunHe should I retract all od550aer_AERday for ALL experments and ALL resolution for LM and MM?

oyvindseland commented 1 year ago

I have not checked all the simulations but agree that dayfoc is always the value (not 1) The difference is that dod550aer should sometimes be divided by dayfoc (standard settings) and sometimes not ("aerocom" settings). The treatment should be identical for both daily and monthly files

If the easiest solution is to retract the daily variable for all experiments that is probably fine. The raw data are still around so the variable can be cmorized later on. Dirk: Do you know of anyone who use the daily AOD values ? @DirkOlivie

YanchunHe commented 1 year ago

@YanchunHe should I retract all od550aer_AERday for ALL experments and ALL resolution for LM and MM?

Yes, then please retract all data.

monsieuralok commented 1 year ago

@YanchunHe retracted https://errata.es-doc.org/static/view.html?uid=d5e19894-2804-fab1-82bf-3091b8172c8d