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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Changed
24Jul2026:
- now able to write out ncdiags for specific jiter iteration
21Jul2026:
- revise settings of jedi-gsi (closer to actual GSI)

Expand Down
23 changes: 20 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/analyzer
Original file line number Diff line number Diff line change
Expand Up @@ -1982,14 +1982,31 @@ sub lndiag {
$lsubdirs = "-subdirs";
}

$this = `nmlread.py $rcname SETUP netcdf_diag`; chomp($result);
$var = "$this"; chomp($var);
# Remove the brackets
$var =~ s/^\[//;
$var =~ s/\]$//;
my @values = split /\s*,\s*/, $var;
my $ncdjiter = 0;
for my $value (@values) {
if ($value eq 'True') {
$ncdjiter++;
}
}

$npe_factor = 4;
$myncpus = floor($npes/$npe_factor);
$myncpus = $myncpus - $myncpus % 2;
if ( $doasens ) {
my $nametag = "ans_${gnorm}${jiteradm}";
$cmd = "gsidiags -ncpus $myncpus -jiter $jiteradm -tag $nametag $nymd $nhms $expid $opt";
my $nametag = "-tag ans_${gnorm}${jiteradm}";
$cmd = "gsidiags -ncpus $myncpus -jiter $jiteradm $nametag $nymd $nhms $expid $opt";
} else {
$cmd = "gsidiags $lsubdirs -ncpus $myncpus $nymd $nhms $expid $opt";
my $nametag = "";
if ($ncdjiter == 1) {
$nametag = "-tag ges";
}
$cmd = "gsidiags -ncpus $myncpus $lsubdirs -jiter $ncdjiter $nametag $nymd $nhms $expid $opt";
}
print " $cmd\n";
$rc = System($cmd, "$log_ana","gsidiag");
Expand Down
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/GEOSIT/gsi.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
! l4densvar=.true.,nmn_obsbin=360,iwrtinc=1,thin4d=.true.,
iorthomax=10,
ens_nstarthr=3,
netcdf_diag=.false.,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
newpc4pred=.true.,adp_anglebc=.true.,angord=4,
passive_bc=.true.,use_edges=.false.,
diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
lobsdiagsave=.true.,
ens_nstarthr=3,
tau_fcst=-1,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
newpc4pred=.true.,adp_anglebc=.true.,angord=4,
passive_bc=.true.,use_edges=.false.,
diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
3 changes: 2 additions & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/R21C/gsi.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
@4DHYB l4densvar=.true.,nmn_obsbin=@VAROBSBIN,iwrtinc=@IWRTINC,thin4d=.true.,
iorthomax=10,
ens_nstarthr=3,
netcdf_diag=.false.,wrtgeovals=.false.,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
wrtgeovals=.false.,
@RADBC newpc4pred=.true.,adp_anglebc=.true.,angord=4,
@RADBC passive_bc=.true.,use_edges=.false.,
@RADBC diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
1 change: 1 addition & 0 deletions GEOSaana_GridComp/GSI_GridComp/etc/R21C/gsi_sens.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
lobsdiagsave=.true.,
ens_nstarthr=3,
tau_fcst=-1,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
@RADBC newpc4pred=.true.,adp_anglebc=.true.,angord=4,
@RADBC passive_bc=.true.,use_edges=.false.,
@RADBC diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
3 changes: 2 additions & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/gsi.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
@4DHYB l4densvar=.true.,nmn_obsbin=@VAROBSBIN,iwrtinc=@IWRTINC,thin4d=.true.,
iorthomax=10,
ens_nstarthr=3,
netcdf_diag=.false.,wrtgeovals=.false.,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
wrtgeovals=.false.,
@RADBC newpc4pred=.true.,adp_anglebc=.true.,angord=4,
@RADBC passive_bc=.true.,use_edges=.false.,
@RADBC diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
1 change: 1 addition & 0 deletions GEOSaana_GridComp/GSI_GridComp/etc/gsi_sens.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
lobsdiagsave=.true.,
ens_nstarthr=3,
tau_fcst=-1,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
@RADBC newpc4pred=.true.,adp_anglebc=.true.,angord=4,
@RADBC passive_bc=.true.,use_edges=.false.,
@RADBC diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
3 changes: 2 additions & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/jedi_gsi.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
iorthomax=100,
ltcost=.true.,
ens_nstarthr=3,
netcdf_diag=.true.,wrtgeovals=.false.,
netcdf_diag(1)=.true.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
wrtgeovals=.false.,
@RADBC newpc4pred=.true.,adp_anglebc=.true.,angord=4,
@RADBC passive_bc=.true.,use_edges=.false.,
@RADBC diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
1 change: 1 addition & 0 deletions GEOSaana_GridComp/GSI_GridComp/etc/jedi_gsi_sens.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
lobsdiagsave=.true.,
ens_nstarthr=3,
tau_fcst=-1,
netcdf_diag(1)=.false.,netcdf_diag(2)=.false.,netcdf_diag(3)=.false.,
@RADBC newpc4pred=.true.,adp_anglebc=.true.,angord=4,
@RADBC passive_bc=.true.,use_edges=.false.,
@RADBC diag_precon=.true.,step_start=1.e-3,emiss_bc=.true.,
Expand Down
6 changes: 3 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/genstats_gps.f90
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ subroutine genstats_gps(bwork,awork,toss_gps_sub,conv_diagsave,mype)
mpi_comm_world,ierror)

! If netcdf diag, initialize it
if (conv_diagsave.and.netcdf_diag) call init_netcdf_diag_
if (conv_diagsave.and.netcdf_diag(jiter)) call init_netcdf_diag_

! Get height of maximum bending angle
dobs_height_sub = zero
Expand Down Expand Up @@ -697,7 +697,7 @@ subroutine genstats_gps(bwork,awork,toss_gps_sub,conv_diagsave,mype)
endif


if (conv_diagsave .and. netcdf_diag .and. luse) call contents_netcdf_diag_
if (conv_diagsave .and. netcdf_diag(jiter) .and. luse) call contents_netcdf_diag_

gps_allptr => gps_allptr%llpoint

Expand All @@ -709,7 +709,7 @@ subroutine genstats_gps(bwork,awork,toss_gps_sub,conv_diagsave,mype)

! If requested, write information to diagnostic file
if(conv_diagsave) then
if (netcdf_diag) call nc_diag_write
if (netcdf_diag(jiter)) call nc_diag_write
if (binary_diag .and. icnt > 0)then
nchar = 1
write(7)'gps',nchar,nreal,icnt,mype,ioff
Expand Down
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/obsmod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ module obsmod
#endif

logical luse_obsdiag
logical binary_diag, netcdf_diag
logical binary_diag, netcdf_diag(1:50)

! Declare types

Expand Down
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/radinfo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ subroutine init_predx
fdiag_rad = 'diag_' // trim(dtype(iii)) // '_' // trim(dplat(iii))

! Set diagnostic file type
call set_netcdf_read(netcdf_diag)
call set_netcdf_read(any(netcdf_diag))

! See if diagnostic file exists
inquire(file=fdiag_rad,exist=lexist)
Expand Down
6 changes: 3 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/setupaod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ subroutine setupaod(obsLL,odiagLL,lunin,mype,nchanl,nreal,nobs,&
varnames(6:) = aerosol_names

if (binary_diag) call init_binary_diag_
if (netcdf_diag) call init_netcdf_diag_
if (netcdf_diag(jiter)) call init_netcdf_diag_
end if


Expand Down Expand Up @@ -616,7 +616,7 @@ subroutine setupaod(obsLL,odiagLL,lunin,mype,nchanl,nreal,nobs,&
write(4) psfc,diagbuf,diagbufchan

if (binary_diag) call contents_binary_diag_
if (netcdf_diag) call contents_netcdf_diag_
if (netcdf_diag(jiter)) call contents_netcdf_diag_
end if
endif ! (in_curbin)

Expand All @@ -632,7 +632,7 @@ subroutine setupaod(obsLL,odiagLL,lunin,mype,nchanl,nreal,nobs,&
if (aero_diagsave) then
close(4)
if (binary_diag) call final_binary_diag_
if (netcdf_diag) call nc_diag_write
if (netcdf_diag(jiter)) call nc_diag_write
endif

call destroy_crtm
Expand Down
6 changes: 3 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/setupcldch.f90
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ subroutine setupcldch(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_dia
if (lobsdiagsave) nreal=nreal+4*miter+1
allocate(cdiagbuf(nobs),rdiagbuf(nreal,nobs))
allocate(cprvstg(nobs),csprvstg(nobs))
if(netcdf_diag) call init_netcdf_diag_
if(netcdf_diag(jiter)) call init_netcdf_diag_
end if

mm1=mype+1
Expand Down Expand Up @@ -480,7 +480,7 @@ subroutine setupcldch(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_dia
if (err_final>tiny_r_kind) errinv_final = one/err_final

if (binary_diag) call contents_binary_diag_(my_diag)
if (netcdf_diag) call contents_netcdf_diag_(my_diag)
if (netcdf_diag(jiter)) call contents_netcdf_diag_(my_diag)

end if

Expand All @@ -492,7 +492,7 @@ subroutine setupcldch(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_dia

! Write information to diagnostic file
if(conv_diagsave) then
if(netcdf_diag) call nc_diag_write
if(netcdf_diag(jiter)) call nc_diag_write
if(binary_diag .and. ii>0)then
write(7)'cei',nchar,nreal,ii,mype,ioff0
write(7)cdiagbuf(1:ii),rdiagbuf(:,1:ii)
Expand Down
8 changes: 4 additions & 4 deletions GEOSaana_GridComp/GSI_GridComp/setupcldtot.F90
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ subroutine setupcldtot(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_di
allocate(all_qv_obs(nrealcld,nobs*nsig))
all_qv_obs=miss_obs_real
endif
if (netcdf_diag) call init_netcdf_diag_
if (netcdf_diag(jiter)) call init_netcdf_diag_
endif
endif

Expand Down Expand Up @@ -626,7 +626,7 @@ subroutine setupcldtot(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_di
if (err_final>tiny_r_kind) errinv_final = one/err_final

if (binary_diag) call contents_binary_diag_
if (netcdf_diag) call contents_netcdf_diag_
if (netcdf_diag(jiter)) call contents_netcdf_diag_

if (i_ens_mean == 1) then

Expand Down Expand Up @@ -706,7 +706,7 @@ subroutine setupcldtot(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_di

if(conv_diagsave)then
if (binary_diag) call contents_binary_diag_mem_
if (netcdf_diag) call contents_netcdf_diag_mem_
if (netcdf_diag(jiter)) call contents_netcdf_diag_mem_
endif
enddo

Expand All @@ -718,7 +718,7 @@ subroutine setupcldtot(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_di
!! Write information to diagnostic file
if(conv_diagsave)then
if (i_cloud_q_innovation == 2 .and. iip>0) then
if(netcdf_diag) call nc_diag_write
if(netcdf_diag(jiter)) call nc_diag_write
if(binary_diag)then
write(7)' q',nchar,nreal,iip,mype,ioff0
write(7)cdiagbufp(1:iip),rdiagbufp(:,1:iip)
Expand Down
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/setupdbz.f90
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ subroutine setupdbz(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,radardbz_d
if (err_final>tiny_r_kind) errinv_final = one/err_final

if(binary_diag) call contents_binary_diag_(my_diag)
if(netcdf_diag) call contents_netcdf_diag_(my_diag)
if(netcdf_diag(jiter)) call contents_netcdf_diag_(my_diag)


end if
Expand Down
12 changes: 6 additions & 6 deletions GEOSaana_GridComp/GSI_GridComp/setupdw.f90
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ subroutine setupdw(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsa
nreal = nreal + size(dhx_dx)
endif
allocate(cdiagbuf(nobs),rdiagbuf(nreal,nobs))
if(netcdf_diag.and.nobs>0) call init_netcdf_diag_
if(netcdf_diag(jiter).and.nobs>0) call init_netcdf_diag_
end if

scale=one
Expand Down Expand Up @@ -664,7 +664,7 @@ subroutine setupdw(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsa
if (err_final>tiny_r_kind) errinv_final=one/err_final

if (binary_diag) call contents_binary_diag_(my_diag)
if (netcdf_diag) call contents_netcdf_diag_(my_diag)
if (netcdf_diag(jiter)) call contents_netcdf_diag_(my_diag)

end if

Expand All @@ -675,7 +675,7 @@ subroutine setupdw(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diagsa

! Write information to diagnostic file
if(conv_diagsave) then
if(netcdf_diag.and.nobs>0) call nc_diag_write
if(netcdf_diag(jiter).and.nobs>0) call nc_diag_write
if(binary_diag .and. ii>0)then
write(7)' dw',nchar,nreal,ii,mype,ioff0
write(7)cdiagbuf(1:ii),rdiagbuf(:,1:ii)
Expand Down Expand Up @@ -958,9 +958,9 @@ subroutine contents_netcdf_diag_(odiag)
if (save_jacobian) then
call fullarray(dhx_dx, dhx_dx_array)
call nc_diag_data2d("Observation_Operator_Jacobian", dhx_dx_array)
call nc_diag_data2d("Observation_Operator_Jacobian_stind", dhx_dx%st_ind)
call nc_diag_data2d("Observation_Operator_Jacobian_endind", dhx_dx%end_ind)
call nc_diag_data2d("Observation_Operator_Jacobian_val", real(dhx_dx%val,r_single))
call nc_diag_data2d("Observation_Operator_Jacobian_stind", dhx_dx%st_ind)
call nc_diag_data2d("Observation_Operator_Jacobian_endind", dhx_dx%end_ind)
call nc_diag_data2d("Observation_Operator_Jacobian_val", real(dhx_dx%val,r_single))
endif

end subroutine contents_netcdf_diag_
Expand Down
6 changes: 3 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/setupgust.f90
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ subroutine setupgust(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diag
if (lobsdiagsave) nreal=nreal+4*miter+1
allocate(cdiagbuf(nobs),rdiagbuf(nreal,nobs))
allocate(cprvstg(nobs),csprvstg(nobs))
if(netcdf_diag) call init_netcdf_diag_
if(netcdf_diag(jiter)) call init_netcdf_diag_
end if

call dtime_setup()
Expand Down Expand Up @@ -597,7 +597,7 @@ subroutine setupgust(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diag
if (err_final>tiny_r_kind) errinv_final = one/err_final

if(binary_diag) call contents_binary_diag_(my_diag)
if(netcdf_diag) call contents_netcdf_diag_(my_diag)
if(netcdf_diag(jiter)) call contents_netcdf_diag_(my_diag)

end if

Expand All @@ -609,7 +609,7 @@ subroutine setupgust(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diag

! Write information to diagnostic file
if(conv_diagsave) then
if(netcdf_diag) call nc_diag_write
if(netcdf_diag(jiter)) call nc_diag_write
if(binary_diag .and. ii>0)then
write(7)'gst',nchar,nreal,ii,mype,ioff0
write(7)cdiagbuf(1:ii),rdiagbuf(:,1:ii)
Expand Down
6 changes: 3 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/setuphowv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ subroutine setuphowv(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diag
if (lobsdiagsave) nreal=nreal+4*miter+1
if (twodvar_regional) then; nreal=nreal+2; allocate(cprvstg(nobs),csprvstg(nobs)); endif
allocate(cdiagbuf(nobs),rdiagbuf(nreal,nobs))
if (netcdf_diag) call init_netcdf_diag_
if (netcdf_diag(jiter)) call init_netcdf_diag_
end if


Expand Down Expand Up @@ -432,7 +432,7 @@ subroutine setuphowv(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diag
if (err_final>tiny_r_kind) errinv_final = one/err_final

if (binary_diag) call contents_binary_diag_(my_diag)
if (netcdf_diag) call contents_netcdf_diag_(my_diag)
if (netcdf_diag(jiter)) call contents_netcdf_diag_(my_diag)

end if
end do
Expand All @@ -442,7 +442,7 @@ subroutine setuphowv(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_diag

! Write information to diagnostic file
if(conv_diagsave) then
if(netcdf_diag) call nc_diag_write
if(netcdf_diag(jiter)) call nc_diag_write
if(binary_diag .and. ii>0)then
write(7)'hwv',nchar,nreal,ii,mype,ioff0
write(7)cdiagbuf(1:ii),rdiagbuf(:,1:ii)
Expand Down
6 changes: 3 additions & 3 deletions GEOSaana_GridComp/GSI_GridComp/setuplcbas.f90
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ subroutine setuplcbas(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_dia
if (lobsdiagsave) nreal=nreal+4*miter+1
allocate(cdiagbuf(nobs),rdiagbuf(nreal,nobs))
allocate(cprvstg(nobs),csprvstg(nobs))
if(netcdf_diag) call init_netcdf_diag_
if(netcdf_diag(jiter)) call init_netcdf_diag_
end if

call dtime_setup()
Expand Down Expand Up @@ -435,7 +435,7 @@ subroutine setuplcbas(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_dia
if (err_final>tiny_r_kind) errinv_final = one/err_final

if(binary_diag) call contents_binary_diag_(my_diag)
if(netcdf_diag) call contents_netcdf_diag_(my_diag)
if(netcdf_diag(jiter)) call contents_netcdf_diag_(my_diag)

end if

Expand All @@ -444,7 +444,7 @@ subroutine setuplcbas(obsLL,odiagLL,lunin,mype,bwork,awork,nele,nobs,is,conv_dia

! Write information to diagnostic file
if(conv_diagsave)then
if(netcdf_diag) call nc_diag_write
if(netcdf_diag(jiter)) call nc_diag_write
if(binary_diag) then
write(7)'lcb',nchar,nreal,ii,mype,ioff0
write(7)cdiagbuf(1:ii),rdiagbuf(:,1:ii)
Expand Down
Loading
Loading