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

fix initialization of dglc import/export pointers #286

Merged
merged 4 commits into from
Jun 26, 2024
Merged
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
13 changes: 9 additions & 4 deletions dglc/dglc_datamode_noevolve_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module dglc_datamode_noevolve_mod
use NUOPC , only : NUOPC_Advertise, NUOPC_IsConnected
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_sys_mod , only : shr_sys_abort
use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_RHOSW, SHR_CONST_REARTH
use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_RHOSW, SHR_CONST_REARTH, SHR_CONST_TKFRZ
use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr
use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add
use dshr_strdata_mod , only : shr_strdata_type
Expand Down Expand Up @@ -46,8 +46,8 @@ module dglc_datamode_noevolve_mod
integer, parameter :: nlev_import = 30
type(icesheet_ptr_t), allocatable :: Sl_tsrf(:)
type(icesheet_ptr_t), allocatable :: Flgl_qice(:)
! type(icesheet_ptr_t), allocatable :: So_t(:)
! type(icesheet_ptr_t), allocatable :: So_q(:)
! type(icesheet_ptr_t), allocatable :: So_t(:)
! type(icesheet_ptr_t), allocatable :: So_q(:)

! Export Field names
character(len=*), parameter :: field_out_area = 'Sg_area'
Expand Down Expand Up @@ -177,6 +177,8 @@ subroutine dglc_datamode_noevolve_init_pointers(NStateExp, NstateImp, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call dshr_state_getfldptr(NStateExp(ns), field_out_rofi, fldptr1=Fogg_rofi(ns)%ptr, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

Fogg_rofi(ns)%ptr(:) = 0._r8
end do

! initialize pointers to import fields if appropriate
Expand All @@ -193,6 +195,9 @@ subroutine dglc_datamode_noevolve_init_pointers(NStateExp, NstateImp, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call dshr_state_getfldptr(NStateImp(ns), field_in_qice, fldptr1=Flgl_qice(ns)%ptr, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

Sl_tsrf(ns)%ptr(:) = SHR_CONST_TKFRZ
Flgl_qice(ns)%ptr(:) = 0._r8
end do

end subroutine dglc_datamode_noevolve_init_pointers
Expand Down Expand Up @@ -368,7 +373,7 @@ subroutine dglc_datamode_noevolve_advance(pio_subsystem, io_type, io_format, &
! Compute Fogg_rofi
do ns = 1,num_icesheets
do ng = 1,size(Fogg_rofi(ns)%ptr)
Fogg_rofi(ns)%ptr(ng) = Flgl_qice(ns)%ptr(ng)
Fogg_rofi(ns)%ptr(ng) = Flgl_qice(ns)%ptr(ng)
end do
end do
end if
Expand Down
Loading