Skip to content

Commit

Permalink
Unify obs and test configurations between FV3-JEDI and MPAS-JEDI (#255)
Browse files Browse the repository at this point in the history
## Description
The goal of this PR is to unify the obs and configuration between
FV3-JEDI and MPAS-JEDI.
  • Loading branch information
SamuelDegelia-NOAA authored Jan 29, 2025
1 parent 0f4c45a commit d7172d4
Show file tree
Hide file tree
Showing 53 changed files with 14,054 additions and 4,087 deletions.
2 changes: 1 addition & 1 deletion fix/bumploc/conus12km-401km11levels
1 change: 0 additions & 1 deletion fix/expr_data/fv3_2024052700/Data

This file was deleted.

1 change: 1 addition & 0 deletions fix/expr_data/fv3_2024052700/Data/bkg
1 change: 1 addition & 0 deletions fix/expr_data/fv3_2024052700/Data/crtm
1 change: 1 addition & 0 deletions fix/expr_data/fv3_2024052700/Data/fieldmetadata
1 change: 1 addition & 0 deletions fix/expr_data/fv3_2024052700/Data/geovals
1 change: 1 addition & 0 deletions fix/expr_data/fv3_2024052700/Data/inputs
1 change: 1 addition & 0 deletions fix/expr_data/fv3_2024052700/Data/obs
2 changes: 1 addition & 1 deletion fix/expr_data/mpas_2024052700/obs
1 change: 0 additions & 1 deletion fix/expr_data/mpas_2024052700/obs_ctest

This file was deleted.

1 change: 1 addition & 0 deletions fix/graphinfo/conus12km_mpas.graph.info
1 change: 1 addition & 0 deletions fix/graphinfo/conus12km_mpas.graph.info.part.160
49 changes: 28 additions & 21 deletions rrfs-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ set (src_yaml "${CMAKE_SOURCE_DIR}/rrfs-test/testinput")
if(FV3_DYCORE)

message(STATUS "MACHINE_ID is " ${MACHINE_ID})
set(RESTORE_MPI_ARGS ${MPI_ARGS})
if("${MACHINE_ID}" STREQUAL "orion" OR "${MACHINE_ID}" STREQUAL "hercules")
message(STATUS "Because MACHINE_ID is orion, adding exclusive MPI option" )
set(MPI_ARGS "${MPI_ARGS} --exclusive")
endif()
set(MPI_ARGS "${MPI_ARGS} --time=00:30:00")

get_all_keys(rrfs_fv3jedi_tests caselist)
foreach(case ${caselist})

set(RESTORE_MPI_ARGS ${MPI_ARGS})
if("${MACHINE_ID}" STREQUAL "orion" OR "${MACHINE_ID}" STREQUAL "hercules")
message(STATUS "Because MACHINE_ID is orion, adding exclusive MPI option" )
set(MPI_ARGS "${MPI_ARGS} --exclusive")
endif()
set(MPI_ARGS "${MPI_ARGS} --time=00:30:00")

get_from_dictionary(rrfs_fv3jedi_tests case exe)
set(casedir "${CMAKE_CURRENT_BINARY_DIR}/rundir-${case}")
set(src_casedir "${rrfs-test_data_local}/rrfs-data_fv3jedi_2024052700")
Expand Down Expand Up @@ -67,24 +69,25 @@ if(FV3_DYCORE)
ARGS ${target_test}.yaml
COMMAND ${exe} )
endif()
set(MPI_ARGS ${RESTORE_MPI_ARGS})
endforeach()
set(MPI_ARGS ${RESTORE_MPI_ARGS})

endif()

if(MPAS_DYCORE)

message(STATUS "MACHINE_ID is " ${MACHINE_ID})
set(RESTORE_MPI_ARGS ${MPI_ARGS})
if("${MACHINE_ID}" STREQUAL "orion" OR "${MACHINE_ID}" STREQUAL "hercules")
message(STATUS "Because MACHINE_ID is orion, adding exclusive MPI option" )
set(MPI_ARGS "${MPI_ARGS} --exclusive")
endif()
set(MPI_ARGS "${MPI_ARGS} --ntasks-per-node=4")
set(MPI_ARGS "${MPI_ARGS} --time=00:30:00")

get_all_keys(rrfs_mpasjedi_tests caselist)
foreach(case ${caselist})

set(RESTORE_MPI_ARGS ${MPI_ARGS})
if("${MACHINE_ID}" STREQUAL "orion" OR "${MACHINE_ID}" STREQUAL "hercules")
message(STATUS "Because MACHINE_ID is orion, adding exclusive MPI option" )
set(MPI_ARGS "${MPI_ARGS} --exclusive")
endif()
set(MPI_ARGS "${MPI_ARGS} --time=00:30:00")

get_from_dictionary(rrfs_mpasjedi_tests case exe)
set(casedir "${CMAKE_CURRENT_BINARY_DIR}/rundir-${case}")
set(src_casedir "${rrfs-test_data_local}/rrfs-data_mpasjedi_2024052700")
Expand All @@ -105,21 +108,22 @@ if(MPAS_DYCORE)
file(COPY ${src_yaml}/${case}.yaml DESTINATION ${casedir})
set(target_test ${case})
if ("${target_test}" STREQUAL "rrfs_mpasjedi_2024052700_getkf_solver")
set(MPI_ARGS "${MPI_ARGS} --ntasks-per-node=8")
ecbuild_add_test( TARGET ${target_test}
MPI 120
MPI 160
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rundir-${target_test}
ARGS ${target_test}.yaml
TEST_DEPENDS "rrfs_mpasjedi_2024052700_getkf_observer"
COMMAND ${exe} )
else()
ecbuild_add_test( TARGET ${target_test}
MPI 120
MPI 160
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rundir-${target_test}
ARGS ${target_test}.yaml
COMMAND ${exe} )
endif()
set(MPI_ARGS ${RESTORE_MPI_ARGS})
endforeach()
set(MPI_ARGS ${RESTORE_MPI_ARGS})

########################
### Bufr2ioda ctests ###
Expand All @@ -131,10 +135,13 @@ if(MPAS_DYCORE)
set(src_casedir "${rrfs-test_data_local}/rrfs-data_mpasjedi_2024052700")
if (NOT EXISTS "${casedir}")
file(MAKE_DIRECTORY ${casedir})
file(MAKE_DIRECTORY ${casedir}/bufr)
endif()
file(CREATE_LINK ${src_casedir}/data ${casedir}/data SYMBOLIC)
configure_file(${src_casedir}/data/obs/bufr/rap.t00z.prepbufr.tm00 ${casedir}/prepbufr COPYONLY)
file(COPY ${src_yaml}/${case}.yaml DESTINATION ${casedir})
set (src_yaml "${CMAKE_SOURCE_DIR}/rrfs-test/IODA/yaml")
configure_file(${src_casedir}/data/obs/bufr/rap.t00z.prepbufr.tm00 ${casedir}/bufr/prepbufr COPYONLY)
configure_file(${src_yaml}/prepbufr_msonet.yaml ${casedir}/${case}.yaml COPYONLY)
execute_process(COMMAND sed -i "s/@REFERENCETIME@/2024-05-27T00:00:00Z/g" ${casedir}/${case}.yaml)
set(MPI_ARGS "--time=00:05:00 --mem=64G")
set(IODA_CONV_COMP_TOL "5.0e-4")
ecbuild_add_test( TARGET ${case}
Expand All @@ -145,8 +152,8 @@ if(MPAS_DYCORE)
ARGS ${CMAKE_SOURCE_DIR}/rrfs-test/ush/iodaconv_comp_rrfs.sh
netcdf
"${CMAKE_BINARY_DIR}/bin/bufr2ioda.x ${case}.yaml"
data/obs/ioda_mesonet.nc
ioda_mesonet.nc
data/obs/ioda_msonet.nc
ioda_msonet.nc
${IODA_CONV_COMP_TOL}
DEPENDS bufr2ioda.x )

Expand Down
8 changes: 7 additions & 1 deletion rrfs-test/IODA/offline_domain_check_satrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def shrink_boundary(points, centroid, factor=0.01):
if 'grid_lat' in grid_ds.variables and 'grid_lon' in grid_ds.variables: # FV3 grid
grid_lat = grid_ds.variables['grid_lat'][:, :]
grid_lon = grid_ds.variables['grid_lon'][:, :]
grid_lat = grid_lat.flatten()
grid_lon = grid_lon.flatten()
dycore = "FV3"
elif 'latCell' in grid_ds.variables and 'lonCell' in grid_ds.variables: # MPAS grid
grid_lat = np.degrees(grid_ds.variables['latCell'][:]) # Convert radians to degrees
Expand Down Expand Up @@ -296,7 +298,11 @@ def shrink_boundary(points, centroid, factor=0.01):
g.createVariable(var, vartype, dimensions, fill_value=fill)
except:
g.createVariable(var, 'str', dimensions, fill_value=fill)
g.variables[var][:] = invar[:][inside_indices]
# If variable has only dimensions of channel then we do not need to process it
if g.variables[var].dimensions[0] == 'Channel':
g.variables[var][:] = invar[:][:]
else:
g.variables[var][:] = invar[:][inside_indices]
# Copy attributes for this variable
for attr in invar.ncattrs():
if '_FillValue' in attr: continue
Expand Down
79 changes: 79 additions & 0 deletions rrfs-test/gsi_fix/anavinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
met_guess::
!var level crtm_use desc orig_name
ps 1 -1 surface_pressure ps
z 1 -1 geopotential_height phis
u 65 2 zonal_wind u
v 65 2 meridional_wind v
w 65 -1 vertical velocity w
tv 65 2 virtual_temperature tv
q 65 2 specific_humidity sphu
oz 65 2 ozone ozone
delp 65 -1 fv3 del pressure delp
t2m 1 -1 2-m_T t2m
q2m 1 -1 2-m_Q q2m
! ql 65 10 cloud_condensate QCLOUD
! qr 65 10 rain QRAIN
! qs 65 10 snow QSNOW
! qi 65 10 ice QICE
! qg 65 10 graupel QGRAUP
! dbz 65 10 reflectivity REFL_10CM
::

state_derivatives::
!var level src
ps 1 met_guess
u 65 met_guess
v 65 met_guess
tv 65 met_guess
q 65 met_guess
oz 65 met_guess
prse 66 met_guess
::

state_tendencies::
!var levels source
u 65 met_guess
v 65 met_guess
tv 65 met_guess
q 65 met_guess
oz 65 met_guess
prse 66 met_guess
::

state_vector::
!var level itracer source funcof
u 65 0 met_guess u
v 65 0 met_guess v
w 65 0 met_guess w
tv 65 0 met_guess tv
tsen 65 0 met_guess tv,q
q 65 1 met_guess q
! oz 65 1 met_guess oz
prse 66 0 met_guess prse
ps 1 0 met_guess prse
sst 1 0 met_guess sst
! qr 65 1 met_guess qr
! ql 65 1 met_guess qc
! qs 65 1 met_guess qs
! qi 65 1 met_guess qi
! qg 65 1 met_guess qg
! dbz 65 1 met_guess dbz
::

control_vector::
!var level itracer as/tsfc_sdv an_amp0 source funcof
sf 65 0 0.90 -1.0 state u,v
vp 65 0 0.90 -1.0 state u,v
ps 1 0 1.00 -1.0 state prse
t 65 0 1.40 -1.0 state tv
q 65 1 0.80 -1.0 state q
sst 1 0 1.00 -1.0 state sst
stl 1 0 1.00 -1.0 motley sst
sti 1 0 1.00 -1.0 motley sst
! qr 65 1 1.0 -1.0 state qr
! qs 65 1 1.0 -1.0 state qs
! qi 65 1 1.0 -1.0 state qi
! qg 65 1 1.0 -1.0 state qg
! ql 65 1 1.0 -1.0 state qc
! dbz 65 1 1.00 -1.0 state dbz
::
Loading

0 comments on commit d7172d4

Please sign in to comment.