@@ -65,6 +65,7 @@ module opsinputs_fill_mod
65
65
opsinputs_fill_fillelementtypefromsimulatedvariable, &
66
66
opsinputs_fill_fillelementtype2dfromsimulatedvariable, &
67
67
opsinputs_fill_fillinteger, &
68
+ opsinputs_fill_fillinteger2d, &
68
69
opsinputs_fill_fillreal, &
69
70
opsinputs_fill_fillreal2d, &
70
71
opsinputs_fill_fillrealfromgeoval, &
@@ -580,11 +581,11 @@ end subroutine opsinputs_fill_fillelementtype2dfromsimulatedvariable
580
581
! > \param[in] JediValueVarName
581
582
! > Name of the JEDI variable containing observation values.
582
583
! > \param[in] JediValueGroup
583
- ! > Group of the JEDI variable containing observation values.
584
+ ! > Group name of the JEDI variable containing observation values.
584
585
! > \param[in] JediErrorVarName
585
586
! > (Optional) Name of the JEDI variable containing observation errors.
586
587
! > \param[in] JediErrorGroup
587
- ! > (Optional) Group of the JEDI variable containing observation errors.
588
+ ! > (Optional) Group name of the JEDI variable containing observation errors.
588
589
! > \param[in] PackPGEs
589
590
! > Optional; true by default. If set to false, PGEs won't be stored in packed form.
590
591
! > The Ops_VarobPGEs subroutine expects PGEs to be stored in packed form for most varobs fields,
@@ -693,11 +694,11 @@ end subroutine opsinputs_fill_fillelementtypefromnormalvariable
693
694
! > \param[in] JediValueVarName
694
695
! > Name of the JEDI variable containing observation values.
695
696
! > \param[in] JediValueGroup
696
- ! > Group of the JEDI variable containing observation values.
697
+ ! > Group name of the JEDI variable containing observation values.
697
698
! > \param[in] JediErrorVarName
698
699
! > (Optional) Name of the JEDI variable containing observation errors.
699
700
! > \param[in] JediErrorGroup
700
- ! > (Optional) Group of the JEDI variable containing observation errors.
701
+ ! > (Optional) Group name of the JEDI variable containing observation errors.
701
702
! > \param[in] PackPGEs
702
703
! > Optional; true by default. If set to false, PGEs won't be stored in packed form.
703
704
! > The Ops_VarobPGEs subroutine expects PGEs to be stored in packed form for most varobs fields,
@@ -829,13 +830,13 @@ end subroutine opsinputs_fill_fillelementtype2dfromnormalvariable
829
830
! > \param[in] JediValueVarName
830
831
! > Name of the JEDI variable containing observation values.
831
832
! > \param[in] JediValueGroup
832
- ! > Group of the JEDI variable containing observation values.
833
+ ! > Group name of the JEDI variable containing observation values.
833
834
! > \param[in] LevelsAreTopToBottom
834
835
! > A logical to specify if the levels being passed in are top to bottom in the atmosphere.
835
836
! > \param[in] JediErrorVarName
836
837
! > (Optional) Name of the JEDI variable containing observation errors.
837
838
! > \param[in] JediErrorGroup
838
- ! > (Optional) Group of the JEDI variable containing observation errors.
839
+ ! > (Optional) Group name of the JEDI variable containing observation errors.
839
840
! >
840
841
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
841
842
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -950,7 +951,7 @@ end subroutine opsinputs_fill_fillelementtype2dfromnormalvariablewithlevels
950
951
! > \param[in] JediVarName
951
952
! > Name of the JEDI variable used to populate \p Real1.
952
953
! > \param[in] JediGroup
953
- ! > Group of the JEDI variable used to populate \p Real1.
954
+ ! > Group name of the JEDI variable used to populate \p Real1.
954
955
! >
955
956
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
956
957
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -1030,7 +1031,7 @@ end subroutine opsinputs_fill_fillreal
1030
1031
! > variable with no channel suffix (in which case \p Real2 will have only a single row) or a set
1031
1032
! > of variables with suffixes corresponding to the indices specified in \p Channels.
1032
1033
! > \param[in] JediGroup
1033
- ! > Group of the JEDI variable used to populate \p Real2.
1034
+ ! > Group name of the JEDI variable used to populate \p Real2.
1034
1035
! > \param[in] compressVarChannels
1035
1036
! > Whether to apply var channel compression (No NaN spaces between channels)
1036
1037
! > \param[in] sizeOfVarobsArray
@@ -1165,7 +1166,7 @@ end subroutine opsinputs_fill_fillreal2d_norecords
1165
1166
! > \param[in] JediVarName
1166
1167
! > Name of the JEDI variable used to populate \p Real2.
1167
1168
! > \param[in] JediGroup
1168
- ! > Group of the JEDI variable used to populate \p Real2.
1169
+ ! > Group name of the JEDI variable used to populate \p Real2.
1169
1170
! >
1170
1171
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
1171
1172
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -1235,7 +1236,7 @@ end subroutine opsinputs_fill_fillreal2d_records
1235
1236
! > \param[inout] Hdr
1236
1237
! > Header to be populated.
1237
1238
! > \param[in] OpsVarName
1238
- ! > Name of the OB_type field to which \p Real1 corresponds.
1239
+ ! > Name of the OB_type field to which \p Real2 corresponds.
1239
1240
! > \param[in] JediToOpsLayoutMapping
1240
1241
! > Data needed to map JEDI locations stored on the current PE to OPS observations.
1241
1242
! > \param[inout] Real2
@@ -1254,7 +1255,7 @@ end subroutine opsinputs_fill_fillreal2d_records
1254
1255
! > suffix (in which case \p Real2 will have only a single row) or a set of variables with
1255
1256
! > suffixes corresponding to the indices specified in \p Channels.
1256
1257
! > \param[in] JediGroup
1257
- ! > Group of the JEDI variable used to populate \p Real2.
1258
+ ! > Group name of the JEDI variable used to populate \p Real2.
1258
1259
! >
1259
1260
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
1260
1261
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -1764,7 +1765,7 @@ end subroutine opsinputs_fill_fillreal2dfromgeovalformultilevelobs
1764
1765
! > \param[in] JediVarName
1765
1766
! > Name of the JEDI variable used to populate \p Int1.
1766
1767
! > \param[in] JediGroup
1767
- ! > Group of the JEDI variable used to populate \p Int1.
1768
+ ! > Group name of the JEDI variable used to populate \p Int1.
1768
1769
! >
1769
1770
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
1770
1771
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -1817,6 +1818,87 @@ subroutine opsinputs_fill_fillinteger( &
1817
1818
end if
1818
1819
end subroutine opsinputs_fill_fillinteger
1819
1820
1821
+
1822
+ ! ------------------------------------------------------------------------------
1823
+ ! > Populate a 2D array of integers and its header from a JEDI variable.
1824
+ ! >
1825
+ ! > \param[inout] Hdr
1826
+ ! > Header to be populated.
1827
+ ! > \param[in] OpsVarName
1828
+ ! > Name of the OB_type field to which \p Int2 corresponds.
1829
+ ! > \param[in] JediToOpsLayoutMapping
1830
+ ! > Data needed to map JEDI locations stored on the current PE to OPS observations.
1831
+ ! > \param[inout] Int2
1832
+ ! > Pointer to the array to be populated.
1833
+ ! > \param[in] ObsSpace
1834
+ ! > Pointer to ioda::ObsSpace object containing the specified JEDI variable. The variable can
1835
+ ! > have either no channel suffix (in which case \p Int2 will have only a single row) or suffixes
1836
+ ! > representing the indices specified in \p Channels.
1837
+ ! > \param[in] Channels
1838
+ ! > Indices returned by ioda::ObsSpace::obsvariables().channels().
1839
+ ! > \param[in] VarobsLength
1840
+ ! > Length of varobs profile.
1841
+ ! > \param[in] JediVarName
1842
+ ! > Name of the JEDI variable used to populate \p Int2. If each JEDI location needs to be mapped
1843
+ ! > to a separate OPS observation, this can represent either a single variable with no channel
1844
+ ! > suffix (in which case \p Int2 will have only a single row) or a set of variables with
1845
+ ! > suffixes corresponding to the indices specified in \p Channels.
1846
+ ! > \param[in] JediGroup
1847
+ ! > Group name of the JEDI variable used to populate \p Int2.
1848
+ ! >
1849
+ ! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
1850
+ ! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
1851
+ ! > are not found.
1852
+ subroutine opsinputs_fill_fillinteger2d ( &
1853
+ Hdr , OpsVarName , JediToOpsLayoutMapping , Int2 , ObsSpace , Channels , &
1854
+ VarobsLength , JediVarName , JediVarGroup )
1855
+ implicit none
1856
+
1857
+ ! Subroutine arguments:
1858
+ type (ElementHeader_Type), intent (inout ) :: Hdr
1859
+ character (len=* ), intent (in ) :: OpsVarName
1860
+ type (opsinputs_jeditoopslayoutmapping), intent (in ) :: JediToOpsLayoutMapping
1861
+ integer (integer64), pointer , intent (out ) :: Int2(:,:)
1862
+ type (c_ptr), value, intent (in ) :: ObsSpace
1863
+ integer (c_int), intent (in ) :: Channels(:)
1864
+ integer (integer64), intent (in ) :: VarobsLength
1865
+ character (len=* ), intent (in ) :: JediVarName
1866
+ character (len=* ), intent (in ) :: JediVarGroup
1867
+ ! todo(someone): add optional arguments used in opsinputs_fill_fillreal2d if there is a need.
1868
+
1869
+ ! Local declarations:
1870
+ integer (kind= c_int) :: VarValue(JediToOpsLayoutMapping % NumJediObs)
1871
+ integer (kind= c_int) :: CurrentVarValue
1872
+ integer (kind= c_int) :: MissingInt
1873
+ integer :: i
1874
+ integer :: numchans
1875
+
1876
+ ! Body:
1877
+
1878
+ MissingInt = missing_value(0_c_int32_t )
1879
+
1880
+ ! todo(someone): add this if needed
1881
+ if (JediToOpsLayoutMapping % ConvertRecordsToMultilevelObs) then
1882
+ call abor1_ftn(" must extend opsinputs_fill_fillreal2d to deal with multi-level observations" )
1883
+ end if
1884
+
1885
+ ! todo(someone): make this configurable if required
1886
+ numchans = 1
1887
+
1888
+ if (obsspace_has(ObsSpace, JediVarGroup, JediVarName)) then
1889
+ ! Retrieve data from JEDI
1890
+ call obsspace_get_db(ObsSpace, JediVarGroup, JediVarName, VarValue)
1891
+
1892
+ ! Fill the OPS data structures
1893
+ call Ops_Alloc(Hdr, OpsVarName, JediToOpsLayoutMapping % NumOpsObs, Int2, &
1894
+ num_levels = int (numchans, kind= integer64))
1895
+ do i = 1 , JediToOpsLayoutMapping % NumOpsObs
1896
+ CurrentVarValue = VarValue(i)
1897
+ if (CurrentVarValue /= MissingInt) Int2(i, 1 ) = CurrentVarValue
1898
+ end do
1899
+ end if
1900
+ end subroutine opsinputs_fill_fillinteger2d
1901
+
1820
1902
! ------------------------------------------------------------------------------
1821
1903
1822
1904
! > Populate a 1D array of strings and its header from a JEDI variable.
@@ -1837,7 +1919,7 @@ end subroutine opsinputs_fill_fillinteger
1837
1919
! > \param[in] JediVarName
1838
1920
! > Name of the JEDI variable used to populate \p String1.
1839
1921
! > \param[in] JediGroup
1840
- ! > Group of the JEDI variable used to populate \p String1.
1922
+ ! > Group name of the JEDI variable used to populate \p String1.
1841
1923
! > \param[in] ConvertIntToSTring
1842
1924
! > Convert an integer-valued ObsSpace vector to a string.
1843
1925
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
@@ -1934,7 +2016,7 @@ end subroutine opsinputs_fill_fillstring
1934
2016
! > \param[in] JediVarName
1935
2017
! > Name of the JEDI variable used to populate \p Real1.
1936
2018
! > \param[in] JediGroup
1937
- ! > Group of the JEDI variable used to populate \p Real1.
2019
+ ! > Group name of the JEDI variable used to populate \p Real1.
1938
2020
! > \param[in] ReferenceTime
1939
2021
! > Reference time. JEDI datetimes will be converted into offsets from this time.
1940
2022
! >
@@ -2010,7 +2092,7 @@ end subroutine opsinputs_fill_filltimeoffsets
2010
2092
! > variable with no channel suffix (in which case \p Real2 will have only a single row) or a set
2011
2093
! > of variables with suffixes corresponding to the indices specified in \p Channels.
2012
2094
! > \param[in] JediGroup
2013
- ! > Group of the JEDI variable used to populate \p Real2.
2095
+ ! > Group name of the JEDI variable used to populate \p Real2.
2014
2096
! > \param[in] ReferenceTime
2015
2097
! > Reference time. JEDI datetimes will be converted into offsets from this time.
2016
2098
! >
@@ -2085,7 +2167,7 @@ end subroutine opsinputs_fill_filltimeoffsets2d_norecords
2085
2167
! > \param[in] JediVarName
2086
2168
! > Name of the JEDI variable used to populate \p Real2.
2087
2169
! > \param[in] JediGroup
2088
- ! > Group of the JEDI variable used to populate \p Real2.
2170
+ ! > Group name of the JEDI variable used to populate \p Real2.
2089
2171
! > \param[in] ReferenceTime
2090
2172
! > Reference time. JEDI datetimes will be converted into offsets from this time.
2091
2173
! >
@@ -2181,7 +2263,7 @@ end subroutine opsinputs_fill_filltimeoffsets2d_records
2181
2263
! > suffix (in which case \p Real2 will have only a single row) or a set of variables with
2182
2264
! > suffixes corresponding to the indices specified in \p Channels.
2183
2265
! > \param[in] JediGroup
2184
- ! > Group of the JEDI variable used to populate \p Real2.
2266
+ ! > Group name of the JEDI variable used to populate \p Real2.
2185
2267
! > \param[in] ReferenceTime
2186
2268
! > Reference time. JEDI datetimes will be converted into offsets from this time.
2187
2269
! >
@@ -2249,7 +2331,7 @@ end subroutine opsinputs_fill_filltimeoffsets2d
2249
2331
! > variable with no channel suffix (in which case \p Coord2 will have only a single row) or a set
2250
2332
! > of variables with suffixes corresponding to the indices specified in \p Channels.
2251
2333
! > \param[in] JediGroup
2252
- ! > Group of the JEDI variable used to populate \p Coord2.
2334
+ ! > Group name of the JEDI variable used to populate \p Coord2.
2253
2335
! >
2254
2336
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
2255
2337
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -2318,7 +2400,7 @@ end subroutine opsinputs_fill_fillcoord2d_norecords
2318
2400
! > \param[in] JediVarName
2319
2401
! > Name of the JEDI variable used to populate \p Coord2.
2320
2402
! > \param[in] JediGroup
2321
- ! > Group of the JEDI variable used to populate \p Coord2.
2403
+ ! > Group name of the JEDI variable used to populate \p Coord2.
2322
2404
! >
2323
2405
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
2324
2406
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
@@ -2390,7 +2472,7 @@ end subroutine opsinputs_fill_fillcoord2d_records
2390
2472
! > suffix (in which case \p Coord2 will have only a single row) or a set of variables with
2391
2473
! > suffixes corresponding to the indices specified in \p Channels.
2392
2474
! > \param[in] JediGroup
2393
- ! > Group of the JEDI variable used to populate \p Coord2.
2475
+ ! > Group name of the JEDI variable used to populate \p Coord2.
2394
2476
! >
2395
2477
! > \note This function returns early (without a warning) if the specified JEDI variable is not found.
2396
2478
! > We rely on warnings printed by the OPS code whenever data needed to output a requested varfield
0 commit comments