Skip to content

Commit 75f1e8a

Browse files
Merge branch 'whannah/atm/fix_conv_water_init' (PR #6858)
Adds fice initialization to conv_water_init Add initialization of the "fice" pbuf variable within conv_water_init to avoid debug mode failure when shr_infnan_isnan is called. Fixes #6179. [BFB] * whannah/atm/fix_conv_water_init: add fice initialization to conv_water_init
2 parents ea06baf + 1214216 commit 75f1e8a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

components/eam/src/physics/cam/conv_water.F90

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,23 @@ end subroutine conv_water_register
7272
! !
7373
!============================================================================ !
7474

75-
subroutine conv_water_init()
75+
subroutine conv_water_init(pbuf2d)
7676
! --------------------------------------------------------------------- !
7777
! Purpose: !
7878
! Initializes the pbuf indices required by conv_water
7979
! --------------------------------------------------------------------- !
8080

8181

82-
use physics_buffer, only : pbuf_get_index
82+
use physics_buffer, only : physics_buffer_desc, pbuf_get_index, pbuf_set_field
8383
use cam_history, only : addfld
8484
use phys_control, only : phys_getopts
8585

8686
use constituents, only: cnst_get_ind
8787

8888
implicit none
89+
90+
type(physics_buffer_desc), pointer :: pbuf2d(:,:)
91+
8992
logical :: use_MMF
9093

9194
call phys_getopts(use_MMF_out = use_MMF)
@@ -102,6 +105,8 @@ subroutine conv_water_init()
102105
ast_idx = pbuf_get_index('AST')
103106
rei_idx = pbuf_get_index('REI')
104107

108+
call pbuf_set_field(pbuf2d, fice_idx, 0.0_r8)
109+
105110
! Convective cloud water variables.
106111
call addfld ('ICIMRCU', (/ 'lev' /), 'A', 'kg/kg', 'Convection in-cloud ice mixing ratio ' )
107112
call addfld ('ICLMRCU', (/ 'lev' /), 'A', 'kg/kg', 'Convection in-cloud liquid mixing ratio ' )

components/eam/src/physics/cam/physpkg.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_out )
964964
if (.not. do_clubb_sgs .and. .not. do_shoc_sgs) call macrop_driver_init(pbuf2d)
965965
call microp_aero_init()
966966
call microp_driver_init(pbuf2d)
967-
call conv_water_init
967+
call conv_water_init(pbuf2d)
968968
end if
969969

970970
! initiate CLUBB within CAM

components/eam/src/physics/crm/physpkg.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_out )
660660
call nucleate_ice_cam_init(mincld, bulk_scale)
661661
call hetfrz_classnuc_cam_init(mincld)
662662

663-
call conv_water_init
663+
call conv_water_init(pbuf2d)
664664

665665
call crm_physics_init(phys_state, pbuf2d, species_class)
666666

0 commit comments

Comments
 (0)