-
Notifications
You must be signed in to change notification settings - Fork 9
Updates for JEDI+UFS #824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates for JEDI+UFS #824
Changes from all commits
640291c
db9dd2c
9bb19c5
2133711
33b55fc
580c48a
421ad8a
1ec7062
dbb1231
2f52611
f999437
cade6cf
33ac3b5
12ebbb3
a339b54
27ab811
d53c98a
70e5ecc
42c0af3
b1da07a
0fe0503
3fff0f7
af8ac0e
a8d7be5
c41141d
a2709f5
fe799f0
9fe0985
afd28be
4ce96f7
e5d6b28
65ef2b2
eb43fa2
13dc0cf
30f7f6b
6ba06c5
214b5b0
e8b3b07
0a94c5e
61c4d06
4f8be3c
513fdaa
542b088
12eb06c
e28d795
81f15f4
c655184
5da07ac
f066bb8
5978cbe
f511920
bc370cb
8fbb875
93f2f5f
959ef23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,24 +31,83 @@ find_package( vader 1.6.0 REQUIRED) | |
| find_package( saber 1.9.0 REQUIRED) | ||
| find_package( ioda 2.8.0 REQUIRED) | ||
| find_package( ufo 1.9.0 REQUIRED) | ||
| find_package( fms 2020.4.0 REQUIRED) | ||
| find_package( mom6 2020.4.0 REQUIRED) | ||
| # fms | ||
| find_package(FMS 2022.04 REQUIRED COMPONENTS R4 R8) | ||
| if (FV3_PRECISION MATCHES DOUBLE OR NOT FV3_PRECISION) | ||
| add_library(fms ALIAS FMS::fms_r8) | ||
| else() | ||
| add_library(fms ALIAS FMS::fms_r4) | ||
| endif() | ||
| if(FV3_FORECAST_MODEL MATCHES UFS) | ||
| find_package( ESMF MODULE REQUIRED STATIC) | ||
| find_package( crtm 2.2.3) | ||
| find_package( bacio REQUIRED) | ||
| find_package( sigio REQUIRED) | ||
| find_package( sp REQUIRED) | ||
| find_package( w3emc REQUIRED) | ||
| find_package( w3nco REQUIRED) | ||
| find_package( nemsio REQUIRED) | ||
| find_package( nemsio REQUIRED) | ||
| find_package( PIO 2.5.3 REQUIRED COMPONENTS C Fortran) | ||
| else() | ||
| find_package( mom6 2020.4.0 REQUIRED) | ||
| endif() | ||
|
|
||
| # Optionally look for icepack | ||
| find_package( icepack 1.2.0 QUIET) | ||
|
|
||
| include_directories( ${NETCDF_INCLUDE_DIRS} ) | ||
| include_directories( ${NETCDF_INCLUDE_DIRS} ${DEPEND_LIB_ROOT}/include_r8 ${DEPEND_LIB_ROOT}/MOM6/mod ) | ||
| include_directories( ${DEPEND_LIB_ROOT}/../ufs-weather-model/src/ufs-weather-model-build/MOM6-interface/mod_solo) | ||
|
|
||
|
|
||
| ################################################################################ | ||
| # Sources | ||
| ################################################################################ | ||
| set( SOCA_LINKER_LANGUAGE CXX) | ||
|
|
||
| if(FV3_FORECAST_MODEL MATCHES UFS) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these names are going to be updated @climbfuji . I don't know what convention will be adopted but it will be less confusing than |
||
| if(${UFS_APP} MATCHES "NG-GODAS") | ||
| set( UFS_LIBS | ||
| soca | ||
| cdeps | ||
| cmeps | ||
| PIO::PIO_C PIO::PIO_Fortran | ||
| stochastic_physics | ||
| cice | ||
| esmf | ||
| ) | ||
| elseif(${UFS_APP} MATCHES "S2S") | ||
| set( UFS_LIBS | ||
| soca | ||
| cmeps | ||
| PIO::PIO_C PIO::PIO_Fortran | ||
| fv3atm | ||
| fv3 | ||
| fv3ccpp | ||
| ccpp_framework | ||
| ccpp_physics | ||
| stochastic_physics | ||
| FMS::fms_r8 | ||
| cice | ||
| esmf | ||
| ) | ||
| else() | ||
| message(FATAL_ERROR "soca UFS_LIBS not configured for UFS_APP ${UFS_APP}") | ||
| endif() | ||
| endif() | ||
|
|
||
| add_subdirectory( src ) | ||
| add_subdirectory( test ) | ||
| add_subdirectory( tutorial ) | ||
|
|
||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| testdata | ||
| URL https://ftp.emc.ncep.noaa.gov/jcsda/WDQMS/NCEP/UFS-JEDI-DATA/ufs.tar.gz | ||
| URL_HASH MD5=762e54986481c01e3a939edbe57b0ec4 | ||
| ) | ||
| FetchContent_MakeAvailable(testdata) | ||
|
|
||
| # Build Doxygen documentation | ||
| add_subdirectory( docs ) | ||
|
|
||
|
|
@@ -61,7 +120,7 @@ endif() | |
| ################################################################################ | ||
|
|
||
| # prepares a tar.gz of the sources and/or binaries | ||
| ecbuild_install_project( NAME soca ) | ||
| # ecbuild_install_project( NAME soca ) | ||
|
|
||
| # print the summary of the configuration | ||
| ecbuild_print_summary() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # - Try to find ESMF | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self - get rid of this, jedi-cmake has a |
||
| # | ||
| # Requires setting ESMFMKFILE to the filepath of esmf.mk. If this is NOT set, | ||
| # then ESMF_FOUND will always be FALSE. If ESMFMKFILE exists, then ESMF_FOUND=TRUE | ||
| # and all ESMF makefile variables will be set in the global scope. Optionally, | ||
| # set ESMF_MKGLOBALS to a string list to filter makefile variables. For example, | ||
| # to globally scope only ESMF_LIBSDIR and ESMF_APPSDIR variables, use this CMake | ||
| # command in CMakeLists.txt: | ||
| # | ||
| # set(ESMF_MKGLOBALS "LIBSDIR" "APPSDIR") | ||
|
|
||
|
|
||
| # Add the ESMFMKFILE path to the cache if defined as system env variable | ||
| if (DEFINED ENV{ESMFMKFILE} AND NOT DEFINED ESMFMKFILE) | ||
| set(ESMFMKFILE $ENV{ESMFMKFILE} CACHE FILEPATH "Path to ESMF mk file") | ||
| endif () | ||
|
|
||
| # Found the mk file and ESMF exists on the system | ||
| if (EXISTS ${ESMFMKFILE}) | ||
| set(ESMF_FOUND TRUE CACHE BOOL "ESMF mk file found" FORCE) | ||
| # Did not find the ESMF mk file | ||
| else() | ||
| set(ESMF_FOUND FALSE CACHE BOOL "ESMF mk file NOT found" FORCE) | ||
| # Best to warn users that without the mk file there is no way to find ESMF | ||
| if (NOT DEFINED ESMFMKFILE) | ||
| message(FATAL_ERROR "ESMFMKFILE not defined. This is the path to esmf.mk file. \ | ||
| Without this filepath, ESMF_FOUND will always be FALSE.") | ||
| endif () | ||
| endif() | ||
|
|
||
| # Only parse the mk file if it is found | ||
| if (ESMF_FOUND) | ||
| # Read the mk file | ||
| file(STRINGS "${ESMFMKFILE}" esmfmkfile_contents) | ||
| # Parse each line in the mk file | ||
| foreach(str ${esmfmkfile_contents}) | ||
| # Only consider uncommented lines | ||
| string(REGEX MATCH "^[^#]" def ${str}) | ||
| # Line is not commented | ||
| if (def) | ||
| # Extract the variable name | ||
| string(REGEX MATCH "^[^=]+" esmf_varname ${str}) | ||
| # Extract the variable's value | ||
| string(REGEX MATCH "=.+$" esmf_vardef ${str}) | ||
| # Only for variables with a defined value | ||
| if (esmf_vardef) | ||
| # Get rid of the assignment string | ||
| string(SUBSTRING ${esmf_vardef} 1 -1 esmf_vardef) | ||
| # Remove whitespace | ||
| string(STRIP ${esmf_vardef} esmf_vardef) | ||
| # A string or single-valued list | ||
| if(NOT DEFINED ESMF_MKGLOBALS) | ||
| # Set in global scope | ||
| set(${esmf_varname} ${esmf_vardef}) | ||
| # Don't display by default in GUI | ||
| mark_as_advanced(esmf_varname) | ||
| else() # Need to filter global promotion | ||
| foreach(m ${ESMF_MKGLOBALS}) | ||
| string(FIND ${esmf_varname} ${m} match) | ||
| # Found the string | ||
| if(NOT ${match} EQUAL -1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's a lot of nested |
||
| # Promote to global scope | ||
| set(${esmf_varname} ${esmf_vardef}) | ||
| # Don't display by default in the GUI | ||
| mark_as_advanced (esmf_varname) | ||
| # No need to search for the current string filter | ||
| break() | ||
| endif() | ||
| endforeach() | ||
| endif() | ||
| endif() | ||
| endif() | ||
| endforeach() | ||
|
|
||
| separate_arguments(ESMF_F90COMPILEPATHS NATIVE_COMMAND ${ESMF_F90COMPILEPATHS}) | ||
| foreach (ITEM ${ESMF_F90COMPILEPATHS}) | ||
| string(REGEX REPLACE "^-I" "" ITEM "${ITEM}") | ||
| list(APPEND tmp ${ITEM}) | ||
| endforeach() | ||
| set(ESMF_F90COMPILEPATHS ${tmp}) | ||
|
|
||
| add_library(esmf UNKNOWN IMPORTED) | ||
| # Look for static library, if not found try dynamic library | ||
| find_library(esmf_lib NAMES libesmf.a PATHS ${ESMF_LIBSDIR}) | ||
| if(esmf_lib MATCHES "esmf_lib-NOTFOUND") | ||
| message(STATUS "Static ESMF library not found, searching for dynamic library instead") | ||
| find_library(esmf_lib NAMES esmf_fullylinked PATHS ${ESMF_LIBSDIR}) | ||
| if(esmf_lib MATCHES "esmf_lib-NOTFOUND") | ||
| message(FATAL_ERROR "Neither the dynamic nor the static ESMF library was found") | ||
| else() | ||
| message(STATUS "Found ESMF library: ${esmf_lib}") | ||
| endif() | ||
| set(ESMF_INTERFACE_LINK_LIBRARIES "") | ||
| else() | ||
| # When linking the static library, also need the ESMF linker flags; strip any leading/trailing whitespaces | ||
| string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES) | ||
| message(STATUS "Found ESMF library: ${esmf_lib}") | ||
| endif() | ||
|
|
||
| set_target_properties(esmf PROPERTIES | ||
| IMPORTED_LOCATION ${esmf_lib} | ||
| INTERFACE_INCLUDE_DIRECTORIES "${ESMF_F90COMPILEPATHS}" | ||
| INTERFACE_LINK_LIBRARIES "${ESMF_INTERFACE_LINK_LIBRARIES}") | ||
|
|
||
| endif() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,96 +1,96 @@ | ||
| ecbuild_add_executable( TARGET soca_forecast.x | ||
| SOURCES Forecast.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_hofx3d.x | ||
| SOURCES HofX3D.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_hofx.x | ||
| SOURCES HofX.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_enshofx.x | ||
| SOURCES EnsHofX.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_var.x | ||
| SOURCES Var.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| saber | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_error_covariance_toolbox.x | ||
| SOURCES ErrorCovarianceToolbox.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| saber | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_enspert.x | ||
| SOURCES GenEnsPertB.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_sqrtvertloc.x | ||
| SOURCES SqrtOfVertLoc.cc | ||
| LIBS soca | ||
| ) | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_ensmeanandvariance.x | ||
| SOURCES EnsMeanAndVariance.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_ensrecenter.x | ||
| SOURCES EnsRecenter.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_hybridgain.x | ||
| SOURCES HybridGain.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_checkpoint_model.x | ||
| SOURCES CheckpointModel.cc | ||
| LIBS soca | ||
| ) | ||
| #ecbuild_add_executable( TARGET soca_checkpoint_model.x | ||
| # SOURCES CheckpointModel.cc | ||
| # LIBS ${UFS_LIBS} | ||
| # ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_gridgen.x | ||
| SOURCES GridGen.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_letkf.x | ||
| SOURCES LETKF.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_convertincrement.x | ||
| SOURCES ConvertIncrement.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_convertstate.x | ||
| SOURCES ConvertState.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_addincrement.x | ||
| SOURCES AddIncrement.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_diffstates.x | ||
| SOURCES DiffStates.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) | ||
|
|
||
| ecbuild_add_executable( TARGET soca_setcorscales.x | ||
| SOURCES SetCorScales.cc | ||
| LIBS soca | ||
| LIBS ${UFS_LIBS} | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| /* | ||
| * (C) Copyright 2017-2021 UCAR. | ||
| * (C) Copyright 2017 UCAR | ||
| * | ||
| * This software is licensed under the terms of the Apache Licence Version 2.0 | ||
| * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
| */ | ||
|
|
||
| #include "soca/Traits.h" | ||
| #include "oops/runs/Run.h" | ||
| #include "test/interface/ErrorCovariance.h" | ||
| #include "test/interface/Model.h" | ||
|
|
||
| int main(int argc, char ** argv) { | ||
| oops::Run run(argc, argv); | ||
| test::ErrorCovariance<soca::Traits> tests; | ||
| test::Model<soca::Traits> tests; | ||
| return run.execute(tests); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self, this needs to be fixed.