-
Notifications
You must be signed in to change notification settings - Fork 25
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
Unify N-deposition input reading #398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I assume you have tested that it gives the same results?
I will, once the input files are ready - while I expect - as discussed no bfb, but just similar results in the range of numerical precision to small discrepancies due to different conservative re-gridding methods that were previously and are now used for the input files. |
But you can test that for the SAME input file (the already existing cmip-1850 files) this change should be bit for bit, or not? |
Good idea, but I am afraid, not, since I was previously doing the remapping AFTER summing up NHx and NOy for the default model (for |
Ah, ok I see, thanks for the explanation. |
@JorgSchwinger @jmaerz - it would be good to strategize how to move forwards with the ability to do the remapping in the nuopc cap using streams rather than mapping offline. |
Hi @mvertens , not yet being familiar with the nuopc cap, I wonder, how it would e.g. deal with having to plug together different files, sum up their variables, potentially extend the files by one year, or pick only one specific year provided by a particular file. Just to name a few culprits that I stumbled upon when re-gridding the files recently. Of course, it would be very elegant to directly use the provided input4MIPs files for any of those tasks through the nuopc cap. @JorgSchwinger , you suggested some discussion points for a BLOM meeting in that respect. Maybe we can discuss this either in #376 or open a new issue for discussion on this? Just to note: the script for re-gridding N-dep is almost there (year 2000 is missing and the extension by 1 year, if needed - which both should be straight forward to add + info, which 0.125 grid to use). |
@jmaerz - by the "nuopc cap" I mean the code in $SRCROOT/components/blom/drivers/noupc.
! from atm - nitrogen deposition
call shr_ndep_readnl("drv_flds_in", ndep_nflds)
if (ndep_nflds > 0) then
call fldlist_add(fldsToLnd_num, fldsToLnd, Faxa_ndep, ungridded_lbound=1, ungridded_ubound=ndep_nflds)
! This sets a variable in clm_varctl
ndep_from_cpl = .true.
end if
.....
! Atmosphere ndep
if (fldchk(importState, Faxa_ndep)) then
! The mediator is sending ndep in units of kgN/m2/s - and ctsm
! uses units of gN/m2/sec so the following conversion needs to happen
call state_getimport_2d(importState, Faxa_ndep, forc_ndep(begg:,:), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
do g = begg, endg
atm2lnd_inst%forc_ndep_grc(g) = (forc_ndep(g,1) + forc_ndep(g,2))*1000._r8
end do
end if
I would be happy to give everyone a more detailed overview of how cdeps handles this and discuss how BLOM can leverage this capability. |
@mvertens , many thanks for your detailed explanation - just to summarize, essentially, no reading of forcing files should be needed any longer inside iHAMOCC and instead should be streamed through BLOM via nuopc/CDEPS - either from CAM (interactively coupled) or DATM (input forcing field, e.g. in ocean only setups and non-interactively coupled NorESM setups). Currently, N-deposition is read and applied inside iHAMOCC. For this PR, it means that we may have to reconsider rather the Reading your comment @mvertens , though, brought up (a maybe naive) general question in terms of design strategy:
Further,
|
@jmaerz - good questions.
I'm happy to explain this in more detail on a call. |
there might be a misunderstanding(?), please let me clarify: HAMMOC uses several fields as boundary conditions
While all these fields can be coupled to an active atmosphere or land model, this will in the near future not be the default (also not for N-deposition). Therefore, by default, all these fields need to be read in by HAMOCC. Since this is also the case in coupled compsets, I don't think it would be practical to do this through DATM. Rather, as far as I have understood, this would be a typical use-case for the "inline" functions of CDEPS as it has been done for the SSS-relaxation in BLOM. There are therefore two separate issues:
There are modules Dos this make sense? We might need a zoom call on this? |
@JorgSchwinger - thanks for the clarifications. I think both 1. and 2. are straightforward to implement. I think a zoom call once I've finished implementing would be good to make sure we are all on the same page. |
Due to #410, I withdraw this PR - things have been done there. |
Hi @JorgSchwinger and @TomasTorsvik ,
with this PR, I aim at unifying the input reading for N-deposition as requested for #340 . The new code always reads in NHx and NOy separately (requiring re-generation of all input files for all scenarios and grids, see #397), while then applies the reduced and oxidized N species depending on whether the extended N-cycle is used or not (if not, NHx and NOy are lumped together as before and enter the NO3 pool, otherwise the NHx enters NH4 and NOy enters NO3).
Thus far, it is a draft, since the input files are still in progress to be updated (sorry, some betzy issues + open questions from #397) - which then will also be entered in the config-files (still to do) - once the input files are re-generated and in place, the draft will be turned into a regular PR.
Closes #397
This draft PR has been withdrawn due to PR #410.