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

Fix history and restart frequency, new features to scripts #610

Merged
merged 11 commits into from
Jul 2, 2021
18 changes: 10 additions & 8 deletions cicecore/drivers/unittest/bcstchk/bcstchk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ program bcstchk
else
write(6,*) 'BCSTCHK FAILED'
endif
write(6,*) ' '
write(6,*) '=========================================================='
write(6,*) ' '
write(6,*) 'NOTE: We are testing the abort now so you should see an abort to follow'
write(6,*) 'The BCSTCHK passed, so please ignore the abort'
write(6,*) ' '
endif

! Test abort_ice, regardless of test outcome
Expand All @@ -276,13 +270,21 @@ program bcstchk

call flush_fileunit(6)
call ice_barrier()
call abort_ice(subname//' Test abort ',file=__FILE__,line=__LINE__, doabort=.false.)
if (my_task == master_task) then
write(6,*) ' '
write(6,*) '=========================================================='
write(6,*) ' '
write(6,*) 'NOTE: We are testing the abort now so you should see an abort to follow'
write(6,*) 'The BCSTCHK passed, so please ignore the abort'
write(6,*) ' '
call abort_ice(subname//' Test abort ',file=__FILE__,line=__LINE__, doabort=.false.)
endif
call flush_fileunit(6)
call ice_barrier()

if (my_task == master_task) then
write(6,*) ' '
write(6,*) 'BCSTCHK abort test done'
write(6,*) 'BCSTCHK done'
write(6,*) ' '
endif

Expand Down
4 changes: 1 addition & 3 deletions cicecore/drivers/unittest/calchk/calchk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ program calchk
use ice_kinds_mod, only: int_kind, dbl_kind
use ice_calendar, only: myear, mmonth, mday, msec
use ice_calendar, only: year_init, month_init, day_init, sec_init
use ice_calendar, only: dt, ndtd, istep0, diagfreq, npt, npt_unit
use ice_calendar, only: dt, istep0, diagfreq, npt, npt_unit
use ice_calendar, only: months_per_year, daymo, timesecs, seconds_per_day
use ice_calendar, only: use_leap_years, days_per_year
use ice_calendar, only: compute_elapsed_days
Expand Down Expand Up @@ -55,8 +55,6 @@ program calchk
testname(7) = 'special checks'
testname(8) = 'calc_timesteps'

ndtd = 1

! test yearmax years from year 0
! yearmax = 1000
yearmax = 100000
Expand Down
70 changes: 0 additions & 70 deletions cicecore/drivers/unittest/sumchk/CICE_FinalMod.F90

This file was deleted.

7 changes: 3 additions & 4 deletions cicecore/drivers/unittest/sumchk/sumchk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ program sumchk
! infrastructure built-in.

use CICE_InitMod
use CICE_FinalMod
use ice_kinds_mod, only: int_kind, dbl_kind, real_kind
use ice_communicate, only: my_task, master_task, get_num_procs
use ice_domain_size, only: nx_global, ny_global
Expand All @@ -23,7 +22,7 @@ program sumchk
use ice_constants, only: field_loc_center, field_loc_Nface
use ice_fileunits, only: bfbflag
use ice_global_reductions
use ice_exit, only: abort_ice
use ice_exit, only: abort_ice, end_run

implicit none

Expand Down Expand Up @@ -687,10 +686,10 @@ program sumchk


!-----------------------------------------------------------------
! Finalize CICE
! Gracefully end
!-----------------------------------------------------------------

call CICE_Finalize
call end_run()

end program sumchk

Expand Down
9 changes: 4 additions & 5 deletions cicecore/shared/ice_calendar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module ice_calendar
dayyr , & ! number of days in the current year
npt , & ! total number of time steps (dt)
npt0 , & ! original npt value in npt0_unit
ndtd , & ! number of dynamics subcycles: dt_dyn=dt/ndtd
ndtd = 1 , & ! number of dynamics subcycles: dt_dyn=dt/ndtd
stop_now , & ! if 1, end program execution
write_restart, & ! if 1, write restart now
diagfreq , & ! diagnostic output frequency (10 = once per 10 dt)
Expand Down Expand Up @@ -126,10 +126,9 @@ module ice_calendar
dumpfreq ! restart frequency, 'y','m','d'

character (len=char_len), public :: &
dumpfreq_base, & ! restart frequency basetime ('zero', 'init')
histfreq_base, & ! history frequency basetime ('zero', 'init')
calendar_type ! differentiates Gregorian from other calendars
! default = ' '
dumpfreq_base = 'zero', & ! restart frequency basetime ('zero', 'init')
histfreq_base = 'init', & ! history frequency basetime ('zero', 'init')
calendar_type ! define calendar type
Copy link
Member

Choose a reason for hiding this comment

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

why are the default values set here in ice_calendar instead of in ice_init as for other namelist flags ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are also set in ice_init in the standard method. The reason that I set them here as well is to help the unit testing work better. calchk doesn't go thru any CICE initialization, so having defaults set here means I don't have to explicitly set them when I run the calchk unit test. One could argue whether that is the best way to do it. I also made a similar change to ndtd in ice_calendar.


! PRIVATE

Expand Down