Skip to content

Commit

Permalink
Merge pull request NCAR#19 from climbfuji/tendencies_sam_with_dom_mods
Browse files Browse the repository at this point in the history
Bug fixes to 3D diagnostic tendencies (based on NCAR#15)
  • Loading branch information
DomHeinzeller committed Apr 22, 2020
2 parents 0963476 + 13928aa commit 537df51
Show file tree
Hide file tree
Showing 13 changed files with 700 additions and 171 deletions.
38 changes: 36 additions & 2 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,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 @@ -461,7 +483,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 @@ -678,10 +700,22 @@ 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

#ifdef CCPP
! 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')
Expand Down
1 change: 1 addition & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
'FV3/ccpp/physics/physics/ozphys.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/ozphys_2015.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/precpd.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/phys_tend.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/radlw_main.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/radsw_main.f' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/rayleigh_damp.f' : [ 'slow_physics' ],
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v15_mynn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v15p2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v16beta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GSD_SAR.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
Expand Down
3 changes: 2 additions & 1 deletion ccpp/suites/suite_FV3_GSD_v0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
Expand Down Expand Up @@ -88,6 +88,7 @@
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GSD_v0_drag_suite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
Expand Down
Loading

0 comments on commit 537df51

Please sign in to comment.