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 dtc/develop from NOAA-EMC develop 2020/07/07 #58

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
61 changes: 48 additions & 13 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,28 @@ subroutine update_atmos_radiation_physics (Atmos)
! print *,'in atmos_model, after assign_importdata, rc=',rc
endif

! Calculate total non-physics tendencies by substracting old IPD Stateout
! variables from new/updated IPD Statein variables (gives the tendencies
! due to anything else than physics)
if (IPD_Control%ldiag3d) then
do nb = 1,Atm_block%nblks
IPD_Data(nb)%Intdiag%du3dt(:,:,8) = IPD_Data(nb)%Intdiag%du3dt(:,:,8) &
+ (IPD_Data(nb)%Statein%ugrs - IPD_Data(nb)%Stateout%gu0)
IPD_Data(nb)%Intdiag%dv3dt(:,:,8) = IPD_Data(nb)%Intdiag%dv3dt(:,:,8) &
+ (IPD_Data(nb)%Statein%vgrs - IPD_Data(nb)%Stateout%gv0)
IPD_Data(nb)%Intdiag%dt3dt(:,:,11) = IPD_Data(nb)%Intdiag%dt3dt(:,:,11) &
+ (IPD_Data(nb)%Statein%tgrs - IPD_Data(nb)%Stateout%gt0)
enddo
if (IPD_Control%qdiag3d) then
do nb = 1,Atm_block%nblks
IPD_Data(nb)%Intdiag%dq3dt(:,:,12) = IPD_Data(nb)%Intdiag%dq3dt(:,:,12) &
+ (IPD_Data(nb)%Statein%qgrs(:,:,IPD_Control%ntqv) - IPD_Data(nb)%Stateout%gq0(:,:,IPD_Control%ntqv))
IPD_Data(nb)%Intdiag%dq3dt(:,:,13) = IPD_Data(nb)%Intdiag%dq3dt(:,:,13) &
+ (IPD_Data(nb)%Statein%qgrs(:,:,IPD_Control%ntoz) - IPD_Data(nb)%Stateout%gq0(:,:,IPD_Control%ntoz))
enddo
endif
endif

call mpp_clock_end(setupClock)

if (mpp_pe() == mpp_root_pe() .and. debug) write(6,*) "radiation driver"
Expand Down Expand Up @@ -466,7 +488,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
integer :: bdat(8), cdat(8)
integer :: ntracers, maxhf, maxh
character(len=32), allocatable, target :: tracer_names(:)
integer :: nthrds
integer :: nthrds, nb

!-----------------------------------------------------------------------

Expand Down Expand Up @@ -633,17 +655,6 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
if(IPD_Control%me == IPD_Control%master) print *,'do_skeb=',IPD_Control%do_skeb
end if

#ifdef CCPP
! Initialize the CCPP framework
call CCPP_step (step="init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP init step failed')
! Doing the init here requires logic in thompson aerosol init if no aerosol
! profiles are specified and internal profiles are calculated, because these
! require temperature/geopotential etc which are not yet set. Sim. for RUC LSM.
call CCPP_step (step="physics_init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP physics_init step failed')
#endif

Atmos%Diag => IPD_Diag

if (IPD_Control%do_sfcperts) then
Expand Down Expand Up @@ -703,6 +714,30 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain)
#endif

! Populate the IPD_Data%Statein container with the prognostic state
! in Atm_block, which contains the initial conditions/restart data.
call atmos_phys_driver_statein (IPD_data, Atm_block, flip_vc)

! When asked to calculate 3-dim. tendencies, set Stateout variables to
! Statein variables here in order to capture the first call to dycore
if (IPD_Control%ldiag3d) then
do nb = 1,Atm_block%nblks
IPD_Data(nb)%Stateout%gu0 = IPD_Data(nb)%Statein%ugrs
IPD_Data(nb)%Stateout%gv0 = IPD_Data(nb)%Statein%vgrs
IPD_Data(nb)%Stateout%gt0 = IPD_Data(nb)%Statein%tgrs
IPD_Data(nb)%Stateout%gq0 = IPD_Data(nb)%Statein%qgrs
enddo
endif

#ifdef CCPP
! Initialize the CCPP framework
call CCPP_step (step="init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP init step failed')
! Initialize the CCPP physics
call CCPP_step (step="physics_init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP physics_init step failed')
#endif

!--- set the initial diagnostic timestamp
diag_time = Time
if (output_1st_tstep_rst) then
Expand Down Expand Up @@ -1456,7 +1491,7 @@ subroutine update_atmos_chemistry(state, rc)
ib = i + Atm_block%isc - 1
nb = Atm_block%blkno(ib,jb)
ix = Atm_block%ixp(ib,jb)
hpbl(i,j) = IPD_Data(nb)%IntDiag%hpbl(ix)
hpbl(i,j) = IPD_Data(nb)%Tbd%hpbl(ix)
area(i,j) = IPD_Data(nb)%Grid%area(ix)
stype(i,j) = IPD_Data(nb)%Sfcprop%stype(ix)
rainc(i,j) = IPD_Data(nb)%Coupling%rainc_cpl(ix)
Expand Down
Loading