@@ -30,7 +30,7 @@ subroutine GFS_time_vary_pre_init (errmsg, errflg)
3030 errflg = 0
3131
3232 if (is_initialized) return
33-
33+
3434 !- -- Call gfuncphys (funcphys.f) to compute all physics function tables.
3535 call gfuncphys ()
3636
@@ -93,7 +93,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
9393 real (kind= kind_phys), parameter :: con_hr = 3600.0_kind_phys
9494 real (kind= kind_dbl_prec) :: rinc8(5 )
9595
96- integer :: iw3jdn
96+ integer :: w3kindreal, w3kindint
97+ integer :: iw3jdn
9798 integer :: jd0, jd1
9899 real :: fjd
99100
@@ -112,9 +113,17 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
112113 !- -- jdat is being updated directly inside of the time integration
113114 !- -- loop of scm.F90
114115 !- -- update calendars and triggers
115- rinc8(1 :5 ) = 0
116- call w3difdat(jdat,idat,4 ,rinc8)
117- sec = rinc8(4 )
116+ call w3kind(w3kindreal, w3kindint)
117+ !- -- CCPP uses w3emc_d, therefore expecting the following values
118+ if (w3kindreal == 8 .and. w3kindint== 4 ) then
119+ rinc8(1 :5 ) = 0
120+ call w3difdat(jdat,idat,4 ,rinc8)
121+ sec = rinc8(4 )
122+ else
123+ write (errmsg,' (*(a))' ) " FATAL ERROR: Invalid w3kindreal or w3kindint:" , w3kindreal, w3kindint
124+ errflg = 1
125+ return
126+ end if
118127 phour = sec/ con_hr
119128 !- -- set current bucket hour
120129 zhour = phour
0 commit comments