@@ -30,7 +30,7 @@ subroutine GFS_time_vary_pre_init (errmsg, errflg)
30
30
errflg = 0
31
31
32
32
if (is_initialized) return
33
-
33
+
34
34
!- -- Call gfuncphys (funcphys.f) to compute all physics function tables.
35
35
call gfuncphys ()
36
36
@@ -93,7 +93,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
93
93
real (kind= kind_phys), parameter :: con_hr = 3600.0_kind_phys
94
94
real (kind= kind_dbl_prec) :: rinc8(5 )
95
95
96
- integer :: iw3jdn
96
+ integer :: w3kindreal, w3kindint
97
+ integer :: iw3jdn
97
98
integer :: jd0, jd1
98
99
real :: fjd
99
100
@@ -112,9 +113,17 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
112
113
!- -- jdat is being updated directly inside of the time integration
113
114
!- -- loop of scm.F90
114
115
!- -- 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
118
127
phour = sec/ con_hr
119
128
!- -- set current bucket hour
120
129
zhour = phour
0 commit comments