Skip to content

Commit

Permalink
Working meow
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Feb 19, 2025
1 parent da0fe97 commit c2cfcf4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
5 changes: 1 addition & 4 deletions ccpp/driver/GFS_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,7 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
ExtDiag(idx)%unit = 'w/m**2'
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag%dswsfcci(Model%chunk_begin(nb):Model%chunk_end(nb))
enddo
ExtDiag(idx)%data%var2 => IntDiag%dswsfcci(:)

idx = idx + 1
ExtDiag(idx)%axes = 2
Expand Down
28 changes: 15 additions & 13 deletions io/fv3atm_restart_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ subroutine phys_restart_read (GFS_Restart, Atm_block, Model, fv_domain, ignore_r
call read_restart(Phy_restart, ignore_checksum=ignore_rst_cksum)
call close_file(Phy_restart)

call phy%transfer_data(.true., GFS_Restart, Atm_block, Model)
call phy%transfer_data(.true., GFS_Restart, Atm_block, Model, .true.)

end subroutine phys_restart_read

Expand All @@ -963,10 +963,10 @@ subroutine phys_restart_write (GFS_Restart, Atm_block, Model, fv_domain, timesta
implicit none
!--- interface variable definitions
type(GFS_restart_type), intent(inout) :: GFS_Restart(:)
type(block_control_type), intent(in) :: Atm_block
type(GFS_control_type), intent(in) :: Model
type(domain2d), intent(in) :: fv_domain
character(len=32), optional, intent(in) :: timestamp
type(block_control_type), intent(in ) :: Atm_block
type(GFS_control_type), intent(in ) :: Model
type(domain2d), intent(in ) :: fv_domain
character(len=32), optional, intent(in ) :: timestamp
!--- local variables
integer :: i, j, k, nb, ix, num2, num3
integer :: isc, iec, jsc, jec, nx, ny
Expand Down Expand Up @@ -1054,7 +1054,7 @@ subroutine phys_restart_write (GFS_Restart, Atm_block, Model, fv_domain, timesta
nullify(var2_p)
nullify(var3_p)

call phy%transfer_data(.false., GFS_Restart, Atm_block, Model)
call phy%transfer_data(.false., GFS_Restart, Atm_block, Model, .false.)

call write_restart(Phy_restart)
call close_file(Phy_restart)
Expand Down Expand Up @@ -1100,10 +1100,10 @@ subroutine fv_phy_restart_output(GFS_Restart, Atm_block, Model)
implicit none

type(GFS_restart_type), intent(inout) :: GFS_Restart(:)
type(block_control_type), intent(in) :: Atm_block
type(GFS_control_type), intent(in) :: Model
type(block_control_type), intent(in ) :: Atm_block
type(GFS_control_type), intent(in ) :: Model

call phy_quilt%transfer_data(.false., GFS_Restart, Atm_block, Model, restart_output=.true.)
call phy_quilt%transfer_data(.false., GFS_Restart, Atm_block, Model, .false.)

end subroutine fv_phy_restart_output

Expand Down Expand Up @@ -1273,15 +1273,15 @@ end function phy_data_alloc
!! direction of the copy. For reading=.true., data is copied from the temporary arrays to the
!! model grid (during restart read). For reading=.false., data is copied from the model grid to
!! temporary arrays (for writing the restart).
subroutine phy_data_transfer_data(phy, reading, GFS_Restart, Atm_block, Model, restart_output)
subroutine phy_data_transfer_data(phy, reading, GFS_Restart, Atm_block, Model, reset_diag)
use mpp_mod, only: FATAL, mpp_error
implicit none
class(phy_data_type) :: phy
logical, intent(in) :: reading
type(GFS_restart_type), intent(inout) :: GFS_Restart(:)
type(block_control_type) :: Atm_block
type(GFS_control_type), intent(in) :: Model
logical, optional, intent(in) :: restart_output
logical, intent(in) :: reset_diag

integer :: i, j, k, ivar, nb, ix, im, num2, num3

Expand Down Expand Up @@ -1311,8 +1311,10 @@ subroutine phy_data_transfer_data(phy, reading, GFS_Restart, Atm_block, Model, r
j = Atm_block%index(nb)%jj(ix) - Atm_block%jsc + 1
GFS_Restart(ivar)%data%var2(im) = phy%var2(i,j,num2)
!--- if restart from init time, reset accumulated diag fields
if (GFS_restart(ivar)%reset .and. (present(restart_output)) .and. Model%phour < 1.e-7) then
GFS_Restart(ivar)%data%var2(im) = zero
if (reset_diag) then
if (GFS_restart(ivar)%reset .and. Model%phour < 1.e-7) then
GFS_Restart(ivar)%data%var2(im) = zero
endif
endif
enddo
enddo
Expand Down

0 comments on commit c2cfcf4

Please sign in to comment.