Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
640291c
fixes for build/link with ufs
mark-a-potts Jan 25, 2022
db9dd2c
fixes for linking
mark-a-potts Jan 26, 2022
9bb19c5
uncommented out lines
mark-a-potts Jan 26, 2022
2133711
Updates for build with ufs
mark-a-potts Mar 9, 2022
33b55fc
udated to build both s2s and ng-godas
mark-a-potts Mar 9, 2022
580c48a
Updates for build
mark-a-potts Mar 9, 2022
421ad8a
Merge branch 'develop' of https://github.com/JCSDA/soca into feature/ufs
mark-a-potts Mar 11, 2022
1ec7062
Tweaks
mark-a-potts Mar 14, 2022
dbb1231
changes for build
mark-a-potts Mar 20, 2022
2f52611
changes for build
mark-a-potts Mar 20, 2022
f999437
commented out problem test
mark-a-potts Mar 21, 2022
cade6cf
Some extra print statements and fv3-to-state commmented out
mark-a-potts Mar 25, 2022
33ac3b5
Merge remote-tracking branch 'origin/develop' into feature/ufs
mark-a-potts Apr 29, 2022
12ebbb3
updates
mark-a-potts May 9, 2022
a339b54
Merge remote-tracking branch 'origin/develop' into feature/ufs
mark-a-potts Jun 22, 2022
27ab811
Consolidating builds for ng-godas and s2s
mark-a-potts Jun 24, 2022
d53c98a
adding test to ctest
mark-a-potts Jun 28, 2022
70e5ecc
updated mpp stack size
mark-a-potts Jun 28, 2022
42c0af3
working version with ctest
mark-a-potts Jun 28, 2022
b1da07a
updates for merge
mark-a-potts Jun 29, 2022
0fe0503
Removed debugging output
mark-a-potts Jun 30, 2022
3fff0f7
Fix FMS dependencies in src/soca/CMakeLists.txt
climbfuji Oct 20, 2022
af8ac0e
Fix library dependencies in src/soca/CMakeLists.txt
climbfuji Oct 21, 2022
a8d7be5
Update library dependencies depending on UFS_APP in CMakeLists.txt an…
climbfuji Oct 26, 2022
c41141d
Update src/soca/Model/ufs/soca_ufs_mod.F90 to reflect changes in ufs-…
climbfuji Nov 21, 2022
a2709f5
Temporarily turn off downlaoding testdata in CMakeLists.txt
climbfuji Nov 21, 2022
fe799f0
Update calls with 'answers_2018=answers_2018' to 'answer_date=answer_…
climbfuji Nov 21, 2022
9fe0985
Provide option to cache download of soca testdata
climbfuji Nov 21, 2022
afd28be
Comment out faulty code to use cached downloads in CMakeLists.txt
climbfuji Nov 22, 2022
4ce96f7
Comment out faulty code to use cached downloads in CMakeLists.txt
climbfuji Nov 22, 2022
e5d6b28
Fix typo in CMakeLists.txt
climbfuji Nov 22, 2022
65ef2b2
Merge commit '5014fe33be32aaaba4b7ec480bd6bad0e39fb841' of https://gi…
climbfuji Nov 22, 2022
eb43fa2
Comment out test checkpointmodel
climbfuji Nov 22, 2022
13dc0cf
Merge commit '89fbf9bf88e7e66e2de9668b1b00ab1c0c4827a7' of https://gi…
climbfuji Nov 22, 2022
30f7f6b
Major cleanup for PR
climbfuji Nov 23, 2022
6ba06c5
Fix PIO linker errors
climbfuji Jan 21, 2023
214b5b0
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Jan 31, 2023
e8b3b07
Merge branch 'develop' into feature/ufs_clem
cmgas Apr 17, 2023
0a94c5e
Merge pull request #864 from JCSDA-internal/feature/ufs_clem
climbfuji Apr 20, 2023
61c4d06
Bring feature/ufs_dom up to date with develop (#918)
cmgas Jul 17, 2023
4f8be3c
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Dec 12, 2023
513fdaa
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Dec 13, 2023
542b088
Update ModelUFS for param/config changes in oops develop
fmahebert Dec 13, 2023
12eb06c
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Dec 13, 2023
e28d795
Attempt to make soca feature/ufs_dom compile
climbfuji Dec 13, 2023
81f15f4
Fix merge
fmahebert Dec 15, 2023
c655184
fixed calls for head of develop
mark-a-potts Dec 18, 2023
5da07ac
Merge pull request #987 from JCSDA-internal/feature/ufs_dom_update_fr…
climbfuji Dec 18, 2023
f066bb8
Merge remote-tracking branch 'origin/develop' into feature/ufs_dom_up…
mark-a-potts Jan 2, 2024
5978cbe
Merge branch 'feature/ufs_dom' into feature/ufs_mark
climbfuji Jan 2, 2024
f511920
Merge pull request #990 from JCSDA-internal/feature/ufs_mark
mark-a-potts Jan 5, 2024
bc370cb
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Feb 5, 2024
8fbb875
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Feb 14, 2024
93f2f5f
Merge branch 'develop' of https://github.com/jcsda-internal/soca into…
climbfuji Feb 26, 2024
959ef23
Update feature/ufs_dom from develop 2024-03-08 (#1024)
climbfuji Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 63 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor Author

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.



################################################################################
# Sources
################################################################################
set( SOCA_LINKER_LANGUAGE CXX)

if(FV3_FORECAST_MODEL MATCHES UFS)
Copy link
Contributor

Choose a reason for hiding this comment

The 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 NG-GODAS, S2S, S2SW, ...

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 )

Expand All @@ -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()
106 changes: 106 additions & 0 deletions cmake/FindESMF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# - Try to find ESMF
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self - get rid of this, jedi-cmake has a FindESMF.cmake module

#
# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a lot of nested ifs

# 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()

46 changes: 23 additions & 23 deletions src/mains/CMakeLists.txt
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}
)
4 changes: 2 additions & 2 deletions src/mains/Forecast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*/


#include "soca/Traits.h"
#include "oops/generic/instantiateModelFactory.h"
#include "oops/runs/Forecast.h"
#include "oops/runs/Run.h"
#include "oops/runs/Forecast.h"

#include "soca/Traits.h"

int main(int argc, char ** argv) {
oops::Run run(argc, argv);
Expand Down
2 changes: 2 additions & 0 deletions src/mains/SqrtOfVertLoc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*/

#include "saber/oops/instantiateCovarFactory.h"

#include "oops/generic/instantiateModelFactory.h"
#include "oops/runs/Run.h"
Expand All @@ -14,6 +15,7 @@
int main(int argc, char ** argv) {
oops::Run run(argc, argv);
oops::instantiateModelFactory<soca::Traits>();
saber::instantiateCovarFactory<soca::Traits>();
oops::SqrtOfVertLoc<soca::Traits> sqrtgen;
return run.execute(sqrtgen);
}
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);
}

Loading