Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- remove redundant offending line associated with ncdiag (radiance) output
- latest FSI-based tuning (using x50)

### Fixed

Expand Down
89 changes: 65 additions & 24 deletions GEOSaana_GridComp/GSI_GridComp/etc/gmao_global_fsi_weights.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,67 @@
fsi_weights::
# criterium var instr lata latb lev/chn (low/hi) weight
c001 t 133 30.0 70.0 500.0 0.0 1.1
c002 t 120 -90.0 90.0 900.0 150.0 0.9
c002 t 120 -90.0 90.0 151.0 0.0 1.0
c003 wnd 220 -90.0 90.0 900.0 10.0 0.9
c005 q 120 -90.0 90.0 900.0 10.0 0.9
c006 spd 220 -90.0 90.0 900.0 10.0 0.9
c007 gps 9999 -90.0 90.0 900.0 10.0 1.1
c008 rad 9999 -90.0 90.0 2000.0 0.0 1.1
c009 wnd 242 -90.0 90.0 900.0 10.0 0.9
c011 wnd 243 -90.0 90.0 900.0 10.0 0.9
c012 wnd 244 -90.0 90.0 900.0 10.0 0.9
c013 wnd 245 -90.0 90.0 900.0 10.0 0.9
c014 wnd 246 -90.0 90.0 900.0 10.0 0.9
c015 wnd 247 -90.0 90.0 900.0 10.0 0.9
c016 wnd 250 -90.0 90.0 900.0 10.0 0.9
c017 wnd 251 -90.0 90.0 900.0 10.0 0.9
c018 wnd 252 -90.0 90.0 900.0 10.0 0.9
c019 wnd 253 -90.0 90.0 900.0 10.0 0.9
c020 wnd 254 -90.0 90.0 900.0 10.0 0.9
c021 wnd 257 -90.0 90.0 900.0 10.0 0.9
c022 wnd 258 -90.0 90.0 900.0 10.0 0.9
c023 wnd 259 -90.0 90.0 900.0 10.0 0.9
c999 all 9999 -40.0 20.0 2000.0 0.0 1.1
# criterium dplat sis var instr lata latb lev/chn (low/hi) weight
c001 dplat sis t 120 30.0 70.0 850.0 200.0 0.9
c002 dplat sis t 131 -40.0 -30.0 250.0 150.0 0.9
c003 dplat sis t 131 30.0 60.0 250.0 150.0 0.9
c004 dplat sis t 133 30.0 70.0 800.0 450.0 0.9
c005 dplat sis t 133 30.0 70.0 300.0 100.0 0.9
c006 dplat sis q 120 -30.0 80.0 900.0 10.0 1.2
c007 dplat sis wnd 231 -50.0 -20.0 400.0 100.0 0.8
c008 dplat sis wnd 231 20.0 60.0 400.0 100.0 0.8
c009 dplat sis wnd 233 20.0 60.0 1000.0 100.0 0.8
c010 dplat sis wnd 220 -60.0 60.0 1000.0 50.0 0.8
c011 dplat sis wnd 242 -10.0 60.0 1000.0 800.0 1.2
c012 dplat sis wnd 242 -10.0 60.0 350.0 150.0 1.2
c013 dplat sis wnd 244 -90.0 -60.0 1000.0 150.0 0.7
c014 dplat sis wnd 244 60.0 90.0 1000.0 150.0 0.7
c015 dplat sis wnd 245 -60.0 0.0 800.0 500.0 0.7
c016 dplat sis wnd 247 -60.0 0.0 600.0 250.0 0.7
c017 dplat sis wnd 247 20.0 60.0 600.0 250.0 0.7
c018 dplat sis wnd 250 -10.0 55.0 350.0 100.0 1.2
c019 dplat sis wnd 252 -10.0 55.0 1000.0 850.0 1.2
c020 dplat sis wnd 252 -10.0 55.0 350.0 100.0 1.2
c021 dplat sis wnd 253 -90.0 20.0 800.0 10.0 0.7
c022 dplat sis wnd 254 -60.0 20.0 600.0 250.0 0.7
c023 dplat sis gps 3 -65.0 -45.0 900.0 0.0 0.8
c024 dplat sis gps 3 40.0 80.0 900.0 0.0 0.8
c025 dplat sis gps 5 -60.0 -40.0 900.0 0.0 0.8
c026 dplat sis gps 5 40.0 80.0 900.0 0.0 0.8
c027 dplat sis gps 269 -80.0 70.0 400.0 0.0 1.2
c028 dplat sis gps 751 -30.0 -10.0 100.0 0.0 1.2
c029 dplat sis gps 751 10.0 50.0 800.0 450.0 0.8
c030 dplat sis gps 752 -30.0 -10.0 100.0 0.0 1.2
c031 dplat sis gps 752 10.0 50.0 600.0 450.0 0.8
c032 dplat sis gps 753 -30.0 -10.0 100.0 0.0 1.2
c033 dplat sis gps 753 10.0 50.0 800.0 450.0 0.8
c034 dplat sis gps 754 -30.0 -10.0 100.0 0.0 1.2
c035 dplat sis gps 754 10.0 50.0 800.0 450.0 0.8
c036 dplat sis gps 755 -30.0 -10.0 100.0 0.0 1.2
c037 dplat sis gps 755 10.0 50.0 800.0 450.0 0.8
c038 dplat sis gps 825 -70.0 -40.0 800.0 0.0 0.8
c039 aqua airs rad 49 -90.0 66.5 0.0 5000.0 0.8
c040 gcom-w1 amsr2 rad 550 -90.0 90.0 0.0 5000.0 1.2
c041 metop-b amsua rad 326 -66.5 -23.5 0.0 5000.0 0.8
c042 metop-b amsua rad 326 66.5 90.0 0.0 5000.0 1.2
c043 metop-c amsua rad 327 -66.5 -23.5 0.0 5000.0 0.8
c044 n15 amsua rad 315 -90.0 -66.5 0.0 5000.0 1.2
c045 n15 amsua rad 315 -23.5 90.0 0.0 5000.0 1.2
c046 n18 amsua rad 318 -66.5 -23.5 0.0 5000.0 0.8
c047 n19 amsua rad 319 66.5 90.0 0.0 5000.0 1.2
c048 n20 atms rad 920 -90.0 90.0 0.0 5000.0 1.2
c049 npp atms rad 900 -90.0 -66.5 0.0 5000.0 1.2
c050 npp atms rad 900 -23.5 66.5 0.0 5000.0 1.2
c051 metop-b avhrr rad 626 -66.5 -23.5 0.0 5000.0 1.2
c052 metop-b avhrr rad 626 23.5 66.5 0.0 5000.0 0.8
c053 metop-b avhrr rad 626 66.5 90.0 0.0 5000.0 1.2
c054 n18 avhrr rad 618 23.5 66.5 0.0 5000.0 0.8
c055 n19 avhrr rad 619 -66.5 -23.5 0.0 5000.0 1.2
c056 n19 avhrr rad 619 23.5 66.5 0.0 5000.0 0.8
c057 n19 avhrr rad 619 66.5 90.0 0.0 5000.0 1.2
c058 n20 cris-fsr rad 960 -66.5 -23.5 0.0 5000.0 0.8
c059 n20 cris-fsr rad 960 23.5 66.5 0.0 5000.0 0.8
c060 gpm gmi rad 706 -23.5 23.5 0.0 5000.0 1.2
c061 metop-b iasi rad 876 -90.0 66.5 0.0 5000.0 0.8
c062 metop-c iasi rad 877 -90.0 66.5 0.0 5000.0 0.8
c063 metop-b mhs rad 826 -23.5 23.5 0.0 5000.0 1.2
c064 metop-c mhs rad 827 -23.5 23.5 0.0 5000.0 1.2
::
71 changes: 41 additions & 30 deletions GEOSaana_GridComp/GSI_GridComp/m_fsi_weight.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ module m_fsi_weight
character(len=*),parameter :: myname = 'm_fsi_weight'
logical :: fsi_weight
logical :: iamroot_
logical :: verbose = .false. ! careful: when used blindly this produce huge output

type fsi_type
integer :: ncri ! number of criteria
character(len= 4),allocatable :: criterium(:)
character(len=20),allocatable :: variable(:)
character(len=20),allocatable :: dplat(:)
character(len=20),allocatable :: obtype(:)
integer, allocatable :: instrument(:)
real(r_kind),allocatable :: lata(:), latb(:)
real(r_kind),allocatable :: levl(:), levh(:)
Expand Down Expand Up @@ -75,7 +78,7 @@ subroutine init_ (iamroot)
integer :: luin,ii,ntot,nrows,instrument
character(len=MAXSTR),allocatable,dimension(:):: utable
character(len=4) criterium
character(len=20) var
character(len=20) var,dplat,obtype
real(r_kind) lata,latb
real(r_kind) levl,levh
real(r_kind) sfactor
Expand Down Expand Up @@ -115,8 +118,10 @@ subroutine init_ (iamroot)
! Count variables first
if(iamroot_) write(6,*) myname_,': FSI scaling factors'
do ii=1,fsi%ncri
read(utable(ii),*) criterium, var, instrument, lata, latb, levl, levh, sfactor
read(utable(ii),*) criterium, dplat, obtype, var, instrument, lata, latb, levl, levh, sfactor
fsi%criterium(ii) = trim(criterium)
fsi%dplat(ii) = trim(dplat)
fsi%obtype(ii) = trim(obtype)
fsi%variable(ii) = trim(var)
fsi%instrument(ii) = instrument
fsi%lata(ii) = lata
Expand All @@ -125,7 +130,8 @@ subroutine init_ (iamroot)
fsi%levh(ii) = levh
fsi%sfactor(ii) = sfactor
if(iamroot_) then
write(6,'(1x,2(a10,1x),i4,1x,4f15.3,1x,f7.2)') trim(criterium), trim(var), instrument, lata, latb, levl, levh, sfactor
write(6,'(1x,4(a10,1x),i4,1x,4f15.3,1x,f7.2)') trim(criterium), trim(dplat), trim(obtype), &
trim(var), instrument, lata, latb, levl, levh, sfactor
endif
enddo

Expand All @@ -143,6 +149,8 @@ subroutine fsi_type_init_(this)
integer n
n=this%ncri
allocate(this%criterium(n))
allocate(this%dplat(n))
allocate(this%obtype(n))
allocate(this%variable(n))
allocate(this%instrument(n))
allocate(this%lata(n))
Expand All @@ -161,6 +169,8 @@ subroutine fsi_type_clean_(this)
deallocate(this%lata)
deallocate(this%instrument)
deallocate(this%variable)
deallocate(this%obtype)
deallocate(this%dplat)
deallocate(this%criterium)
end subroutine fsi_type_clean_

Expand Down Expand Up @@ -194,7 +204,7 @@ subroutine apply_lev_weight_(sfactor,var,kx,lat,lon,lev)
criterium = fsi%criterium(ii)
sfactor = fsi%sfactor(ii)
done = .true.
! print *, 'DEBUG_RT: ', trim(var), kx, sfactor
!if(verbose) print *, 'fsi*conv:', trim(var), kx, sfactor
exit
endif
endif
Expand All @@ -216,11 +226,11 @@ subroutine apply_lev_weight_(sfactor,var,kx,lat,lon,lev)

end subroutine apply_lev_weight_

subroutine apply_chn_weight_(sfactor,dplat,obstype,ich,lat,lon)
subroutine apply_chn_weight_(sfactor,dplat,obtype,ich,lat,lon)
implicit none
real(r_kind), intent(inout) :: sfactor
character(len=*), intent(in) :: dplat ! metop-c - not yet implemented
character(len=*), intent(in) :: obstype ! iasi - not yet implemented
character(len=*), intent(in) :: dplat ! e.g., metop-c
character(len=*), intent(in) :: obtype ! e.g., iasi
real(r_kind), intent(in) :: lat,lon
integer(i_kind), intent(in) :: ich
!
Expand All @@ -235,33 +245,34 @@ subroutine apply_chn_weight_(sfactor,dplat,obstype,ich,lat,lon)
iirad=-1
done=.false.
do ii=1,fsi%ncri
if(trim(fsi%variable(ii))=='rad') then
if(trim(fsi%variable(ii))/='rad') then
iirad=ii
cycle ! see special handle below
cycle
endif
if (trim(fsi%dplat(ii)) == trim(dplat) .and. &
trim(fsi%obtype(ii)) == trim(obtype) ) then
if( lat>fsi%lata(ii) .and. lat<fsi%latb(ii) .and. &
ich>nint(fsi%levl(ii)) .and. ich<nint(fsi%levh(ii)) ) then
criterium = fsi%criterium(ii)
sfactor = fsi%sfactor(ii)
if(verbose) print *, 'fsi*rad:', trim(criterium), sfactor
done = .true.
exit
endif
endif
! if(trim(fsi%variable(ii)) == trim(var)) then
! if(fsi%instrument(ii) == kx) then
! if( lat>fsi%lata(ii) .and. lat<fsi%latb(ii) .and. &
! lev<fsi%levl(ii) .and. lev>fsi%levh(ii) ) then
! criterium = fsi%criterium(ii)
! sfactor = fsi%sfactor(ii)
! done = .true.
! exit
! endif
! endif
! endif
enddo
! special handle case of all others
if (.not. done) then
if(iirad>0) then
ii=iirad
if( lat>fsi%lata(ii) .and. lat<fsi%latb(ii) ) then
criterium = fsi%criterium(ii)
sfactor = fsi%sfactor(ii)
done = .true.
endif
endif
endif
!if (.not. done) then
! if(iirad>0) then
! ii=iirad
! if( lat>fsi%lata(ii) .and. lat<fsi%latb(ii) ) then
! criterium = fsi%criterium(ii)
! sfactor = fsi%sfactor(ii)
! if(verbose) print *, 'fsi*rad:', trim(dplat), sfactor
! done = .true.
! endif
! endif
!endif

end subroutine apply_chn_weight_

Expand Down
8 changes: 7 additions & 1 deletion GEOSaana_GridComp/GSI_GridComp/setupq.f90
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,13 @@ subroutine setupq(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsav

error=one/(data(ier2,i)*qsges)

my_head%res = ddiff
if (fsi_weight) then
! Adjustment to omb residual following FSI
call fsi_apply_weight(sfactor,'q',itype,data(ilate,i),data(ilone,i),presq)
my_head%res = sfactor*ddiff
else
my_head%res = ddiff
endif
my_head%err2 = error**2
my_head%raterr2 = ratio_errors**2
my_head%time = dtime
Expand Down
8 changes: 7 additions & 1 deletion GEOSaana_GridComp/GSI_GridComp/setupt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,13 @@ subroutine setupt(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsav
my_head%elat= data(ilate,i)
my_head%elon= data(ilone,i)

my_head%res = ddiff
if (fsi_weight) then
! Adjustment to omb residual following FSI
call fsi_apply_weight(sfactor,'t',itype,data(ilate,i),data(ilone,i),prest)
my_head%res = sfactor*ddiff
else
my_head%res = ddiff
endif
my_head%err2 = error**2
my_head%raterr2 = ratio_errors**2
my_head%time = dtime
Expand Down
Loading