Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement diurnal ozone downscaling #2496

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

adrifoster
Copy link
Contributor

Description of changes

Adds the capability to downscale daily or multi-day ozone into sub-daily ozone input (DATM or from CAM).

As laid out in CTSM Issue #270 we want to downscale input ozone partial pressure (mol/mol) temporally if we receive a multi-day average input ozone (usually in DATM mode).

We have the infrastructure laid out for CAM and DATM to inform CTSM which type of input we are receiving (i.e., 'multiday_average' or 'subdaily'). We only apply this downscaling when receiving multi-day average ozone.

Specific notes

A gridded file provided by @lkemmons for a diurnal ozone variation factor is read in via a new ozone streams module. This streams file is then used to downscale the ozone provided by DATM or otherwise.

Inside the existing CalcOzoneUptake routine, if we are using multi-day average ozone, interpolate/downscale the forc_o3 array using the new Interp subroutine.

Right now we are assuming that the units of the input diurnal file are going to be in seconds, and that the file covers the whole day.

There is no need to assume that the dimension will be 1-24 (i.e. on the hour) or that the dimensions be equal intervals.

The file is read in using a new src/share_esmf/diurnalOzoneStreamMod module, with associated updates to bld/CLMBuildNamelist.pm, bld/namelist_files/namelist_defaults_ctsm.xml and bld/namelist_files/namelist_definition_csvm.xml

Right now the new variable use_do3_streams is set in the user_nl_clm file. And the other namelist variables (stream_fldfilename_do3, stream_meshfile_do3, and do3_mapalgo) are inside the lnd_in file under a do3_streams namelist.

I'm not sure setting up the use_do3_streams namelist variable is the best way to go about this, since we essentially want this feature on whenever the ozone frequency is 'multiday_average' @billsacks what do you think?

Right now we are hard-coding the stream_var_name, and stream_lev_dimname. I think this is okay. Otherwise, we would want them to be namelist variables that get read in.

These updates do change answers, namely ozone uptake is decreased (@danicalombardozzi does this make sense?)

ozone forcing for non-diurnal vs. diurnal for the first simulation day:
ozone_forcing_hist

ozone uptake for the same day:
ozone_uptake_hourly_hist

ozone uptake summed up over the year:
ozone_uptake_sum_hist

@danicalombardozzi i'm not sure about the units for these ozone history variables, they are in mol/m2/time step... do we want to convert them to a per second? Or is this already done somewhere?

Contributors other than yourself, if any:
@billsacks @danicalombardozzi @lkemmons

CTSM Issues Fixed (include github issue #): Fixes #270

Are answers expected to change (and if so in what way)? Yes, see above. If turned on will modify ozone uptake. If ozone damage and ozone downscaling are not on, this will have no effect.

Any User Interface Changes (namelist or namelist defaults changes)? Yes, adds new namelist options for do3_streams. We also need to decide if we want to only optionally do this, or automatically do this all the time if we have multi-day ozone.

Testing performed, if any:

See above, will also do system testing

@adrifoster
Copy link
Contributor Author

TL; DR:

The big thing we still need to decide is how to implement the namelist options and whether we want to automatically downscale ozone any time we get multi-day average, or only optionally do this if

  1. we have multi-day average ozone
  2. the user requests downscaling via "use_do3_streams" in the user_nl_clm file

My vote: just automatically do it. Or optionally turn it off

@samsrabin samsrabin added this to In progress - master in Upcoming tags May 2, 2024
@ekluzek ekluzek moved this from In progress - master/b4b-dev to Stalled (needs review, blocked etc.) in Upcoming tags May 6, 2024
Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrifoster I looked at your PR and came up with a comment about indentation. If I were nit-picky, I would have pointed out other, aesthetic, indentation issues, but I'm not :-))

Otherwise, this looks great and it seems straightforward enough that I'm comfortable approving without further follow-up.

A question / comment seeking confirmation: I think this is the land model's first example of a stream with an interp function to take data to subdaily, right?

src/biogeophys/OzoneMod.F90 Outdated Show resolved Hide resolved
@adrifoster
Copy link
Contributor Author

I looked at your PR and came up with a comment about indentation. If I were nit-picky, I would have pointed out other, aesthetic, indentation issues, but I'm not :-))

I'd like to be consistent, could you point out the other nit-picky things?

@adrifoster
Copy link
Contributor Author

A question / comment seeking confirmation: I think this is the land model's first example of a stream with an interp function to take data to subdaily, right?

Yes I believe that is correct.

@adrifoster
Copy link
Contributor Author

All tests PASS except for expected fails, and NLCOMP diffs (which is expected because of the namelist changes I made)

11:16 $ ./cs.status.fails -c NLCOMP
0506-190200de_gnu: 61 tests
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.derecho_gnu.clm-default--clm-NEON-NIWO SHAREDLIB_BUILD time=14 (UNEXPECTED: expected FAIL)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.derecho_gnu.clm-default--clm-NEON-NIWO RUN time=44 (UNEXPECTED: expected FAIL)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.derecho_gnu.clm-NEON-MOAB--clm-PRISM SHAREDLIB_BUILD time=9 (UNEXPECTED: expected FAIL)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.derecho_gnu.clm-NEON-MOAB--clm-PRISM RUN time=92 (UNEXPECTED: expected FAIL)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.derecho_gnu.clm-FatesPRISM--clm-NEON-FATES-YELL SHAREDLIB_BUILD time=10 (UNEXPECTED: expected FAIL)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.derecho_gnu.clm-FatesPRISM--clm-NEON-FATES-YELL RUN time=29 (UNEXPECTED: expected FAIL)

 
0506-190200de_int: 130 tests
    FAIL ERP_P256x2_Ld30.f45_f45_mg37.I2000Clm60FatesRs.derecho_intel.clm-mimicsFatesCold RUN time=71 (EXPECTED FAILURE)
    PEND ERP_P256x2_Ld30.f45_f45_mg37.I2000Clm60FatesRs.derecho_intel.clm-mimicsFatesCold COMPARE_base_rest
    FAIL ERP_P64x2_Ly3.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_o3falk_reduceOutput COMPARE_base_rest
    FAIL ERP_P64x2_Ly3.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_o3falk_reduceOutput BASELINE ctsm5.2.003: DIFF
    FAIL ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream COMPARE_base_rest (EXPECTED FAILURE)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.derecho_intel.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO SHAREDLIB_BUILD time=10 (UNEXPECTED: expected FAIL)
    PASS SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.derecho_intel.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO RUN time=37 (UNEXPECTED: expected FAIL)

 
0506-190200de_nvh: 3 tests
    FAIL SMS_D.f10_f10_mg37.I2000Clm60BgcCrop.derecho_nvhpc.clm-crop SHAREDLIB_BUILD time=278 (EXPECTED FAILURE)

Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrifoster I added a few "nit" comments about indentation since you asked.

src/biogeophys/DiurnalOzoneType.F90 Outdated Show resolved Hide resolved
src/biogeophys/OzoneMod.F90 Outdated Show resolved Hide resolved
src/biogeophys/OzoneMod.F90 Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Upcoming tags
Stalled (needs review, blocked etc.)
Development

Successfully merging this pull request may close these issues.

Receive ozone from atmosphere
2 participants