-
Notifications
You must be signed in to change notification settings - Fork 7
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
Set gregorian calednar correctly for CICE #112
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||||||||||
diff --git a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 | ||||||||||||||
index b94fcff0..af9e4a36 100644 | ||||||||||||||
--- a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 | ||||||||||||||
+++ b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 | ||||||||||||||
@@ -23,10 +23,10 @@ module ice_comp_nuopc | ||||||||||||||
use ice_domain_size , only : nx_global, ny_global | ||||||||||||||
use ice_grid , only : grid_format, init_grid2 | ||||||||||||||
use ice_communicate , only : init_communicate, my_task, master_task, mpi_comm_ice | ||||||||||||||
- use ice_calendar , only : force_restart_now, write_ic, init_calendar | ||||||||||||||
- use ice_calendar , only : idate, mday, mmonth, myear, year_init | ||||||||||||||
+ use ice_calendar , only : force_restart_now, write_ic | ||||||||||||||
+ use ice_calendar , only : idate, idate0, mday, mmonth, myear, year_init, month_init, day_init | ||||||||||||||
use ice_calendar , only : msec, dt, calendar, calendar_type, nextsw_cday, istep | ||||||||||||||
- use ice_calendar , only : ice_calendar_noleap, ice_calendar_gregorian | ||||||||||||||
+ use ice_calendar , only : ice_calendar_noleap, ice_calendar_gregorian, use_leap_years | ||||||||||||||
use ice_kinds_mod , only : dbl_kind, int_kind, char_len, char_len_long | ||||||||||||||
use ice_fileunits , only : nu_diag, nu_diag_set, inst_index, inst_name | ||||||||||||||
use ice_fileunits , only : inst_suffix, release_all_fileunits, flush_fileunit | ||||||||||||||
@@ -746,7 +746,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) | ||||||||||||||
call cice_init2() | ||||||||||||||
call t_stopf ('cice_init2') | ||||||||||||||
!--------------------------------------------------------------------------- | ||||||||||||||
- ! use EClock to reset calendar information on initial start | ||||||||||||||
+ ! use EClock to reset calendar information | ||||||||||||||
!--------------------------------------------------------------------------- | ||||||||||||||
|
||||||||||||||
! - on initial run | ||||||||||||||
@@ -762,7 +762,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) | ||||||||||||||
if (ref_ymd /= start_ymd .or. ref_tod /= start_tod) then | ||||||||||||||
if (my_task == master_task) then | ||||||||||||||
write(nu_diag,*) trim(subname),': ref_ymd ',ref_ymd, ' must equal start_ymd ',start_ymd | ||||||||||||||
- write(nu_diag,*) trim(subname),': ref_ymd ',ref_tod, ' must equal start_ymd ',start_tod | ||||||||||||||
+ write(nu_diag,*) trim(subname),': ref_tod',ref_tod, ' must equal start_tod ',start_tod | ||||||||||||||
end if | ||||||||||||||
end if | ||||||||||||||
|
||||||||||||||
@@ -794,6 +794,19 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) | ||||||||||||||
|
||||||||||||||
end if | ||||||||||||||
|
||||||||||||||
+ ! - start time from ESMF clock. Used to set history time units | ||||||||||||||
+ idate0 = start_ymd | ||||||||||||||
+ year_init = (idate0/10000) | ||||||||||||||
+ month_init= (idate0-year_init*10000)/100 ! integer month of basedate | ||||||||||||||
+ day_init = idate0-year_init*10000-month_init*100 | ||||||||||||||
+ | ||||||||||||||
+ ! - Set use_leap_years based on calendar (as some CICE calls use this instead of the calendar type) | ||||||||||||||
+ if (calendar_type == ice_calendar_gregorian) then | ||||||||||||||
+ use_leap_years = .true. | ||||||||||||||
+ else | ||||||||||||||
+ use_leap_years = .false. ! no_leap calendars | ||||||||||||||
+ endif | ||||||||||||||
Comment on lines
+48
to
+52
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 can be made more compact:
Suggested change
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. Oh good pickup! I'm also going to leave this as is because we already committed this to cice-main :) |
||||||||||||||
+ | ||||||||||||||
call calendar() ! update calendar info | ||||||||||||||
|
||||||||||||||
!---------------------------------------------------------------------------- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@micaeljtoliveira - is there a neater syntax than this for adding multiple patched sources?
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.
No, not really. If you have many files to patch then it might be worth putting them in a list and loop over the list contents. Something like this:
Another option would be to add a variant of
add_patched_source
that takes multiple files:IMO, none of them looks much neater than what you have here, but happy to hear other opinions.
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.
Ok thanks - ill leave it alone :)