Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions lis/core/LIS_DAobservationsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2047,10 +2047,12 @@ subroutine LIS_writevar_innov(ftn, n, k, varid, var)
count1=1 + (i-1)*SUM(LIS_obs_ngrids(k,0:i-2))
gtmp1 = LIS_rc%udef
do l=1,LIS_npes
count1=count1+MIN0(1,l-1)*&
(LIS_rc%nobtypes(k)-i)*LIS_obs_ngrids(k,l-2) +&
MIN0(1,l-1)*&
(i-1)*LIS_obs_ngrids(k,l-1)
if (l.gt.1) then
count1=count1+MIN0(1,l-1)*&
(LIS_rc%nobtypes(k)-i)*LIS_obs_ngrids(k,l-2) +&
MIN0(1,l-1)*&
(i-1)*LIS_obs_ngrids(k,l-1)
endif
do t =1, LIS_obs_ngrids(k,l-1)
c = LIS_obs_domain(n,k)%glb_col(l,t)
r = LIS_obs_domain(n,k)%glb_row(l,t)
Expand Down
2 changes: 1 addition & 1 deletion lis/dataassim/algorithm/enkf/enkf_Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ subroutine enkf_increments(n,k)
!----------------------------------------------------------------------------
! Assemble observation covariances.
!----------------------------------------------------------------------------
allocate(obs_param(LIS_rc%nobtypes(k)))
allocate(obs_param(Nobjs))
call generateObsparam(Nobjs, LIS_OBS_Pert_State(n,k),obs_param)

!----------------------------------------------------------------------------
Expand Down
27 changes: 23 additions & 4 deletions lis/dataassim/obs/S1_sigmaVVSM/S1_sigmaVVSM_Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ subroutine S1_sigmaVVSM_setup(k, OBS_State, OBS_Pert_State)
use LIS_DAobservationsMod
use LIS_logMod
use netcdf

use LIS_constantsMod, only : LIS_CONST_PATH_LEN

implicit none

! !ARGUMENTS:
Expand Down Expand Up @@ -93,6 +94,7 @@ subroutine S1_sigmaVVSM_setup(k, OBS_State, OBS_Pert_State)
character*100 :: S1sigmaobsdir
character*80 :: S1_firstfile
character*80 :: S1_filename
character(len=LIS_CONST_PATH_LEN) :: list_files
character*100 :: temp
real, allocatable :: obsstd(:)
character*1 :: vid(2)
Expand All @@ -107,9 +109,10 @@ subroutine S1_sigmaVVSM_setup(k, OBS_State, OBS_Pert_State)
integer :: ncid
integer :: flist
integer :: ios
integer :: rc
character*100 :: infile
character*100 :: xname, yname

integer, external :: create_filelist

allocate(S1_sigma_struc(LIS_rc%nnest))

Expand Down Expand Up @@ -270,13 +273,29 @@ subroutine S1_sigmaVVSM_setup(k, OBS_State, OBS_Pert_State)
!-------------------------------------------------------------

! Open first file to get nx ny dimensions
call system('ls ./' // trim(S1sigmaobsdir) // ' > ./S1_listfiles.txt')
if(LIS_masterproc) then
list_files = trim(S1sigmaobsdir)//'/'//'S1*.nc'
write(LIS_logunit,*) &
'[INFO] Searching for ',trim(list_files)
rc = create_filelist(trim(list_files)//char(0), &
"S1_listfiles.txt"//char(0))
if (rc .ne. 0) then
write(LIS_logunit,*) &
'[WARN] Problem encountered when searching for S1 files'
write(LIS_logunit,*) &
'Was searching for ',trim(list_files)
write(LIS_logunit,*) &
'LIS will continue...'
endif
end if

flist = LIS_getNextUnitNumber()

open(flist, file=trim('./S1_listfiles.txt'), &
status='old', iostat=status)

read(flist, '(a)', iostat=status) S1_firstfile
S1_filename = trim(S1sigmaobsdir) // '/' // trim(S1_firstfile)
S1_filename = trim(S1_firstfile)

ios = nf90_open(path=S1_filename,&
mode=NF90_NOWRITE,ncid=ncid)
Expand Down
27 changes: 23 additions & 4 deletions lis/dataassim/obs/S1_sigmaVVVHSMLAI/S1_sigmaVVVHSMLAI_Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ subroutine S1_sigmaVVVHSMLAI_setup(k, OBS_State, OBS_Pert_State)
use LIS_DAobservationsMod
use LIS_logMod
use netcdf

use LIS_constantsMod, only : LIS_CONST_PATH_LEN

implicit none

! !ARGUMENTS:
Expand Down Expand Up @@ -95,6 +96,7 @@ subroutine S1_sigmaVVVHSMLAI_setup(k, OBS_State, OBS_Pert_State)
character*100 :: S1sigmaobsdir
character*80 :: S1_firstfile
character*80 :: S1_filename
character(len=LIS_CONST_PATH_LEN) :: list_files
character*100 :: temp
real, allocatable :: obsstd(:)
character*1 :: vid(2)
Expand All @@ -109,8 +111,10 @@ subroutine S1_sigmaVVVHSMLAI_setup(k, OBS_State, OBS_Pert_State)
integer :: ncid
integer :: flist
integer :: ios
integer :: rc
character*100 :: infile
character*100 :: xname, yname
integer, external :: create_filelist

allocate(S1_sigma_struc(LIS_rc%nnest))

Expand Down Expand Up @@ -284,15 +288,30 @@ subroutine S1_sigmaVVVHSMLAI_setup(k, OBS_State, OBS_Pert_State)
!-------------------------------------------------------------
! set up the S1 domain %and interpolation weights.
!-------------------------------------------------------------

! Open first file to get nx ny dimensions
call system('ls ./' // trim(S1sigmaobsdir) // ' > ./S1_listfiles.txt')
if(LIS_masterproc) then
list_files = trim(S1sigmaobsdir)//'/'//'S1*.nc'
write(LIS_logunit,*) &
'[INFO] Searching for ',trim(list_files)
rc = create_filelist(trim(list_files)//char(0), &
"S1_listfiles.txt"//char(0))
if (rc .ne. 0) then
write(LIS_logunit,*) &
'[WARN] Problem encountered when searching for S1 files'
write(LIS_logunit,*) &
'Was searching for ',trim(list_files)
write(LIS_logunit,*) &
'LIS will continue...'
endif
end if

flist = LIS_getNextUnitNumber()

open(flist, file=trim('./S1_listfiles.txt'), &
status='old', iostat=status)

read(flist, '(a)', iostat=status) S1_firstfile
S1_filename = trim(S1sigmaobsdir) // '/' // trim(S1_firstfile)
S1_filename = trim(S1_firstfile)

ios = nf90_open(path=S1_filename,&
mode=NF90_NOWRITE,ncid=ncid)
Expand Down