Skip to content

Commit 6f707a5

Browse files
committed
Merge branch 'feature/check_w3emc_flavor' into NRL_combo_2025_08_29
2 parents d041320 + ea1cebd commit 6f707a5

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
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

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)