From 4f1a4af743fcc3615b7923ef73de7efc2e4724b8 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 25 Jun 2021 11:28:23 -0600 Subject: [PATCH] fix unitialized variable in timeInit, remove option ifdays0 --- cime_config/config_component.xml | 6 +++--- nuopc_cap_share/nuopc_shr_methods.F90 | 24 +++--------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 8f6030c52..77b7b8437 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -331,7 +331,7 @@ char - none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end ndays run_begin_stop_restart env_run.xml @@ -363,7 +363,7 @@ char - none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end $STOP_OPTION run_begin_stop_restart env_run.xml @@ -2293,7 +2293,7 @@ char - none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,end never run_drv_history env_run.xml diff --git a/nuopc_cap_share/nuopc_shr_methods.F90 b/nuopc_cap_share/nuopc_shr_methods.F90 index 8d3283a4f..8cbf91056 100644 --- a/nuopc_cap_share/nuopc_shr_methods.F90 +++ b/nuopc_cap_share/nuopc_shr_methods.F90 @@ -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 @@ -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') @@ -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)' !------------------------------------------------------------------------------- @@ -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)