Skip to content

Commit

Permalink
almost done (with ARGO floats)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdicerbo committed Jul 20, 2016
1 parent c500f5c commit a320bf2
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 45 deletions.
4 changes: 2 additions & 2 deletions def_nml.f90
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ subroutine def_nml

grd%nchl = nchl
chl%dep = chl_dep
drv%argo = 1
drv%argo = 0 !1

write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ''


write(drv%dia,*) '------------------------------------------------------------'
write(drv%dia,*) ''
Expand Down
31 changes: 8 additions & 23 deletions get_obs_arg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,17 @@ subroutine get_obs_arg
arg%nc = 0


open(511,file='arg_mis.dat',form='formatted') !,form='unformatted',status='old',err=1111)
open(511,file='arg_mis.dat',form='formatted')

! ---
! Allocate memory for observations

! Allocate memory for observations
read(511,'(I5)') arg%no

write(drv%dia,*)'Number of ARGO observations: ',arg%no

if(arg%no.eq.0)then
close(511)
return
endif
write(*,*)''
write(*,*)'ARGO DATA FILE OPEN!!!!!!!!!!',arg%no
write(*,*)''
ALLOCATE ( arg%ino(arg%no), arg%flg(arg%no), arg%flc(arg%no), arg%par(arg%no))
ALLOCATE ( arg%lon(arg%no), arg%lat(arg%no), arg%dpt(arg%no), arg%tim(arg%no))
ALLOCATE ( arg%val(arg%no), arg%bac(arg%no), arg%inc(arg%no))
Expand All @@ -77,20 +72,16 @@ subroutine get_obs_arg
arg%lon(k), arg%lat(k), &
arg%dpt(k), arg%tim(k), &
arg%res(k), arg%err(k), arg%ino(k)
! arg%flc(1:arg%no), arg%par(1:arg%no), &
! arg%lon(1:arg%no), arg%lat(1:arg%no), &
! arg%dpt(1:arg%no), arg%tim(1:arg%no), &
! arg%val(1:arg%no), arg%err(1:arg%no), arg%ino(1:arg%no)
end do
close (511)

! DECOMMENT FOLLOWING TWO LINES TO MAKE FILTER TEST
! arg%res(:) = 1
! arg%err(:) = 1.d-5
! arg%err(:) = 1.d-2


! ---
! Initialise quality flag
! if(obs%arg.eq.0) arg%flg(:) = -1
arg%flg(:) = 1

! ---
Expand All @@ -109,12 +100,10 @@ subroutine get_obs_arg


! residual check
do k=1,arg%no
! if(arg%par(k).eq.1 .and. abs(arg%res(k)).gt.5.0) arg%flg(k) = 0
if(arg%par(k).eq.2 .and. abs(arg%res(k)).gt.2.0) arg%flg(k) = 0
enddo


! do k=1,arg%no
! if(arg%par(k).eq.1 .and. abs(arg%res(k)).gt.5.0) arg%flg(k) = 0
! enddo

! ---
! Count good observations
arg%nc = 0
Expand All @@ -139,10 +128,6 @@ subroutine get_obs_arg

arg%flc(:) = arg%flg(:)


1111 continue


end subroutine get_obs_arg


Expand Down
4 changes: 4 additions & 0 deletions get_obs_chl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ subroutine get_obs_chl
chl%err(k) = chl_err(i,j)
enddo

! DECOMMENT FOLLOWING TWO LINES TO MAKE FILTER TEST
! chl%res(:) = 0.
! chl%err(:) = 1.

DEALLOCATE( chl_mis )
DEALLOCATE( chl_err )

Expand Down
2 changes: 1 addition & 1 deletion obs_arg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subroutine obs_arg

do kk = 1,arg%no

if(arg%flc(kk).eq.1 .and. arg%par(kk).eq.1 )then
if(arg%flc(kk).eq.1)then

i=arg%ib(kk)
j=arg%jb(kk)
Expand Down
2 changes: 1 addition & 1 deletion obs_arg_ad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subroutine obs_arg_ad

do kk = 1,arg%no

if(arg%flc(kk).eq.1 .and. arg%par(kk).eq.1 )then
if(arg%flc(kk).eq.1)then

obs%k = obs%k + 1

Expand Down
22 changes: 12 additions & 10 deletions obs_vec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ subroutine obs_vec
! -------
! Define observational vector

obs%no = chl%nc
obs%no = chl%nc + arg%no

write(drv%dia,*) ' Total number of observations: ', obs%no

Expand All @@ -53,16 +53,18 @@ subroutine obs_vec


k=0

! ARGO observations
do i=1,arg%no
if(arg%flc(i).eq.1)then
k=k+1
obs%res(k) = arg%res(i)
obs%err(k) = arg%err(i)
endif
enddo

if (drv%argo .eq. 1) then
! ARGO observations
do i=1,arg%no
if(arg%flc(i).eq.1)then
k=k+1
obs%res(k) = arg%res(i)
obs%err(k) = arg%err(i)
endif
enddo
endif

! Observations of chlorophyll
do i=1,chl%no
if(chl%flc(i).eq.1)then
Expand Down
6 changes: 5 additions & 1 deletion rdeofs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ subroutine rdeofs
stat = nf90_get_var (ncid,idvar,ros%evc, &
start = (/1,1,1/), count = (/ros%nreg, ros%kmt, ros%neof/))
if (stat /= nf90_noerr) call netcdf_err(stat)


! DECOMMENT FOLLOWING TWO LINES TO MAKE FILTER TEST
! ros%evc(:,:,:) = 1.
! ros%eva(:,:) = 1.

stat = nf90_close(ncid)

end subroutine rdeofs
Expand Down
17 changes: 10 additions & 7 deletions resid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ subroutine resid

use set_knd
use obs_str
use drv_str

implicit none

Expand All @@ -40,13 +41,15 @@ subroutine resid

! ---
! ARGO observations
do i=1,arg%no
if(arg%flc(i).eq.1)then
k = k + 1
obs%inc(k) = arg%inc(i)
obs%amo(k) = ( obs%inc(k) - obs%res(k) ) / obs%err(k)
endif
enddo
if (drv%argo .eq. 1) then
do i=1,arg%no
if(arg%flc(i).eq.1)then
k = k + 1
obs%inc(k) = arg%inc(i)
obs%amo(k) = ( obs%inc(k) - obs%res(k) ) / obs%err(k)
endif
enddo
endif

! ---
! Observations of chlorophyll
Expand Down

0 comments on commit a320bf2

Please sign in to comment.