3#if (defined FOUR_DVAR || defined VERIFICATION) && defined OBSERVATIONS
33# if defined PIO_LIB && defined DISTRIBUTE
45 logical,
intent(in) :: backward
47 integer,
intent(in) :: ng, model
51 character (len=*),
parameter :: myfile = &
58 SELECT CASE (
obs(ng)%IOtype)
62# if defined PIO_LIB && defined DISTRIBUTE
72 10
FORMAT (
' OBS_INITIAL - Illegal input file type, io_type = ',i0, &
73 & /,15x,
'Check KeyWord ''INP_LIB'' in ''roms.in''.')
86 logical,
intent(in) :: backward
88 integer,
intent(in) :: ng, model
92 logical,
dimension(NV) :: got_var(
nv)
94 integer :: ifirst, i, nvd, recdim, status
97# ifdef WEAK_CONSTRAINT
98 real(r8),
parameter :: inival = 0.0_r8
102 character (len=*),
parameter :: myfile = &
103 & __FILE__//
"obs_initial_nf90"
112 query :
IF (
obs(ng)%ncid.eq.-1)
THEN
181 IF (.not.got_var(
idoday))
THEN
187 IF (.not.got_var(
idnobs))
THEN
193 IF (.not.got_var(
idotyp))
THEN
199 IF (.not.got_var(
idobst))
THEN
206 IF (.not.got_var(
idobsd))
THEN
213 IF (.not.got_var(
idobsx))
THEN
219 IF (.not.got_var(
idobsy))
THEN
226 IF (.not.got_var(
idobsz))
THEN
233 IF (.not.got_var(
idoerr))
THEN
239 IF (.not.got_var(
idoval))
THEN
256# ifdef GENERIC_DSTART
262 IF ((tend.le.
fourdvar(ng)%SurveyTime(i)).and. &
268 IF (ifirst.eq.0)
THEN
279 & (
fourdvar(ng)%SurveyTime(i).le.tend))
THEN
284 IF (ifirst.eq.0)
THEN
314 IF (.not.backward)
THEN
331 IF (ifirst.eq.1)
THEN
349# ifdef WEAK_CONSTRAINT
359# if defined SP4DVAR && defined DISJOINTED && \
360 defined concurrent_kernel
364# if defined SP4DVAR && defined DISJOINTED && \
366 IF (model.ne.
iadm)
THEN
374 10
FORMAT (/,
' OBS_INITIAL_NF90 - unable to open input NetCDF', &
376 20
FORMAT (/,
' OBS_INITIAL_NF90 - unable to find model variable:', &
377 & 1x,a,/,20x,
'in input NetCDF file: ',a)
378 30
FORMAT (/,
' OBS_INITIAL_NF90 - No are observations available', &
379 &
' for time window (days): ',/,12x,f12.4,
' - ',f12.4,/)
384# if defined PIO_LIB && defined DISTRIBUTE
394 logical,
intent(in) :: backward
396 integer,
intent(in) :: ng, model
400 logical,
dimension(NV) :: got_var(
nv)
402 integer :: ifirst, i, nvd, recdim, status
405# ifdef WEAK_CONSTRAINT
406 real(r8),
parameter :: inival = 0.0_r8
410 character (len=*),
parameter :: myfile = &
411 & __FILE__//
"obs_initial_nf90"
420 query :
IF (
obs(ng)%ncid.eq.-1)
THEN
447 IF (trim(var_name(i)).eq.trim(
vname(1,
idoday)))
THEN
450 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idnobs)))
THEN
453 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idotyp)))
THEN
456 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idobst)))
THEN
460 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idobsd)))
THEN
464 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idobsx)))
THEN
467 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idobsy)))
THEN
471 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idobsz)))
THEN
475 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idoerr)))
THEN
478 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idoval)))
THEN
481 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idomet)))
THEN
490 IF (.not.got_var(
idoday))
THEN
496 IF (.not.got_var(
idnobs))
THEN
502 IF (.not.got_var(
idotyp))
THEN
508 IF (.not.got_var(
idobst))
THEN
515 IF (.not.got_var(
idobsd))
THEN
522 IF (.not.got_var(
idobsx))
THEN
528 IF (.not.got_var(
idobsy))
THEN
535 IF (.not.got_var(
idobsz))
THEN
542 IF (.not.got_var(
idoerr))
THEN
548 IF (.not.got_var(
idoval))
THEN
565# ifdef GENERIC_DSTART
571 IF ((tend.le.
fourdvar(ng)%SurveyTime(i)).and. &
577 IF (ifirst.eq.0)
THEN
588 & (
fourdvar(ng)%SurveyTime(i).le.tend))
THEN
593 IF (ifirst.eq.0)
THEN
623 IF (.not.backward)
THEN
640 IF (ifirst.eq.1)
THEN
658# ifdef WEAK_CONSTRAINT
668# if defined SP4DVAR && defined DISJOINTED && \
669 defined concurrent_kernel
673# if defined SP4DVAR && defined DISJOINTED && \
675 IF (model.ne.
iadm)
THEN
683 10
FORMAT (/,
' OBS_INITIAL_PIO - unable to open input NetCDF', &
685 20
FORMAT (/,
' OBS_INITIAL_PIO - unable to find model variable:', &
686 & 1x,a,/,20x,
'in input NetCDF file: ',a)
687 30
FORMAT (/,
' OBS_INITIAL_PIO - No are observations available', &
688 &
' for time window (days): ',/,12x,f12.4,
' - ',f12.4,/)
type(t_fourdvar), dimension(:), allocatable fourdvar
real(r8), dimension(:), allocatable obsvetting
integer, dimension(:), allocatable nobsvar
logical, dimension(:), allocatable haveobsmeta
integer, dimension(:), allocatable nsurvey
real(r8), dimension(:), allocatable nlmodval
integer, dimension(:), allocatable obssurvey
integer, dimension(:), allocatable nstrobs
logical, dimension(:), allocatable processobs
integer, dimension(:), allocatable nendobs
type(t_io), dimension(:), allocatable obs
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
character(len=maxlen), dimension(6, 0:nv) vname
subroutine, public netcdf_open(ng, model, ncname, omode, ncid)
character(len=100), dimension(mvars) var_name
integer, dimension(mvars) var_id
subroutine, public netcdf_inq_var(ng, model, ncname, ncid, myvarname, searchvar, varid, nvardim, nvaratt)
type(var_desc_t), dimension(:), pointer var_desc
subroutine, public pio_netcdf_inq_var(ng, model, ncname, piofile, myvarname, searchvar, piovar, nvardim, nvaratt)
subroutine, public pio_netcdf_open(ng, model, ncname, omode, piofile)
real(dp), parameter day2sec
integer, dimension(:), allocatable ntimes
real(dp), dimension(:), allocatable obstime
real(dp), dimension(:), allocatable dt
real(dp), dimension(:), allocatable tdays
real(dp), parameter sec2day
real(dp), dimension(:), allocatable time
integer, dimension(:), allocatable ntstart
subroutine, public obs_initial(ng, model, backward)
subroutine, private obs_initial_nf90(ng, model, backward)
subroutine, private obs_initial_pio(ng, model, backward)
logical function, public founderror(flag, noerr, line, routine)