Skip to content

Commit e9cb13d

Browse files
committed
physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90: check that w3emc is using the expected precision
1 parent 9b527e4 commit e9cb13d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr,
9696
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
9797
real(kind=kind_dbl_prec) :: rinc8(5)
9898

99-
integer :: iw3jdn
99+
integer :: w3kindreal, w3kindint
100+
integer :: iw3jdn
100101
integer :: jd0, jd1
101102
real :: fjd
102103

@@ -113,9 +114,17 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr,
113114

114115
!--- jdat is being updated directly inside of FV3GFS_cap.F90
115116
!--- update calendars and triggers
116-
rinc8(1:5) = 0
117-
call w3difdat(jdat,idat,4,rinc8)
118-
sec = rinc8(4)
117+
call w3kind(w3kindreal, w3kindint)
118+
!--- CCPP uses w3emc_d, therefore expecting the following values
119+
if (w3kindreal == 8 .and. w3kindint==4) then
120+
rinc8(1:5) = 0
121+
call w3difdat(jdat,idat,4,rinc8)
122+
sec = rinc8(4)
123+
else
124+
write(errmsg,'(*(a))') "FATAL ERROR: Invalid w3kindreal or w3kindint:", w3kindreal, w3kindint
125+
errflg = 1
126+
return
127+
end if
119128
phour = sec/con_hr
120129
!--- set current bucket hour
121130
zhour = phour

0 commit comments

Comments
 (0)