Skip to content

Commit

Permalink
LST-DA: state-vector with TSKIN, plus TG and TV
Browse files Browse the repository at this point in the history
  • Loading branch information
jjokella committed Jan 23, 2025
1 parent 41e005a commit 86793e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
21 changes: 14 additions & 7 deletions bldsva/intf_DA/pdaf/model/clm5_0/enkf_clm_mod_5.F90
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ subroutine define_clm_statevec(mype)

clm_varsize = endp-begp+1
! clm_paramsize = endp-begp+1 !LAI
clm_statevecsize = (endp-begp+1) !TSKIN
clm_statevecsize = 3* (endp-begp+1) !TSKIN, then TG and TV

IF (allocated(state_pdaf2clm_p_p)) deallocate(state_pdaf2clm_p_p)
allocate(state_pdaf2clm_p_p(clm_statevecsize))
Expand All @@ -334,12 +334,15 @@ subroutine define_clm_statevec(mype)

do p=clm_begp,clm_endp
cc = cc + 1
state_pdaf2clm_p_p(cc) = p !TG
state_pdaf2clm_c_p(cc) = patch%column(p) !TG
state_pdaf2clm_p_p(cc) = p !TSKIN
state_pdaf2clm_c_p(cc) = patch%column(p) !TSKIN
state_pdaf2clm_j_p(cc) = 1
state_pdaf2clm_p_p(cc+clm_varsize) = p !TV
state_pdaf2clm_c_p(cc+clm_varsize) = patch%column(p) !TV
state_pdaf2clm_p_p(cc+clm_varsize) = p !TG
state_pdaf2clm_c_p(cc+clm_varsize) = patch%column(p) !TG
state_pdaf2clm_j_p(cc+clm_varsize) = 1
state_pdaf2clm_p_p(cc+2*clm_varsize) = p !TV
state_pdaf2clm_c_p(cc+2*clm_varsize) = patch%column(p) !TV
state_pdaf2clm_j_p(cc+2*clm_varsize) = 1
end do

endif
Expand Down Expand Up @@ -456,9 +459,11 @@ subroutine set_clm_statevec(tstartcycle, mype)

! skin temperature state vector
if(clmupdate_T.eq.2) then
do cc = 1, clm_statevecsize
do cc = 1, clm_varsize
! t_skin iterated over patches
clm_statevec(cc) = t_skin(state_pdaf2clm_p_p(cc))
clm_statevec(cc) = t_skin(state_pdaf2clm_p_p(cc))
clm_statevec(cc+clm_varsize) = t_grnd(state_pdaf2clm_c_p(cc+clm_varsize))
clm_statevec(cc+2*clm_varsize) = t_veg(state_pdaf2clm_p_p(cc+2*clm_varsize))
end do
endif

Expand Down Expand Up @@ -731,6 +736,8 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
do p = clm_begp, clm_endp
c = patch%column(p)
t_skin(p) = clm_statevec(state_clm2pdaf_p(p,1))
t_grnd(c) = clm_statevec(state_clm2pdaf_p(p,1) + clm_varsize)
t_veg(p) = clm_statevec(state_clm2pdaf_p(p,1) + 2*clm_varsize)
end do
endif

Expand Down
21 changes: 14 additions & 7 deletions bldsva/intf_DA/pdaf/model/eclm/enkf_clm_mod_5.F90
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ subroutine define_clm_statevec(mype)

clm_varsize = endp-begp+1
! clm_paramsize = endp-begp+1 !LAI
clm_statevecsize = (endp-begp+1) !TSKIN
clm_statevecsize = 3* (endp-begp+1) !TSKIN, then TG and TV

IF (allocated(state_pdaf2clm_p_p)) deallocate(state_pdaf2clm_p_p)
allocate(state_pdaf2clm_p_p(clm_statevecsize))
Expand All @@ -334,12 +334,15 @@ subroutine define_clm_statevec(mype)

do p=clm_begp,clm_endp
cc = cc + 1
state_pdaf2clm_p_p(cc) = p !TG
state_pdaf2clm_c_p(cc) = patch%column(p) !TG
state_pdaf2clm_p_p(cc) = p !TSKIN
state_pdaf2clm_c_p(cc) = patch%column(p) !TSKIN
state_pdaf2clm_j_p(cc) = 1
state_pdaf2clm_p_p(cc+clm_varsize) = p !TV
state_pdaf2clm_c_p(cc+clm_varsize) = patch%column(p) !TV
state_pdaf2clm_p_p(cc+clm_varsize) = p !TG
state_pdaf2clm_c_p(cc+clm_varsize) = patch%column(p) !TG
state_pdaf2clm_j_p(cc+clm_varsize) = 1
state_pdaf2clm_p_p(cc+2*clm_varsize) = p !TV
state_pdaf2clm_c_p(cc+2*clm_varsize) = patch%column(p) !TV
state_pdaf2clm_j_p(cc+2*clm_varsize) = 1
end do

endif
Expand Down Expand Up @@ -456,9 +459,11 @@ subroutine set_clm_statevec(tstartcycle, mype)

! skin temperature state vector
if(clmupdate_T.eq.2) then
do cc = 1, clm_statevecsize
do cc = 1, clm_varsize
! t_skin iterated over patches
clm_statevec(cc) = t_skin(state_pdaf2clm_p_p(cc))
clm_statevec(cc) = t_skin(state_pdaf2clm_p_p(cc))
clm_statevec(cc+clm_varsize) = t_grnd(state_pdaf2clm_c_p(cc+clm_varsize))
clm_statevec(cc+2*clm_varsize) = t_veg(state_pdaf2clm_p_p(cc+2*clm_varsize))
end do
endif

Expand Down Expand Up @@ -731,6 +736,8 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
do p = clm_begp, clm_endp
c = patch%column(p)
t_skin(p) = clm_statevec(state_clm2pdaf_p(p,1))
t_grnd(c) = clm_statevec(state_clm2pdaf_p(p,1) + clm_varsize)
t_veg(p) = clm_statevec(state_clm2pdaf_p(p,1) + 2*clm_varsize)
end do
endif

Expand Down

0 comments on commit 86793e4

Please sign in to comment.