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
38 changes: 34 additions & 4 deletions ROMS/Drivers/nl_roms.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
USE mod_ncparam
USE mod_scalars
!
#ifdef VERIFICATION
#if defined VERIFICATION && defined ARCHAIC_OBS
USE def_mod_mod, ONLY : def_mod
#endif
USE close_io_mod, ONLY : close_inp, close_out
Expand All @@ -43,7 +43,12 @@
# endif
#endif
#ifdef VERIFICATION
# ifdef MODERN_OBS
USE roms_hofx_mod, ONLY : hofx_finalize
# endif
# ifdef ARCHAIC_OBS
USE stats_modobs_mod, ONLY : stats_modobs
# endif
#endif
USE stdout_mod, ONLY : Set_StdOutUnit, stdout_unit
USE strings_mod, ONLY : FoundError
Expand Down Expand Up @@ -215,6 +220,7 @@
Nrun=1

#ifdef VERIFICATION
# ifdef ARCHAIC_OBS
!
! Create NetCDF file for model solution at observation locations.
!
Expand All @@ -227,6 +233,19 @@
IF (FoundError(exit_flag, NoError, __LINE__, MyFile)) RETURN
END DO
END IF
# endif
# ifdef MODERN_OBS
!
! Set switches to compute and write model at observation locations.
!
IF (Nrun.eq.1) THEN
DO ng=1,Ngrids
LdefMOD(ng)=.TRUE.
wrtNLmod(ng)=.TRUE.
wrtObsScale(ng)=.TRUE.
END DO
END IF
# endif
#endif
#ifdef ENKF_RESTART
!
Expand Down Expand Up @@ -350,18 +369,29 @@
END IF
#endif
#ifdef VERIFICATION
# ifdef ARCHAIC_OBS
!
!-----------------------------------------------------------------------
! Compute and report model-observation comparison statistics.
!-----------------------------------------------------------------------
!
DO ng=1,Ngrids
# ifdef DISTRIBUTE
# ifdef DISTRIBUTE
CALL stats_modobs (ng, MyRank)
# else
# else
CALL stats_modobs (ng, -1)
# endif
# endif
END DO
# endif
# ifdef MODERN_OBS
!
!-----------------------------------------------------------------------
! Finalize model at observation locations, H(x). Then, write ouput
! enhanced NetCDF-4 files.
!-----------------------------------------------------------------------
!
CALL hofx_finalize (iNLM)
# endif
#endif
!
!-----------------------------------------------------------------------
Expand Down
68 changes: 40 additions & 28 deletions ROMS/External/s4dvar.in
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
F F F F

! Input model, initial conditions, boundary conditions, and surface forcing
! standard deviation file names, [1:Ngrids].
! standard deviation filenames, [1:Ngrids].

STDnameM == roms_std_m.nc
STDnameI == roms_std_i.nc
Expand All @@ -443,40 +443,42 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD

! If computing the standard deviation from the background (prior) state
! vector as an alternative to climatological values read from the
! input NetCDF file, enter output standard deviation file name,
! input NetCDF file, enter output standard deviation filename,
! [1:Ngrids].

STDnameC == roms_std_c.nc

! Input/output model, initial conditions, boundary conditions, and surface
! forcing error covariance normalization factors file name, [1:Ngrids].
! forcing error covariance normalization factors filename, [1:Ngrids].

NRMnameM == roms_nrm_m.nc
NRMnameI == roms_nrm_i.nc
NRMnameB == roms_nrm_b.nc
NRMnameF == roms_nrm_f.nc

! Input/output observation file name, [1:Ngrids].
! Input observation filename(s), [1:Ngrids].

NOBSFILES = 1

OBSname == roms_obs.nc

! Input/output Hessian eigenvectors file name, [1:Ngrids].
! Input/output Hessian eigenvectors filename, [1:Ngrids].

HSSname == roms_hss.nc

! Input/output Lanczos vectors file name, [1:Ngrids].
! Input/output Lanczos vectors filename, [1:Ngrids].

LCZname == roms_lcz.nc

! Output time-evolved Lanczos vectors file name, [1:Ngrids].
! Output time-evolved Lanczos vectors filename, [1:Ngrids].

LZEname == roms_lze.nc

! Output model data at observation locations file name, [1:Ngrids].
! Output model data at observation locations filename, [1:Ngrids].

MODname == roms_mod.nc

! Output posterior error covariance matrix file name, [1:Ngrids].
! Output posterior error covariance matrix filename, [1:Ngrids].

ERRname == roms_err.nc

Expand All @@ -487,7 +489,7 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
OIFnameA == roms_oif_a.nc
OIFnameB == roms_oif_b.nc

! Input coarser grid increment file name, [1:Ngrids]. It is used in
! Input coarser grid increment filename, [1:Ngrids]. It is used in
! mixed-resolution split 4D-Var for regridding (coarse-to-fine), where
! the inner loops are run at lower resolution to accelerate the computations.

Expand Down Expand Up @@ -1028,50 +1030,60 @@ Sigma_max(isTvar) == 0.33d0 0.056d0 ! 1:NT tracers maximum STD
! Input/Output NetCDF files (a string with a maximum of 256 characters).
!------------------------------------------------------------------------------
!
! NOBSFILES Number of observation files, usually NOBSFILES=1.
!
! OBSname Input/Output observations data filename(s).
!
! Users can utilize the original native 4D-Var NetCDF file,
! which consolidates all observations into a single vector
! sorted in ascending order of time. As the observation
! operators and filters become increasingly complex,
! separating the observations into multiple files can be
! beneficial. Alternatively, IODA enhanced-NetCDF4 files
! with "Groups" are also acceptable.
!
! STDnameM Input model error covariance
! standard deviation file name.
! standard deviation filename.
!
! STDnameI Input initial conditions error covariance
! standard deviation file name.
! standard deviation filename.
!
! STDnameB Input open boundary conditions error covariance
! standard deviation file name.
! standard deviation filename.
!
! STDnameF Input surface forcing error covariance
! standard deviation file name.
! standard deviation filename.
!
! STDnameC Output standard deviation file name
! STDnameC Output standard deviation filename
! computed from background (prior) state
!
! NRMnameM Input/output model error covariance
! normalization factors file name.
! normalization factors filename.
!
! NRMnameI Input/output initial conditions error covariance
! normalization factors file name.
! normalization factors filename.
!
! NRMnameB Input/output open boundary conditions error covariance
! normalization factors file name.
! normalization factors filename.
!
! NRMnameF Input/output surface forcing error covariance
! normalization factors file name.
!
! OBSname Input/Output observations data file name.
! normalization factors filename.
!
! HSSname Input/Output Hessian eigenvectors file name.
! HSSname Input/Output Hessian eigenvectors filename.
!
! LCZname Input/output Lanczos vectors file name.
! LCZname Input/output Lanczos vectors filename.
!
! LZEname Output time-evolved Lanczos vectors file name.
! LZEname Output time-evolved Lanczos vectors filename.
!
! MODname Output model data at observations locations file name.
! MODname Output model data at observations locations filename.
!
! ERRname Output posterior error covariance matrix file name.
! ERRname Output posterior error covariance matrix filename.
!
! Input coarser grid increment file name, [1:Ngrids]. It is used in
! Input coarser grid increment filename, [1:Ngrids]. It is used in
! mixed-resolution split 4D-Var for regridding (coarse-to-fine), where
! the inner loops are run at lower resolution to accelerate the computations.
!
! INCname Coarse grid increment file name.
! INCname Coarse grid increment filename.
!
! Input forcing filenames at observation locations for computing observations
! impacts during the analysis-forecast cycle when RBL4DVAR_FCT_SENSITIVITY and
Expand Down
12 changes: 11 additions & 1 deletion ROMS/Modules/mod_iounits.F
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ MODULE mod_iounits
TYPE(T_IO), allocatable :: LZE(:) ! evolved Lanczos vectors
TYPE(T_IO), allocatable :: NRM(:,:) ! normalization
TYPE(T_IO), allocatable :: NUD(:) ! nudging coefficients
TYPE(T_IO), allocatable :: OBS(:) ! observations
#if defined RBL4DVAR_FCT_SENSITIVITY && defined OBS_SPACE
TYPE(T_IO), allocatable :: OIFA(:) ! observation impacts, A
TYPE(T_IO), allocatable :: OIFB(:) ! observation impacts, B
Expand Down Expand Up @@ -285,6 +284,13 @@ MODULE mod_iounits
#endif
TYPE(T_IO), allocatable :: FRC(:,:)
!
! Input observations data.
!
integer, allocatable :: nOBSfiles(:)
!
TYPE(T_IO), allocatable :: OBS(:)
TYPE(T_IO), allocatable :: OBS2(:,:)
!
! Error messages.
!
character (len=50), dimension(9) :: Rerror = &
Expand Down Expand Up @@ -509,6 +515,9 @@ SUBROUTINE allocate_iounits (Ngrids)
IF (.not.allocated(nFfiles)) THEN
allocate ( nFfiles(Ngrids) )
END IF
IF (.not.allocated(nOBSfiles)) THEN
allocate ( nOBSfiles(Ngrids) )
END IF
!
!-----------------------------------------------------------------------
! Initialize I/O NetCDF files ID to close state.
Expand Down Expand Up @@ -566,6 +575,7 @@ SUBROUTINE allocate_iounits (Ngrids)
nBCfiles(ng)=-1
nCLMfiles(ng)=-1
nFfiles(ng)=-1
nOBSfiles(ng)=-1
END DO
!
!-----------------------------------------------------------------------
Expand Down
Loading