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 unitialized variable in timeInit, remove option ifdays0 #209

Merged
merged 1 commit into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@

<entry id="STOP_OPTION">
<type>char</type>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end</valid_values>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end</valid_values>
<default_value>ndays</default_value>
<group>run_begin_stop_restart</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -363,7 +363,7 @@

<entry id="REST_OPTION">
<type>char</type>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end</valid_values>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end</valid_values>
<default_value>$STOP_OPTION</default_value>
<group>run_begin_stop_restart</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -2293,7 +2293,7 @@

<entry id="HIST_OPTION">
<type>char</type>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end</valid_values>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,end</valid_values>
<default_value>never</default_value>
<group>run_drv_history</group>
<file>env_run.xml</file>
Expand Down
24 changes: 3 additions & 21 deletions nuopc_cap_share/nuopc_shr_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ module nuopc_shr_methods
optNYear = "nyear" , &
optMonthly = "monthly" , &
optYearly = "yearly" , &
optDate = "date" , &
optIfdays0 = "ifdays0"
optDate = "date"

! Module data
integer, parameter :: SecPerDay = 86400 ! Seconds per day
Expand Down Expand Up @@ -572,22 +571,6 @@ subroutine alarmInit( clock, alarm, option, &
if (chkerr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .false.

case (optIfdays0)
if (.not. present(opt_ymd)) then
call shr_sys_abort(subname//trim(option)//' requires opt_ymd')
end if
if (.not.present(opt_n)) then
call shr_sys_abort(subname//trim(option)//' requires opt_n')
end if
if (opt_n <= 0) then
call shr_sys_abort(subname//trim(option)//' invalid opt_n')
end if
call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_TimeSet( NextAlarm, yy=cyy, mm=cmm, dd=opt_n, s=0, calendar=cal, rc=rc )
if (chkerr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .true.

case (optNSteps)
if (.not.present(opt_n)) then
call shr_sys_abort(subname//trim(option)//' requires opt_n')
Expand Down Expand Up @@ -808,7 +791,6 @@ subroutine timeInit( Time, ymd, cal, tod, rc)
! local variables
integer :: year, mon, day ! year, month, day as integers
integer :: tdate ! temporary date
integer :: date ! coded-date (yyyymmdd)
character(len=*), parameter :: subname='(timeInit)'
!-------------------------------------------------------------------------------

Expand All @@ -818,9 +800,9 @@ subroutine timeInit( Time, ymd, cal, tod, rc)
call shr_sys_abort( subname//'ERROR yymmdd is a negative number or time-of-day out of bounds' )
end if

tdate = abs(date)
tdate = abs(ymd)
year = int(tdate/10000)
if (date < 0) year = -year
if (ymd < 0) year = -year
mon = int( mod(tdate,10000)/ 100)
day = mod(tdate, 100)

Expand Down