diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index bd4b0d6b..575606c8 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -239,7 +239,8 @@ end subroutine opsinputs_fill_fillelementtypefromsimulatedvariable !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. subroutine opsinputs_fill_fillelementtype2dfromsimulatedvariable_norecords( & - Hdr, OpsVarName, NumObs, El2, ObsSpace, Channels, Flags, ObsErrors, JediVarName, JediGroupName, PackPGEs) + Hdr, OpsVarName, NumObs, El2, ObsSpace, Channels, Flags, ObsErrors, JediVarName, JediGroupName, & + PackPGEs) implicit none ! Subroutine arguments: @@ -287,7 +288,8 @@ subroutine opsinputs_fill_fillelementtype2dfromsimulatedvariable_norecords( & MissingDouble = missing_value(0.0_c_double) MissingFloat = missing_value(0.0_c_float) -JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels(JediVarName, Channels) +JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels( & + JediVarName, Channels) if (obsspace_has(ObsSpace, JediGroupName, JediVarNamesWithChannels(1))) then ! Allocate OPS data structures @@ -549,7 +551,6 @@ subroutine opsinputs_fill_fillelementtype2dfromsimulatedvariable( & logical, optional, intent(in) :: PackPGEs ! Body: - if (JediToOpsLayoutMapping % ConvertRecordsToMultilevelObs) then call opsinputs_fill_fillelementtype2dfromsimulatedvariable_records( & Hdr, OpsVarName, JediToOpsLayoutMapping, El2, ObsSpace, Flags, & @@ -688,8 +689,8 @@ end subroutine opsinputs_fill_fillelementtypefromnormalvariable !> Pointer to the array to be populated. !> \param[in] ObsSpace !> Pointer to ioda::ObsSpace object containing the specified JEDI variables. The variables can -!> have either no channel suffix (in which case \p El2 will have only a single row) or suffixes -!> representing the indices specified in \p Channels. +!> have either no channel suffix (when no channel numbers are provided, in which case \p El2 +!> will have only a single row) or suffixes representing the indices specified in \p Channels. !> \param[in] Channel indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] JediValueVarName !> Name of the JEDI variable containing observation values. @@ -1022,16 +1023,20 @@ end subroutine opsinputs_fill_fillreal !> Pointer to the array to be populated. !> \param[in] ObsSpace !> Pointer to ioda::ObsSpace object containing the specified JEDI variable. The variable can -!> have either no channel suffix (in which case \p Real2 will have only a single row) or suffixes -!> representing the indices specified in \p Channels. +!> have suffixes representing the indices specified in \p Channels, or can be unchannelized +!> when \p JediVarHasChannels is false. !> \param[in] Channels !> Indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] JediVarName -!> Name of the JEDI variable used to populate \p Real2. This can represent either a single -!> variable with no channel suffix (in which case \p Real2 will have only a single row) or a set -!> of variables with suffixes corresponding to the indices specified in \p Channels. +!> Name of the JEDI variable used to populate \p Real2. This can represent a set of variables +!> with suffixes corresponding to the indices specified in \p Channels, or a single variable +!> with no channel suffix (in which case Real2 will have a single row) when no channels are +!> specified. If \p JediVarHasChannels is false, the exact variable name is used for each output +!> channel. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Real2. +!> \param[in] JediVarHasChannels +!> If false, use \p JediVarName for every output channel. !> \param[in] compressVarChannels !> Whether to apply var channel compression (No NaN spaces between channels) !> \param[in] sizeOfVarobsArray @@ -1044,7 +1049,7 @@ end subroutine opsinputs_fill_fillreal !> are not found. subroutine opsinputs_fill_fillreal2d_norecords( & Hdr, OpsVarName, NumObs, Real2, ObsSpace, Channels, JediVarName, & - JediVarGroup, compressVarChannels, sizeOfVarobsArray, varChannels) + JediVarGroup, JediVarHasChannels, compressVarChannels, sizeOfVarobsArray, varChannels) implicit none ! Subroutine arguments: @@ -1056,6 +1061,7 @@ subroutine opsinputs_fill_fillreal2d_norecords( & integer(c_int), intent(in) :: Channels(:) character(len=*), intent(in) :: JediVarName character(len=*), intent(in) :: JediVarGroup +logical, intent(in) :: JediVarHasChannels logical, optional, intent(in) :: compressVarChannels integer(integer64), optional, intent(in) :: sizeOfVarobsArray integer(c_int), optional, intent(in) :: varChannels(:) @@ -1081,7 +1087,8 @@ subroutine opsinputs_fill_fillreal2d_norecords( & compressChannels = compressVarChannels end if -JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels(JediVarName, Channels) +JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels( & + JediVarName, Channels, JediVarHasChannels) !take into account offsetting of 2nd dimension if required !designed to be used to pack where multiple satellite instruments expected @@ -1100,8 +1107,13 @@ subroutine opsinputs_fill_fillreal2d_norecords( & ! Allocate OPS data structures call Ops_Alloc(Hdr, OpsVarName, NumObs, Real2, & num_levels = int(numchans, kind=integer64)) + if (.not. JediVarHasChannels) then + call obsspace_get_db(ObsSpace, JediVarGroup, JediVarNamesWithChannels(1), VarValue) + end if do iChannel = 1, size(JediVarNamesWithChannels) - call obsspace_get_db(ObsSpace, JediVarGroup, JediVarNamesWithChannels(iChannel), VarValue) + if (JediVarHasChannels) then + call obsspace_get_db(ObsSpace, JediVarGroup, JediVarNamesWithChannels(iChannel), VarValue) + end if arrayindex = iChannel ! if VAR channels have been assigned then jopa channels will be mapped to these var channels @@ -1243,26 +1255,29 @@ end subroutine opsinputs_fill_fillreal2d_records !> Pointer to the array to be populated. !> \param[in] ObsSpace !> Pointer to ioda::ObsSpace object containing the specified JEDI variable. The variable can -!> have either no channel suffix (in which case \p Real2 will have only a single row) or suffixes -!> representing the indices specified in \p Channels. +!> have suffixes representing the indices specified in \p Channels, or can be unchannelized +!> when \p JediVarHasChannels is false. !> \param[in] Channels !> Indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] VarobsLength !> Length of varobs profile. !> \param[in] JediVarName !> Name of the JEDI variable used to populate \p Real2. If each JEDI location needs to be mapped -!> to a separate OPS observation, this can represent either a single variable with no channel -!> suffix (in which case \p Real2 will have only a single row) or a set of variables with -!> suffixes corresponding to the indices specified in \p Channels. +!> to a separate OPS observation, this can represent a set of variables with suffixes +!> corresponding to the indices specified in \p Channels. If \p JediVarHasChannels is false, +!> the exact variable name is used for each output channel. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Real2. +!> \param[in] JediVarHasChannels +!> Optional; defaults to true. If false, use \p JediVarName for every output channel. !> !> \note This function returns early (without a warning) if the specified JEDI variable is not found. !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. subroutine opsinputs_fill_fillreal2d( & Hdr, OpsVarName, JediToOpsLayoutMapping, Real2, ObsSpace, Channels, & - VarobsLength, JediVarName, JediVarGroup, compressVarChannels, sizeOfVarobsArray, varChannels) + VarobsLength, JediVarName, JediVarGroup, compressVarChannels, sizeOfVarobsArray, varChannels, & + JediVarHasChannels) implicit none ! Subroutine arguments: @@ -1278,9 +1293,11 @@ subroutine opsinputs_fill_fillreal2d( & logical, optional, intent(in) :: compressVarChannels integer(integer64), optional, intent(in) :: sizeOfVarobsArray integer(c_int), optional, intent(in) :: varChannels(:) +logical, optional, intent(in) :: JediVarHasChannels ! local variables logical :: compressChannels +logical :: JediVarHasChannelsLocal integer(integer64) :: sizeOfVarobsArray_local integer(c_int), allocatable :: localvarChannels(:) @@ -1291,6 +1308,9 @@ subroutine opsinputs_fill_fillreal2d( & compressChannels = compressVarChannels end if +JediVarHasChannelsLocal = .true. +if (present(JediVarHasChannels)) JediVarHasChannelsLocal = JediVarHasChannels + if (present(varChannels)) then allocate(localvarChannels(size(varChannels))) localvarChannels = varChannels @@ -1308,11 +1328,13 @@ subroutine opsinputs_fill_fillreal2d( & if (allocated(localvarChannels)) then call opsinputs_fill_fillreal2d_norecords( & Hdr, OpsVarName, JediToOpsLayoutMapping % NumOpsObs, Real2, ObsSpace, Channels, & - JediVarName, JediVarGroup, compressChannels, sizeOfVarobsArray_local, varChannels) + JediVarName, JediVarGroup, JediVarHasChannelsLocal, compressChannels, & + sizeOfVarobsArray_local, varChannels) else call opsinputs_fill_fillreal2d_norecords( & Hdr, OpsVarName, JediToOpsLayoutMapping % NumOpsObs, Real2, ObsSpace, Channels, & - JediVarName, JediVarGroup, compressChannels, sizeOfVarobsArray_local) + JediVarName, JediVarGroup, JediVarHasChannelsLocal, compressChannels, & + sizeOfVarobsArray_local) end if end if @@ -2100,24 +2122,27 @@ end subroutine opsinputs_fill_filltimeoffsets !> Pointer to the array to be populated. !> \param[in] ObsSpace !> Pointer to ioda::ObsSpace object containing the specified JEDI variable. The variable can -!> have either no channel suffix (in which case \p Real2 will have only a single row) or suffixes -!> representing the indices specified in \p Channels. +!> have suffixes representing the indices specified in \p Channels, or can be unchannelized +!> when \p JediVarHasChannels is false. !> \param[in] Channels !> Indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] JediVarName -!> Name of the JEDI variable used to populate \p Real2. This can represent either a single -!> variable with no channel suffix (in which case \p Real2 will have only a single row) or a set -!> of variables with suffixes corresponding to the indices specified in \p Channels. +!> Name of the JEDI variable used to populate \p Real2. This can represent a set of variables +!> with suffixes corresponding to the indices specified in \p Channels. If +!> \p JediVarHasChannels is false, the exact variable name is used for each output channel. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Real2. !> \param[in] ReferenceTime !> Reference time. JEDI datetimes will be converted into offsets from this time. +!> \param[in] JediVarHasChannels +!> If false, use \p JediVarName for every output channel. !> !> \note This function returns early (without a warning) if the specified JEDI variable is not found. !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. subroutine opsinputs_fill_filltimeoffsets2d_norecords( & - Hdr, OpsVarName, NumObs, Real2, ObsSpace, Channels, JediVarName, JediVarGroup, ReferenceTime) + Hdr, OpsVarName, NumObs, Real2, ObsSpace, Channels, JediVarName, JediVarGroup, JediVarHasChannels, & + ReferenceTime) use datetime_mod, only: datetime implicit none @@ -2130,6 +2155,7 @@ subroutine opsinputs_fill_filltimeoffsets2d_norecords( & integer(c_int), intent(in) :: Channels(:) character(len=*), intent(in) :: JediVarName character(len=*), intent(in) :: JediVarGroup +logical, intent(in) :: JediVarHasChannels type(datetime), intent(in) :: ReferenceTime ! Local declarations: @@ -2142,16 +2168,23 @@ subroutine opsinputs_fill_filltimeoffsets2d_norecords( & MissingDouble = missing_value(0.0_c_double) -JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels(JediVarName, Channels) +JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels( & + JediVarName, Channels, JediVarHasChannels) if (obsspace_has(ObsSpace, JediVarGroup, JediVarNamesWithChannels(1))) then ! Allocate OPS data structures call Ops_Alloc(Hdr, OpsVarName, NumObs, Real2, & num_levels = int(size(JediVarNamesWithChannels), kind=integer64)) - do iChannel = 1, size(JediVarNamesWithChannels) - ! Retrieve data from JEDI + if (.not. JediVarHasChannels) then call opsinputs_obsspace_get_db_datetime_offset_in_seconds( & - ObsSpace, JediVarGroup, JediVarNamesWithChannels(iChannel), ReferenceTime, VarValue) + ObsSpace, JediVarGroup, JediVarNamesWithChannels(1), ReferenceTime, VarValue) + end if + do iChannel = 1, size(JediVarNamesWithChannels) + if (JediVarHasChannels) then + ! Retrieve data from JEDI + call opsinputs_obsspace_get_db_datetime_offset_in_seconds( & + ObsSpace, JediVarGroup, JediVarNamesWithChannels(iChannel), ReferenceTime, VarValue) + end if ! Fill the OPS data structures where (VarValue /= MissingDouble) @@ -2268,28 +2301,30 @@ end subroutine opsinputs_fill_filltimeoffsets2d_records !> Pointer to the array to be populated. !> \param[in] ObsSpace !> Pointer to ioda::ObsSpace object containing the specified JEDI variable. The variable can -!> have either no channel suffix (in which case \p Real2 will have only a single row) or suffixes -!> representing the indices specified in \p Channels. +!> have suffixes representing the indices specified in \p Channels, or can be unchannelized +!> when \p JediVarHasChannels is false. !> \param[in] Channels !> Indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] VarobsLength !> Length of varobs profile. !> \param[in] JediVarName !> Name of the JEDI variable used to populate \p Real2. If each JEDI location needs to be mapped -!> to a separate OPS observation, this can represent either a single variable with no channel -!> suffix (in which case \p Real2 will have only a single row) or a set of variables with -!> suffixes corresponding to the indices specified in \p Channels. +!> to a separate OPS observation, this can represent a set of variables with suffixes +!> corresponding to the indices specified in \p Channels. If \p JediVarHasChannels is false, +!> the exact variable name is used for each output channel. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Real2. !> \param[in] ReferenceTime !> Reference time. JEDI datetimes will be converted into offsets from this time. +!> \param[in] JediVarHasChannels +!> Optional; defaults to true. If false, use \p JediVarName for every output channel. !> !> \note This function returns early (without a warning) if the specified JEDI variable is not found. !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. subroutine opsinputs_fill_filltimeoffsets2d( & Hdr, OpsVarName, JediToOpsLayoutMapping, Real2, ObsSpace, Channels, VarobsLength, JediVarName, JediVarGroup, & - ReferenceTime) + ReferenceTime, JediVarHasChannels) use datetime_mod, only: datetime implicit none @@ -2304,8 +2339,14 @@ subroutine opsinputs_fill_filltimeoffsets2d( & character(len=*), intent(in) :: JediVarName character(len=*), intent(in) :: JediVarGroup type(datetime), intent(in) :: ReferenceTime +logical, optional, intent(in) :: JediVarHasChannels + +! Local declarations: +logical :: JediVarHasChannelsLocal ! Body: +JediVarHasChannelsLocal = .true. +if (present(JediVarHasChannels)) JediVarHasChannelsLocal = JediVarHasChannels if (JediToOpsLayoutMapping % ConvertRecordsToMultilevelObs) then call opsinputs_fill_filltimeoffsets2d_records(Hdr, OpsVarName, & @@ -2316,7 +2357,7 @@ subroutine opsinputs_fill_filltimeoffsets2d( & call opsinputs_fill_filltimeoffsets2d_norecords(Hdr, OpsVarName, & JediToOpsLayoutMapping % NumOpsObs, Real2, & ObsSpace, Channels, JediVarName, JediVarGroup, & - ReferenceTime) + JediVarHasChannelsLocal, ReferenceTime) end if end subroutine opsinputs_fill_filltimeoffsets2d @@ -2339,22 +2380,25 @@ end subroutine opsinputs_fill_filltimeoffsets2d !> Pointer to the array to be populated. !> \param[in] ObsSpace !> Pointer to ioda::ObsSpace object containing the specified JEDI variable. The variable can -!> have either no channel suffix (in which case \p Coord2 will have only a single row) or suffixes -!> representing the indices specified in \p Channels. +!> have suffixes representing the indices specified in \p Channels, or can be unchannelized +!> when \p JediVarHasChannels is false. !> \param[in] Channels !> Indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] JediVarName -!> Name of the JEDI variable used to populate \p Coord2. This can represent either a single -!> variable with no channel suffix (in which case \p Coord2 will have only a single row) or a set -!> of variables with suffixes corresponding to the indices specified in \p Channels. +!> Name of the JEDI variable used to populate \p Coord2. This can represent a set of variables +!> with suffixes corresponding to the indices specified in \p Channels. If +!> \p JediVarHasChannels is false, the exact variable name is used for each output channel. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Coord2. +!> \param[in] JediVarHasChannels +!> If false, use \p JediVarName for every output channel. !> !> \note This function returns early (without a warning) if the specified JEDI variable is not found. !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. subroutine opsinputs_fill_fillcoord2d_norecords( & - Hdr, OpsVarName, NumObs, Coord2, ObsSpace, Channels, JediVarName, JediVarGroup) + Hdr, OpsVarName, NumObs, Coord2, ObsSpace, Channels, JediVarName, JediVarGroup, & + JediVarHasChannels) implicit none ! Subroutine arguments: @@ -2366,6 +2410,7 @@ subroutine opsinputs_fill_fillcoord2d_norecords( & integer(c_int), intent(in) :: Channels(:) character(len=*), intent(in) :: JediVarName character(len=*), intent(in) :: JediVarGroup +logical, intent(in) :: JediVarHasChannels ! Local declarations: real(kind=c_double) :: VarValue(NumObs) @@ -2377,16 +2422,22 @@ subroutine opsinputs_fill_fillcoord2d_norecords( & MissingDouble = missing_value(0.0_c_double) -JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels(JediVarName, Channels) +JediVarNamesWithChannels = opsinputs_fill_varnames_with_channels( & + JediVarName, Channels, JediVarHasChannels) if (obsspace_has(ObsSpace, JediVarGroup, JediVarNamesWithChannels(1))) then ! Allocate OPS data structures call Ops_Alloc(Hdr, OpsVarName, NumObs, Coord2, & num_levels = int(size(JediVarNamesWithChannels), kind=integer64)) + if (.not. JediVarHasChannels) then + call obsspace_get_db(ObsSpace, JediVarGroup, JediVarNamesWithChannels(1), VarValue) + end if do iChannel = 1, size(JediVarNamesWithChannels) - ! Retrieve data from JEDI - call obsspace_get_db(ObsSpace, JediVarGroup, JediVarNamesWithChannels(iChannel), VarValue) + if (JediVarHasChannels) then + ! Retrieve data from JEDI + call obsspace_get_db(ObsSpace, JediVarGroup, JediVarNamesWithChannels(iChannel), VarValue) + end if ! Fill the OPS data structures where (VarValue /= MissingDouble) @@ -2418,7 +2469,6 @@ end subroutine opsinputs_fill_fillcoord2d_norecords !> Name of the JEDI variable used to populate \p Coord2. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Coord2. -!> !> \note This function returns early (without a warning) if the specified JEDI variable is not found. !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. @@ -2485,17 +2535,20 @@ end subroutine opsinputs_fill_fillcoord2d_records !> Indices returned by ioda::ObsSpace::obsvariables().channels(). !> \param[in] JediVarName !> Name of the JEDI variable used to populate \p Coord2. If each JEDI location needs to be mapped -!> to a separate OPS observation, this can represent either a single variable with no channel -!> suffix (in which case \p Coord2 will have only a single row) or a set of variables with -!> suffixes corresponding to the indices specified in \p Channels. +!> to a separate OPS observation, this can represent a set of variables with suffixes +!> corresponding to the indices specified in \p Channels. If \p JediVarHasChannels is false, +!> the exact variable name is used for each output channel. !> \param[in] JediGroup !> Group name of the JEDI variable used to populate \p Coord2. +!> \param[in] JediVarHasChannels +!> Optional; defaults to true. If false, use \p JediVarName for every output channel. !> !> \note This function returns early (without a warning) if the specified JEDI variable is not found. !> We rely on warnings printed by the OPS code whenever data needed to output a requested varfield !> are not found. subroutine opsinputs_fill_fillcoord2d( & - Hdr, OpsVarName, JediToOpsLayoutMapping, Coord2, ObsSpace, Channels, JediVarName, JediVarGroup) + Hdr, OpsVarName, JediToOpsLayoutMapping, Coord2, ObsSpace, Channels, JediVarName, JediVarGroup, & + JediVarHasChannels) implicit none ! Subroutine arguments: @@ -2507,8 +2560,14 @@ subroutine opsinputs_fill_fillcoord2d( & integer(c_int), intent(in) :: Channels(:) character(len=*), intent(in) :: JediVarName character(len=*), intent(in) :: JediVarGroup +logical, optional, intent(in) :: JediVarHasChannels + +! Local declarations: +logical :: JediVarHasChannelsLocal ! Body: +JediVarHasChannelsLocal = .true. +if (present(JediVarHasChannels)) JediVarHasChannelsLocal = JediVarHasChannels if (JediToOpsLayoutMapping % ConvertRecordsToMultilevelObs) then call opsinputs_fill_fillcoord2d_records( & @@ -2516,7 +2575,7 @@ subroutine opsinputs_fill_fillcoord2d( & else call opsinputs_fill_fillcoord2d_norecords( & Hdr, OpsVarName, JediToOpsLayoutMapping % NumOpsObs, Coord2, ObsSpace, Channels, & - JediVarName, JediVarGroup) + JediVarName, JediVarGroup, JediVarHasChannelsLocal) end if end subroutine opsinputs_fill_fillcoord2d @@ -2549,20 +2608,28 @@ end function opsinputs_fill_varnames_with_levels ! ------------------------------------------------------------------------------ !> Return an array containing the names of JEDI variables storing individual channels of the -!> variable \p VarName. If the list of channels is empty, this means the variable in question is -!> 1D and hence the returned array contains just the single string \p VarName. -function opsinputs_fill_varnames_with_channels(VarName, Channels) result(VarNames) +!> variable \p VarName. If \p Channels is empty, the result contains the unsuffixed variable name +!> once. If \p JediVarHasChannels is false, the exact variable name is repeated for each channel. +!> \p JediVarHasChannels is optional and defaults to true. +function opsinputs_fill_varnames_with_channels(VarName, Channels, JediVarHasChannels) result(VarNames) implicit none ! Subroutine arguments: character(len=*), intent(in) :: VarName integer(c_int), intent(in) :: Channels(:) +logical, optional, intent(in) :: JediVarHasChannels ! Local declarations: character(len=max_varname_with_channel_length) :: VarNames(max(size(Channels), 1)) integer :: ichan +logical :: useChannelSuffixes + +useChannelSuffixes = .true. +if (present(JediVarHasChannels)) useChannelSuffixes = JediVarHasChannels if (size(Channels) == 0) then VarNames(1) = VarName +else if (.not. useChannelSuffixes) then + VarNames = VarName else do ichan = 1, size(Channels) write (VarNames(ichan),'(A,"_",I0)') VarName, Channels(ichan) diff --git a/src/opsinputs/opsinputs_varobswriter_mod.F90 b/src/opsinputs/opsinputs_varobswriter_mod.F90 index a7c4c856..d493f792 100644 --- a/src/opsinputs/opsinputs_varobswriter_mod.F90 +++ b/src/opsinputs/opsinputs_varobswriter_mod.F90 @@ -769,9 +769,10 @@ subroutine opsinputs_varobswriter_populateobservations( & call Ops_DeAlloc(Ob % Header % SatId, "SatId", Ob % SatId) end if +! Fill each output-channel pressure level from the 1D variable using JediVarHasChannels = .false. call opsinputs_fill_fillcoord2d( & Ob % Header % PlevelsA, "PlevelsA", JediToOpsLayoutMapping, Ob % PlevelsA, & - ObsSpace, self % channels, "pressure", "MetaData") + ObsSpace, self % channels, "pressure", "MetaData", JediVarHasChannels = .false.) GPSRO_TPD = self % AccountForGPSROTangentPointDrift if (Ob % header % ObsGroup == ObsGroupGPSRO .and. GPSRO_TPD) then @@ -1062,15 +1063,18 @@ subroutine opsinputs_varobswriter_populateobservations( & case (VarField_RadarBeamElev) call opsinputs_fill_fillreal2d( & Ob % Header % RadarBeamElev, "RadarBeamElev", JediToOpsLayoutMapping, Ob % RadarBeamElev, & - ObsSpace, self % channels, self % VarobsLength, "beamTiltAngle", "MetaData") + ObsSpace, self % channels, self % VarobsLength, "beamTiltAngle", "MetaData", & + JediVarHasChannels = .false.) case (VarField_RadarObRange) call opsinputs_fill_fillreal2d( & Ob % Header % RadarObRange, "RadarObRange", JediToOpsLayoutMapping, Ob % RadarObRange, & - ObsSpace, self % channels, self % VarobsLength, "gateRange", "MetaData") + ObsSpace, self % channels, self % VarobsLength, "gateRange", "MetaData", & + JediVarHasChannels = .false.) case (VarField_RadarObAzim) call opsinputs_fill_fillreal2d( & Ob % Header % RadarObAzim, "RadarObAzim", JediToOpsLayoutMapping, Ob % RadarObAzim, & - ObsSpace, self % channels, self % VarobsLength, "beamAzimuthAngle", "MetaData") + ObsSpace, self % channels, self % VarobsLength, "beamAzimuthAngle", "MetaData", & + JediVarHasChannels = .false.) case (VarField_RadIdent) call opsinputs_fill_fillinteger2d( & Ob % Header % RadIdent, "RadIdent", JediToOpsLayoutMapping, Ob % RadIdent, & @@ -1078,7 +1082,8 @@ subroutine opsinputs_varobswriter_populateobservations( & case (VarField_RadAltAboveMSL) call opsinputs_fill_fillreal2d( & Ob % Header % RadAltAboveMSL, "RadAltAboveMSL", JediToOpsLayoutMapping, Ob % RadAltAboveMSL, & - ObsSpace, self % channels, self % VarobsLength, "stationElevation", "MetaData") + ObsSpace, self % channels, self % VarobsLength, "stationElevation", "MetaData", & + JediVarHasChannels = .false.) case (VarField_RadNoiseLvl) ! TODO(someone): handle this varfield ! call Ops_Alloc(Ob % Header % RadNoiseLvl, "RadNoiseLvl", Ob % Header % NumObsLocal, Ob % RadNoiseLvl) @@ -1161,15 +1166,18 @@ subroutine opsinputs_varobswriter_populateobservations( & case (VarField_LevelTime) call opsinputs_fill_filltimeoffsets2d( & Ob % Header % level_time, "level_time", JediToOpsLayoutMapping, Ob % level_time, & - ObsSpace, self % channels, self % VarobsLength, "dateTime", "MetaData", self % validitytime) + ObsSpace, self % channels, self % VarobsLength, "dateTime", "MetaData", self % validitytime, & + JediVarHasChannels = .false.) case (VarField_LevelLat) call opsinputs_fill_fillreal2d( & Ob % Header % level_lat, "level_lat", JediToOpsLayoutMapping, Ob % level_lat, & - ObsSpace, self % channels, self % VarobsLength, "latitude", "MetaData") + ObsSpace, self % channels, self % VarobsLength, "latitude", "MetaData", & + JediVarHasChannels = .false.) case (VarField_LevelLon) call opsinputs_fill_fillreal2d( & Ob % Header % level_lon, "level_lon", JediToOpsLayoutMapping, Ob % level_lon, & - ObsSpace, self % channels, self % VarobsLength, "longitude", "MetaData") + ObsSpace, self % channels, self % VarobsLength, "longitude", "MetaData", & + JediVarHasChannels = .false.) case (VarField_RainAccum) ! TODO(someone): handle this varfield ! call Ops_Alloc(Ob % Header % RainAccum, "RainAccum", Ob % Header % NumObsLocal, Ob % RainAccum)