Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GEFS branch to current production #333

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,24 @@ subroutine update_atmos_chemistry(state, rc)
enddo
enddo

! -- zero out accumulated fields
!$OMP parallel do default (none) &
!$OMP shared (nj, ni, Atm_block, IPD_Control, IPD_Data) &
!$OMP private (j, jb, i, ib, nb, ix)
do j = 1, nj
jb = j + Atm_block%jsc - 1
do i = 1, ni
ib = i + Atm_block%isc - 1
nb = Atm_block%blkno(ib,jb)
ix = Atm_block%ixp(ib,jb)
IPD_Data(nb)%coupling%rainc_cpl(ix) = 0._IPD_kind_phys
if (.not.IPD_Control%cplflx) then
IPD_Data(nb)%coupling%rain_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%snow_cpl(ix) = 0._IPD_kind_phys
end if
enddo
enddo

if (IPD_Control%debug) then
! -- diagnostics
write(6,'("update_atmos: prsi - min/max/avg",3g16.6)') minval(prsi), maxval(prsi), sum(prsi)/size(prsi)
Expand Down Expand Up @@ -2536,24 +2554,24 @@ subroutine setup_exportdata (rc)
do i=isc,iec
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)
IPD_Data(nb)%coupling%dusfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dvsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dtsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dqsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dlwsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dswsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%rain_cpl(ix) = 0.0
IPD_Data(nb)%coupling%nlwsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%nswsfc_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dnirbm_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dnirdf_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dvisbm_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dvisdf_cpl(ix) = 0.0
IPD_Data(nb)%coupling%nnirbm_cpl(ix) = 0.0
IPD_Data(nb)%coupling%nnirdf_cpl(ix) = 0.0
IPD_Data(nb)%coupling%nvisbm_cpl(ix) = 0.0
IPD_Data(nb)%coupling%nvisdf_cpl(ix) = 0.0
IPD_Data(nb)%coupling%snow_cpl(ix) = 0.0
IPD_Data(nb)%coupling%dusfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dvsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dtsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dqsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dlwsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dswsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%rain_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%nlwsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%nswsfc_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dnirbm_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dnirdf_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dvisbm_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%dvisdf_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%nnirbm_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%nnirdf_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%nvisbm_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%nvisdf_cpl(ix) = 0._IPD_kind_phys
IPD_Data(nb)%coupling%snow_cpl(ix) = 0._IPD_kind_phys
enddo
enddo
endif !cplflx
Expand Down
5 changes: 5 additions & 0 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module fv3gfs_cap_mod
NUOPC_ModelGet
!
use module_fv3_config, only: quilting, restart_interval, &
other_restart_time, &
nfhout, nfhout_hf, nsout, dt_atmos, &
nfhmax, nfhmax_hf,output_hfmax, &
output_interval,output_interval_hf, &
Expand Down Expand Up @@ -283,6 +284,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
CALL ESMF_ConfigGetAttribute(config=CF,value=restart_interval, &
label ='restart_interval:',rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
!
CALL ESMF_ConfigGetAttribute(config=CF,value=other_restart_time, &
label ='other_restart_time:',rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
!
CALL ESMF_ConfigGetAttribute(config=CF,value=calendar, &
label ='calendar:',rc=rc)
Expand Down
8 changes: 6 additions & 2 deletions gfsphysics/GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3202,9 +3202,13 @@ subroutine GFS_physics_driver &
dtdt(1:im,:) = Stateout%gt0(1:im,:)
endif ! end if_ldiag3d/cnvgwd

if (Model%ldiag3d .or. Model%lgocart) then
if (Model%ldiag3d .or. Model%lgocart .or. Model%cplchm) then
dqdt(1:im,:,1) = Stateout%gq0(1:im,:,1)
endif ! end if_ldiag3d/lgocart
endif ! end if_ldiag3d/lgocart/cplchm

if (Model%lgocart .or. Model%cplchm) then
Coupling%dqdti(1:im,:) = 0._kind_phys
endif ! end if_lgocart/cplchm

#ifdef GFS_HYDRO
call get_phi(im, ix, levs, ntrac, Stateout%gt0, Stateout%gq0, &
Expand Down
39 changes: 31 additions & 8 deletions gfsphysics/GFS_layer/GFS_radiation_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2116,18 +2116,41 @@ subroutine GFS_radiation_driver &
Diag%fluxr(i,11-j) = Diag%fluxr(i,11-j) + tem0d * Statein%prsi(i,itop+kt)
Diag%fluxr(i,14-j) = Diag%fluxr(i,14-j) + tem0d * Statein%prsi(i,ibtc+kb)
Diag%fluxr(i,17-j) = Diag%fluxr(i,17-j) + tem0d * Statein%tgrs(i,itop)
end do
end do

! Anning adds optical depth and emissivity output
tem1 = 0.
tem2 = 0.
do k=ibtc,itop
tem1 = tem1 + cldtausw(i,k) ! approx .55 mu channel
tem2 = tem2 + cldtaulw(i,k) ! approx 10. mu channel

if (Model%lsswr .and. (nday > 0)) then
do j = 1, 3
do i = 1, IM
tem0d = raddt * cldsa(i,j)
itop = mtopa(i,j) - kd
ibtc = mbota(i,j) - kd
tem1 = 0.
do k=ibtc,itop
tem1 = tem1 + cldtausw(i,k) ! approx .55 um channel
enddo
Diag%fluxr(i,43-j) = Diag%fluxr(i,43-j) + tem0d * tem1
enddo
Diag%fluxr(i,43-j) = Diag%fluxr(i,43-j) + tem0d * tem1
Diag%fluxr(i,46-j) = Diag%fluxr(i,46-j) + tem0d * (1.0-exp(-tem2))
enddo
enddo
end if

if (Model%lslwr) then
do j = 1, 3
do i = 1, IM
tem0d = raddt * cldsa(i,j)
itop = mtopa(i,j) - kd
ibtc = mbota(i,j) - kd
tem2 = 0.
do k=ibtc,itop
tem2 = tem2 + cldtaulw(i,k) ! approx 10. um channel
enddo
Diag%fluxr(i,46-j) = Diag%fluxr(i,46-j) + tem0d * (1.0-exp(-tem2))
enddo
enddo
endif

endif

! if (.not. Model%uni_cld) then
Expand Down
1 change: 1 addition & 0 deletions gfsphysics/physics/sflx.f
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ subroutine sflx &
runoff2 = 0.0
runoff3 = 0.0
snomlt = 0.0
rc = 0.0

! --- ... define local variable ice to achieve:
! sea-ice case, ice = 1
Expand Down
21 changes: 17 additions & 4 deletions module_fcst_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ module module_fcst_grid_comp
!
use module_fv3_io_def, only: num_pes_fcst, num_files, filename_base, nbdlphys, &
iau_offset
use module_fv3_config, only: dt_atmos, calendar, restart_interval, &
use module_fv3_config, only: dt_atmos, calendar, restart_interval, &
other_restart_time, &
quilting, calendar_type, cpl, &
cplprint_flag, force_date_from_configure
!
Expand All @@ -88,7 +89,8 @@ module module_fcst_grid_comp
type(atmos_data_type) :: Atm
type(time_type) :: Time_atmos, Time_init, Time_end, &
Time_step_atmos, Time_step_ocean, &
Time_restart, Time_step_restart
Time_restart, Time_step_restart, &
Time_restart1, Time_other_restart
integer :: num_atmos_calls, ret, intrm_rst
end type

Expand Down Expand Up @@ -179,7 +181,7 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)

integer :: Run_length
integer,dimension(6) :: date, date_end
integer :: res_intvl
integer :: res_intvl, res_time
integer :: mpi_comm_comp
!
logical,save :: first=.true.
Expand Down Expand Up @@ -321,10 +323,13 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
date_init,'time_atmos=',date,'time_end=',date_end,'dt_atmos=',dt_atmos, &
'Run_length=',Run_length
res_intvl = restart_interval*3600
res_time = other_restart_time*3600
atm_int_state%Time_step_restart = set_time (res_intvl, 0)
atm_int_state%Time_other_restart = set_time (res_time, 0)
atm_int_state%Time_restart = atm_int_state%Time_atmos + atm_int_state%Time_step_restart
atm_int_state%Time_restart1 = atm_int_state%Time_init + atm_int_state%Time_other_restart
atm_int_state%intrm_rst = 0
if (res_intvl>0) atm_int_state%intrm_rst = 1
if (res_intvl>0 .or. res_time>0) atm_int_state%intrm_rst = 1
atm_int_state%Atm%iau_offset = iau_offset
!
!
Expand Down Expand Up @@ -784,6 +789,14 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc)
call wrt_atmres_timestamp(atm_int_state,timestamp)
atm_int_state%Time_restart = atm_int_state%Time_restart + atm_int_state%Time_step_restart
endif

if ((na /= atm_int_state%num_atmos_calls) .and. &
(atm_int_state%Time_atmos == atm_int_state%Time_restart1)) then
timestamp = date_to_string (atm_int_state%Time_restart1)
call atmos_model_restart(atm_int_state%Atm, timestamp)
call wrt_atmres_timestamp(atm_int_state,timestamp)
endif

endif
!
call print_memuse_stats('after full step')
Expand Down
2 changes: 1 addition & 1 deletion module_fv3_config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module module_fv3_config
implicit none
!

integer :: restart_interval
integer :: restart_interval, other_restart_time
!
integer :: nfhout, nfhout_hf, nsout, dt_atmos
integer :: nfhmax, nfhmax_hf, first_kdt
Expand Down
4 changes: 2 additions & 2 deletions stochastic_physics/stochastic_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ subroutine run_stochastic_physics(nblks,Model,Grid,Coupling)
maxlen = max(maxlen,size(Grid(blk)%xlat,1))
ENDDO
! check to see if it is time to write out random patterns
if (Model%phour .EQ. fhstoch) then
if (fhstoch.GE. 0 .AND. MOD(Model%phour,fhstoch) .EQ. 0) then
write(STRFH,FMT='(I6.6)') nint(Model%phour)
sfile='stoch_out.F'//trim(STRFH)
sfile='RESTART/stoch_out.F'//trim(STRFH)
call dump_patterns(sfile)
endif
allocate(tmp_wts(nblks,maxlen))
Expand Down