-
Notifications
You must be signed in to change notification settings - Fork 134
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
Update implementation of some optional arguments in Icepack #429
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -997,10 +997,12 @@ subroutine cleanup_itd (dt, ntrcr, & | |
faero_ocn(it) = faero_ocn(it) + dfaero_ocn(it) | ||
enddo | ||
endif | ||
if (tr_iso) then | ||
do it = 1, n_iso | ||
fiso_ocn(it) = fiso_ocn(it) + dfiso_ocn(it) | ||
enddo | ||
if (present(fiso_ocn)) then | ||
if (tr_iso) then | ||
do it = 1, n_iso | ||
fiso_ocn(it) = fiso_ocn(it) + dfiso_ocn(it) | ||
enddo | ||
endif | ||
Comment on lines
+1000
to
+1005
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, this change is in a different category, no ? here we are hardening the code since before we were using This is a good improvement. |
||
endif | ||
if (present(flux_bio)) then | ||
do it = 1, nbtrcr | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,11 +177,24 @@ subroutine compute_coszen (tlat, tlon, & | |
|
||
real (kind=dbl_kind) :: ydayp1 ! day of year plus one time step | ||
|
||
logical (kind=log_kind), save :: & | ||
first_call = .true. ! first call flag | ||
|
||
character(len=*),parameter :: subname='(compute_coszen)' | ||
|
||
! Solar declination for next time step | ||
|
||
#ifdef CESMCOUPLED | ||
if (icepack_chkoptargflag(first_call)) then | ||
if (.not.(present(days_per_year) .and. & | ||
present(nextsw_cday) .and. & | ||
present(calendar_type))) then | ||
call icepack_warnings_add(subname//' error in CESMCOUPLED args') | ||
call icepack_warnings_setabort(.true.,__FILE__,__LINE__) | ||
return | ||
endif | ||
endif | ||
|
||
Comment on lines
+188
to
+197
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, so if I understand correctly these flags are not optional for CESM, so we add a check to that effect here? If so, that makes sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might complicate coupling in E3SM, if it's using CESMCOUPLED (I'm not sure). @njeffery There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, there are very few CESMCOUPLED cpps left in Icepack, we tried to clear them out a while ago and shift more to namelist settings. Use of CESMCOUPLED in icepack_orbital was discussed of that at the time. If this causes E3SM a problem, we can refactor it. The problem is that it will probably require a change in all the models using CESMCOUPLED in terms of how the orbital stuff is handled, so we're trying not to change that until we have to. But maybe we should do this at some point with consultation with CESM, RASM, etc so it's well coordinated. New implementation still TBD as well. |
||
if (calendar_type == "GREGORIAN") then | ||
ydayp1 = min(nextsw_cday, real(days_per_year,kind=dbl_kind)) | ||
else | ||
|
@@ -206,6 +219,8 @@ subroutine compute_coszen (tlat, tlon, & | |
endif | ||
#endif | ||
|
||
first_call = .false. | ||
|
||
end subroutine compute_coszen | ||
|
||
!=============================================================================== | ||
|
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.
This change, along with the deletions above, change the behaviour of the subroutine if
write_diags
is absent. Before, in that case we would write diagnostics sincel_write_diags
was initialized to.true.
. Now we check if the argument is present, and so callers must always setwrite_diags
to true if they want diagnostics.I checked we already pass this argument in CICE drivers, bu we do not do so in the Icepack driver:
Icepack/configuration/driver/icedrv_InitMod.F90
Lines 100 to 105 in 67c8741
I think this should be pointed out in the commit message, and maybe in the release notes ?
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.
You are correct, thanks for noticing this @phil-blain. I missed that and assume it behaved like everything else in the code, didn't look closely enough. Overall, the diagnostics should either be on all the time OR they should be turned on via the interface. It doesn't make sense to me that they be on by default but can be turned OFF by the interface. That's counter to how everything works in CICE/Icepack in general. What do others think? For now, I think I'll update the call to icepack_init_fsd_bounds and set the flag to true.