Skip to content

Revised SM DA codes for Noah39 and NoahMP401 #1694

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

Draft
wants to merge 11 commits into
base: support/lisf-557ww-7.6
Choose a base branch
from
Draft
5 changes: 5 additions & 0 deletions lis/configs/557WW-7.6-FOC/NRT/attribs/noah_sm_attribs_sm1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#nfields
1
#name varmin varmax
Soil Moisture Layer 1
0.00 0.55
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#perttype std std_max zeromean tcorr xcorr ycorr ccorr
Soil Moisture Layer 1
0 0.04 0.1 1 10800 0 0 1.0 0.0 0.0 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#nfields
1
#name varmin varmax
Soil Moisture Layer 1
0.00 0.55
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#perttype std std_max zeromean tcorr xcorr ycorr ccorr
Soil Moisture Layer 1
0 0.04 0.1 1 10800 0 0 1.0 0.0 0.0 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#nfields
1
#name varmin varmax
Soil Moisture Layer 1
0.00 0.55
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#perttype std std_max zeromean tcorr xcorr ycorr ccorr
Soil Moisture Layer 1
0 0.04 0.1 1 10800 0 0 1.0 0.0 0.0 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#nfields
1
#name varmin varmax
Soil Moisture Layer 1
0.00 0.55
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#perttype std std_max zeromean tcorr xcorr ycorr ccorr
Soil Moisture Layer 1
0 0.04 0.1 1 10800 0 0 1.0 0.0 0.0 0.0
59 changes: 18 additions & 41 deletions lis/surfacemodels/land/noah.3.9/da_soilm/noah39_getsoilm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,51 @@
! All Rights Reserved.
!-------------------------END NOTICE -- DO NOT EDIT-----------------------
!BOP
! !ROUTINE: noah39_getsoilm
! \label{noah39_getsoilm}
! !ROUTINE: Noah39_getsoilm
! \label{Noah39_getsoilm}
!
! !REVISION HISTORY:
! 21Oct2018: Mahdi Navari; Sujay Kumar ; Initial Specification
!
! 20 Mar 2025: Eric Kemp; Changed to use top soil layer only. Based on
! Noah39 code from Sujay Kumar and Wanshu Nie used for, e.g.,
! HydroGlobe.
! !INTERFACE:
subroutine noah39_getsoilm(n, LSM_State)
subroutine Noah39_getsoilm(n, LSM_State)

! !USES:
use ESMF
use LIS_coreMod, only : LIS_rc
use LIS_logMod, only : LIS_verify
use noah39_lsmMod
use LIS_coreMod, only: LIS_rc
use LIS_logMod, only: LIS_verify
use Noah39_lsmMod, only: noah39_struc

implicit none
! !ARGUMENTS:

! !ARGUMENTS:
integer, intent(in) :: n
type(ESMF_State) :: LSM_State
type(ESMF_State), intent(in) :: LSM_State
!
! !DESCRIPTION:
!
! Returns the soilmoisture related state prognostic variables for
! data assimilation
!
! The arguments are:
!
! The arguments are:
! \begin{description}
! \item[n] index of the nest \newline
! \item[LSM\_State] ESMF State container for LSM state variables \newline
! \end{description}
!EOP
type(ESMF_Field) :: sm1Field
type(ESMF_Field) :: sm2Field
type(ESMF_Field) :: sm3Field
type(ESMF_Field) :: sm4Field
integer :: t
integer :: status
real, pointer :: soilm1(:)
real, pointer :: soilm2(:)
real, pointer :: soilm3(:)
real, pointer :: soilm4(:)
character*100 :: lsm_state_objs(4)
integer :: t

call ESMF_StateGet(LSM_State,"Soil Moisture Layer 1",sm1Field,rc=status)
call LIS_verify(status,'ESMF_StateGet failed for sm1 in noah39_getsoilm')
call ESMF_StateGet(LSM_State,"Soil Moisture Layer 2",sm2Field,rc=status)
call LIS_verify(status,'ESMF_StateGet failed for sm2 in noah39_getsoilm')
call ESMF_StateGet(LSM_State,"Soil Moisture Layer 3",sm3Field,rc=status)
call LIS_verify(status,'ESMF_StateGet failed for sm3 in noah39_getsoilm')
call ESMF_StateGet(LSM_State,"Soil Moisture Layer 4",sm4Field,rc=status)
call LIS_verify(status,'ESMF_StateGet failed for sm4 in noah39_getsoilm')

call LIS_verify(status,'ESMF_StateGet failed for sm1 in Noah39_getsoilm')
call ESMF_FieldGet(sm1Field,localDE=0,farrayPtr=soilm1,rc=status)
call LIS_verify(status,'ESMF_FieldGet failed for sm1 in noah39_getsoilm')
call ESMF_FieldGet(sm2Field,localDE=0,farrayPtr=soilm2,rc=status)
call LIS_verify(status,'ESMF_FieldGet failed for sm2 in noah39_getsoilm')
call ESMF_FieldGet(sm3Field,localDE=0,farrayPtr=soilm3,rc=status)
call LIS_verify(status,'ESMF_FieldGet failed for sm3 in noah39_getsoilm')
call ESMF_FieldGet(sm4Field,localDE=0,farrayPtr=soilm4,rc=status)
call LIS_verify(status,'ESMF_FieldGet failed for sm4 in noah39_getsoilm')


call LIS_verify(status,'ESMF_FieldGet failed for sm1 in Noah39_getsoilm')
do t=1,LIS_rc%npatch(n,LIS_rc%lsm_index)
soilm1(t) = noah39_struc(n)%noah(t)%smc(1)
soilm2(t) = noah39_struc(n)%noah(t)%smc(2)
soilm3(t) = noah39_struc(n)%noah(t)%smc(3)
soilm4(t) = noah39_struc(n)%noah(t)%smc(4)
enddo

end subroutine noah39_getsoilm

end subroutine Noah39_getsoilm
Loading