-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix sediment diagnostics and sediment quality #511
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.
@jmaerz - thanks for fix, looks fine to me!
hamocc/mo_sedshi.F90
Outdated
|
||
sedfluxb(:,:,:) = 0. | ||
|
||
if(do_sedspinup .and. kplyear>=sedspin_yr_s .and. kplyear<=sedspin_yr_e) then | ||
! accumulated time spent due to sediment acceleration | ||
acc_time = 86400.*sedspin_ncyc/31104000. ! *dtbgc/dtbgc |
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.
What is the number 31104000
? A comment explaining this would be nice.
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.
Also, this depends on the fact that sedshi
is called once per model day, right? Maybe it would be good to add a short comment in hamocc4bcm
line 364 that there is a dependency on this choice in the sediment code.
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.
Hi @JorgSchwinger , maybe the number is incorrect? - it's a model year with 360 days in seconds - but maybe better refer to 365 days? (How is it handled in BLOM/NorESM? - naive question... - shall we maybe better introduce a parameter for this in mo_param_bgc
?). Yes, it's due to the fact that sedshi
is only called once per day, as far as I understand from hamocc4bcm
.
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.
If the number is meant to represent seconds in a model year, then it should be 86400*365
. Is this number used more often in the code? Then it might really be worth to replace it by a parameter in mo_param_bgc
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.
It could be useful to include parameters for both
seconds_in_day = 86400.
seconds_in_year = 86400.*365.
However, I see also references to different calendars in phy/mod_calendar.F90
, so I'm not sure if seconds_in_year
should be a fixed parameter.
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.
The calendar is defined in phy/mod_time.F90
: init_timevars
. The cesm
case is run with noleap
= 365.
Other cases use different calendars.
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.
I don't think we will use something different than a 365 day calendar (at least not in the near future). One could hard code it in HAMOCC, query the BLOM calendar in hamocc_init and stop if the calendar type is not 365.
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.
The fuk95
and single_column
test cases use 360_day
calendar, so these will not work if the 365 day calendar is hard coded. We usually run these only for short tests, so maybe a warning is sufficient.
I suppose some of the input files assume a 365 day calendar. Not sure what is the best approach here, but I can see that we can run into trouble if we allow different calendar options.
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.
I propose to make a new issue / PR regarding calendar setting in iHAMOCC, not to bundle everything into this PR.
Thus far no rigorous changes throughout the code - just for sediment quality
Hi @TomasTorsvik and @JorgSchwinger , I just included some routine to handle the question. The only calendar that I feel issues with is the In any case, I see that some parameter settings rely on |
hamocc/mo_param_bgc.F90
Outdated
! see mod_calendar.F90 and mod_time.F90 | ||
case ('noleap','365_day') | ||
days_per_year = 365. | ||
case ('all_leap','366_day') |
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.
case ('all_leap','366_day') | |
case ('all_leap','366_day') | |
if (mnproc == 1) then | |
write (io_stdo_bgc,*) 'WARNING: Init iHAMOCC time variables: non-standard 366_day calendar selected' | |
endif |
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.
I suggest to include a warning message if anythin other than 'noleap' is selected.
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.
I'll do so. Sorry, I overlooked your previous comment on doing all this in a different PR (was already working on it...) - shall I try to split it up or is it ok to proceed?
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.
Since you are already working on it, it is probably best to proceed, unless the rabbit hole goes too deep ...
hamocc/mo_param_bgc.F90
Outdated
!******************************************************************** | ||
real, parameter :: sec_per_day = 86400. ! seconds per day | ||
real, protected :: sec_per_year ! seconds per year | ||
real, protected :: days_per_year ! simulated days per year |
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.
Can we set default values also for sec_per_year
and days_per_year
, such that something is used even if ini_bgctimes
is not called?
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.
Propose some - based on a 365 year?
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.
Thus far, we're rather free to start off with some idea, how to best handle it in the future. In any case, ini_bgctimes
is called early in in the initialization by purpose...
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.
I.e. I only see very minor issues in the parameter definition - where a few 365
are hard-coded (while I am not seeing a need to change this).
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.
Propose some - based on a 365 year?
Yes, that would make sense.
Hi @JorgSchwinger and @TomasTorsvik , I would start a short testrun with the current branch. If that results in reasonable results, I would merge it as is (thus far only tested in the single column mode). Afterward, we can discuss, in how far we should exchange the |
Note that |
@matsbn , what do you mean by "it can change" during a simulation? - with the latest change, I only make use of it once at initialization (when calling |
Ok, you're probably referring to restarts and leap years, etc. - which would then necessitate to update the value throughout run time? |
Not only restarts, but if it is a Gregorian calendar, nday_per_year changes every 4th year. I don't know if there are plans to support such calendar with NorESM anytime soon. So for now maybe just issue an error message and stop if calendar is set to Gregorian? |
Hi @JorgSchwinger , while I see an issue for the initial parameter settings (where I wouldn't change the parameter according to year length), I don't see good reasons, why not updating the time accordingly. I now update the time also at runtime (while admittedly the warning is currently not taking always effect in case of non- versus leap years - up to potential change). |
Hi @JorgSchwinger and @TomasTorsvik , |
Hi @TomasTorsvik and @JorgSchwinger ,
I realized the issue, why diagnosed burial fluxes (and some extended nitrogen cycle diagnostics) were overestimated/not correctly estimated - now setting those at each time step to zero, before performing calculations (i.e. burial fluxes are only calculated once per day and not per time step, which overestimated the burial fluxes by factor 24 - similarly, rates for processes that only happen below certain thresholds, etc.). In that process, I also updated the sediment quality calculations to account for the sediment acceleration scheme and in general fixed the burial POC age (previously underestimated).
I set up a run - and at least the diagnostics now look reasonable. Wrt sediment quality, it remains still a bit experimental, while promising - we can discuss details in person, if needed.