From 44094a2723e99d08dab28a4c69592d63f5297d84 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Wed, 22 May 2024 15:43:17 +0100 Subject: [PATCH 01/17] Output visibility in ukv surface cx files --- etc/ukv/cx/Surface.nl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/ukv/cx/Surface.nl b/etc/ukv/cx/Surface.nl index fd2c6f90..80430855 100644 --- a/etc/ukv/cx/Surface.nl +++ b/etc/ukv/cx/Surface.nl @@ -11,7 +11,7 @@ ! 4 IndexCxrh2 3245 Yes ! 5 IndexCxu10 3209 Yes ! 6 IndexCxv10 3210 Yes -! 8 IndexCxvis 3247 No +! 8 IndexCxvis 3247 Yes ! 13 IndexCxTskinSea 24 Yes ! 16 IndexCxpmsl 16222 No ! 17 IndexCxSeaIce 31 No @@ -42,5 +42,5 @@ ! 36 IndexCxRichNumber 3208 No ! 37 IndexCxSoilMoisture 8223 No ! 38 IndexCxSoilTemp 8225 No -CxFields=33,1,3236,3245,3209,3210,24,4,2,3,10,407,12,254 +CxFields=33,1,3236,3245,3209,3210,3247,24,4,2,3,10,407,12,254 / From 67d7c770abef4ecf9aa2f1e6ebcd99be8d0be259 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 27 May 2024 15:42:13 +0100 Subject: [PATCH 02/17] Test cxwriter for visibility --- test/generate_unittest_netcdfs.py | 4 ++-- test/testinput/cx_ukvnamelist_surface.nc4 | Bin 16851 -> 17222 bytes .../cxwriter_ukvnamelist_surface.yaml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/generate_unittest_netcdfs.py b/test/generate_unittest_netcdfs.py index cac939e0..0bfc12bc 100644 --- a/test/generate_unittest_netcdfs.py +++ b/test/generate_unittest_netcdfs.py @@ -1126,7 +1126,7 @@ def copy_var_to_var(Group, invarname, outvarname, filename): # Surface - UKV output_full_cx_to_netcdf(['skin_temperature', 'surface_altitude', 'surface_pressure', 'uwind_at_10m', - 'vwind_at_10m', 'surface_temperature', 'relative_humidity_2m'], + 'vwind_at_10m', 'surface_temperature', 'relative_humidity_2m', 'visibility_1p5m',], ['potential_temperature', 'specific_humidity', 'cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water', 'cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water', 'air_pressure_levels', 'cloud_volume_fraction_in_atmosphere_layer', 'liquid_cloud_volume_fraction_in_atmosphere_layer', 'ice_cloud_volume_fraction_in_atmosphere_layer', @@ -1156,7 +1156,7 @@ def copy_var_to_var(Group, invarname, outvarname, filename): 'testinput/cx_globalnamelist_screen.nc4') # Oceanwinds - output_full_cx_to_netcdf(['skin_temperature', 'ice_area_fraction', 'surface_altitude', 'surface_pressure', + output_full_cx_to_netcdf(['skin_temperature', 'ice_area_fraction', 'surface_altitude', 'surface_pressure', 'uwind_at_10m', 'vwind_at_10m'], ['air_pressure_levels'], 'testinput/cx_globalnamelist_oceanwinds.nc4') diff --git a/test/testinput/cx_ukvnamelist_surface.nc4 b/test/testinput/cx_ukvnamelist_surface.nc4 index 324e8159f42e49b8cb9537b225e03aebef70ec8d..fead9c55b38fc8d9175a0bfbba61a8a411298afa 100644 GIT binary patch delta 1637 zcmcIkdrVtp6u;l?EnHe~Jj!}`l>#m8R%lC0DTOvGWp3RTpcz99VOb`X*iDdyre=); zCz*3TpxyZkvdEaIiHQkXAB%|u8eFGkbBl|Qm}q0NV9cVp%(&n({l0s-Soqg?lAGW8 zoqJy2x#zoIjiDBDaBw-QV2&4 z#V|*Y!y2+N(Z|QHgO%P-&oeMe-(zgm?j=~z`r&&?k|U9PG%KW_F{l>?SD?kMfLVJO zbwhdM1l!wsCfd>JJphYM?KLXw)ALR5TFu~-!9IV#tKR4^Zfd-KDen@0)*K2_y2Fsj zSmO$|6jET`**-o3i#wGZji`sD@^DLI7lsXi2boUrv1a_RaFNwRYF#&H>0u~KurFlk z&&veWC(}bj(2)xASS6%nbF?ofHX}ch4Ri99_cRBeLyCF)r#2dnsa2>8&Z%`s0q?2zDpn3@cW*R_mHQLgkNJ@fRV2C0Em_E9 zY0sP-kF*SiDg*GEj>TiW;eLksYi#?c&{gHjS5RagMDF_~{@PoeAwFG+CdtXLF}*1{ z=6~ddufjtOSNLySZ*YFwo=z`rYZMGxlbUTN*(j;m9_G~{rZ%SDVM3nmTiz-$ z|K;YO6N8$f5keVQBO>Cn5`pt6u}U_tL+&`MJ)XWxUc(sbgJpx7(I2I3uxjwi`Xd)~ z)G-`g3HF)@^S1unUi?XmQEaug3KfvWNG0ST*G_58}#CKxz)6?pWA- z7BS@~C%y)$WtxsR!dsRKI%0>?(6rg7_0M>FTE)q?RjS#ykZ-rQ&Pxou*z=y zKJpPo-I;a=`Dwq~kmO3YWGKUY_OQnc^UNXeHYJp5Y&daMwF84FgH5*^jGaL!F0$Z!UoSlrRc9o!R z4Q79utv#YE#&}~I!D__5ncLUbQMBH6h?;;i7tWaYYR8)sEZNzHP(c_k-#EW`)BgXO zf7!LUp7`}d>!Wur&yxDc2iKifSn|((VJ!PDS%2m^MB!_1Z_CPG_s)kAolMeEiKRo6#5u#3N6sm2DYwU+hsU94bmZIE*UWdP(&RNCx}bH zIWxjYaP8R^HA|R_Su&?=(rF|!2!2>KjbFqi6Qfx+W9F2Ak<5i`>V5aU#?o&lo-gP8 z&Y#~o@80w7)uVXv2tIDMF77~7+_FN0zYXYHB8{yKf0@}#eJW!tY}e`a61b_B(+!wwLlbTe{NEej(1vv!!cDFqRyRDmIjHl6Jm}QIIR}hqYVxWPgXGLwcfv@> z#XfkteJC++b7A4(tUfw|+wRn?z)G+bto8v~5Mo`$Xo=3Yy)q@_Wz`r6KGz#*Oo&y4 z(UcVx2>#}dt_p6bTR95>b>YfdX-kZ!5bBlIcc1E7W#)QCoJW{G4TLoo_Uxz21F-6h zz|QJ7+5IO*Hj&%2;lyf91!nJE{_J^J$o&phU3u*1ruUja?LLS*6R*0*Fx%YMJO*md z6f?)dIZrvW=7X<1rOeD$xJ}e>05o1JWAa0d*T$5E2+irls@H`r#aYvr5WKhL?r3_x zjzBX^)Q>XHI)HER=6=zz@IFEbTQo>d=fj4SP@2UcE$6MCm)FTcOp?=-mmtiV&qQCM z|LlZ68TYdlv(xjY0{ES zu;xogWIeNWBc6PF@e1YhZA)^}+Kg2(mC_cl`!O Date: Tue, 28 May 2024 15:26:31 +0100 Subject: [PATCH 03/17] Implement varfield logvis for horizontal visibility --- Varfields.md | 2 +- src/opsinputs/opsinputs_varobswriter_mod.F90 | 5 +- test/CMakeLists.txt | 3 ++ test/generate_unittest_netcdfs.py | 1 + .../009_VarField_horizontalVisibility.nc4 | Bin 0 -> 11977 bytes .../009_VarField_horizontalVisibility.yaml | 47 ++++++++++++++++++ 6 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 test/testinput/009_VarField_horizontalVisibility.nc4 create mode 100644 test/testinput/009_VarField_horizontalVisibility.yaml diff --git a/Varfields.md b/Varfields.md index edda8309..3f6e9c2e 100644 --- a/Varfields.md +++ b/Varfields.md @@ -10,7 +10,7 @@ | 3 | `VarField_rh` | `rh2(:)` or `rh(:,:)` | relative humidity | `ObsValue/relativeHumidity` (`ObsValue/relativeHumidityAt2M` for rh2) | | | 4 | `VarField_u` | `u10(:)` or `u(:,:)` | eastward wind | `ObsValue/windEastward` (`ObsValue/windEastwardAt10M` for u10) | | | 5 | `VarField_v` | `v10(:)` or `v(:,:)` | northward wind | `ObsValue/windNorthward` (`ObsValue/windNorthwardAt10M` for u10) | | -| 6 | `VarField_logvis` | | | | Implement | +| 6 | `VarField_logvis` | `logvis(:)` | Base 10 log of horizontal visibility (m) | `ObsValue/horizonalVisibility` | | | 7 | `VarField_tcwv` | `TCWV(:)` | total column water vapour | `ObsValue/precipitableWater` | | | 8 | `VarField_windspeed` | `WindSpeed(:)` | 10 metre windspeed | `ObsValue/WindSpeed` | | | 9 | `VarField_lwp` | | | | Implement | diff --git a/src/opsinputs/opsinputs_varobswriter_mod.F90 b/src/opsinputs/opsinputs_varobswriter_mod.F90 index 527c55e8..3717287a 100644 --- a/src/opsinputs/opsinputs_varobswriter_mod.F90 +++ b/src/opsinputs/opsinputs_varobswriter_mod.F90 @@ -856,8 +856,9 @@ subroutine opsinputs_varobswriter_populateobservations( & ObsSpace, self % channels, Flags, ObsErrors, self % VarobsLength, "windNorthward", "ObsValue") end if case (VarField_logvis) - ! TODO(someone): handle this varfield - ! call Ops_Alloc(Ob % Header % logvis, "logvis", Ob % Header % NumObsLocal, Ob % logvis) + call opsinputs_fill_fillelementtypefromsimulatedvariable( & + Ob % Header % logvis, "logvis", Ob % Header % NumObsLocal, Ob % logvis, & + ObsSpace, Flags, ObsErrors, "horizontalVisibility", "ObsValue") case (VarField_tcwv) if (Ob % Header % ObsGroup == ObsGroupSatTCWV) then call opsinputs_fill_fillelementtypefromsimulatedvariable(Ob % Header % tcwv, "TCWV", Ob % Header % NumObsLocal, Ob % tcwv, & diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 26d19ebd..2367121e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -145,6 +145,9 @@ ADD_WRITER_TEST(NAME varobswriter_007_VarField_tcwv ADD_WRITER_TEST(NAME varobswriter_008_VarField_WindSpeed YAML 008_VarField_WindSpeed.yaml DATA 008_VarField_WindSpeed.nc4) +ADD_WRITER_TEST(NAME varobswriter_009_VarField_horizontalVisibility + YAML 009_VarField_horizontalVisibility.yaml + DATA 009_VarField_horizontalVisibility.nc4) ADD_WRITER_TEST(NAME varobswriter_010_VarField_britemp YAML 010_VarField_britemp.yaml NAMELIST VarObsWriterNamelists_010_VarField_britemp/AMSUB.nl diff --git a/test/generate_unittest_netcdfs.py b/test/generate_unittest_netcdfs.py index 0bfc12bc..48a77333 100644 --- a/test/generate_unittest_netcdfs.py +++ b/test/generate_unittest_netcdfs.py @@ -700,6 +700,7 @@ def copy_var_to_var(Group, invarname, outvarname, filename): output_simulated_var_profiles_to_netcdf('windNorthward', 'testinput/005_VarField_v_Sonde.nc4') output_1d_simulated_var_to_netcdf('precipitableWater', 'testinput/007_VarField_tcwv.nc4') output_1d_simulated_var_to_netcdf('windSpeed', 'testinput/008_VarField_WindSpeed.nc4') + output_1d_simulated_var_to_netcdf('horizontalVisibility', 'testinput/009_VarField_horizontalVisibility.nc4') output_2d_simulated_var_to_netcdf('brightnessTemperature', 'testinput/010_VarField_britemp.nc4', with_bias=True) output_1d_normal_var_to_netcdf ('skinTemperature', 'OneDVar', 'testinput/011_VarField_tskin.nc4') output_2d_normal_var_to_netcdf ('cloudAmount', 'DerivedObsValue', 'testinput/015_VarField_cloud.nc4', use_chans=True) diff --git a/test/testinput/009_VarField_horizontalVisibility.nc4 b/test/testinput/009_VarField_horizontalVisibility.nc4 new file mode 100644 index 0000000000000000000000000000000000000000..ffa08ac24329300320064cc0d44716a8804d5029 GIT binary patch literal 11977 zcmeHNYitx%6u!H&ZI@+B3$(Tr5(bfn6*th<2BO;s+wCK6TWAT11}wYml#W?;ab^l= zG_>NQM2!9si@p7__R%YxmwmKS;bF)Y}R00tC#mLT!sR}mLmO2EMLgiJM6_43O+Vms>Y8pYe(^?^s|<(TE>{{+!a*rRz!$Dq zE+?w2!pkZS0e1mch2q2e_}KaT#SIooi3vV`RxJGY;S7ZpGB2(jiZu83vc*6`#o$x5 zbaaNhdONzi`g%jnkudW=3W&gj0x_Yhxiif9njIksHR}fA{SO2;1UA$KYQGq($cdel=7*gih=(qv_M=t`(YWC4L3ZG=AQB!x zsG$_D#s4l3*+98z@fTx9TuWMdzb;;rJ7fqt{MPss^8eS;7V3_0^ObJL+b~&LGo#lp zii^cgCz0)RlGaYAH?CL>o=!IGe6+D3J{qS!#cJyNs3Gh5vL-$WTHgjq_h%Wek@Vs$ z;L5Seg4gwAW4gwAW4gwAW4gwAW z4gwAW4gwAW4gxbG@Ln@xXW<(EjImFl{u3^?8GaLj%e$F9d!dbu!F3(3%Fo-5jEp>V zWW*c1JP`>(JIKGU<;N+0b7%JP8#}X)-_)6X{B*rMakTNBea}qw_n&U8tv%Oxd14}n z{S(KJH$c1Lhp(C@T|AY93Rv^dBvvP6B!}Vc4 zgXiMJPN8YWEZWW8?FVs*ftyzji>27d7e~L(MXpiJj~o&vUxv%Sn?fa08kJJglxXlD zh15T&qlB%;>}F56HQW>K3WfW4cC#K-jGUmQsHs`gY0h*mo_TRxq;nvZ4#`hS`A|(~ zAf(P1op_-Bs7ftS@3?;OiCidkeSRnvp?>qi;UI@-`lJnRda;mx?REO73U|Zwxe!)1 zkTUeAQb{YC*shzp@YS8G#bRu$tmn3hog4o8kByZ=$t!0)C9nh%>S$zmiO2M^g1fM( zR3nWS`Hg`wh)lgnD!fT>+^Hu9Fa^5n*zn7_RCsKy#3(lkH+CJpArsK@K5X(w&p9P`7A8WRU|sq_QYIaRu{Z0JRs($jH8-gwnk-N;hf7&oqWBf&zaor zrjAZ4NgXpfk3@ZYWUw1WI#$UE?_d4M5=K&TtNnu?cL|wiJqt2U7sAjG?G?`EhjHL> lpaWH`^_Ir*Gh_4T)HwK$ws2>v|8L_+$24gypKJ>({~Nj^4dDO) literal 0 HcmV?d00001 diff --git a/test/testinput/009_VarField_horizontalVisibility.yaml b/test/testinput/009_VarField_horizontalVisibility.yaml new file mode 100644 index 00000000..41672adb --- /dev/null +++ b/test/testinput/009_VarField_horizontalVisibility.yaml @@ -0,0 +1,47 @@ +time window: + begin: 2018-01-01T00:00:00Z + end: 2018-01-01T02:00:00Z + +observations: + - obs space: + name: Surface + obsdatain: + engine: + type: H5File + obsfile: Data/009_VarField_horizontalVisibility.nc4 + simulated variables: [horizontalVisibility] + obs filters: + # Double all observation errors: we want to check if error changes made by filters are + # propagated to VarObs files + - filter: BlackList + action: + name: inflate error + inflation factor: 2.0 + # Set the flag of observations with missing values to "pass": we want to check if these + # values are encoded correctly in the VarObsFile. + - filter: Reset Flags to Pass + flags_to_reset: [10, 15] # missing, Hfailed + # Reject observation 3: we want to check if it is omitted from the VarObs file, as expected. + - filter: Domain Check + where: + - variable: + name: MetaData/latitude + minvalue: 0.0 + - filter: VarObs Writer + reject_obs_with_any_variable_failing_qc: true + general_mode: debug + - filter: VarObs Checker + expected_main_table_columns: + # Only observations 1, 2 and 4 are passed; observation 3 is rejected by the domain check + field: ["6", "6", "6"] + ob value: ["1.10000", "-1073741824.00000", "1.40000"] + ob error: ["0.20000", "-1073741824.00000", "0.80000"] + # 1.111 is the missing value indicator for PGEs. VarObs files store PGEs multiplied by 10000. + pge: ["4210.00000", "11110.00000", "2380.00000"] + lat: ["21.00000", "22.00000", "24.00000"] + lon: ["31.00000", "32.00000", "34.00000"] + time: ["-3540.00000", "-3480.00000", "-3360.00000"] + Callsign: ["station_1", "station_2", "station_4"] + HofX: ObsValue # just a placeholder -- not used, but needed to force calls to postFilter. + benchmarkFlag: 1000 # just to keep the ObsFilters test happy + flaggedBenchmark: 0 From 6dafc8efaf3e239612015f09aa70c17a414abe97 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Wed, 29 May 2024 13:45:45 +0100 Subject: [PATCH 04/17] Add aerosol and qt2 to cx output Surface.nl --- etc/ukv/cx/Surface.nl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/ukv/cx/Surface.nl b/etc/ukv/cx/Surface.nl index 80430855..7ba677fd 100644 --- a/etc/ukv/cx/Surface.nl +++ b/etc/ukv/cx/Surface.nl @@ -15,8 +15,8 @@ ! 13 IndexCxTskinSea 24 Yes ! 16 IndexCxpmsl 16222 No ! 17 IndexCxSeaIce 31 No -! 20 IndexCxqt2 3255 No -! 21 IndexCxaerosol 90 No +! 20 IndexCxqt2 3255 Yes +! 21 IndexCxaerosol 90 Yes ! 22 IndexCxPSurfParamA 20000 No ! 23 IndexCxPSurfParamB 20001 No ! 24 IndexCxCloudAmount 9217 No @@ -42,5 +42,5 @@ ! 36 IndexCxRichNumber 3208 No ! 37 IndexCxSoilMoisture 8223 No ! 38 IndexCxSoilTemp 8225 No -CxFields=33,1,3236,3245,3209,3210,3247,24,4,2,3,10,407,12,254 +CxFields=33,1,3236,3245,3209,3210,3247,24,3255,90,4,2,3,10,407,12,254 / From a4df030aa7eaa8c1b8c16d5e3cdda05918fb6a1c Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Fri, 31 May 2024 17:25:34 +0100 Subject: [PATCH 05/17] Add and test aerosol and total water cx fields --- .../OpsMod_CXGenerate/Ops_CXSetupArrays.inc | 3 +++ deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 | 1 + src/opsinputs/opsinputs_cxfields_mod.F90 | 4 ++-- src/opsinputs/opsinputs_cxwriter_mod.F90 | 19 +++++++++--------- test/generate_unittest_netcdfs.py | 2 +- test/testinput/cx_ukvnamelist_surface.nc4 | Bin 17222 -> 17979 bytes .../cxwriter_ukvnamelist_surface.yaml | 8 ++++---- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc b/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc index 91044bab..172a349f 100644 --- a/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc +++ b/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc @@ -158,6 +158,9 @@ DO iGroup = -1, SIZE (Obs) CALL Ops_CXAddField (StashCode_qt2, & Cx % Header % qt2, & R1 = CX % qt2) + CALL Ops_CXAddField (StashCode_aerosol, & + Cx % Header % aerosol, & + R1 = CX % aerosol) CALL Ops_CXAddField (StashItem_SnowAmount, & Cx % Header % SnowAmount, & R1 = CX % SnowAmount) diff --git a/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 b/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 index 16ed32d1..48b69956 100644 --- a/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 +++ b/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 @@ -165,6 +165,7 @@ MODULE OpsMod_Stash INTEGER, PARAMETER :: StashCode_WIND_SPED = 6017 INTEGER, PARAMETER :: StashCode_WAVE_HGHT = 6001 INTEGER, PARAMETER :: StashCode_qt2 = 3255 +INTEGER, PARAMETER :: StashCode_aerosol = 90 INTEGER, PARAMETER :: StashCode_ObukhovLength = 3464 ! Obukhov length INTEGER, PARAMETER :: StashCode_FrictionVel = 3465 ! Friction velocity INTEGER, PARAMETER :: StashCode_BLtype = 3476 ! Boundary layer type diff --git a/src/opsinputs/opsinputs_cxfields_mod.F90 b/src/opsinputs/opsinputs_cxfields_mod.F90 index 9361680d..b24d18a6 100644 --- a/src/opsinputs/opsinputs_cxfields_mod.F90 +++ b/src/opsinputs/opsinputs_cxfields_mod.F90 @@ -29,8 +29,8 @@ module opsinputs_cxfields_mod character(len=*), parameter, public :: opsinputs_cxfields_pmsl = var_pmsl character(len=*), parameter, public :: opsinputs_cxfields_SeaIce = var_sfc_ifrac character(len=*), parameter, public :: opsinputs_cxfields_SnowAmount = opsinputs_cxfields_unknown -character(len=*), parameter, public :: opsinputs_cxfields_qt2 = opsinputs_cxfields_unknown -character(len=*), parameter, public :: opsinputs_cxfields_aerosol = opsinputs_cxfields_unknown +character(len=*), parameter, public :: opsinputs_cxfields_qt2 = "qt_1p5m" +character(len=*), parameter, public :: opsinputs_cxfields_aerosol = "aerosol" character(len=*), parameter, public :: opsinputs_cxfields_PSurfParamA = "surf_param_a" character(len=*), parameter, public :: opsinputs_cxfields_PSurfParamB = "surf_param_b" character(len=*), parameter, public :: opsinputs_cxfields_LapseRate = opsinputs_cxfields_unknown diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index 2b23f0a6..b3394dcc 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -643,8 +643,8 @@ subroutine opsinputs_cxwriter_addrequiredgeovars(self, geovars) GeoVarName = opsinputs_cxfields_SnowAmount case (StashCode_qt2) ! IndexCxqt2 GeoVarName = opsinputs_cxfields_qt2 - ! wsmigaj: I haven't been able to identify the stash code associated with this field - ! GeoVarName = opsinputs_cxfields_aerosol + case (StashCode_aerosol) ! IndexCxaerosol + GeoVarName = opsinputs_cxfields_aerosol case (StashCode_PsurfParamA) ! IndexCxPsurfParamA GeoVarName = opsinputs_cxfields_PSurfParamA case (StashCode_PSurfParamB) ! IndexCxPSurfParamB @@ -775,7 +775,7 @@ subroutine opsinputs_cxwriter_addrequiredgeovars(self, geovars) end if end select - + if (GeoVarName /= opsinputs_cxfields_unknown) then call geovars % push_back(GeoVarName) end if @@ -973,13 +973,12 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) call opsinputs_fill_fillrealfromgeoval( & Cx % Header % qt2, "qt2", Cx % Header % NumLocal, Cx % qt2, & self % GeoVals, opsinputs_cxfields_qt2, self % JediToOpsLayoutMapping) - ! wsmigaj: I haven't been able to identify the stash code associated with this field - ! case (?) ! IndexCxaerosol - ! if (Cx % Header % ObsGroup == ObsGroupSurface) then - ! call opsinputs_fill_fillrealfromgeoval( & - ! Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & - ! self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) - ! end if + case (StashCode_aerosol) ! IndexCxaerosol + if (Cx % Header % ObsGroup == ObsGroupSurface) then + call opsinputs_fill_fillrealfromgeoval( & + Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & + self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) + end if case (StashCode_PsurfParamA) ! IndexCxPsurfParamA call opsinputs_fill_fillrealfromgeoval( & Cx % Header % PSurfParamA, "PSurfParamA", Cx % Header % NumLocal, Cx % PSurfParamA, & diff --git a/test/generate_unittest_netcdfs.py b/test/generate_unittest_netcdfs.py index 48a77333..f81d8023 100644 --- a/test/generate_unittest_netcdfs.py +++ b/test/generate_unittest_netcdfs.py @@ -1127,7 +1127,7 @@ def copy_var_to_var(Group, invarname, outvarname, filename): # Surface - UKV output_full_cx_to_netcdf(['skin_temperature', 'surface_altitude', 'surface_pressure', 'uwind_at_10m', - 'vwind_at_10m', 'surface_temperature', 'relative_humidity_2m', 'visibility_1p5m',], + 'vwind_at_10m', 'surface_temperature', 'relative_humidity_2m', 'visibility_1p5m','qt_1p5m','aerosol'], ['potential_temperature', 'specific_humidity', 'cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water', 'cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water', 'air_pressure_levels', 'cloud_volume_fraction_in_atmosphere_layer', 'liquid_cloud_volume_fraction_in_atmosphere_layer', 'ice_cloud_volume_fraction_in_atmosphere_layer', diff --git a/test/testinput/cx_ukvnamelist_surface.nc4 b/test/testinput/cx_ukvnamelist_surface.nc4 index fead9c55b38fc8d9175a0bfbba61a8a411298afa..22f54eab7123187cb5b2f7098ba5cb7f46eb50c5 100644 GIT binary patch delta 628 zcmX@s#<;tOae|DBwHpH%7(gfnn^#iH{5@QPn0U4@DS^e9#U?teW?@k`*)#FIhqNd| zr3*yqAw~!-D#O46WHF0RPSlo~yn(52@-IeH7OA49d7F)yYB?CyCJSoj3ncSji+L#vlf91A~R}f-|~Tg3Bf!P)(UEt@2wGAr)9?cgii; z1L$h+$=a&!EJvAFNo_7uoyNvBU+pFv!!l+D2C2#1I(}S&8+KMQ^nke$I#n!TKW#n% z?Pp=!{6W`9`Y7|{ zCWm0ggvp9_$2io0;u`XQv?tfvdT)+(NMU5@VPp`UEMV`;DGV{2L3nbVdidnM_6JlN zfhHjXnDsER)q9pyOm1`tVJrZftqv65p80L| zigEJ?T_Z*orY~0aCV%8QwfTd-AQOvxW&gF!tVZRGlfQG7Z2n-Z&(2fAz|g}Cw3z28 zN9|^9>!Zw*t6XGQau^weC*NoBR diff --git a/test/testinput/cxwriter_ukvnamelist_surface.yaml b/test/testinput/cxwriter_ukvnamelist_surface.yaml index 5aa3c71b..572017f3 100644 --- a/test/testinput/cxwriter_ukvnamelist_surface.yaml +++ b/test/testinput/cxwriter_ukvnamelist_surface.yaml @@ -29,21 +29,21 @@ observations: general_mode: debug IC_PLevels: 5 - filter: Cx Checker - expected_surface_variables: ["1","2","3","4","5","6","8","13"] + expected_surface_variables: ["1","2","3","4","5","6","8","13","20","21"] expected_upper_air_variables: ["1","3","4","5","11","29","30"] expected_main_table_columns: - # observation 3 is rejected by the tests above hence only 3 (1,2,4) columns - ["17.10","27.10","57.10","67.10","37.10","47.10","77.10", - "7.10","1.10","1.20","1.30","81.10","81.20","81.30", + "7.10","87.10","97.10","1.10","1.20","1.30","81.10","81.20","81.30", "91.10","91.20","91.30","11.10","11.20","11.30", "41.10","41.20","41.30","21.10","21.20","21.30", "31.10","31.20","31.30"] # column 1 - 1st observation - ["**********","**********","**********","**********","**********","**********","**********","**********", - "2.10","**********","2.30","82.10","**********","82.30","92.10","**********","92.30","12.10", + "**********","**********","2.10","**********","2.30","82.10","**********","82.30","92.10","**********","92.30","12.10", "**********","12.30","42.10","**********","42.30","22.10","**********","22.30","32.10","**********", "32.30"] # column 2 - 2nd observation - ["17.40","27.40","57.40","67.40","37.40","47.40","77.40", - "7.40","4.10","4.20","4.30","84.10","84.20","84.30", + "7.40","87.40","97.40","4.10","4.20","4.30","84.10","84.20","84.30", "94.10","94.20","94.30","14.10","14.20","14.30", "44.10","44.20","44.30","24.10","24.20","24.30", "34.10","34.20","34.30"] # column 3 - observation 4 From 1bb02496af4a34cdb08dde2c22d67e35ccad4865 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Wed, 12 Jun 2024 13:41:32 +0100 Subject: [PATCH 06/17] Rename aerosol cx field logm VAR expects aerosol (for visibility) to be called logm. --- deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc | 4 ++-- src/opsinputs/opsinputs_cxwriter_mod.F90 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc b/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc index 172a349f..fd94cd3b 100644 --- a/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc +++ b/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc @@ -159,8 +159,8 @@ DO iGroup = -1, SIZE (Obs) Cx % Header % qt2, & R1 = CX % qt2) CALL Ops_CXAddField (StashCode_aerosol, & - Cx % Header % aerosol, & - R1 = CX % aerosol) + Cx % Header % logm, & + R1 = CX % logm) ! note called logm not aerosol CALL Ops_CXAddField (StashItem_SnowAmount, & Cx % Header % SnowAmount, & R1 = CX % SnowAmount) diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index b3394dcc..f15b5bfd 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -976,9 +976,9 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) case (StashCode_aerosol) ! IndexCxaerosol if (Cx % Header % ObsGroup == ObsGroupSurface) then call opsinputs_fill_fillrealfromgeoval( & - Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & + Cx % Header % logm, "logm", Cx % Header % NumLocal, Cx % logm, & self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) - end if + end if ! note named logm rather than aerosol case (StashCode_PsurfParamA) ! IndexCxPsurfParamA call opsinputs_fill_fillrealfromgeoval( & Cx % Header % PSurfParamA, "PSurfParamA", Cx % Header % NumLocal, Cx % PSurfParamA, & From 0e94e4a02dd803a9ce6a747e153606197ddcf1af Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Wed, 12 Jun 2024 16:42:21 +0100 Subject: [PATCH 07/17] remove changes to OPS --- deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc | 3 --- deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 | 1 - 2 files changed, 4 deletions(-) diff --git a/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc b/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc index fd94cd3b..91044bab 100644 --- a/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc +++ b/deps/ops/stubs/OpsMod_CXGenerate/Ops_CXSetupArrays.inc @@ -158,9 +158,6 @@ DO iGroup = -1, SIZE (Obs) CALL Ops_CXAddField (StashCode_qt2, & Cx % Header % qt2, & R1 = CX % qt2) - CALL Ops_CXAddField (StashCode_aerosol, & - Cx % Header % logm, & - R1 = CX % logm) ! note called logm not aerosol CALL Ops_CXAddField (StashItem_SnowAmount, & Cx % Header % SnowAmount, & R1 = CX % SnowAmount) diff --git a/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 b/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 index 48b69956..16ed32d1 100644 --- a/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 +++ b/deps/ops/stubs/Ops_Constants/OpsMod_Stash.f90 @@ -165,7 +165,6 @@ MODULE OpsMod_Stash INTEGER, PARAMETER :: StashCode_WIND_SPED = 6017 INTEGER, PARAMETER :: StashCode_WAVE_HGHT = 6001 INTEGER, PARAMETER :: StashCode_qt2 = 3255 -INTEGER, PARAMETER :: StashCode_aerosol = 90 INTEGER, PARAMETER :: StashCode_ObukhovLength = 3464 ! Obukhov length INTEGER, PARAMETER :: StashCode_FrictionVel = 3465 ! Friction velocity INTEGER, PARAMETER :: StashCode_BLtype = 3476 ! Boundary layer type From aedc80f9fa3c186e4536b79880dad3bd907ad82a Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Wed, 12 Jun 2024 16:45:58 +0100 Subject: [PATCH 08/17] Use correct OPS aerosol stash code name --- src/opsinputs/opsinputs_cxwriter_mod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index f15b5bfd..37e6e268 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -643,7 +643,7 @@ subroutine opsinputs_cxwriter_addrequiredgeovars(self, geovars) GeoVarName = opsinputs_cxfields_SnowAmount case (StashCode_qt2) ! IndexCxqt2 GeoVarName = opsinputs_cxfields_qt2 - case (StashCode_aerosol) ! IndexCxaerosol + case (StashItem_aerosol) ! IndexCxaerosol GeoVarName = opsinputs_cxfields_aerosol case (StashCode_PsurfParamA) ! IndexCxPsurfParamA GeoVarName = opsinputs_cxfields_PSurfParamA @@ -973,7 +973,7 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) call opsinputs_fill_fillrealfromgeoval( & Cx % Header % qt2, "qt2", Cx % Header % NumLocal, Cx % qt2, & self % GeoVals, opsinputs_cxfields_qt2, self % JediToOpsLayoutMapping) - case (StashCode_aerosol) ! IndexCxaerosol + case (StashItem_aerosol) ! IndexCxaerosol if (Cx % Header % ObsGroup == ObsGroupSurface) then call opsinputs_fill_fillrealfromgeoval( & Cx % Header % logm, "logm", Cx % Header % NumLocal, Cx % logm, & From e9ecdb57fb5b706ee11e902e39e77d44b741e06f Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 8 Jul 2024 11:45:20 +0100 Subject: [PATCH 09/17] rename logm aerosol again A search using the stash code reveals that the field using the correct stash code is named aerosol rather than logm. --- src/opsinputs/opsinputs_cxwriter_mod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index 37e6e268..c3ae4e63 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -976,9 +976,9 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) case (StashItem_aerosol) ! IndexCxaerosol if (Cx % Header % ObsGroup == ObsGroupSurface) then call opsinputs_fill_fillrealfromgeoval( & - Cx % Header % logm, "logm", Cx % Header % NumLocal, Cx % logm, & + Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) - end if ! note named logm rather than aerosol + end if case (StashCode_PsurfParamA) ! IndexCxPsurfParamA call opsinputs_fill_fillrealfromgeoval( & Cx % Header % PSurfParamA, "PSurfParamA", Cx % Header % NumLocal, Cx % PSurfParamA, & From e28295b1e187402bf8996b32edaa929d65be218a Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 29 Jul 2024 17:25:19 +0100 Subject: [PATCH 10/17] WIP: Working aerosol output! tests may fail. --- src/opsinputs/opsinputs_cxwriter_mod.F90 | 14 ++-- src/opsinputs/opsinputs_fill_mod.F90 | 99 +++++++++++++++++++++--- 2 files changed, 98 insertions(+), 15 deletions(-) diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index c3ae4e63..5169c9ec 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -974,11 +974,15 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) Cx % Header % qt2, "qt2", Cx % Header % NumLocal, Cx % qt2, & self % GeoVals, opsinputs_cxfields_qt2, self % JediToOpsLayoutMapping) case (StashItem_aerosol) ! IndexCxaerosol - if (Cx % Header % ObsGroup == ObsGroupSurface) then - call opsinputs_fill_fillrealfromgeoval( & - Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & - self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) - end if + print *, "Extracting aerosol with stash code.", StashItem_aerosol + call opsinputs_fill_fillrealfromgeoval( & + Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & + self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) + print *, "Extracted aerosol with stash code!", StashItem_aerosol + ! if (Cx % Header % ObsGroup == ObsGroupSurface) then + ! call opsinputs_fill_fillrealfromgeoval( & + ! Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & + ! self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) case (StashCode_PsurfParamA) ! IndexCxPsurfParamA call opsinputs_fill_fillrealfromgeoval( & Cx % Header % PSurfParamA, "PSurfParamA", Cx % Header % NumLocal, Cx % PSurfParamA, & diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index f2404abc..c342fea7 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1088,8 +1088,8 @@ subroutine opsinputs_fill_fillreal2d_norecords( & !e.g. HIRS in ATOVS stream numchans = size(JediVarNamesWithChannels) -!sizeOfVarobsArray comes from intitial setting of size_of_varobs_array -! used to define the size of the channel array to fill. +!sizeOfVarobsArray comes from intitial setting of size_of_varobs_array +! used to define the size of the channel array to fill. if (present(sizeOfVarobsArray)) then if (sizeOfVarobsArray > 0) then numchans = sizeOfVarobsArray @@ -1121,7 +1121,7 @@ subroutine opsinputs_fill_fillreal2d_norecords( & else exit end if - else + else if (.not. compressChannels) then arrayindex = Channels(iChannel) end if @@ -1372,25 +1372,104 @@ subroutine opsinputs_fill_fillrealfromgeoval( & MissingReal = missing_value(0.0_c_float) if (JediToOpsLayoutMapping % ConvertRecordsToMultiLevelObs) then + print *, "Using opsinputs_fill_fillrealfromgeovalformultilevelobs. JediVarName:", JediVarName + print *, "JediToOpsLayoutMapping % NumOpsObs:", JediToOpsLayoutMapping % NumOpsObs call opsinputs_fill_fillrealfromgeovalformultilevelobs( & Hdr, OpsVarName, JediToOpsLayoutMapping % NumOpsObs, Real1, & GeoVals, JediVarName, JediToOpsLayoutMapping) else + print *, "Retieving geoval directly. JediVarName:", JediVarName + print *, "JediToOpsLayoutMapping % NumOpsObs:", JediToOpsLayoutMapping % NumOpsObs ! Try to retrieve GeoVal call ufo_geovals_get_var(GeoVals, JediVarName, GeoVal, must_be_found = .false.) if (associated(GeoVal)) then if (GeoVal % nval /= 1) then - write (ErrorMessage, '("GeoVal ",A," contains more than one value per location. & - &Only the first of these values will be written to the VarObs file")') JediVarName + write (ErrorMessage, '("GeoVal ",A," contains ",I0," values per location. & + &Only the first of these values will be written to the VarObs file")') JediVarName, GeoVal % nval call gen_warn(RoutineName, ErrorMessage) end if end if ! Fill the OPS data structures call Ops_Alloc(Hdr, OpsVarName, NumObs, Real1) - where (GeoVal % vals(1,:) /= MissingReal) - Real1 = GeoVal % vals(1,:) - end where + if (JediVarName == "aerosol") then + ! print GeoVal % vals(1,1) to GeoVal % vals(70,1) + print *, "GeoVal % vals(1,1):", GeoVal % vals(1,1) + print *, "GeoVal % vals(2,1):", GeoVal % vals(2,1) + print *, "GeoVal % vals(3,1):", GeoVal % vals(3,1) + print *, "GeoVal % vals(4,1):", GeoVal % vals(4,1) + print *, "GeoVal % vals(5,1):", GeoVal % vals(5,1) + print *, "GeoVal % vals(6,1):", GeoVal % vals(6,1) + print *, "GeoVal % vals(7,1):", GeoVal % vals(7,1) + print *, "GeoVal % vals(8,1):", GeoVal % vals(8,1) + print *, "GeoVal % vals(9,1):", GeoVal % vals(9,1) + print *, "GeoVal % vals(10,1):", GeoVal % vals(10,1) + print *, "GeoVal % vals(11,1):", GeoVal % vals(11,1) + print *, "GeoVal % vals(12,1):", GeoVal % vals(12,1) + print *, "GeoVal % vals(13,1):", GeoVal % vals(13,1) + print *, "GeoVal % vals(14,1):", GeoVal % vals(14,1) + print *, "GeoVal % vals(15,1):", GeoVal % vals(15,1) + print *, "GeoVal % vals(16,1):", GeoVal % vals(16,1) + print *, "GeoVal % vals(17,1):", GeoVal % vals(17,1) + print *, "GeoVal % vals(18,1):", GeoVal % vals(18,1) + print *, "GeoVal % vals(19,1):", GeoVal % vals(19,1) + print *, "GeoVal % vals(20,1):", GeoVal % vals(20,1) + print *, "GeoVal % vals(21,1):", GeoVal % vals(21,1) + print *, "GeoVal % vals(22,1):", GeoVal % vals(22,1) + print *, "GeoVal % vals(23,1):", GeoVal % vals(23,1) + print *, "GeoVal % vals(24,1):", GeoVal % vals(24,1) + print *, "GeoVal % vals(25,1):", GeoVal % vals(25,1) + print *, "GeoVal % vals(26,1):", GeoVal % vals(26,1) + print *, "GeoVal % vals(27,1):", GeoVal % vals(27,1) + print *, "GeoVal % vals(28,1):", GeoVal % vals(28,1) + print *, "GeoVal % vals(29,1):", GeoVal % vals(29,1) + print *, "GeoVal % vals(30,1):", GeoVal % vals(30,1) + print *, "GeoVal % vals(31,1):", GeoVal % vals(31,1) + print *, "GeoVal % vals(32,1):", GeoVal % vals(32,1) + print *, "GeoVal % vals(33,1):", GeoVal % vals(33,1) + print *, "GeoVal % vals(34,1):", GeoVal % vals(34,1) + print *, "GeoVal % vals(35,1):", GeoVal % vals(35,1) + print *, "GeoVal % vals(36,1):", GeoVal % vals(36,1) + print *, "GeoVal % vals(37,1):", GeoVal % vals(37,1) + print *, "GeoVal % vals(38,1):", GeoVal % vals(38,1) + print *, "GeoVal % vals(39,1):", GeoVal % vals(39,1) + print *, "GeoVal % vals(40,1):", GeoVal % vals(40,1) + print *, "GeoVal % vals(41,1):", GeoVal % vals(41,1) + print *, "GeoVal % vals(42,1):", GeoVal % vals(42,1) + print *, "GeoVal % vals(43,1):", GeoVal % vals(43,1) + print *, "GeoVal % vals(44,1):", GeoVal % vals(44,1) + print *, "GeoVal % vals(45,1):", GeoVal % vals(45,1) + print *, "GeoVal % vals(46,1):", GeoVal % vals(46,1) + print *, "GeoVal % vals(47,1):", GeoVal % vals(47,1) + print *, "GeoVal % vals(48,1):", GeoVal % vals(48,1) + print *, "GeoVal % vals(49,1):", GeoVal % vals(49,1) + print *, "GeoVal % vals(50,1):", GeoVal % vals(50,1) + print *, "GeoVal % vals(51,1):", GeoVal % vals(51,1) + print *, "GeoVal % vals(52,1):", GeoVal % vals(52,1) + print *, "GeoVal % vals(53,1):", GeoVal % vals(53,1) + print *, "GeoVal % vals(54,1):", GeoVal % vals(54,1) + print *, "GeoVal % vals(55,1):", GeoVal % vals(55,1) + print *, "GeoVal % vals(56,1):", GeoVal % vals(56,1) + print *, "GeoVal % vals(57,1):", GeoVal % vals(57,1) + print *, "GeoVal % vals(58,1):", GeoVal % vals(58,1) + print *, "GeoVal % vals(59,1):", GeoVal % vals(59,1) + print *, "GeoVal % vals(60,1):", GeoVal % vals(60,1) + print *, "GeoVal % vals(61,1):", GeoVal % vals(61,1) + print *, "GeoVal % vals(62,1):", GeoVal % vals(62,1) + print *, "GeoVal % vals(63,1):", GeoVal % vals(63,1) + print *, "GeoVal % vals(64,1):", GeoVal % vals(64,1) + print *, "GeoVal % vals(65,1):", GeoVal % vals(65,1) + print *, "GeoVal % vals(66,1):", GeoVal % vals(66,1) + print *, "GeoVal % vals(67,1):", GeoVal % vals(67,1) + print *, "GeoVal % vals(68,1):", GeoVal % vals(68,1) + print *, "GeoVal % vals(69,1):", GeoVal % vals(69,1) + print *, "GeoVal % vals(70,1):", GeoVal % vals(70,1) + Real1 = GeoVal % vals(70,:) + else + where (GeoVal % vals(1,:) /= MissingReal) + Real1 = GeoVal % vals(1,:) + end where + end if end if end subroutine opsinputs_fill_fillrealfromgeoval @@ -2583,13 +2662,13 @@ subroutine opsinputs_fill_setpgefinal(PGE, MissingDouble, PackPGEs, Element) end if if (PackPGEs) then - ! For varfields which Ops_VarobPGEs expects PGEs in packed form: + ! For varfields which Ops_VarobPGEs expects PGEs in packed form: ! pack consistent with OPS by multiplying by PPF and then truncate. Element % PGEFinal = Element % PGEFinal * PPF Element % PGEFinal = AINT(Element % PGEFinal) else ! Varfields which Ops_VarobPGEs expects PGEs in unpacked form, - ! To reduce the error (and avoid having to take the truncation error into account when preparing + ! To reduce the error (and avoid having to take the truncation error into account when preparing ! known good outputs for tests), round the number after multiplying by PPF and then divide to undo. Element % PGEFinal = Element % PGEFinal * PPF Element % PGEFinal = NINT(Element % PGEFinal) From 1102379ef67d4e35f24a49cea67a4b9e29777fcd Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 12 Aug 2024 12:10:38 +0100 Subject: [PATCH 11/17] Remove print statements --- src/opsinputs/opsinputs_cxwriter_mod.F90 | 2 - src/opsinputs/opsinputs_fill_mod.F90 | 75 ------------------------ 2 files changed, 77 deletions(-) diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index 5169c9ec..3eb0d71f 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -974,11 +974,9 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) Cx % Header % qt2, "qt2", Cx % Header % NumLocal, Cx % qt2, & self % GeoVals, opsinputs_cxfields_qt2, self % JediToOpsLayoutMapping) case (StashItem_aerosol) ! IndexCxaerosol - print *, "Extracting aerosol with stash code.", StashItem_aerosol call opsinputs_fill_fillrealfromgeoval( & Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) - print *, "Extracted aerosol with stash code!", StashItem_aerosol ! if (Cx % Header % ObsGroup == ObsGroupSurface) then ! call opsinputs_fill_fillrealfromgeoval( & ! Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index c342fea7..853f03da 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1372,14 +1372,10 @@ subroutine opsinputs_fill_fillrealfromgeoval( & MissingReal = missing_value(0.0_c_float) if (JediToOpsLayoutMapping % ConvertRecordsToMultiLevelObs) then - print *, "Using opsinputs_fill_fillrealfromgeovalformultilevelobs. JediVarName:", JediVarName - print *, "JediToOpsLayoutMapping % NumOpsObs:", JediToOpsLayoutMapping % NumOpsObs call opsinputs_fill_fillrealfromgeovalformultilevelobs( & Hdr, OpsVarName, JediToOpsLayoutMapping % NumOpsObs, Real1, & GeoVals, JediVarName, JediToOpsLayoutMapping) else - print *, "Retieving geoval directly. JediVarName:", JediVarName - print *, "JediToOpsLayoutMapping % NumOpsObs:", JediToOpsLayoutMapping % NumOpsObs ! Try to retrieve GeoVal call ufo_geovals_get_var(GeoVals, JediVarName, GeoVal, must_be_found = .false.) if (associated(GeoVal)) then @@ -1393,77 +1389,6 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Fill the OPS data structures call Ops_Alloc(Hdr, OpsVarName, NumObs, Real1) if (JediVarName == "aerosol") then - ! print GeoVal % vals(1,1) to GeoVal % vals(70,1) - print *, "GeoVal % vals(1,1):", GeoVal % vals(1,1) - print *, "GeoVal % vals(2,1):", GeoVal % vals(2,1) - print *, "GeoVal % vals(3,1):", GeoVal % vals(3,1) - print *, "GeoVal % vals(4,1):", GeoVal % vals(4,1) - print *, "GeoVal % vals(5,1):", GeoVal % vals(5,1) - print *, "GeoVal % vals(6,1):", GeoVal % vals(6,1) - print *, "GeoVal % vals(7,1):", GeoVal % vals(7,1) - print *, "GeoVal % vals(8,1):", GeoVal % vals(8,1) - print *, "GeoVal % vals(9,1):", GeoVal % vals(9,1) - print *, "GeoVal % vals(10,1):", GeoVal % vals(10,1) - print *, "GeoVal % vals(11,1):", GeoVal % vals(11,1) - print *, "GeoVal % vals(12,1):", GeoVal % vals(12,1) - print *, "GeoVal % vals(13,1):", GeoVal % vals(13,1) - print *, "GeoVal % vals(14,1):", GeoVal % vals(14,1) - print *, "GeoVal % vals(15,1):", GeoVal % vals(15,1) - print *, "GeoVal % vals(16,1):", GeoVal % vals(16,1) - print *, "GeoVal % vals(17,1):", GeoVal % vals(17,1) - print *, "GeoVal % vals(18,1):", GeoVal % vals(18,1) - print *, "GeoVal % vals(19,1):", GeoVal % vals(19,1) - print *, "GeoVal % vals(20,1):", GeoVal % vals(20,1) - print *, "GeoVal % vals(21,1):", GeoVal % vals(21,1) - print *, "GeoVal % vals(22,1):", GeoVal % vals(22,1) - print *, "GeoVal % vals(23,1):", GeoVal % vals(23,1) - print *, "GeoVal % vals(24,1):", GeoVal % vals(24,1) - print *, "GeoVal % vals(25,1):", GeoVal % vals(25,1) - print *, "GeoVal % vals(26,1):", GeoVal % vals(26,1) - print *, "GeoVal % vals(27,1):", GeoVal % vals(27,1) - print *, "GeoVal % vals(28,1):", GeoVal % vals(28,1) - print *, "GeoVal % vals(29,1):", GeoVal % vals(29,1) - print *, "GeoVal % vals(30,1):", GeoVal % vals(30,1) - print *, "GeoVal % vals(31,1):", GeoVal % vals(31,1) - print *, "GeoVal % vals(32,1):", GeoVal % vals(32,1) - print *, "GeoVal % vals(33,1):", GeoVal % vals(33,1) - print *, "GeoVal % vals(34,1):", GeoVal % vals(34,1) - print *, "GeoVal % vals(35,1):", GeoVal % vals(35,1) - print *, "GeoVal % vals(36,1):", GeoVal % vals(36,1) - print *, "GeoVal % vals(37,1):", GeoVal % vals(37,1) - print *, "GeoVal % vals(38,1):", GeoVal % vals(38,1) - print *, "GeoVal % vals(39,1):", GeoVal % vals(39,1) - print *, "GeoVal % vals(40,1):", GeoVal % vals(40,1) - print *, "GeoVal % vals(41,1):", GeoVal % vals(41,1) - print *, "GeoVal % vals(42,1):", GeoVal % vals(42,1) - print *, "GeoVal % vals(43,1):", GeoVal % vals(43,1) - print *, "GeoVal % vals(44,1):", GeoVal % vals(44,1) - print *, "GeoVal % vals(45,1):", GeoVal % vals(45,1) - print *, "GeoVal % vals(46,1):", GeoVal % vals(46,1) - print *, "GeoVal % vals(47,1):", GeoVal % vals(47,1) - print *, "GeoVal % vals(48,1):", GeoVal % vals(48,1) - print *, "GeoVal % vals(49,1):", GeoVal % vals(49,1) - print *, "GeoVal % vals(50,1):", GeoVal % vals(50,1) - print *, "GeoVal % vals(51,1):", GeoVal % vals(51,1) - print *, "GeoVal % vals(52,1):", GeoVal % vals(52,1) - print *, "GeoVal % vals(53,1):", GeoVal % vals(53,1) - print *, "GeoVal % vals(54,1):", GeoVal % vals(54,1) - print *, "GeoVal % vals(55,1):", GeoVal % vals(55,1) - print *, "GeoVal % vals(56,1):", GeoVal % vals(56,1) - print *, "GeoVal % vals(57,1):", GeoVal % vals(57,1) - print *, "GeoVal % vals(58,1):", GeoVal % vals(58,1) - print *, "GeoVal % vals(59,1):", GeoVal % vals(59,1) - print *, "GeoVal % vals(60,1):", GeoVal % vals(60,1) - print *, "GeoVal % vals(61,1):", GeoVal % vals(61,1) - print *, "GeoVal % vals(62,1):", GeoVal % vals(62,1) - print *, "GeoVal % vals(63,1):", GeoVal % vals(63,1) - print *, "GeoVal % vals(64,1):", GeoVal % vals(64,1) - print *, "GeoVal % vals(65,1):", GeoVal % vals(65,1) - print *, "GeoVal % vals(66,1):", GeoVal % vals(66,1) - print *, "GeoVal % vals(67,1):", GeoVal % vals(67,1) - print *, "GeoVal % vals(68,1):", GeoVal % vals(68,1) - print *, "GeoVal % vals(69,1):", GeoVal % vals(69,1) - print *, "GeoVal % vals(70,1):", GeoVal % vals(70,1) Real1 = GeoVal % vals(70,:) else where (GeoVal % vals(1,:) /= MissingReal) From de4350e42ffec3c3184b5f39e82bb02924fa6b5f Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 12 Aug 2024 13:50:41 +0100 Subject: [PATCH 12/17] Comment and correct aerosol behaviour --- src/opsinputs/opsinputs_cxwriter_mod.F90 | 5 +---- src/opsinputs/opsinputs_fill_mod.F90 | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/opsinputs/opsinputs_cxwriter_mod.F90 b/src/opsinputs/opsinputs_cxwriter_mod.F90 index 3eb0d71f..7a71ed35 100644 --- a/src/opsinputs/opsinputs_cxwriter_mod.F90 +++ b/src/opsinputs/opsinputs_cxwriter_mod.F90 @@ -974,13 +974,10 @@ subroutine opsinputs_cxwriter_populatecx(self, ReportFlags, Cx) Cx % Header % qt2, "qt2", Cx % Header % NumLocal, Cx % qt2, & self % GeoVals, opsinputs_cxfields_qt2, self % JediToOpsLayoutMapping) case (StashItem_aerosol) ! IndexCxaerosol + ! Note this is treated specially, see opsinputs_fill_fillrealfromgeoval call opsinputs_fill_fillrealfromgeoval( & Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) - ! if (Cx % Header % ObsGroup == ObsGroupSurface) then - ! call opsinputs_fill_fillrealfromgeoval( & - ! Cx % Header % aerosol, "aerosol", Cx % Header % NumLocal, Cx % aerosol, & - ! self % GeoVals, opsinputs_cxfields_aerosol, self % JediToOpsLayoutMapping) case (StashCode_PsurfParamA) ! IndexCxPsurfParamA call opsinputs_fill_fillrealfromgeoval( & Cx % Header % PSurfParamA, "PSurfParamA", Cx % Header % NumLocal, Cx % PSurfParamA, & diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index 853f03da..eaed1906 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1380,16 +1380,26 @@ subroutine opsinputs_fill_fillrealfromgeoval( & call ufo_geovals_get_var(GeoVals, JediVarName, GeoVal, must_be_found = .false.) if (associated(GeoVal)) then if (GeoVal % nval /= 1) then - write (ErrorMessage, '("GeoVal ",A," contains ",I0," values per location. & - &Only the first of these values will be written to the VarObs file")') JediVarName, GeoVal % nval - call gen_warn(RoutineName, ErrorMessage) + if (JediVarName /= "aerosol") then ! special case - see below + write (ErrorMessage, '("GeoVal ",A," contains ",I0," values per location. & + &Only the first of these values will be written to the VarObs file")') JediVarName, GeoVal % nval + call gen_warn(RoutineName, ErrorMessage) + end if end if end if ! Fill the OPS data structures call Ops_Alloc(Hdr, OpsVarName, NumObs, Real1) if (JediVarName == "aerosol") then - Real1 = GeoVal % vals(70,:) + ! This field "Total Aerosol (for Vis)" exists on 70 levels, but OPS only + ! outputs (and VAR expects) a single value at the surface (GeoVal level + ! 70 or cx level 1) for the calculation of visibility. See + ! Ops_BGEandCXCreate.inc line 166 and Ops_CxComplete.inc line 299. This + ! field is only used for surface visibility calculations so no further + ! specific handling is required. + where (GeoVal % vals(70,:) /= MissingReal) + Real1 = GeoVal % vals(70,:) + end where else where (GeoVal % vals(1,:) /= MissingReal) Real1 = GeoVal % vals(1,:) From 3669f7a10b860f49e8f7a8f0dc45442e0b866334 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 12 Aug 2024 16:05:00 +0100 Subject: [PATCH 13/17] Allow for geovals of fewer than 70 levels --- src/opsinputs/opsinputs_fill_mod.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index eaed1906..dd14e1ad 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1362,6 +1362,8 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Local declarations: type(ufo_geoval), pointer :: GeoVal real(kind_real) :: MissingReal +integer(integer64), dimension(2) :: GeoValShape +integer(integer64) :: NumLevs character(len=*), parameter :: & RoutineName = "opsinputs_fill_fillrealfromgeoval" @@ -1397,8 +1399,10 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Ops_BGEandCXCreate.inc line 166 and Ops_CxComplete.inc line 299. This ! field is only used for surface visibility calculations so no further ! specific handling is required. - where (GeoVal % vals(70,:) /= MissingReal) - Real1 = GeoVal % vals(70,:) + GeoValShape = shape(GeoVaL % vals) + NumLevs = GeoValShape(1) + where (GeoVal % vals(NumLevs,:) /= MissingReal) + Real1 = GeoVal % vals(NumLevs,:) end where else where (GeoVal % vals(1,:) /= MissingReal) From 6481513679dd49b3f45341dce7c60687e0a35ce8 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 12 Aug 2024 16:05:45 +0100 Subject: [PATCH 14/17] Update tests since aerosol has multiple levels --- test/generate_unittest_netcdfs.py | 4 ++-- test/testinput/cx_ukvnamelist_surface.nc4 | Bin 17979 -> 17994 bytes .../cxwriter_ukvnamelist_surface.yaml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/generate_unittest_netcdfs.py b/test/generate_unittest_netcdfs.py index f81d8023..f46abeb1 100644 --- a/test/generate_unittest_netcdfs.py +++ b/test/generate_unittest_netcdfs.py @@ -1127,11 +1127,11 @@ def copy_var_to_var(Group, invarname, outvarname, filename): # Surface - UKV output_full_cx_to_netcdf(['skin_temperature', 'surface_altitude', 'surface_pressure', 'uwind_at_10m', - 'vwind_at_10m', 'surface_temperature', 'relative_humidity_2m', 'visibility_1p5m','qt_1p5m','aerosol'], + 'vwind_at_10m', 'surface_temperature', 'relative_humidity_2m', 'visibility_1p5m','qt_1p5m'], ['potential_temperature', 'specific_humidity', 'cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water', 'cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water', 'air_pressure_levels', 'cloud_volume_fraction_in_atmosphere_layer', 'liquid_cloud_volume_fraction_in_atmosphere_layer', 'ice_cloud_volume_fraction_in_atmosphere_layer', - 'eastward_wind', 'northward_wind'], + 'eastward_wind', 'northward_wind', 'aerosol'], 'testinput/cx_ukvnamelist_surface.nc4') # Scatwind diff --git a/test/testinput/cx_ukvnamelist_surface.nc4 b/test/testinput/cx_ukvnamelist_surface.nc4 index 22f54eab7123187cb5b2f7098ba5cb7f46eb50c5..bcb1f554a2d820350326e7a35dc93e12f757963c 100644 GIT binary patch delta 1449 zcmcIjYiLth5T0{;)1+xq8%=3UTa&ihr;nJ6eOqH&YEg^g+6uc{(m-O3ZECD(OMF)p zr4P9>_`~Akha$dT7erkswt@>m+fsB{tzcMoagqLLLB+DJdhWeB`*(kc2g1zv&CK~` z=H&j;Pa^$9OgFEs1?4zY1NXZ34%~Jm5ONI5$a}uGq``;+SC?jhkrFk}C){2(y|35XnJ*7r`nIzO%Dhz(7;RJ7}p69k#3CsScI z>P3<#dn8}MQN51S8KoKhXTu#!lq?%O6{*^~HBu!Ak*dK{PpZxb_k9tBC)6LM{3zu| zsXtEraq5rb>-i^WakJ)*{YOpuaDgh7tr}pq=%KD9VoDG8I0S`@a0J(53=S4hpQPv87i{d;GF=KII)?pgUg69pp z93UwbZ}*=m1qWSH4w!D;55q;=zIaQag{IlSyX5#&D5h=>+&yyW6*SO_OlW<>{ROks zwZTMios~|)6P#Z1>j5hmV>2jw&4wffRjD})s=X?&CR6HNCKgq-=Q613&tp&>&di`X zPl^l`wTrY{D`XtJyc}or*QDuXCXVMC^Vgup*{aied>uP>?P$Xur`g)-Z+C}$fuOI$ z6YA{n4at8vdI+C{{Z31wSj_Moyy>(Q)Rr^M`ZjcS``f*4PsqL85qMY1!X}(?niD5i zGCUWPg*2zXf?+m^xx?4y3HiHx?rog`ztw7C}W z+t!zK%baAd{FlVYg=}ZBI$%p;c(5Kvq#oBof`?o`kb{_6`8Xwy2LI`8JIZpXRV8Zv z?>4q_R>@Y*FpkZRDQ#b=o|1-Fn^>FPZ@rj38WUoV#_;Sw-;^v&M0rA8KIMP@bU={8 WHA`6!q3_*;ubOqE+DlhIc)tS7ZzePV delta 1422 zcmcIjTWAw$6h8lC(oULGlUlKjv8K&7URt-Qp{8kTiEUN_;;y>e?oyNxO_bP+HA$m= z@QNZzk;r*!@q)DLU2r=h-dNV`y2_&12baYQ*au}-5sVA_u%gy~E=PRxL7a#A=R4wG<6gMsg_3>y2G(EE)`^jTstREZLf1*9H^Duga&~!8WENUecOgpDK zK#3R%F;Zp6bHcA;ojdRw{!$sm2ZqPa*3c5ENU1ci3H`BXM6kRDu;9tyQd5B*DL}vf zI6gF*Fx#+HD&x_PzgE6FaHUlKHtztl2n^l|JeXWm-!`1f7g!nEq-mHl%|@prp|jwG zNf!dA%*+!Obec;>OU4;m?HQ}rn{65H-7+yWm~FXzE88O5%-fBl&JLqPYSd^holWO; z!zsI*u6!vf2Am);#`5%%JU;0^(A7yI!%X(G`Tg|mslHF6AMSWQt?z@G?uN$L-R|Q_aE>Gt2^Zlquj7Y~Cc@-*ayp)j zua0-cQ~lxE-n#A`0ji)CefKony@naz zcS254x-QM+(KY+J@5vdTi{Z7oF8bAA+o{qPr4oyb{kW?BYpI-;82c?|ak9rD;B8;M6h nRh({$n$i6bK7Dm$vz!S8nEYe#eb?0I?%Li;{k3znw)p8gd%_l8 diff --git a/test/testinput/cxwriter_ukvnamelist_surface.yaml b/test/testinput/cxwriter_ukvnamelist_surface.yaml index 572017f3..68bea462 100644 --- a/test/testinput/cxwriter_ukvnamelist_surface.yaml +++ b/test/testinput/cxwriter_ukvnamelist_surface.yaml @@ -34,16 +34,16 @@ observations: expected_main_table_columns: - # observation 3 is rejected by the tests above hence only 3 (1,2,4) columns - ["17.10","27.10","57.10","67.10","37.10","47.10","77.10", - "7.10","87.10","97.10","1.10","1.20","1.30","81.10","81.20","81.30", + "7.10","87.10","101.10","1.10","1.20","1.30","81.10","81.20","81.30", "91.10","91.20","91.30","11.10","11.20","11.30", "41.10","41.20","41.30","21.10","21.20","21.30", "31.10","31.20","31.30"] # column 1 - 1st observation - ["**********","**********","**********","**********","**********","**********","**********","**********", - "**********","**********","2.10","**********","2.30","82.10","**********","82.30","92.10","**********","92.30","12.10", + "**********","102.10","2.10","**********","2.30","82.10","**********","82.30","92.10","**********","92.30","12.10", "**********","12.30","42.10","**********","42.30","22.10","**********","22.30","32.10","**********", "32.30"] # column 2 - 2nd observation - ["17.40","27.40","57.40","67.40","37.40","47.40","77.40", - "7.40","87.40","97.40","4.10","4.20","4.30","84.10","84.20","84.30", + "7.40","87.40","104.10","4.10","4.20","4.30","84.10","84.20","84.30", "94.10","94.20","94.30","14.10","14.20","14.30", "44.10","44.20","44.30","24.10","24.20","24.30", "34.10","34.20","34.30"] # column 3 - observation 4 From b0f55987b221b132dc7de36ed68a018c6ea6aaf3 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Fri, 16 Aug 2024 11:01:55 +0100 Subject: [PATCH 15/17] tidy special case --- src/opsinputs/opsinputs_fill_mod.F90 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index dd14e1ad..82adf87c 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1363,7 +1363,7 @@ subroutine opsinputs_fill_fillrealfromgeoval( & type(ufo_geoval), pointer :: GeoVal real(kind_real) :: MissingReal integer(integer64), dimension(2) :: GeoValShape -integer(integer64) :: NumLevs +integer(integer64) :: LvlIdx character(len=*), parameter :: & RoutineName = "opsinputs_fill_fillrealfromgeoval" @@ -1400,15 +1400,14 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! field is only used for surface visibility calculations so no further ! specific handling is required. GeoValShape = shape(GeoVaL % vals) - NumLevs = GeoValShape(1) - where (GeoVal % vals(NumLevs,:) /= MissingReal) - Real1 = GeoVal % vals(NumLevs,:) - end where + LvlIdx = GeoValShape(1) ! Usually 70 else - where (GeoVal % vals(1,:) /= MissingReal) - Real1 = GeoVal % vals(1,:) - end where + LvlIdx = 1 end if + + where (GeoVal % vals(LvlIdx,:) /= MissingReal) + Real1 = GeoVal % vals(LvlIdx,:) + end where end if end subroutine opsinputs_fill_fillrealfromgeoval From b4efa39fa2c6f833bed2f25b31932c59f442b8f5 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 19 Aug 2024 10:01:52 +0100 Subject: [PATCH 16/17] simplify level querying --- src/opsinputs/opsinputs_fill_mod.F90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index 82adf87c..5ae79a06 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1362,7 +1362,6 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Local declarations: type(ufo_geoval), pointer :: GeoVal real(kind_real) :: MissingReal -integer(integer64), dimension(2) :: GeoValShape integer(integer64) :: LvlIdx character(len=*), parameter :: & @@ -1399,8 +1398,7 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Ops_BGEandCXCreate.inc line 166 and Ops_CxComplete.inc line 299. This ! field is only used for surface visibility calculations so no further ! specific handling is required. - GeoValShape = shape(GeoVaL % vals) - LvlIdx = GeoValShape(1) ! Usually 70 + LvlIdx = shape(GeoVaL % vals, dim=1) ! Usually 70 else LvlIdx = 1 end if From 23a7e6a1d9fef5abf3394eb933c9f000c505ff09 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Mon, 19 Aug 2024 14:06:12 +0100 Subject: [PATCH 17/17] Revert "simplify level querying" This reverts commit b4efa39fa2c6f833bed2f25b31932c59f442b8f5. Either the syntax is wrong or this is not allowed. --- src/opsinputs/opsinputs_fill_mod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index 5ae79a06..82adf87c 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1362,6 +1362,7 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Local declarations: type(ufo_geoval), pointer :: GeoVal real(kind_real) :: MissingReal +integer(integer64), dimension(2) :: GeoValShape integer(integer64) :: LvlIdx character(len=*), parameter :: & @@ -1398,7 +1399,8 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! Ops_BGEandCXCreate.inc line 166 and Ops_CxComplete.inc line 299. This ! field is only used for surface visibility calculations so no further ! specific handling is required. - LvlIdx = shape(GeoVaL % vals, dim=1) ! Usually 70 + GeoValShape = shape(GeoVaL % vals) + LvlIdx = GeoValShape(1) ! Usually 70 else LvlIdx = 1 end if