Skip to content

Commit f0eceab

Browse files
authored
Merge pull request #286 from mvertens/feature/init_dglc_pointers
fix initialization of dglc import/export pointers
2 parents ab7df9f + ae3c6ff commit f0eceab

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Diff for: dglc/dglc_datamode_noevolve_mod.F90

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module dglc_datamode_noevolve_mod
77
use NUOPC , only : NUOPC_Advertise, NUOPC_IsConnected
88
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
99
use shr_sys_mod , only : shr_sys_abort
10-
use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_RHOSW, SHR_CONST_REARTH
10+
use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_RHOSW, SHR_CONST_REARTH, SHR_CONST_TKFRZ
1111
use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr
1212
use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add
1313
use dshr_strdata_mod , only : shr_strdata_type
@@ -46,8 +46,8 @@ module dglc_datamode_noevolve_mod
4646
integer, parameter :: nlev_import = 30
4747
type(icesheet_ptr_t), allocatable :: Sl_tsrf(:)
4848
type(icesheet_ptr_t), allocatable :: Flgl_qice(:)
49-
! type(icesheet_ptr_t), allocatable :: So_t(:)
50-
! type(icesheet_ptr_t), allocatable :: So_q(:)
49+
! type(icesheet_ptr_t), allocatable :: So_t(:)
50+
! type(icesheet_ptr_t), allocatable :: So_q(:)
5151

5252
! Export Field names
5353
character(len=*), parameter :: field_out_area = 'Sg_area'
@@ -177,6 +177,8 @@ subroutine dglc_datamode_noevolve_init_pointers(NStateExp, NstateImp, rc)
177177
if (chkerr(rc,__LINE__,u_FILE_u)) return
178178
call dshr_state_getfldptr(NStateExp(ns), field_out_rofi, fldptr1=Fogg_rofi(ns)%ptr, rc=rc)
179179
if (chkerr(rc,__LINE__,u_FILE_u)) return
180+
181+
Fogg_rofi(ns)%ptr(:) = 0._r8
180182
end do
181183

182184
! initialize pointers to import fields if appropriate
@@ -193,6 +195,9 @@ subroutine dglc_datamode_noevolve_init_pointers(NStateExp, NstateImp, rc)
193195
if (chkerr(rc,__LINE__,u_FILE_u)) return
194196
call dshr_state_getfldptr(NStateImp(ns), field_in_qice, fldptr1=Flgl_qice(ns)%ptr, rc=rc)
195197
if (chkerr(rc,__LINE__,u_FILE_u)) return
198+
199+
Sl_tsrf(ns)%ptr(:) = SHR_CONST_TKFRZ
200+
Flgl_qice(ns)%ptr(:) = 0._r8
196201
end do
197202

198203
end subroutine dglc_datamode_noevolve_init_pointers
@@ -368,7 +373,7 @@ subroutine dglc_datamode_noevolve_advance(pio_subsystem, io_type, io_format, &
368373
! Compute Fogg_rofi
369374
do ns = 1,num_icesheets
370375
do ng = 1,size(Fogg_rofi(ns)%ptr)
371-
Fogg_rofi(ns)%ptr(ng) = Flgl_qice(ns)%ptr(ng)
376+
Fogg_rofi(ns)%ptr(ng) = Flgl_qice(ns)%ptr(ng)
372377
end do
373378
end do
374379
end if

0 commit comments

Comments
 (0)