diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c7485f0f..32bdbd1dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,13 +31,33 @@ 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) ################################################################################ @@ -45,10 +65,49 @@ include_directories( ${NETCDF_INCLUDE_DIRS} ) ################################################################################ set( SOCA_LINKER_LANGUAGE CXX) +if(FV3_FORECAST_MODEL MATCHES UFS) + 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() diff --git a/cmake/FindESMF.cmake b/cmake/FindESMF.cmake new file mode 100644 index 000000000..bae4bca18 --- /dev/null +++ b/cmake/FindESMF.cmake @@ -0,0 +1,106 @@ +# - Try to find ESMF +# +# 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) + # 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() + diff --git a/src/mains/CMakeLists.txt b/src/mains/CMakeLists.txt index 13e2cb463..b4ec4121d 100644 --- a/src/mains/CMakeLists.txt +++ b/src/mains/CMakeLists.txt @@ -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} ) diff --git a/src/mains/Forecast.cc b/src/mains/Forecast.cc index 99529315e..ba1f5d23e 100644 --- a/src/mains/Forecast.cc +++ b/src/mains/Forecast.cc @@ -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); diff --git a/src/mains/SqrtOfVertLoc.cc b/src/mains/SqrtOfVertLoc.cc index 2a97bad1d..d49e14075 100644 --- a/src/mains/SqrtOfVertLoc.cc +++ b/src/mains/SqrtOfVertLoc.cc @@ -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" @@ -14,6 +15,7 @@ int main(int argc, char ** argv) { oops::Run run(argc, argv); oops::instantiateModelFactory(); + saber::instantiateCovarFactory(); oops::SqrtOfVertLoc sqrtgen; return run.execute(sqrtgen); } diff --git a/test/executables/TestErrorCovariance.cc b/src/mains/TestModel.cc similarity index 71% rename from test/executables/TestErrorCovariance.cc rename to src/mains/TestModel.cc index 35058d8ab..90c889e52 100644 --- a/test/executables/TestErrorCovariance.cc +++ b/src/mains/TestModel.cc @@ -1,5 +1,5 @@ /* - * (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. @@ -7,11 +7,11 @@ #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 tests; + test::Model tests; return run.execute(tests); } diff --git a/src/soca/CMakeLists.txt b/src/soca/CMakeLists.txt index eb01a21fb..201a9e90b 100644 --- a/src/soca/CMakeLists.txt +++ b/src/soca/CMakeLists.txt @@ -33,7 +33,7 @@ target_link_libraries( soca PUBLIC NetCDF::NetCDF_Fortran ) target_link_libraries( soca PUBLIC fckit ) target_link_libraries( soca PUBLIC atlas ) target_link_libraries( soca PUBLIC atlas_f ) -target_link_libraries( soca PUBLIC fms ) +target_link_libraries( soca PUBLIC FMS::fms_r8 ) target_link_libraries( soca PUBLIC gsw ) target_link_libraries( soca PUBLIC mom6 ) target_link_libraries( soca PUBLIC oops ) @@ -41,6 +41,9 @@ target_link_libraries( soca PUBLIC saber ) target_link_libraries( soca PUBLIC ioda ) target_link_libraries( soca PUBLIC ufo ) target_link_libraries( soca PUBLIC vader ) + +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${DEPEND_LIB_ROOT}/mod ) + if( ${icepack_FOUND} ) target_link_libraries( soca PUBLIC icepack ) endif() @@ -63,6 +66,66 @@ add_subdirectory(State) add_subdirectory(Utils) add_subdirectory(VariableChange) + # ESMF +separate_arguments(ESMF_F90LINKPATHS NATIVE_COMMAND ${ESMF_F90LINKPATHS}) +set(tmp "") +foreach (ITEM ${ESMF_F90LINKPATHS}) + string(REGEX REPLACE "-L" "" ITEM "${ITEM}") + list(APPEND tmp ${ITEM}) +endforeach() +# Bug fix for ESMF link paths missing MPI library path +foreach(ITEM ${MPI_Fortran_LIBRARIES}) + get_filename_component(itemdir ${ITEM} DIRECTORY) + list(APPEND tmp ${itemdir}) +endforeach() +list(REMOVE_DUPLICATES tmp) +message(STATUS "Additonal link paths added for ESMF: ${tmp}") +set(ESMF_F90LINKPATHS ${tmp}) + +if(${UFS_APP} MATCHES "NG-GODAS") + target_link_libraries( soca PUBLIC ufs) + target_link_libraries( soca PUBLIC cdeps) + target_link_libraries( soca PUBLIC cmeps) + target_link_libraries( soca PUBLIC cice) + target_link_libraries( soca PUBLIC stochastic_physics) + target_link_libraries( soca PUBLIC PIO::PIO_C PIO::PIO_Fortran) + target_link_libraries( soca PUBLIC NetCDF::NetCDF_Fortran) + target_link_libraries( soca PUBLIC nemsio::nemsio) + target_link_libraries( soca PUBLIC w3emc::w3emc_d) + target_link_libraries( soca PUBLIC w3nco::w3nco_d) + target_link_libraries( soca PUBLIC sp::sp_d) + target_link_libraries( soca PUBLIC bacio::bacio_4) + target_link_libraries( soca PUBLIC FMS::fms_r8) + target_link_libraries( soca PUBLIC esmf) +elseif(${UFS_APP} MATCHES "S2S") + target_link_libraries( soca PUBLIC ufs) + target_link_libraries( soca PUBLIC fv3atm) + target_link_libraries( soca PUBLIC fv3) + target_link_libraries( soca PUBLIC cmeps) + target_link_libraries( soca PUBLIC cice) + target_link_libraries( soca PUBLIC fv3ccpp) + target_link_libraries( soca PUBLIC ccpp_framework) + target_link_libraries( soca PUBLIC ccpp_physics) + target_link_libraries( soca PUBLIC stochastic_physics) + target_link_libraries( soca PUBLIC PIO::PIO_C PIO::PIO_Fortran) + target_link_libraries( soca PUBLIC NetCDF::NetCDF_Fortran) + target_link_libraries( soca PUBLIC nemsio::nemsio) + target_link_libraries( soca PUBLIC w3emc::w3emc_d) + target_link_libraries( soca PUBLIC w3nco::w3nco_d) + target_link_libraries( soca PUBLIC sp::sp_d) + target_link_libraries( soca PUBLIC bacio::bacio_4) + target_link_libraries( soca PUBLIC FMS::fms_r8) + target_link_libraries( soca PUBLIC esmf) +else() + message(FATAL_ERROR "soca/src/soca target_link_libraries not configured for UFS_APP ${UFS_APP}") +endif() + +target_include_directories (soca PUBLIC ${ESMF_F90COMPILEPATHS}) +target_link_directories( soca PUBLIC ${ESMF_F90LINKPATHS} ) +target_compile_definitions( soca PUBLIC "-DFRONT_MOM6=mom_cap_mod") +target_compile_definitions(soca PUBLIC UFS_BUILD) +add_dependencies(soca ufs-weather-model ) + ## Fortran modules set(MODULE_DIR ${PROJECT_NAME}/module) set_target_properties(${PROJECT_NAME} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/${MODULE_DIR}) diff --git a/src/soca/Covariance/CMakeLists.txt b/src/soca/Covariance/CMakeLists.txt index 92b252f54..55cff65d4 100644 --- a/src/soca/Covariance/CMakeLists.txt +++ b/src/soca/Covariance/CMakeLists.txt @@ -1,7 +1,3 @@ soca_target_sources( - ErrorCovariance.cc ErrorCovariance.h - ErrorCovarianceFortran.h - soca_covariance_mod.F90 - soca_covariance.interface.F90 ) \ No newline at end of file diff --git a/src/soca/Covariance/ErrorCovariance.cc b/src/soca/Covariance/ErrorCovariance.cc deleted file mode 100644 index 57191ded2..000000000 --- a/src/soca/Covariance/ErrorCovariance.cc +++ /dev/null @@ -1,91 +0,0 @@ -/* - * (C) Copyright 2017-2021 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 - -#include "soca/Covariance/ErrorCovariance.h" -#include "soca/Covariance/ErrorCovarianceFortran.h" -#include "soca/Geometry/Geometry.h" -#include "soca/Increment/Increment.h" -#include "soca/State/State.h" - -#include "eckit/config/Configuration.h" - -#include "oops/assimilation/GMRESR.h" -#include "oops/base/IdentityMatrix.h" -#include "oops/base/Variables.h" -#include "oops/util/Logger.h" - -using oops::Log; - -// ----------------------------------------------------------------------------- -namespace soca { - // ----------------------------------------------------------------------------- - - ErrorCovariance::ErrorCovariance(const Geometry & resol, - const oops::Variables &, - const eckit::Configuration & conf, - const State & bkg, - const State & traj) { - // bkg: Background state, invariant wrt outer-loop. - const eckit::Configuration * configc = &conf; - vars_ = oops::Variables(conf, "analysis variables"); - soca_b_setup_f90(keyFtnConfig_, &configc, resol.toFortran(), - bkg.toFortran(), vars_); - Log::trace() << "ErrorCovariance created" << std::endl; - } - - // ----------------------------------------------------------------------------- - - ErrorCovariance::~ErrorCovariance() { - soca_b_delete_f90(keyFtnConfig_); - Log::trace() << "ErrorCovariance destructed" << std::endl; - } - - // ----------------------------------------------------------------------------- - - void ErrorCovariance::linearize(const State & traj, const Geometry & resol) { - geom_.reset(new Geometry(resol)); - Log::trace() << "Trajectory for ErrorCovariance" << std::endl; - } - - // ----------------------------------------------------------------------------- - - void ErrorCovariance::multiply(const Increment & dxin, Increment & dxout) - const { - dxout = dxin; - soca_b_mult_f90(keyFtnConfig_, dxin.toFortran(), dxout.toFortran()); - Log::trace() << "ErrorCovariance multiply" << std::endl; - } - - // ----------------------------------------------------------------------------- - - void ErrorCovariance::inverseMultiply(const Increment & dxin, - Increment & dxout) const { - // oops::IdentityMatrix Id; - // dxout.zero(); - // GMRESR(dxout, dxin, *this, Id, 10, 1.0e-6); - dxout = dxin; - Log::trace() << "ErrorCovariance inversemultiply" << std::endl; - } - - // ----------------------------------------------------------------------------- - - // void ErrorCovariance::doRandomize(Increment & dx) const { - void ErrorCovariance::randomize(Increment & dx) const { - soca_b_randomize_f90(keyFtnConfig_, dx.toFortran()); - } - - // ----------------------------------------------------------------------------- - - void ErrorCovariance::print(std::ostream & os) const { - os << "ErrorCovariance::print not implemented"; - } - - // ----------------------------------------------------------------------------- - -} // namespace soca diff --git a/src/soca/Covariance/ErrorCovariance.h b/src/soca/Covariance/ErrorCovariance.h index 3c102dcdc..57a01e96d 100644 --- a/src/soca/Covariance/ErrorCovariance.h +++ b/src/soca/Covariance/ErrorCovariance.h @@ -42,20 +42,17 @@ namespace soca { ErrorCovariance(const Geometry &, const oops::Variables &, const eckit::Configuration &, - const State &, const State &); - ~ErrorCovariance(); + const State &, const State &) { + throw eckit::NotImplemented("You should not be using SocaError, use SABER!");} + ~ErrorCovariance() {} - void linearize(const State &, const Geometry &); - void multiply(const Increment &, Increment &) const; - void inverseMultiply(const Increment &, Increment &) const; - void randomize(Increment &) const; + void linearize(const State &, const Geometry &) {} + void multiply(const Increment &, Increment &) const {} + void inverseMultiply(const Increment &, Increment &) const {} + void randomize(Increment &) const {} private: - void print(std::ostream &) const; - int keyFtnConfig_; - boost::scoped_ptr geom_; - boost::scoped_ptr traj_; - oops::Variables vars_; + void print(std::ostream &) const {} }; // ----------------------------------------------------------------------------- diff --git a/src/soca/Covariance/ErrorCovarianceFortran.h b/src/soca/Covariance/ErrorCovarianceFortran.h deleted file mode 100644 index 4acd138cb..000000000 --- a/src/soca/Covariance/ErrorCovarianceFortran.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (C) Copyright 2019-2021 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. - */ - -#ifndef SOCA_COVARIANCE_ERRORCOVARIANCEFORTRAN_H_ -#define SOCA_COVARIANCE_ERRORCOVARIANCEFORTRAN_H_ - -#include "soca/Fortran.h" - -// Forward declarations -namespace eckit { - class Configuration; -} - -namespace soca { - - extern "C" { - void soca_b_setup_f90(F90bmat &, const eckit::Configuration * const *, - const F90geom &, const F90flds &, - const oops::Variables &); - void soca_b_delete_f90(F90bmat &); - void soca_b_mult_f90(const F90bmat &, const F90flds &, - const F90flds &); - void soca_b_invmult_f90(const F90bmat &, const F90flds &, const F90flds &); - void soca_b_randomize_f90(const F90bmat &, const F90flds &); - } -} // namespace soca -#endif // SOCA_COVARIANCE_ERRORCOVARIANCEFORTRAN_H_ diff --git a/src/soca/Covariance/soca_covariance.interface.F90 b/src/soca/Covariance/soca_covariance.interface.F90 deleted file mode 100644 index f4da66f4a..000000000 --- a/src/soca/Covariance/soca_covariance.interface.F90 +++ /dev/null @@ -1,125 +0,0 @@ -! (C) Copyright 2017-2021 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. - -!> C++ interfaces for soca_covariance_mod::soca_cov -module soca_covariance_mod_c - -use fckit_configuration_module, only: fckit_configuration -use iso_c_binding -use oops_variables_mod, only: oops_variables - -! soca modules -use soca_covariance_mod, only: soca_cov -use soca_geom_mod_c, only : soca_geom_registry -use soca_geom_mod, only : soca_geom -use soca_increment_mod, only : soca_increment -use soca_increment_reg, only : soca_increment_registry -use soca_state_mod, only : soca_state -use soca_state_reg, only : soca_state_registry - -implicit none -private - -#define LISTED_TYPE soca_cov - -!> Linked list interface - defines registry_t type -#include "oops/util/linkedList_i.f" - -!> Global registry for soca_cov -type(registry_t), public :: soca_cov_registry - -! ------------------------------------------------------------------------------ -contains -! ------------------------------------------------------------------------------ -!> Linked list implementation -#include "oops/util/linkedList_c.f" -! ------------------------------------------------------------------------------ - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_covariance_mod::soca_cov::setup() -!! -!! Setup for the SOCA model's background error covariance matrix -subroutine soca_b_setup_c(c_key_self, c_conf, c_key_geom, c_key_bkg, c_vars) & - & bind (c,name='soca_b_setup_f90') - integer(c_int), intent(inout) :: c_key_self !< The background covariance structure - type(c_ptr), intent(in) :: c_conf !< The configuration - integer(c_int), intent(in) :: c_key_geom !< Geometry - integer(c_int), intent(in) :: c_key_bkg !< Background - type(c_ptr),value, intent(in) :: c_vars !< List of variables - - type(soca_cov), pointer :: self - type(soca_geom), pointer :: geom - type(soca_state), pointer :: bkg - type(oops_variables) :: vars - - call soca_geom_registry%get(c_key_geom, geom) - call soca_cov_registry%init() - call soca_cov_registry%add(c_key_self) - call soca_cov_registry%get(c_key_self, self) - call soca_state_registry%get(c_key_bkg,bkg) - vars = oops_variables(c_vars) - call self%setup(fckit_configuration(c_conf), geom, bkg, vars) - -end subroutine soca_b_setup_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_covariance_mod::soca_cov::delete() -!! -!! Delete for the SOCA model's background error covariance matrix -subroutine soca_b_delete_c(c_key_self) bind (c,name='soca_b_delete_f90') - integer(c_int), intent(inout) :: c_key_self !< The background covariance structure - - type(soca_cov), pointer :: self - - call soca_cov_registry%get(c_key_self,self) - call self%delete() - call soca_cov_registry%remove(c_key_self) - -end subroutine soca_b_delete_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_covariance_mod::soca_cov::mult() -subroutine soca_b_mult_c(c_key_self, c_key_in, c_key_out) bind(c,name='soca_b_mult_f90') - integer(c_int), intent(inout) :: c_key_self !< The background covariance structure - integer(c_int), intent(in) :: c_key_in !< " to Increment in - integer(c_int), intent(in) :: c_key_out !< " to Increment out - - type(soca_cov), pointer :: self - type(soca_increment), pointer :: xin - type(soca_increment), pointer :: xout - - call soca_cov_registry%get(c_key_self, self) - call soca_increment_registry%get(c_key_in, xin) - call soca_increment_registry%get(c_key_out, xout) - - call xout%copy(xin) !< xout = xin - call self%mult(xout) !< xout = C.xout - -end subroutine soca_b_mult_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_covariance_mod::soca_cov::sqrt_c_mult() -!! -!! Generate randomized C^1/2 x increment -subroutine soca_b_randomize_c(c_key_self, c_key_out) bind(c,name='soca_b_randomize_f90') - integer(c_int), intent(in) :: c_key_self !< covar config structure - integer(c_int), intent(in) :: c_key_out !< Randomized increment - - type(soca_cov), pointer :: self - type(soca_increment), pointer :: xout - - call soca_cov_registry%get(c_key_self, self) - call soca_increment_registry%get(c_key_out, xout) - - ! Randomize increment - call self%sqrt_C_mult(xout) !< xout = C^1/2.xout - -end subroutine soca_b_randomize_c - -end module soca_covariance_mod_c diff --git a/src/soca/Covariance/soca_covariance_mod.F90 b/src/soca/Covariance/soca_covariance_mod.F90 deleted file mode 100644 index 3ed0c615c..000000000 --- a/src/soca/Covariance/soca_covariance_mod.F90 +++ /dev/null @@ -1,468 +0,0 @@ -! (C) Copyright 2017-2023 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. - -!> Structure holding configuration variables for the 3d error -!! covariance matrices of the SOCA analysis. -module soca_covariance_mod - -use atlas_module, only: atlas_fieldset, atlas_field, atlas_real, atlas_integer, atlas_functionspace -use fckit_configuration_module, only: fckit_configuration -use logger_mod -use kinds, only: kind_real -use oops_variables_mod, only: oops_variables -use random_mod, only: normal_distribution -use type_bump, only: bump_type -use type_fieldset, only: fieldset_type - -! soca modules -use soca_fields_mod, only: soca_field -use soca_geom_mod, only : soca_geom -use soca_increment_mod, only: soca_increment -use soca_state_mod, only: soca_state - -implicit none -private - -!> SOCA background/model covariance -type, public :: soca_cov - type(bump_type), pointer :: conv(:) !< convolution op from bump - type(soca_state), pointer :: bkg !< Background field (or first guess) - type(oops_variables) :: vars !< Apply B to vars - - real(kind=kind_real), allocatable :: pert_scale(:) !< index matches "vars" - type(oops_variables), allocatable :: conv_vars(:) !< index mathces "conv" - - type(soca_geom), pointer :: geom -contains - !> \copybrief soca_cov_setup \see soca_cov_setup - procedure :: setup => soca_cov_setup - - !> \copybrief soca_cov_delete \see soca_cov_delete - procedure :: delete => soca_cov_delete - - !> \copybrief soca_cov_c_mult \see soca_cov_c_mult - procedure :: mult => soca_cov_C_mult - - !> \copybrief soca_cov_sqrt_c_mult \see soca_cov_sqrt_c_mult - procedure :: sqrt_C_mult => soca_cov_sqrt_C_mult - - !> \copybrief soca_cov_get_conv \see soca_cov_get_conv - procedure :: getConv => soca_cov_get_conv -end type soca_cov - - -! ------------------------------------------------------------------------------ -contains -! ------------------------------------------------------------------------------ - - -! ------------------------------------------------------------------------------ -!> Setup for the SOCA model's 3d error covariance matrices (B and Q_i) -!! -!! This routine queries the configuration for the parameters that define the -!! covariance matrix, and stores the relevant values in the -!! error covariance structure. -!! \relates soca_covariance_mod::soca_cov -subroutine soca_cov_setup(self, f_conf, geom, bkg, vars) - class(soca_cov), intent(inout) :: self !< The covariance structure - type(fckit_configuration), intent(in) :: f_conf !< The configuration - type(soca_geom), pointer, intent(in) :: geom !< Geometry - type(soca_state), target, intent(in) :: bkg !< Background - type(oops_variables), intent(in) :: vars !< List of variables - - type(fckit_configuration) :: f_conf2 - type(fckit_configuration), allocatable :: f_conf_list(:) - character(len=:), allocatable :: domain_vars(:) - character(len=:), allocatable :: domain - integer :: i, isc, iec, jsc, jec, ivar - - ! save a copy of geometry for use later - self%geom => geom - - ! Setup list of variables to apply B on - self%vars = vars - - ! get perturbation scales (or set to 1.0) - allocate(self%pert_scale(self%vars%nvars())) - self%pert_scale = 1.0 - if (f_conf%get("perturbation scales", f_conf2)) then - do ivar=1,self%vars%nvars() - if ( .not. f_conf2%get(self%vars%variable(ivar), self%pert_scale(ivar))) then - call oops_log%info( & - "WARNING: no pertubation scale given for '" //trim(self%vars%variable(ivar)) & - // "' using default of 1.0") - end if - end do - end if - - ! Associate background - self%bkg => bkg - - ! Indices for compute domain (no halo) - isc = bkg%geom%isc ; iec = bkg%geom%iec - jsc = bkg%geom%jsc ; jec = bkg%geom%jec - - ! Initialize bump - call f_conf%get_or_die("bump", f_conf2) - call f_conf2%set('model.nl0', 1) - call f_conf2%set('model.variables', ['var']) - call f_conf%get_or_die("correlation", f_conf_list) - allocate(self%conv(size(f_conf_list))) - allocate(self%conv_vars(size(self%conv))) - do i=1,size(f_conf_list) - call f_conf_list(i)%get_or_die("name", domain) - call f_conf_list(i)%get_or_die("variables", domain_vars) - self%conv_vars(i) = oops_variables() - call self%conv_vars(i)%push_back(domain_vars) - call f_conf2%set('io.files prefix', domain) - - call soca_bump_correlation(self, self%conv(i), geom, f_conf2, f_conf_list(i), domain) - end do - -end subroutine soca_cov_setup - - -! ------------------------------------------------------------------------------ -!> Delete for the SOCA model's 3d error covariance matrices -!! -!! \relates soca_covariance_mod::soca_cov -subroutine soca_cov_delete(self) - class(soca_cov), intent(inout) :: self !< The covariance structure - - deallocate(self%conv) - deallocate(self%conv_vars) - deallocate(self%pert_scale) - nullify(self%bkg) - -end subroutine soca_cov_delete - - -! ------------------------------------------------------------------------------ -!> Get the convolution operator needed for a specific field -!! -!! \throws abor1_ftn aborts if trying to use a field not on the tracer grid -!! \relates soca_covariance_mod::soca_cov -subroutine soca_cov_get_conv(self, field, conv) - class(soca_cov), intent(inout) :: self - type(soca_field), pointer, intent(in) :: field !< The field that will be convolved - type(bump_type), pointer, intent(out) :: conv !< pointer to resulting convolution - - integer :: j,k - - ! safety check to make sure field is on h grid - ! TODO we really should have separate variable names for staggered/destaggered variables. - ! The "abort" has been turned into a "warning" until we get u/v names straightened out. - if (field%metadata%grid /= "h") then - call oops_log%info("WARNING: Attempting to use a field (" // & - trim(field%name) // ") which is on the u/v grid. PROCEED WITH CAUTION") - end if - - ! determine which horizontal convolution to use - nullify(conv) - outer: do j=1,size(self%conv_vars) - do k=1,self%conv_vars(j)%nvars() - if (self%conv_vars(j)%variable(k) == field%name) then - conv => self%conv(j) - exit outer - end if - end do - end do outer - if ( .not. associated(conv)) then - call abor1_ftn("ERROR: No valid bump operator found for field '"//field%name//"'") - end if -end subroutine - - -! ------------------------------------------------------------------------------ -!> Apply convolution to an increment -!! -!! \relates soca_covariance_mod::soca_cov -subroutine soca_cov_C_mult(self, dx) - class(soca_cov), intent(inout) :: self !< The covariance structure - type(soca_increment), intent(inout) :: dx !< Input: Increment, Output: C dx - integer :: i, z - type(soca_field), pointer :: field - type(bump_type), pointer :: conv - real(kind=kind_real), allocatable :: fld_2d(:,:) - - allocate(fld_2d(self%geom%isd:self%geom%ied, self%geom%jsd:self%geom%jed)) - - do i = 1, self%vars%nvars() - ! why is this sometimes getting an "empty" list with "none" in it? - if (.not. dx%has(self%vars%variable(i))) cycle - - call dx%get(trim(self%vars%variable(i)), field) - - ! a **TEMPORARY** special exception for hocn - if ( field%name == "hocn" ) cycle - - ! determine which horizontal convolution to use - call self%getConv(field, conv) - - ! apply convolution on each level - do z = 1, field%nz - fld_2d = field%val(:,:,z) - call soca_2d_convol(fld_2d, conv, dx%geom) - field%val(:,:,z) = fld_2d - end do - end do -end subroutine soca_cov_C_mult - - -! ------------------------------------------------------------------------------ -!> Apply the square root of C to an increment -!! -!! \throws abor1_ftn aborts if no pertubation scales are given -!! \relates soca_covariance_mod::soca_cov -subroutine soca_cov_sqrt_C_mult(self, dx) - class(soca_cov), intent(inout) :: self !< The covariance structure - type(soca_increment), intent(inout) :: dx !< Input: Increment, Output: C^1/2 dx - integer :: i, z, j - type(soca_field), pointer :: field - real(kind=kind_real) :: scale - type(bump_type), pointer :: conv - real(kind=kind_real), allocatable :: fld_2d(:,:) - - allocate(fld_2d(self%geom%isd:self%geom%ied, self%geom%jsd:self%geom%jed)) - - do i = 1, self%vars%nvars() - conv => null() - call dx%get(trim(self%vars%variable(i)), field) - - ! a **TEMPORARY** special exception for hocn - if ( field%name == "hocn" ) cycle - - ! find matching index in self%vars and get the perturbation scale - if (.not. allocated(self%pert_scale)) then - call abor1_ftn("ERROR: cannot use sqrt_C_mult if no perturbation scales given") - endif - do j=1,self%vars%nvars() - if (self%vars%variable(j) == field%name) exit - end do - scale = self%pert_scale(j) - - ! determine which horizontal convolution to use - call self%getConv(field, conv) - - ! apply convolution - do z = 1,field%nz - fld_2d = field%val(:,:,z) - call soca_2d_sqrt_convol(fld_2d, conv, dx%geom, scale) - field%val(:,:,z) = fld_2d - end do - - end do -end subroutine soca_cov_sqrt_C_mult - - -! ------------------------------------------------------------------------------ -!> Setup bump for horizontal convolution, Using rossby radiusbased correlation lengths -!! -!! Used by soca_cov::setup() -!! -!! Correlation lengths are calculated as follows : -!! 1) rh = "base value" + rossby_radius * "rossby mult" -!! 2) minimum value of "min grid mult" * grid_size is imposed -!! 3) min/max are imposed based on "min value" and "max value" -!! 4) converted from a gaussian sigma to Gaspari-Cohn cutoff distance -!! \relates soca_covariance_mod::soca_cov -subroutine soca_bump_correlation(self, horiz_convol, geom, f_conf_bump, f_conf_domain, domain) - class(soca_cov), intent(inout) :: self !< The covariance structure - type(bump_type), intent(inout) :: horiz_convol - type(soca_geom), intent(in) :: geom - type(fckit_configuration), intent(in) :: f_conf_bump, f_conf_domain - character(len=3), intent(in) :: domain - - integer :: i - integer, allocatable :: hmask(:,:) - integer, pointer :: int_ptr(:,:) - real(kind=kind_real), pointer :: real_ptr(:,:), vArea(:,:), vRossby(:,:) - type(atlas_functionspace) :: afunctionspace - type(fieldset_type) :: afieldset, rh, rv - - type(atlas_field) :: afield, fArea, fRossby - real(kind=kind_real) :: r_base, r_mult, r_min, r_max, r_min_grid - - ! wrap the functionspace - afunctionspace = atlas_functionspace(geom%functionspace%c_ptr()) - - ! Geometry fieldset setup - afieldset = atlas_fieldset() - - ! add existing fields that were created by geometry - call afieldset%add(geom%fieldset%field('area')) - call afieldset%add(geom%fieldset%field('vert_coord')) - call afieldset%add(geom%fieldset%field('gmask')) - call afieldset%add(geom%fieldset%field('owned')) - - - ! Set verbosity - horiz_convol%mpl%verbose = (geom%f_comm%rank()==0) - - ! Create BUMP object - call horiz_convol%create(geom%f_comm,afunctionspace,afieldset,f_conf_bump) - - if (horiz_convol%nam%new_nicas) then - ! get some fields from the geom fieldset - fArea = geom%fieldset%field('area') - call fArea%data(vArea) - fRossby = geom%fieldset%field('rossby_radius') - call fRossby%data(vRossby) - - ! get parameters for correlation lengths - if (.not. f_conf_domain%get('base value', r_base)) r_base = 0.0 - if (.not. f_conf_domain%get('rossby mult', r_mult)) r_mult = 0.0 - if (.not. f_conf_domain%get('min grid mult', r_min_grid)) r_min_grid = 1.0 - if (.not. f_conf_domain%get('min value', r_min)) r_min = 0.0 - if (.not. f_conf_domain%get('max value', r_max)) r_max = huge(r_max) - - ! rh is calculated as follows : - ! 1) rh = "base value" + rossby_radius * "rossby mult" - ! 2) minimum value of "min grid mult" * grid_size is imposed - ! 3) min/max are imposed based on "min value" and "max value" - ! 4) converted from a gaussian sigma to Gaspari-Cohn cutoff distance - rh = atlas_fieldset() - afield = geom%functionspace%create_field('var',kind=atlas_real(kind_real),levels=1) - call rh%add(afield) - call afield%data(real_ptr) - real_ptr(1,:) = r_base + r_mult*vRossby(1,:) - ! min based on grid size - if (r_min_grid .gt. 0.0) then - real_ptr(1,:) = max(real_ptr(1,:), sqrt(vArea(1,:))*r_min_grid ) - end if - real_ptr(1,:) = min(r_max, real_ptr(1,:)) - real_ptr(1,:) = max(r_min, real_ptr(1,:)) - real_ptr(1,:) = real_ptr(1,:) * 3.57_kind_real ! convert from gaussian sigma to - ! Gaspari-Cohn half width - call afield%final() - - ! rv - rv = atlas_fieldset() - afield = geom%functionspace%create_field('var',kind=atlas_real(kind_real),levels=1) - call rv%add(afield) - call afield%data(real_ptr) - real_ptr = 1.0 - call afield%final() - - ! Copy length-scales into BUMP - call horiz_convol%set_parameter('rh', 1, rh) - call horiz_convol%set_parameter('rv', 1, rv) - - ! Clean up - call rh%final() - call rv%final() - call fRossby%final() - call fArea%final() - end if - - ! Run BUMP drivers - call horiz_convol%run_drivers() - -end subroutine soca_bump_correlation - - -! ------------------------------------------------------------------------------ -!> Apply bump 2D convolution -!! -!! Used by soca_cov::mult() -!! \relates soca_covariance_mod::soca_cov -subroutine soca_2d_convol(dx, horiz_convol, geom) - real(kind=kind_real), allocatable, intent(inout) :: dx(:,:) - type(bump_type), intent(inout) :: horiz_convol - type(soca_geom), intent(in) :: geom - - type(fieldset_type) :: fieldset - type(atlas_field) :: field - real(kind_real), pointer :: real_ptr(:,:) - integer :: i, j, n - - ! array to atlas - ! (Yeah, this code is duplicated in a few places, but this whole - ! class is going away "soon" so I don't care) - fieldset = atlas_fieldset() - field = geom%functionspace%create_field('var', kind=atlas_real(kind_real), levels=1) - call fieldset%add(field) - call field%data(real_ptr) - do j=geom%jsc,geom%jec - do i=geom%isc,geom%iec - real_ptr(1,geom%atlas_ij2idx(i,j)) = dx(i,j) - end do - end do - - ! Apply 2D convolution - call horiz_convol%apply_nicas(fieldset) - - ! atlas to array - do j=geom%jsc,geom%jec - do i=geom%isc,geom%iec - dx(i,j) = real_ptr(1,geom%atlas_ij2idx(i,j)) - end do - end do - - ! Clean up - call field%final() - call fieldset%final() -end subroutine soca_2d_convol - - -! ------------------------------------------------------------------------------ -!> Apply bump square root of C -!! -!! used by soca_cov::sqrt_C_mult() -!! \relates soca_covariance_mod::soca_cov -subroutine soca_2d_sqrt_convol(dx, horiz_convol, geom, pert_scale) - real(kind=kind_real), allocatable, intent(inout) :: dx(:,:) - type(bump_type), intent(inout) :: horiz_convol - type(soca_geom), intent(in) :: geom - real(kind=kind_real), intent(in) :: pert_scale - - type(fieldset_type) :: fieldset - type(atlas_field) :: field - real(kind_real), pointer :: real_ptr(:,:) - integer :: i, j, n - - type(atlas_field) :: acv - integer, parameter :: rseed = 1 ! constant for reproducability of tests - ! TODO: pass seed through config - integer :: nn - real(kind=kind_real), pointer :: ptr(:) - - ! array to atlas fieldset - fieldset = atlas_fieldset() - field = geom%functionspace%create_field('var', kind=atlas_real(kind_real), levels=1) - call fieldset%add(field) - call field%data(real_ptr) - do j=geom%jsc,geom%jec - do i=geom%isc,geom%iec - real_ptr(1,geom%atlas_ij2idx(i,j)) = dx(i,j) - end do - end do - - ! Get control variable size - call horiz_convol%get_cv_size(nn) - acv = atlas_field("ctlVec", atlas_real(kind_real), (/nn/)) - call acv%data(ptr) - ptr = 0.0_kind_real - call normal_distribution(ptr, 0.0_kind_real, 1.0_kind_real, rseed) - ptr = pert_scale * ptr - - ! Apply C^1/2 - call horiz_convol%apply_nicas_sqrt(acv, fieldset, 0) - - ! atlas to array - do j=geom%jsc,geom%jec - do i=geom%isc,geom%iec - dx(i,j) = real_ptr(1,geom%atlas_ij2idx(i,j)) - end do - end do - - ! Clean up - call acv%final() - call field%final() - call fieldset%final() - -end subroutine soca_2d_sqrt_convol - -end module soca_covariance_mod diff --git a/src/soca/ExplicitDiffusion/ExplicitDiffusion.F90 b/src/soca/ExplicitDiffusion/ExplicitDiffusion.F90 index c702d2294..578b7a81c 100644 --- a/src/soca/ExplicitDiffusion/ExplicitDiffusion.F90 +++ b/src/soca/ExplicitDiffusion/ExplicitDiffusion.F90 @@ -63,17 +63,20 @@ subroutine soca_explicitdiffusion_calibrate_c(c_key_self, c_conf) bind(c, name=' ! ------------------------------------------------------------------------------ -subroutine soca_explicitdiffusion_multiply_c(c_key_self, c_key_dx) bind(c, name='soca_explicitdiffusion_multiply_f90') +subroutine soca_explicitdiffusion_multiply_c(c_key_self, c_key_dx, c_sqrt) bind(c, name='soca_explicitdiffusion_multiply_f90') integer(c_int), intent(inout) :: c_key_self integer(c_int), intent(in) :: c_key_dx + logical(c_bool), intent(in) :: c_sqrt type(soca_diffusion), pointer :: self type(soca_increment), pointer :: dx + logical :: sqrt + sqrt = c_sqrt call soca_diffusion_registry%get(c_key_self, self) call soca_increment_registry%get(c_key_dx, dx) - call self%multiply(dx) + call self%multiply(dx, sqrt) end subroutine ! ------------------------------------------------------------------------------ diff --git a/src/soca/ExplicitDiffusion/ExplicitDiffusion.cc b/src/soca/ExplicitDiffusion/ExplicitDiffusion.cc index e94ca266a..3a710140d 100644 --- a/src/soca/ExplicitDiffusion/ExplicitDiffusion.cc +++ b/src/soca/ExplicitDiffusion/ExplicitDiffusion.cc @@ -5,6 +5,8 @@ * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. */ +#include "oops/util/FieldSetHelpers.h" + #include "soca/ExplicitDiffusion/ExplicitDiffusion.h" #include "soca/ExplicitDiffusion/ExplicitDiffusionFortran.h" #include "soca/Geometry/Geometry.h" @@ -40,8 +42,17 @@ ExplicitDiffusion::ExplicitDiffusion( // -------------------------------------------------------------------------------------- -void ExplicitDiffusion::randomize(oops::FieldSet3D &) const { - throw eckit::NotImplemented("read not implemented yet for ExplictDiffusion"); +void ExplicitDiffusion::randomize(oops::FieldSet3D & fset) const { + // Create random increments + fset.randomInit(geom_->functionSpace(), fset.variables()); + Increment dx(*geom_, vars_, util::DateTime()); + dx.fromFieldSet(fset.fieldSet()); + + // apply square root of diffusion + soca_explicitdiffusion_multiply_f90(keyFortran_, dx.toFortran(), true); + + // copy back to fieldset + dx.toFieldSet(fset.fieldSet()); } // -------------------------------------------------------------------------------------- diff --git a/src/soca/ExplicitDiffusion/ExplicitDiffusionFortran.h b/src/soca/ExplicitDiffusion/ExplicitDiffusionFortran.h index 890819866..fa7ff1007 100644 --- a/src/soca/ExplicitDiffusion/ExplicitDiffusionFortran.h +++ b/src/soca/ExplicitDiffusion/ExplicitDiffusionFortran.h @@ -23,7 +23,8 @@ extern "C" { void soca_explicitdiffusion_calibrate_f90(const F90explicitdiffusion &, const eckit::Configuration * const &); void soca_explicitdiffusion_multiply_f90(const F90explicitdiffusion &, - const F90flds &); + const F90flds &, + const bool & sqrt = false); void soca_explicitdiffusion_writeparams_f90(const F90explicitdiffusion &, const eckit::Configuration * const &); void soca_explicitdiffusion_readparams_f90(const F90explicitdiffusion &, diff --git a/src/soca/ExplicitDiffusion/soca_diffusion.F90 b/src/soca/ExplicitDiffusion/soca_diffusion.F90 index bbd3f76c5..dcf2aab78 100644 --- a/src/soca/ExplicitDiffusion/soca_diffusion.F90 +++ b/src/soca/ExplicitDiffusion/soca_diffusion.F90 @@ -526,9 +526,10 @@ subroutine soca_diffusion_calibrate_hz(self, params, hz_conf, norm_conf) ! ------------------------------------------------------------------------------ ! Perform horizontal diffusion on each level -subroutine soca_diffusion_multiply(self, dx) +subroutine soca_diffusion_multiply(self, dx, sqrt) class(soca_diffusion), intent(inout) :: self type(soca_increment), intent(inout) :: dx + logical, intent(in) :: sqrt real(kind=kind_real), allocatable :: tmp3d(:,:,:) character(len=1024) :: str @@ -575,7 +576,7 @@ subroutine soca_diffusion_multiply(self, dx) end do ! multipy - call self%multiply_field(tmp3d, self%group(g)) + call self%multiply_field(tmp3d, self%group(g), sqrt) ! copy back into source vars do f=1, size(dx%fields) @@ -589,7 +590,7 @@ subroutine soca_diffusion_multiply(self, dx) ! apply multiply separately to each variable in the group do f=1, size(dx%fields) if ( self%get_group(dx%fields(f)%name) /= g) cycle - call self%multiply_field(dx%fields(f)%val, self%group(g)) + call self%multiply_field(dx%fields(f)%val, self%group(g), sqrt) end do end if end do @@ -598,10 +599,13 @@ subroutine soca_diffusion_multiply(self, dx) end subroutine ! ------------------------------------------------------------------------------ -subroutine soca_diffusion_multiply_field(self, field, params) +! Performs a full multiplcation by diffusion if sqrt == .false. +! Otherwise, the input is multiplied by the square root of the diffusion operator +subroutine soca_diffusion_multiply_field(self, field, params, sqrt) class(soca_diffusion), intent(inout) :: self real(kind=kind_real), allocatable, intent(inout) :: field(:,:,:) type(soca_diffusion_group_params), intent(in) :: params + logical, intent(in) :: sqrt integer :: z real(kind=kind_real), allocatable :: tmp2d(:,:) @@ -609,17 +613,19 @@ subroutine soca_diffusion_multiply_field(self, field, params) allocate(tmp2d(DOMAIN_WITH_HALO)) ! normalization (horizontal + vertical) - if (params%niter_hz > 0) then - do z = 1, size(field, dim=3) - field(DOMAIN,z) = field(DOMAIN,z) * params%normalization_hz(DOMAIN) - end do + if (.not. sqrt) then + if (params%niter_hz > 0) then + do z = 1, size(field, dim=3) + field(DOMAIN,z) = field(DOMAIN,z) * params%normalization_hz(DOMAIN) + end do + end if + if (params%niter_vt > 0) then + field(DOMAIN,:) = field(DOMAIN,:) * params%normalization_vt(DOMAIN,:) + end if end if - if (params%niter_vt > 0) then - field(DOMAIN,:) = field(DOMAIN,:) * params%normalization_vt(DOMAIN,:) - end if ! vertical diffusion AD - if (params%niter_vt > 0) then + if (.not. sqrt .and. params%niter_vt > 0) then call self%diffusion_vt_ad(field, params) end if @@ -630,7 +636,7 @@ subroutine soca_diffusion_multiply_field(self, field, params) tmp2d = field(:,:,z) ! horizontal diffusion AD - if (params%niter_hz > 0) then + if (.not. sqrt .and. params%niter_hz > 0) then call self%diffusion_hz_ad(tmp2d, params) end if @@ -651,7 +657,10 @@ subroutine soca_diffusion_multiply_field(self, field, params) tmp2d = sum(field, dim=3) ! apply diffusion - call self%diffusion_hz_ad(tmp2d, params) + if (.not. sqrt ) then + call self%diffusion_hz_ad(tmp2d, params) + end if + ! TODO grid metric ! tmp2d = tmp2d * self%inv_sqrt_area call self%diffusion_hz_tl(tmp2d, params) diff --git a/src/soca/Fields/soca_fields_mod.F90 b/src/soca/Fields/soca_fields_mod.F90 index 4a38b7cb3..90e4f5750 100644 --- a/src/soca/Fields/soca_fields_mod.F90 +++ b/src/soca/Fields/soca_fields_mod.F90 @@ -1281,18 +1281,18 @@ subroutine soca_fields_write_rst(self, f_conf, vdate) end do ! write out and cleanup - call save_restart(ocean_restart, directory='') + call save_restart(ocean_restart, directory='./') call free_restart_type(ocean_restart) if (write_sfc) then - call save_restart(sfc_restart, directory='') + call save_restart(sfc_restart, directory='./') call free_restart_type(sfc_restart) end if if (write_ice) then - call save_restart(ice_restart, directory='') + call save_restart(ice_restart, directory='./') call free_restart_type(ice_restart) end if if (write_wav) then - call save_restart(wav_restart, directory='') + call save_restart(wav_restart, directory='./') call free_restart_type(wav_restart) end if call fms_io_exit() diff --git a/src/soca/Geometry/soca_geom_mod.F90 b/src/soca/Geometry/soca_geom_mod.F90 index aa19445a0..751b59262 100644 --- a/src/soca/Geometry/soca_geom_mod.F90 +++ b/src/soca/Geometry/soca_geom_mod.F90 @@ -25,7 +25,7 @@ module soca_geom_mod use MOM_EOS, only : EOS_type use mpp_domains_mod, only : mpp_get_compute_domain, mpp_get_data_domain, & mpp_get_global_domain, mpp_update_domains, & - CYCLIC_GLOBAL_DOMAIN, FOLD_NORTH_EDGE + CYCLIC_GLOBAL_DOMAIN, FOLD_NORTH_EDGE ! soca modules use soca_fields_metadata_mod, only : soca_fields_metadata use soca_mom6, only: soca_mom6_config, soca_mom6_init, soca_geomdomain_init @@ -117,6 +117,7 @@ module soca_geom_mod real(kind=kind_real), allocatable, dimension(:,:) :: distance_from_coast !< distance to closest land grid point (m) real(kind=kind_real), allocatable, dimension(:,:,:) :: h !< layer thickness (m) real(kind=kind_real), allocatable, dimension(:,:,:) :: h_zstar + logical, allocatable, dimension(:,:) :: valid_halo_mask !< true unless gridpoint is a duplicate or invalid halo !> \} !> instance of the metadata that is read in from a config file upon initialization @@ -217,6 +218,9 @@ subroutine soca_geom_init(self, f_conf, f_comm) call mpp_update_domains(self%rossby_radius, self%Domain%mpp_domain) call mpp_update_domains(self%distance_from_coast, self%Domain%mpp_domain) + ! calculate which halo points are duplicates / invalid + call soca_geom_find_invalid_halo(self) + ! Set output option for local geometry if ( .not. f_conf%get("save_local_domain", self%save_local_domain) ) & self%save_local_domain = .false. @@ -260,6 +264,7 @@ subroutine soca_geom_end(self) if (allocated(self%distance_from_coast)) deallocate(self%distance_from_coast) if (allocated(self%h)) deallocate(self%h) if (allocated(self%h_zstar)) deallocate(self%h_zstar) + if (allocated(self%valid_halo_mask)) deallocate(self%valid_halo_mask) nullify(self%Domain) call self%functionspace%final() @@ -399,7 +404,7 @@ subroutine soca_geom_gridgen(self) type(EOS_type), pointer :: eqn_of_state integer :: k real(kind=kind_real), allocatable :: tracer(:,:,:) - logical :: answers_2018 = .false. + integer :: answer_date = 20190101 ! Generate grid call soca_mom6_init(mom6_config, partial_init=.true.) @@ -428,7 +433,7 @@ subroutine soca_geom_gridgen(self) ! Setup intermediate zstar coordinate allocate(tracer(self%isd:self%ied, self%jsd:self%jed, self%nzo)) tracer = 0.d0 ! dummy tracer - call diag_remap_init(remap_ctrl, coord_tuple='ZSTAR, ZSTAR, ZSTAR', answers_2018=answers_2018) + call diag_remap_init(remap_ctrl, coord_tuple='ZSTAR, ZSTAR, ZSTAR', answer_date=answer_date) call diag_remap_configure_axes(remap_ctrl, mom6_config%GV, mom6_config%scaling, mom6_config%param_file) self%nzo_zstar = remap_ctrl%nz if (allocated(self%h_zstar)) deallocate(self%h_zstar) @@ -505,6 +510,8 @@ subroutine soca_geom_allocate(self) allocate(self%atlas_ij2idx(isd:ied,jsd:jed)); self%atlas_ij2idx = -1 + allocate(self%valid_halo_mask(isd:ied,jsd:jed));self%valid_halo_mask = .true. + end subroutine soca_geom_allocate @@ -1061,6 +1068,56 @@ subroutine soca_geom_mesh_valid_nodes_cells(self, nodes, cells) end subroutine +! ------------------------------------------------------------------------------ +!> Examine the halo gridpoints to determine which ones are non-duplicate and valid +!! +!! The OOPS interpolation does not like duplicate points, but MOM6 does have duplicate +!! and/or unused halo points. We create a mask (self%valid_halo_mask) that is true if 1) +!! not a halo point, or 2) a halo point that is not a duplicate lat/lon already present +!! in the PE's halo or non-halo regions. Invalid halo points are also masked out +!! (i.e. the lat/lon are not updated from the initialed INVALID_HALO value when a halo +!! exchanged is performed +subroutine soca_geom_find_invalid_halo(self) + class(soca_geom), intent(inout) :: self + + integer :: i1, i2, j1, j2 + + ! iterate over all halo gridpoints + outer: do j1 = self%jsd, self%jed + do i1 = self%isd, self%ied + + ! if not halo region, skip + if (j1 >= self%jsc .and. j1 <= self%jec .and. & + i1 >= self%isc .and. i1 <= self%iec) cycle + + ! if gridpoint is still set to -999 after a halo exchange, it is an invalid point + if (self%lat(i1,j1) == INVALID_HALO) then + self%valid_halo_mask(i1,j1) = .false. + cycle + end if + + ! make sure this halo point doesn't exist anywhere else, if it does mask it out + inner: do j2 = self%jsd, self%jed + do i2 = self%isd, self%ied + ! skip if point 1 is same as point 2 + if (j1 == j2 .and. i1 == i2) cycle + ! skip if point 2 has already been masked out + if (.not. self%valid_halo_mask(i2,j2)) cycle + + ! if lat/lon are the same, mark point 1 as a duplicate, mask out + if (self%lat(i1,j1) == self%lat(i2,j2) .and. & + self%lon(i1,j1) == self%lon(i2,j2)) then + self%valid_halo_mask(i1,j1) = .false. + exit inner + end if + end do + end do inner + + end do + end do outer + +end subroutine soca_geom_find_invalid_halo + ! ------------------------------------------------------------------------------ end module soca_geom_mod diff --git a/src/soca/LinearVariableChange/CMakeLists.txt b/src/soca/LinearVariableChange/CMakeLists.txt index f1db13fc8..7a70a600d 100644 --- a/src/soca/LinearVariableChange/CMakeLists.txt +++ b/src/soca/LinearVariableChange/CMakeLists.txt @@ -3,10 +3,8 @@ add_subdirectory(Base) add_subdirectory(BkgErr) add_subdirectory(BkgErrFilt) add_subdirectory(BkgErrGodas) -add_subdirectory(HorizFilt) add_subdirectory(LinearModel2GeoVaLs) add_subdirectory(util) -add_subdirectory(VertConv) soca_target_sources( LinearVariableChange.cc diff --git a/src/soca/LinearVariableChange/HorizFilt/CMakeLists.txt b/src/soca/LinearVariableChange/HorizFilt/CMakeLists.txt deleted file mode 100644 index 6a796f6ca..000000000 --- a/src/soca/LinearVariableChange/HorizFilt/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -soca_target_sources( - HorizFilt.cc - HorizFilt.h - soca_horizfilt_mod.F90 - soca_horizfilt.interface.F90 -) \ No newline at end of file diff --git a/src/soca/LinearVariableChange/HorizFilt/HorizFilt.cc b/src/soca/LinearVariableChange/HorizFilt/HorizFilt.cc deleted file mode 100644 index f5720830a..000000000 --- a/src/soca/LinearVariableChange/HorizFilt/HorizFilt.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* - * (C) Copyright 2017-2021 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 -#include - -#include "eckit/config/Configuration.h" - -#include "oops/util/abor1_cpp.h" -#include "oops/util/Logger.h" - -#include "soca/Geometry/Geometry.h" -#include "soca/Increment/Increment.h" -#include "soca/State/State.h" -#include "soca/Traits.h" -#include "soca/LinearVariableChange/HorizFilt/HorizFilt.h" -#include "soca/LinearVariableChange/HorizFilt/HorizFiltFortran.h" - - -namespace soca { - - // ----------------------------------------------------------------------------- - - static LinearVariableChangeMaker - makerLinearVariableChangeHorizFilt_("HorizFiltSOCA"); - - // ----------------------------------------------------------------------------- - HorizFilt::HorizFilt(const State & bkg, - const State & traj, - const Geometry & geom, - const eckit::Configuration & conf): - geom_(geom), - vars_(conf, "filter variables") { - const eckit::Configuration * configc = &conf; - - // Interpolate trajectory to the geom resolution - State traj_at_geomres(geom, traj); - - // Compute averaging weights - soca_horizfilt_setup_f90(keyFtnConfig_, - &configc, - geom_.toFortran(), - traj_at_geomres.toFortran(), - vars_); - - // Get number of iterations - niter_ = configc->getInt("niter"); - } - // ----------------------------------------------------------------------------- - HorizFilt::~HorizFilt() { - soca_horizfilt_delete_f90(keyFtnConfig_); - } - // ----------------------------------------------------------------------------- - void HorizFilt::multiply(const Increment & dxin, Increment & dxout) const { - dxout = dxin; - Increment dx_tmp(dxin); - for (unsigned int iter = 0; iter < niter_; ++iter) { - dx_tmp = dxout; - soca_horizfilt_mult_f90(keyFtnConfig_, - dx_tmp.toFortran(), - dxout.toFortran(), - geom_.toFortran()); - } - } - // ----------------------------------------------------------------------------- - void HorizFilt::multiplyInverse(const Increment & dxin, Increment & dxout) - const { - dxout = dxin; - } - // ----------------------------------------------------------------------------- - void HorizFilt::multiplyAD(const Increment & dxin, Increment & dxout) const { - dxout = dxin; - Increment dx_tmp(dxin); - for (unsigned int iter = 0; iter < niter_; ++iter) { - dx_tmp = dxout; - soca_horizfilt_multad_f90(keyFtnConfig_, - dx_tmp.toFortran(), - dxout.toFortran(), - geom_.toFortran()); - } - } - // ----------------------------------------------------------------------------- - void HorizFilt::multiplyInverseAD(const Increment & dxin, Increment & dxout) - const { - dxout = dxin; - } - // ----------------------------------------------------------------------------- - void HorizFilt::print(std::ostream & os) const { - os << "SOCA linear change variable: HorizFilt"; - } - // ----------------------------------------------------------------------------- -} // namespace soca diff --git a/src/soca/LinearVariableChange/HorizFilt/HorizFilt.h b/src/soca/LinearVariableChange/HorizFilt/HorizFilt.h deleted file mode 100644 index 881f9b5ff..000000000 --- a/src/soca/LinearVariableChange/HorizFilt/HorizFilt.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (C) Copyright 2017-2021 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. - */ - -#pragma once - -#include -#include -#include - -#include "oops/base/Variables.h" -#include "oops/util/DateTime.h" -#include "oops/util/Printable.h" - -#include "soca/LinearVariableChange/Base/LinearVariableChangeBase.h" - -// Forward declarations -namespace eckit { - class Configuration; -} -namespace soca { - class Fields; - class State; - class Increment; - class Geometry; -} - -// ----------------------------------------------------------------------------- - -namespace soca { - -/// SOCA linear change of variable -class HorizFilt: public LinearVariableChangeBase { - public: - static const std::string classname() {return "soca::HorizFilt";} - - explicit HorizFilt(const State &, const State &, const Geometry &, - const eckit::Configuration &); - ~HorizFilt(); - -/// Perform linear transforms - void multiply(const Increment &, Increment &) const; - void multiplyInverse(const Increment &, Increment &) const; - void multiplyAD(const Increment &, Increment &) const; - void multiplyInverseAD(const Increment &, Increment &) const; - - private: - void print(std::ostream &) const override; - int keyFtnConfig_; - const Geometry & geom_; - oops::Variables vars_; - unsigned int niter_; -}; -// ----------------------------------------------------------------------------- - -} // namespace soca diff --git a/src/soca/LinearVariableChange/HorizFilt/HorizFiltFortran.h b/src/soca/LinearVariableChange/HorizFilt/HorizFiltFortran.h deleted file mode 100644 index 2ad7797ae..000000000 --- a/src/soca/LinearVariableChange/HorizFilt/HorizFiltFortran.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright 2017-2021 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. - */ - -#pragma once - -#include "soca/Fortran.h" - -#include "oops/base/Variables.h" - -// Forward declarations -namespace eckit { - class Configuration; -} - -namespace soca { - - extern "C" { - void soca_horizfilt_setup_f90(F90balopmat &, - const eckit::Configuration * const *, - const F90geom &, - const F90flds &, - const oops::Variables &); - void soca_horizfilt_delete_f90(F90balopmat &); - void soca_horizfilt_mult_f90(const F90balopmat &, - const F90flds &, - F90flds &, - const F90geom &); - void soca_horizfilt_multad_f90(const F90balopmat &, - const F90flds &, - F90flds &, - const F90geom &); - } -} // namespace soca diff --git a/src/soca/LinearVariableChange/HorizFilt/soca_horizfilt.interface.F90 b/src/soca/LinearVariableChange/HorizFilt/soca_horizfilt.interface.F90 deleted file mode 100644 index b02e19440..000000000 --- a/src/soca/LinearVariableChange/HorizFilt/soca_horizfilt.interface.F90 +++ /dev/null @@ -1,141 +0,0 @@ -! (C) Copyright 2017-2021 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. - -!> C++ interface for soca_horizfilt_mod::soca_horizfilt -module soca_horizfilt_mod_c - -use fckit_configuration_module, only: fckit_configuration -use iso_c_binding -use oops_variables_mod, only: oops_variables - -! soca modules -use soca_geom_mod_c, only: soca_geom_registry -use soca_geom_mod, only : soca_geom -use soca_horizfilt_mod, only: soca_horizfilt -use soca_increment_mod, only: soca_increment -use soca_increment_reg, only: soca_increment_registry -use soca_state_mod, only: soca_state -use soca_state_reg, only: soca_state_registry - -implicit none -private - - -#define LISTED_TYPE soca_horizfilt - -!> Linked list interface - defines registry_t type -#include "oops/util/linkedList_i.f" - -!> Global registry for soca_horizfilt_mod::soca_horizfilt -type(registry_t), public :: soca_horizfilt_registry - -! ------------------------------------------------------------------------------ -contains -! ------------------------------------------------------------------------------ - -!> Linked list implementation -#include "oops/util/linkedList_c.f" -! ------------------------------------------------------------------------------ - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_horizfilt_mod::soca_horizfilt::setup() -!! -!! Setup for the filtering operator -subroutine soca_horizfilt_setup_c(c_key_self, & - c_conf, & - c_key_geom, & - c_key_traj, & - c_vars) & - & bind (c,name='soca_horizfilt_setup_f90') - integer(c_int), intent(inout) :: c_key_self !< The filtering structure - type(c_ptr), intent(in) :: c_conf !< The configuration - integer(c_int), intent(in) :: c_key_geom !< Geometry - integer(c_int), intent(in) :: c_key_traj !< Trajectory - type(c_ptr),value, intent(in) :: c_vars !< List of variables - - type(soca_horizfilt), pointer :: self - type(soca_geom), pointer :: geom - type(soca_state), pointer :: traj - type(oops_variables) :: vars - - call soca_geom_registry%get(c_key_geom, geom) - call soca_state_registry%get(c_key_traj, traj) - call soca_horizfilt_registry%init() - call soca_horizfilt_registry%add(c_key_self) - call soca_horizfilt_registry%get(c_key_self, self) - vars = oops_variables(c_vars) - call self%setup(fckit_configuration(c_conf), geom, traj, vars) - -end subroutine soca_horizfilt_setup_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_horizfilt_mod::soca_horizfilt::delete() -!! -!! Delete filtering operator -subroutine soca_horizfilt_delete_c(c_key_self) bind (c,name='soca_horizfilt_delete_f90') - integer(c_int), intent(inout) :: c_key_self !< The filtering structure - - type(soca_horizfilt), pointer :: self - - call soca_horizfilt_registry%get(c_key_self,self) - call self%delete() - call soca_horizfilt_registry%remove(c_key_self) - -end subroutine soca_horizfilt_delete_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_horizfilt_mod::soca_horizfilt::mult() -!! -!! Multiply -subroutine soca_horizfilt_mult_c(c_key_self, c_key_in, c_key_out, c_key_geom) bind(c,name='soca_horizfilt_mult_f90') - integer(c_int), intent(inout) :: c_key_self !< The filtering structure - integer(c_int), intent(in) :: c_key_in !< " to Increment in - integer(c_int), intent(in) :: c_key_out !< " to Increment out - integer(c_int), intent(in) :: c_key_geom !< Geometry - - type(soca_horizfilt), pointer :: self - type(soca_increment), pointer :: xin - type(soca_increment), pointer :: xout - type(soca_geom), pointer :: geom - - call soca_geom_registry%get(c_key_geom, geom) - call soca_horizfilt_registry%get(c_key_self, self) - call soca_increment_registry%get(c_key_in, xin) - call soca_increment_registry%get(c_key_out, xout) - - call self%mult(xin, xout, geom) !< xout = C.xout - -end subroutine soca_horizfilt_mult_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_horizfilt_mod::soca_horizfilt::multad() -!! -!! Multiply adjoint -subroutine soca_horizfilt_mult_ad_c(c_key_self, c_key_in, c_key_out, c_key_geom) & - bind(c,name='soca_horizfilt_multad_f90') - integer(c_int), intent(inout) :: c_key_self !< The filtering structure - integer(c_int), intent(in) :: c_key_in !< " to Increment in - integer(c_int), intent(in) :: c_key_out !< " to Increment out - integer(c_int), intent(in) :: c_key_geom !< Geometry - - type(soca_horizfilt), pointer :: self - type(soca_increment), pointer :: xin - type(soca_increment), pointer :: xout - type(soca_geom), pointer :: geom - - call soca_geom_registry%get(c_key_geom, geom) - call soca_horizfilt_registry%get(c_key_self, self) - call soca_increment_registry%get(c_key_in, xin) - call soca_increment_registry%get(c_key_out, xout) - - call self%multad(xin, xout, geom) !< xout = C^T.xout - -end subroutine soca_horizfilt_mult_ad_c - -end module soca_horizfilt_mod_c diff --git a/src/soca/LinearVariableChange/HorizFilt/soca_horizfilt_mod.F90 b/src/soca/LinearVariableChange/HorizFilt/soca_horizfilt_mod.F90 deleted file mode 100644 index b8c176799..000000000 --- a/src/soca/LinearVariableChange/HorizFilt/soca_horizfilt_mod.F90 +++ /dev/null @@ -1,311 +0,0 @@ -! (C) Copyright 2017-2023 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. - -!> horizontal filtering -module soca_horizfilt_mod - -use atlas_module, only: atlas_geometry -use fckit_configuration_module, only: fckit_configuration -use iso_c_binding -use kinds -use mpp_domains_mod, only : mpp_update_domains, mpp_update_domains_ad -use oops_variables_mod, only: oops_variables - -! soca modules -use soca_fields_mod, only: soca_field -use soca_geom_mod, only : soca_geom -use soca_increment_mod, only: soca_increment -use soca_state_mod, only: soca_state - -implicit none -private - -!> Variable transform: horizontal filtering -type, public :: soca_horizfilt - type(oops_variables) :: vars !< Apply filtering to vars - real(kind=kind_real), allocatable :: wgh(:,:,:,:) !< Filtering weight - real(kind=kind_real) :: scale_flow !< Used with "flow" filter, sea surface height decorrelation scale - real(kind=kind_real) :: scale_dist - real(kind=kind_real) :: niter !< number of iterations of filter to perform - !> \name indices of compute domain - !! \{ - integer :: isc, iec, jsc, jec - !> \} - - !> \name indices of data domain - !! \{ - integer :: isd, ied, jsd, jed - !> \} - -contains - - !> \copybrief soca_horizfilt_setup \see soca_horizfilt_setup - procedure :: setup => soca_horizfilt_setup - - !> \copybrief soca_horizfilt_delete \see soca_horizfilt_delete - procedure :: delete => soca_horizfilt_delete - - !> \copybrief soca_horizfilt_mult \see soca_horizfilt_mult - procedure :: mult => soca_horizfilt_mult - - !> \copybrief soca_horizfilt_multad \see soca_horizfilt_multad - procedure :: multad => soca_horizfilt_multad -end type soca_horizfilt - - -! ------------------------------------------------------------------------------ -contains -! ------------------------------------------------------------------------------ - - -! ------------------------------------------------------------------------------ -!> Setup for the horizfilt operator -!! -!! \relates soca_horizfilt_mod::soca_horizfilt -subroutine soca_horizfilt_setup(self, f_conf, geom, traj, vars) - class(soca_horizfilt), intent(inout) :: self !< The horizfilt structure - type(fckit_configuration), intent(in) :: f_conf !< The configuration - type(soca_geom), intent(in) :: geom !< Geometry - type(soca_state), intent(in) :: traj !< Trajectory - type(oops_variables), intent(in) :: vars !< List of variables - - type(soca_field), pointer :: ssh - - integer :: i, j, ii, jj - real(kind=kind_real) :: dist(-1:1,-1:1), sum_w, r_dist, r_flow - type(atlas_geometry) :: ageometry - - ! Setup list of variables to apply filtering on - self%vars = vars - - ! Get filter length scales from configuration - if (.not. f_conf%get("scale_dist", self%scale_dist)) self%scale_dist = -1 - if (.not. f_conf%get("scale_flow", self%scale_flow)) self%scale_flow = -1 - call f_conf%get_or_die("niter", self%niter) - - ! scale the gaussian length scales depending on the number of iterations - ! NOTE: numerical instability creeps in once niter is large and scale_dist - ! is much smaller than the size of a grid box - self%scale_dist = self%scale_dist / sqrt(self%niter) - self%scale_flow = self%scale_flow / sqrt(self%niter) - - ! Indices for compute/data domain - self%isd = geom%isd ; self%ied = geom%ied ; self%jsd = geom%jsd; self%jed = geom%jed - self%isc = geom%isc ; self%iec = geom%iec ; self%jsc = geom%jsc; self%jec = geom%jec - - ! Allocate and compute filtering weights - allocate(self%wgh(self%isd:self%ied,self%jsd:self%jed,-1:1,-1:1)) - - ! Create UnitSphere geometry - ageometry = atlas_geometry("Earth") - - ! Compute distance based weights - self%wgh = 0.0_kind_real - r_dist = 1.0 - r_flow = 1.0 - do j = self%jsc, self%jec - do i = self%isc, self%iec - do ii = -1,1 - do jj = -1,1 - - ! Great circle distance - if(self%scale_dist > 0) then - r_dist = ageometry%distance(geom%lon(i,j), geom%lat(i,j), geom%lon(i+ii,j+jj), geom%lat(i+ii,j+jj) ) - r_dist = exp(-0.5 * (r_dist/self%scale_dist) ** 2) - end if - - ! flow based distance (ssh difference) - if(self%scale_flow > 0) then - call traj%get("ssh", ssh) - r_flow = abs(ssh%val(i,j,1) - ssh%val(i+ii,j+jj,1)) - r_flow = exp(-0.5 * ((r_flow / self%scale_flow) ** 2)) - end if - - ! multiply together and apply the land mask - dist(ii,jj) = geom%mask2d(i+ii,j+jj) * r_dist * r_flow - end do - end do - - ! Normalize - sum_w = sum(dist) - if (sum_w>0.0_kind_real) then - self%wgh(i,j,:,:) = dist / sum_w - endif - - end do - end do - -end subroutine soca_horizfilt_setup - - -! ------------------------------------------------------------------------------ -!> Delete horizfilt -!! -!! \relates soca_horizfilt_mod::soca_horizfilt -subroutine soca_horizfilt_delete(self) - class(soca_horizfilt), intent(inout) :: self !< The horizfilt structure - - deallocate(self%wgh) - -end subroutine soca_horizfilt_delete - - -! ------------------------------------------------------------------------------ -!> Forward filtering -!! -!! \relates soca_horizfilt_mod::soca_horizfilt -subroutine soca_horizfilt_mult(self, dxin, dxout, geom) - class(soca_horizfilt), intent(inout) :: self !< The horizfilt structure - type(soca_increment), intent(in) :: dxin !< Input: Increment - type(soca_increment), intent(inout) :: dxout !< Output: filtered Increment - type(soca_geom), intent(in) :: geom - - type(soca_field), pointer :: field_i, field_o - - integer :: k, ivar - real(kind=kind_real), allocatable, dimension(:,:) :: dxi, dxo - - allocate(dxi(self%isd:self%ied,self%jsd:self%jed)) - allocate(dxo(self%isd:self%ied,self%jsd:self%jed)) - - do ivar = 1, self%vars%nvars() - call dxin%get(trim(self%vars%variable(ivar)), field_i) - call dxout%get(trim(self%vars%variable(ivar)), field_o) - do k = 1, field_i%nz - dxi = field_i%val(:,:,k) - call soca_filt2d(self, dxi, dxo, geom) - field_o%val(:,:,k) = dxo - end do - end do - deallocate(dxi, dxo) - -end subroutine soca_horizfilt_mult - - -! ------------------------------------------------------------------------------ -!> Backward filtering -!! -!! \relates soca_horizfilt_mod::soca_horizfilt -subroutine soca_horizfilt_multad(self, dxin, dxout, geom) - class(soca_horizfilt), intent(inout) :: self !< The horizfilt structure - type(soca_increment), intent(in) :: dxin !< Input: - type(soca_increment), intent(inout) :: dxout !< Output: - type(soca_geom), intent(in) :: geom - - type(soca_field), pointer :: field_i, field_o - integer :: k, ivar - real(kind=kind_real), allocatable, dimension(:,:) :: dxi, dxo - - allocate(dxi(self%isd:self%ied,self%jsd:self%jed)) - allocate(dxo(self%isd:self%ied,self%jsd:self%jed)) - - do ivar = 1, self%vars%nvars() - call dxin%get(trim(self%vars%variable(ivar)), field_i) - call dxout%get(trim(self%vars%variable(ivar)), field_o) - do k = 1, field_i%nz - dxi = field_i%val(:,:,k) - call soca_filt2d_ad(self, dxi, dxo, geom) - field_o%val(:,:,k) = dxo - end do - end do - deallocate(dxi, dxo) - -end subroutine soca_horizfilt_multad - - -! ------------------------------------------------------------------------------ -!> Forward filtering for 2D array -!! -!! used by soca_horizfilt_mod::soca_horizfilt::mult() -!! \relates soca_horizfilt_mod::soca_horizfilt -subroutine soca_filt2d(self, dxin, dxout, geom) - class(soca_horizfilt), intent(in) :: self - real(kind=kind_real), allocatable, intent(in) :: dxin(:,:) - real(kind=kind_real), allocatable, intent(inout) :: dxout(:,:) - type(soca_geom), intent(in) :: geom - - integer :: i, j - real(kind=kind_real), allocatable :: dxtmp(:,:) - - ! Make a temporary copy of dxin - allocate(dxtmp(self%isd:self%ied,self%jsd:self%jed)) - dxtmp = 0.0_kind_real - dxtmp(self%isc:self%iec,self%jsc:self%jec) = dxin(self%isc:self%iec,self%jsc:self%jec) - - ! Update halo points of input array - call mpp_update_domains(dxtmp, geom%Domain%mpp_domain, complete=.true.) - - ! 9-point distance weighted average - dxout = 0.0_kind_real - do j = self%jsc, self%jec - do i = self%isc, self%iec - if (geom%mask2d(i,j)==1) then - dxout(i,j) = & - self%wgh(i,j,-1,1)*dxtmp(i-1,j+1) + & - self%wgh(i,j,0,1)*dxtmp(i,j+1) + & - self%wgh(i,j,1,1)*dxtmp(i+1,j+1) + & - self%wgh(i,j,-1,0)*dxtmp(i-1,j) + & - self%wgh(i,j,0,0)*dxtmp(i,j) + & - self%wgh(i,j,1,0)*dxtmp(i+1,j) + & - self%wgh(i,j,-1,-1)*dxtmp(i-1,j-1) + & - self%wgh(i,j,0,-1)*dxtmp(i,j-1) + & - self%wgh(i,j,1,-1)*dxtmp(i+1,j-1) - end if - end do - end do - - ! Update halo - call mpp_update_domains(dxout, geom%Domain%mpp_domain, complete=.true.) - - deallocate(dxtmp) - -end subroutine soca_filt2d - - -! ------------------------------------------------------------------------------ -!> Backward filtering for 2D array -!! -!! used by soca_horizfilt_mod::soca_horizfilt::multad() -!! \relates soca_horizfilt_mod::soca_horizfilt -subroutine soca_filt2d_ad(self, dxin, dxout, geom) - class(soca_horizfilt), intent(in) :: self - real(kind=kind_real), allocatable, intent(in) :: dxin(:,:) - real(kind=kind_real), allocatable, intent(inout) :: dxout(:,:) - type(soca_geom), intent(in) :: geom - - integer :: i, j - real(kind=kind_real), allocatable :: dxtmp(:,:) - - ! Make a temporary copy of dxin - allocate(dxtmp(self%isd:self%ied,self%jsd:self%jed)) - dxtmp = 0.0_kind_real - dxtmp(self%isc:self%iec,self%jsc:self%jec) = dxin(self%isc:self%iec,self%jsc:self%jec) - - dxout = 0.0_kind_real - ! Adjoint of 9-point weighted average - do j = self%jec, self%jsc, -1 - do i = self%iec, self%isc, -1 - if (geom%mask2d(i,j)==1) then - dxout(i-1,j+1) = dxout(i-1,j+1) + self%wgh(i,j,-1, 1)*dxtmp(i,j) - dxout(i,j+1) = dxout(i,j+1) + self%wgh(i,j, 0, 1)*dxtmp(i,j) - dxout(i+1,j+1) = dxout(i+1,j+1) + self%wgh(i,j, 1, 1)*dxtmp(i,j) - dxout(i-1,j) = dxout(i-1,j) + self%wgh(i,j,-1, 0)*dxtmp(i,j) - dxout(i,j) = dxout(i,j) + self%wgh(i,j, 0, 0)*dxtmp(i,j) - dxout(i+1,j) = dxout(i+1,j) + self%wgh(i,j, 1, 0)*dxtmp(i,j) - dxout(i-1,j-1) = dxout(i-1,j-1) + self%wgh(i,j,-1,-1)*dxtmp(i,j) - dxout(i,j-1) = dxout(i,j-1) + self%wgh(i,j, 0,-1)*dxtmp(i,j) - dxout(i+1,j-1) = dxout(i+1,j-1) + self%wgh(i,j, 1,-1)*dxtmp(i,j) - end if - end do - end do - - ! Adjoint of halo update - call mpp_update_domains_ad(dxout, geom%Domain%mpp_domain, complete=.true.) - - deallocate(dxtmp) - -end subroutine soca_filt2d_ad - -end module soca_horizfilt_mod diff --git a/src/soca/LinearVariableChange/VertConv/CMakeLists.txt b/src/soca/LinearVariableChange/VertConv/CMakeLists.txt deleted file mode 100644 index 08b4bc483..000000000 --- a/src/soca/LinearVariableChange/VertConv/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -soca_target_sources( - soca_vertconv_mod.F90 - soca_vertconv.interface.F90 - VertConv.cc - VertConv.h - VertConvFortran.h -) \ No newline at end of file diff --git a/src/soca/LinearVariableChange/VertConv/VertConv.cc b/src/soca/LinearVariableChange/VertConv/VertConv.cc deleted file mode 100644 index 3f38ff15b..000000000 --- a/src/soca/LinearVariableChange/VertConv/VertConv.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* - * (C) Copyright 2017-2021 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 -#include - -#include "eckit/config/Configuration.h" - -#include "oops/util/Logger.h" - -#include "soca/Geometry/Geometry.h" -#include "soca/Increment/Increment.h" -#include "soca/State/State.h" -#include "soca/Traits.h" -#include "soca/LinearVariableChange/VertConv/VertConv.h" -#include "soca/LinearVariableChange/VertConv/VertConvFortran.h" - - -using oops::Log; - -namespace soca { - - // --------------------------------------------------------------------------- - - static LinearVariableChangeMaker - makerLinearVariableCHangeVertConv_("VertConvSOCA"); - - // --------------------------------------------------------------------------- - VertConv::VertConv(const State & bkg, - const State & traj, - const Geometry & geom, - const eckit::Configuration & conf) : - bkg_lr_(geom, bkg), geom_(geom) { - oops::Log::trace() << "soca::VertConv::setup " << std::endl; - const eckit::Configuration * configc = &conf; - - // Compute convolution weights - soca_vertconv_setup_f90(keyFtnConfig_, - &configc, - bkg_lr_.toFortran(), - geom.toFortran()); - } - // --------------------------------------------------------------------------- - VertConv::~VertConv() { - oops::Log::trace() << "soca::VertConv::delete " << std::endl; - soca_vertconv_delete_f90(keyFtnConfig_); - } - // --------------------------------------------------------------------------- - void VertConv::multiply(const Increment & dxa, Increment & dxm) const { - // dxm = K dxa - oops::Log::trace() << "soca::VertConv::multiply " << std::endl; - soca_vertconv_mult_f90(dxa.toFortran(), dxm.toFortran(), keyFtnConfig_); - } - // --------------------------------------------------------------------------- - void VertConv::multiplyInverse(const Increment & dxm, Increment & dxa) const { - oops::Log::trace() << "soca::VertConv::multiplyInverse " << std::endl; - dxa = dxm; - } - // --------------------------------------------------------------------------- - void VertConv::multiplyAD(const Increment & dxm, Increment & dxa) const { - // dxa = K^T dxm - oops::Log::trace() << "soca::VertConv::multiplyAD " << std::endl; - soca_vertconv_multad_f90(dxm.toFortran(), dxa.toFortran(), keyFtnConfig_); - } - // --------------------------------------------------------------------------- - void VertConv::multiplyInverseAD(const Increment & dxa, - Increment & dxm) const { - oops::Log::trace() << "soca::VertConv::multiplyInverseAD " << std::endl; - dxm = dxa; - } - // --------------------------------------------------------------------------- - void VertConv::print(std::ostream & os) const { - os << "SOCA linear change variable: VertConv"; - } - // --------------------------------------------------------------------------- -} // namespace soca diff --git a/src/soca/LinearVariableChange/VertConv/VertConv.h b/src/soca/LinearVariableChange/VertConv/VertConv.h deleted file mode 100644 index 43dcbb105..000000000 --- a/src/soca/LinearVariableChange/VertConv/VertConv.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * (C) Copyright 2017-2021 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. - */ - -#pragma once - -#include -#include - -#include "soca/State/State.h" - -#include "oops/util/DateTime.h" -#include "oops/util/Printable.h" - -#include "soca/LinearVariableChange/Base/LinearVariableChangeBase.h" - -// Forward declarations -namespace eckit { - class Configuration; -} -namespace soca { - class Geometry; - class Increment; -} - -// ----------------------------------------------------------------------------- - -namespace soca { - -/// SOCA linear change of variable -class VertConv: public LinearVariableChangeBase { - public: - static const std::string classname() {return "soca::VertConv";} - - explicit VertConv(const State &, const State &, const Geometry &, - const eckit::Configuration &); - ~VertConv(); - -/// Perform linear transforms - void multiply(const Increment &, Increment &) const; - void multiplyInverse(const Increment &, Increment &) const; - void multiplyAD(const Increment &, Increment &) const; - void multiplyInverseAD(const Increment &, Increment &) const; - - private: - void print(std::ostream &) const override; - int keyFtnConfig_; - const State bkg_lr_; - const Geometry geom_; -}; -// ----------------------------------------------------------------------------- - -} // namespace soca diff --git a/src/soca/LinearVariableChange/VertConv/VertConvFortran.h b/src/soca/LinearVariableChange/VertConv/VertConvFortran.h deleted file mode 100644 index 27006e9d5..000000000 --- a/src/soca/LinearVariableChange/VertConv/VertConvFortran.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (C) Copyright 2019-2021 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. - */ - -#pragma once - -#include "soca/Fortran.h" - -// Forward declarations -namespace eckit { - class Configuration; -} - -namespace soca { - - extern "C" { - void soca_vertconv_setup_f90(F90balopmat &, - const eckit::Configuration * const *, - const F90flds &, - const F90geom &); - void soca_vertconv_delete_f90(F90balopmat &); - void soca_vertconv_mult_f90(const F90balopmat &, F90balopmat &, - const F90balopmat &); - void soca_vertconv_multad_f90(const F90balopmat &, F90balopmat &, - const F90balopmat &); - } -} // namespace soca diff --git a/src/soca/LinearVariableChange/VertConv/soca_vertconv.interface.F90 b/src/soca/LinearVariableChange/VertConv/soca_vertconv.interface.F90 deleted file mode 100644 index 60c99172f..000000000 --- a/src/soca/LinearVariableChange/VertConv/soca_vertconv.interface.F90 +++ /dev/null @@ -1,149 +0,0 @@ -! (C) Copyright 2017-2021 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. - -!> C++ interfaces for soca_vertconv_mod::soca_vertconv -module soca_vertconv_mod_c - -use fckit_configuration_module, only: fckit_configuration -use iso_c_binding -use kinds, only: kind_real - -! soca modules -use soca_geom_mod_c, only: soca_geom_registry -use soca_geom_mod, only: soca_geom -use soca_increment_mod, only: soca_increment -use soca_increment_reg, only: soca_increment_registry -use soca_state_mod, only: soca_state -use soca_state_reg, only: soca_state_registry -use soca_vertconv_mod, only: soca_vertconv - -implicit none -private - -#define LISTED_TYPE soca_vertconv - -!> Linked list interface - defines registry_t type -#include "oops/util/linkedList_i.f" - -!> Global registry for soca_vertconv -type(registry_t), public :: soca_vertconv_registry - -! ------------------------------------------------------------------------------ -contains -! ------------------------------------------------------------------------------ - -!> Linked list implementation -#include "oops/util/linkedList_c.f" - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_vertconv_mod::soca_vertconv::setup() -!! -!! Constructor for Vertconv -subroutine soca_vertconv_setup_c(c_key_self, c_conf, c_key_bkg, c_key_geom) & - bind(c,name='soca_vertconv_setup_f90') - - integer(c_int), intent(inout) :: c_key_self !< The Vertconv structure - type(c_ptr), intent(in) :: c_conf !< The configuration - integer(c_int), intent(in) :: c_key_bkg !< background - integer(c_int), intent(in) :: c_key_geom !< geometry - - type(soca_vertconv), pointer :: self - type(soca_state), pointer :: bkg - type(soca_geom), pointer :: geom - - call soca_vertconv_registry%init() - call soca_vertconv_registry%add(c_key_self) - call soca_vertconv_registry%get(c_key_self, self) - call soca_state_registry%get(c_key_bkg, bkg) - call soca_geom_registry%get(c_key_geom, geom) - - call self%setup(bkg, geom, fckit_configuration(c_conf)) - -end subroutine soca_vertconv_setup_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_vertconv_mod::soca_vertconv destructor -!! -!! Destructor for Vertconv -subroutine soca_vertconv_delete_c(c_key_self) bind(c,name='soca_vertconv_delete_f90') - - integer(c_int), intent(inout) :: c_key_self !< The background covariance structure - - type(soca_vertconv), pointer :: self - - ! Deallocate background - ! TODO - ! Deallocate ocean depth array - ! TODO - - call soca_vertconv_registry%get(c_key_self, self) - - if (associated(self%bkg)) nullify(self%bkg) - - call soca_vertconv_registry%remove(c_key_self) - -end subroutine soca_vertconv_delete_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_vertconv_mod::soca_vertconv::mult() -!! -!! Multiplication -subroutine soca_vertconv_mult_c(c_key_a, c_key_m, c_key_self)& - bind(c,name='soca_vertconv_mult_f90') - - integer(c_int), intent(in) :: c_key_a !< Increment in - integer(c_int), intent(in) :: c_key_m !< Increment out - integer(c_int), intent(in) :: c_key_self !< config - - type(soca_increment), pointer :: dxa ! in - type(soca_increment), pointer :: dxm ! out - type(soca_vertconv), pointer :: self - - call soca_increment_registry%get(c_key_a, dxa) - call soca_increment_registry%get(c_key_m, dxm) - call soca_vertconv_registry%get(c_key_self, self) - - !< Computes dxm = Vertconv dxa - - ! dxm = dxa - call dxm%copy( dxa) - - ! Apply forward convolution operator to T & S - call self%mult(dxm, dxa) - -end subroutine soca_vertconv_mult_c - - -! ------------------------------------------------------------------------------ -!> C++ interface for soca_vertconv_mod::soca_vertconv::mult_ad() -!! -!! Multiplication adjoint -subroutine soca_vertconv_multad_c(c_key_m, c_key_a, c_key_self)& - bind(c,name='soca_vertconv_multad_f90') - - integer(c_int), intent(in) :: c_key_a !< Increment out - integer(c_int), intent(in) :: c_key_m !< Increment in - integer(c_int), intent(in) :: c_key_self !< config - - type(soca_increment), pointer :: dxa - type(soca_increment), pointer :: dxm - type(soca_vertconv), pointer :: self - - call soca_increment_registry%get(c_key_a,dxa) - call soca_increment_registry%get(c_key_m,dxm) - call soca_vertconv_registry%get(c_key_self, self) - - ! dxa = dxm - call dxa%copy(dxm) - - ! Apply adjoint of convolution operator - call self%mult_ad(dxm, dxa) - -end subroutine soca_vertconv_multad_c - -end module soca_vertconv_mod_c diff --git a/src/soca/LinearVariableChange/VertConv/soca_vertconv_mod.F90 b/src/soca/LinearVariableChange/VertConv/soca_vertconv_mod.F90 deleted file mode 100644 index 5af01a99a..000000000 --- a/src/soca/LinearVariableChange/VertConv/soca_vertconv_mod.F90 +++ /dev/null @@ -1,224 +0,0 @@ -! (C) Copyright 2017-2021 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. - -!> variable transform: vertical convolution -module soca_vertconv_mod - -use fckit_configuration_module, only: fckit_configuration -use kinds, only: kind_real -use gc99_mod, only: gc99 -use type_mpl, only: mpl_type - -! soca modules -use soca_fields_mod, only: soca_field -use soca_geom_mod, only: soca_geom -use soca_increment_mod, only:soca_increment -use soca_state_mod, only: soca_state - -implicit none -private - -!> Variable transform for vertical convolution -!! -!! \note this only operates on tocn and socn -type, public :: soca_vertconv - real(kind=kind_real) :: lz_min !> Vertical decorrelation minimum [m] - real(kind=kind_real) :: lz_mld !> if /= 0, Use MLD to calculate Lz - real(kind=kind_real) :: lz_mld_max !> if calculating Lz from MLD, max value to use - real(kind=kind_real) :: scale_layer_thick !> Set the minimum decorrelation scale - !> as a multiple of the layer thickness - type(soca_state), pointer :: bkg !> Background - type(soca_geom), pointer :: geom !> Geometry - integer :: isc, iec, jsc, jec !> Compute domain - -contains - !> \copybrief soca_conv_setup \see soca_conv_setup - procedure :: setup => soca_conv_setup - - !> \copybrief soca_conv_mult \see soca_conv_mult - procedure :: mult => soca_conv_mult - - !> \copybrief soca_conv_mult_ad \see soca_conv_mult_ad - procedure :: mult_ad => soca_conv_mult_ad - -end type soca_vertconv - - -! ------------------------------------------------------------------------------ -contains -! ------------------------------------------------------------------------------ - -! ------------------------------------------------------------------------------ -!> Setup for the vertical convolution -!! -!! \todo: Investigate computing and storing weights in vertconc data structure -!! \relates soca_vertconv_mod::soca_vertconv -subroutine soca_conv_setup (self, bkg, geom, f_conf) - class(soca_vertconv), intent(inout) :: self - type(soca_state), target, intent(in) :: bkg !< T/S background - type(fckit_configuration), intent(in) :: f_conf !< yaml configuration - type(soca_geom), target, intent(in) :: geom !< input geometry - - ! Get configuration for vertical convolution - call f_conf%get_or_die("Lz_min", self%lz_min ) - call f_conf%get_or_die("Lz_mld", self%lz_mld ) - if ( self%lz_mld /= 0) & - call f_conf%get_or_die("Lz_mld_max", self%lz_mld_max ) - call f_conf%get_or_die("scale_layer_thick", self%scale_layer_thick ) - - ! Associate background and geometry - self%bkg => bkg - self%geom => geom - - ! Indices for compute domain (no halo) - self%isc=geom%isc; self%iec=geom%iec - self%jsc=geom%jsc; self%jec=geom%jec - -end subroutine soca_conv_setup - - -! ------------------------------------------------------------------------------ -!> Calculate vertical correlation lengths for a given column -!! -!! \relates soca_vertconv_mod::soca_vertconv -subroutine soca_calc_lz(self, i, j, lz) - class(soca_vertconv), intent(in) :: self - integer, intent(in) :: i !< i index of grid point - integer, intent(in) :: j !< j index of grid point - real(kind=kind_real), intent(inout) :: lz(:) !< output correlation legnths - - real(kind=kind_real) :: mld, z - integer :: k - type(soca_field), pointer :: hocn, mld_fld, layer_depth - - ! minium scale is based on layer thickness - call self%bkg%get("hocn", hocn) - call self%bkg%get("mld", mld_fld) - call self%bkg%get("layer_depth", layer_depth) - lz = self%lz_min - lz = max(lz, self%scale_layer_thick*abs(hocn%val(i,j,:))) - - ! if the upper Lz should be calculated from the MLD - ! interpolate values from top to bottom of ML - if ( self%lz_mld /= 0 ) then - mld = mld_fld%val(i,j, 1) - mld = min( mld, self%lz_mld_max) - mld = max( mld, self%lz_min) - do k=1, size(lz) - z = layer_depth%val(i,j, k) - if (z >= mld) exit ! end of ML, exit loop - lz(k) = max(lz(k), lz(k) + (mld - lz(k)) * (1.0 - z/mld)) - end do - end if - -end subroutine soca_calc_lz - - -! ------------------------------------------------------------------------------ -!> Apply forward convolution -!! -!! \relates soca_vertconv_mod::soca_vertconv -subroutine soca_conv_mult (self, convdx, dx) - class(soca_vertconv), intent(inout) :: self - type(soca_increment), intent(in) :: dx !< input increment to convolve - type(soca_increment),intent(inout) :: convdx !< output increment - - real(kind=kind_real), allocatable :: z(:), lz(:) - real(kind=kind_real) :: dist2, coef - integer :: nl, j, k, id, jd, n - type(mpl_type) :: mpl - - type(soca_field), pointer :: field_dx, field_convdx, layer_depth - - call self%bkg%get("layer_depth", layer_depth) - nl = layer_depth%nz - - allocate(z(nl), lz(nl)) - - do n=1,size(dx%fields) - ! TODO remove these hardcoded values, use the yaml file - select case(dx%fields(n)%name) - case ("tocn", "socn") - call dx%get(dx%fields(n)%name, field_dx) - call convdx%get(dx%fields(n)%name, field_convdx) - do id = self%isc, self%iec - do jd = self%jsc, self%jec - ! skip land - if (self%geom%mask2d(id,jd) /= 1) cycle - - ! get correlation lengths - call soca_calc_lz(self, id, jd, lz) - - ! perform convolution - z(:) = layer_depth%val(id,jd,:) - do j = 1, nl - field_convdx%val(id,jd,j) = 0.0d0 - do k = 1,nl - dist2 = abs(z(j)-z(k)) - coef = gc99(dist2/lz(k)) - field_convdx%val(id,jd,j) = field_convdx%val(id,jd,j) & - &+ field_dx%val(id,jd,k)*coef - end do - end do - end do - end do - end select - end do - deallocate(z, lz) -end subroutine soca_conv_mult - - -! ------------------------------------------------------------------------------ -!> Apply backward convolution -!! -!! \relates soca_vertconv_mod::soca_vertconv -subroutine soca_conv_mult_ad (self, convdx, dx) - class(soca_vertconv), intent(inout) :: self - type(soca_increment),intent(inout) :: dx !< output increment - type(soca_increment), intent(in) :: convdx !< input increment - - real(kind=kind_real), allocatable :: z(:), lz(:) - real(kind=kind_real) :: dist2, coef - integer :: nl, j, k, id, jd, n - type(mpl_type) :: mpl - type(soca_field), pointer :: field_dx, field_convdx, layer_depth - - call self%bkg%get("layer_depth", layer_depth) - nl = layer_depth%nz - allocate(z(nl), lz(nl)) - - do n=1,size(dx%fields) - select case(dx%fields(n)%name) - ! TODO remove these hardcoded values, use the yaml file - case ("tocn", "socn") - call dx%get(dx%fields(n)%name, field_dx) - call convdx%get(dx%fields(n)%name, field_convdx) - do id = self%isc, self%iec - do jd = self%jsc, self%jec - ! skip land - if (self%geom%mask2d(id,jd) /= 1) cycle - - ! get correlation lengths - call soca_calc_lz(self, id, jd, lz) - - ! perform convolution - z(:) = layer_depth%val(id,jd,:) - field_dx%val(id,jd,:) = 0.0d0 - do j = nl, 1, -1 - do k = nl, 1, -1 - dist2 = abs(z(j)-z(k)) - coef = gc99(dist2/lz(k)) - field_dx%val(id,jd,k) = field_dx%val(id,jd,k) + coef*field_convdx%val(id,jd,j) - end do - end do - end do - end do - end select - end do - deallocate(z, lz) - -end subroutine soca_conv_mult_ad - -end module soca_vertconv_mod diff --git a/src/soca/Model/CMakeLists.txt b/src/soca/Model/CMakeLists.txt index 36e24ee17..b9019653c 100644 --- a/src/soca/Model/CMakeLists.txt +++ b/src/soca/Model/CMakeLists.txt @@ -1,4 +1,5 @@ -add_subdirectory(mom6solo) +add_subdirectory(ufs) if (BUILD_UFSM6C6) add_subdirectory(ufsm6c6) endif () +#add_subdirectory(mom6solo) diff --git a/src/soca/Model/mom6solo/soca_mom6.F90 b/src/soca/Model/mom6solo/soca_mom6.F90 index 76e48ae8a..2c2f38ede 100644 --- a/src/soca/Model/mom6solo/soca_mom6.F90 +++ b/src/soca/Model/mom6solo/soca_mom6.F90 @@ -198,8 +198,8 @@ subroutine soca_mom6_init(mom6_config, partial_init) Time_in=Time_in) ! adiabatic - mom6_config%MOM_CSp%adiabatic = .true. - +! mom6_config%MOM_CSp%adiabatic = .true. +! MPchange--commented above line out for linking !US => mom6_config%scaling ! Continue initialization call get_MOM_state_elements(mom6_config%MOM_CSp,& diff --git a/src/soca/Model/ufs/CMakeLists.txt b/src/soca/Model/ufs/CMakeLists.txt new file mode 100644 index 000000000..d9eff3871 --- /dev/null +++ b/src/soca/Model/ufs/CMakeLists.txt @@ -0,0 +1,8 @@ +soca_target_sources( +ModelUFS.cc +ModelUFS.h +ModelUFS.interface.h +soca_ufs_interface_mod.F90 +soca_ufs_mod.F90 +soca_mom6.F90 +) diff --git a/src/soca/Model/ufs/ModelUFS.cc b/src/soca/Model/ufs/ModelUFS.cc new file mode 100644 index 000000000..762827cc1 --- /dev/null +++ b/src/soca/Model/ufs/ModelUFS.cc @@ -0,0 +1,104 @@ +/* + * (C) Copyright 2020 NOAA + * + * 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 + +#include "eckit/config/Configuration.h" + +#include "oops/util/DateTime.h" +#include "oops/util/Logger.h" +#include "oops/util/parameters/Parameters.h" +#include "oops/util/parameters/RequiredParameter.h" + +#include "ModelUFS.interface.h" + +#include "soca/Geometry/Geometry.h" +#include "soca/Model/ufs/ModelUFS.h" +#include "soca/ModelBias/ModelBias.h" +#include "soca/State/State.h" + +namespace soca { +// ------------------------------------------------------------------------------------------------- +// Options taken by ModelUFS +class ModelUFSParameters : public oops::Parameters { + OOPS_CONCRETE_PARAMETERS(ModelUFSParameters, Parameters) + + public: + oops::RequiredParameter modelVariables{ "model variables", this}; + oops::RequiredParameter tstep{ "tstep", this}; + oops::RequiredParameter ufsRunDirectory{ "ufs_run_directory", this}; +}; +// ------------------------------------------------------------------------------------------------- +static oops::interface::ModelMaker makermodel_("UFS"); +// ------------------------------------------------------------------------------------------------- +ModelUFS::ModelUFS(const Geometry & resol, const eckit::Configuration & config) + : keyConfig_(0), tstep_(0), geom_(resol), vars_() { + char tmpdir_[10000]; + oops::Log::trace() << "ModelUFS::ModelUFS starting" << std::endl; + getcwd(tmpdir_, 10000); + + ModelUFSParameters params; + params.deserialize(config); + vars_ = params.modelVariables; + tstep_ = params.tstep; + strcpy(ufsdir_, params.ufsRunDirectory.value().c_str()); + chdir(ufsdir_); + soca_ufs_create_f90(keyConfig_, config, geom_.toFortran()); + + chdir(tmpdir_); + oops::Log::trace() << "ModelUFS::ModelUFS done" << std::endl; +} +// ------------------------------------------------------------------------------------------------- +ModelUFS::~ModelUFS() { + oops::Log::trace() << "ModelUFS::~ModelUFS starting" << std::endl; + soca_ufs_delete_f90(keyConfig_); + oops::Log::trace() << "ModelUFS::~ModelUFS done" << std::endl; +} +// ------------------------------------------------------------------------------------------------- +void ModelUFS::initialize(State & xx) const { + oops::Log::trace() << "ModelUFS::initialize starting" << std::endl; + oops::Log::trace() << "ModelUFS::cd to " << ufsdir_ << std::endl; + + chdir(ufsdir_); + util::DateTime * dtp = &xx.validTime(); + soca_ufs_initialize_f90(keyConfig_, xx.toFortran(), &dtp); + oops::Log::trace() << "ModelUFS::initialize done" << std::endl; +} +// ------------------------------------------------------------------------------------------------- +void ModelUFS::step(State & xx, const ModelBias &) const +{ + oops::Log::trace() << "ModelUFS::step starting" << std::endl; + oops::Log::trace() << "ModelUFS::cd to " << ufsdir_ << std::endl; + chdir(ufsdir_); + + util::DateTime start = xx.validTime(); + util::DateTime * dtp1 = &start; + oops::Log::trace() << "Model start time is " << xx.validTime() << std::endl; + oops::Log::trace() << "Forecast time step is " << tstep_ << std::endl; + xx.validTime() += tstep_; + util::DateTime * dtp2 = &xx.validTime(); + soca_ufs_step_f90(keyConfig_, xx.toFortran(), &dtp1, &dtp2); + oops::Log::trace() << "ModelUFS::step done" << std::endl; +} +// ------------------------------------------------------------------------------------------------- +void ModelUFS::finalize(State & xx) const { + oops::Log::trace() << "ModelUFS::finalize starting" << std::endl; + util::DateTime * dtp = &xx.validTime(); + soca_ufs_finalize_f90(keyConfig_, xx.toFortran(), &dtp); + oops::Log::trace() << "ModelUFS::finalize done" << std::endl; +} +// ------------------------------------------------------------------------------------------------- +int ModelUFS::saveTrajectory(State & xx, const ModelBias &) const { +// ABORT("Model:UFS should not be used for the trajectory"); + return 0; +} +// ------------------------------------------------------------------------------------------------- +void ModelUFS::print(std::ostream & os) const { + os << "ModelUFS::print not implemented"; +} +// ------------------------------------------------------------------------------------------------- +} // namespace soca diff --git a/src/soca/Model/ufs/ModelUFS.h b/src/soca/Model/ufs/ModelUFS.h new file mode 100644 index 000000000..f23d213f7 --- /dev/null +++ b/src/soca/Model/ufs/ModelUFS.h @@ -0,0 +1,68 @@ +/* + * (C) Copyright 2020 NOAA + * + * 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. + */ + +#pragma once + +#include +#include + +#include "eckit/config/Configuration.h" + +#include "oops/base/Variables.h" +#include "oops/generic/ModelBase.h" +#include "oops/interface/ModelBase.h" +#include "oops/util/Duration.h" +#include "oops/util/ObjectCounter.h" +#include "oops/util/Printable.h" + +#include "soca/Geometry/Geometry.h" +#include "soca/Traits.h" +#include "ModelUFS.interface.h" + +// Forward declarations +namespace eckit { + class Configuration; +} + +namespace soca { + class ModelBias; + class Increment; + class State; + +// ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- + +class ModelUFS: public oops::interface::ModelBase, + private util::ObjectCounter { + public: + static const std::string classname() {return "soca::ModelUFS";} + + ModelUFS(const Geometry &, const eckit::Configuration &); + ~ModelUFS(); + + void initialize(State &) const; + void step(State &, const ModelBias &) const; + +/// Finish model integration + void finalize(State &) const; + int saveTrajectory(State &, const ModelBias &) const; + + const util::Duration & timeResolution() const {return tstep_;} + const oops::Variables & variables() const {return vars_;} + + private: + void print(std::ostream &) const; + F90model keyConfig_; + util::Duration tstep_; + const Geometry geom_; + oops::Variables vars_; + char jedidir_[10000]; + char ufsdir_[10000]; +}; +// ----------------------------------------------------------------------------- + +} // namespace soca diff --git a/src/soca/Model/ufs/ModelUFS.interface.h b/src/soca/Model/ufs/ModelUFS.interface.h new file mode 100644 index 000000000..b674c65e9 --- /dev/null +++ b/src/soca/Model/ufs/ModelUFS.interface.h @@ -0,0 +1,40 @@ +/* + * (C) Copyright 2020 NOAA + * + * 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. + */ + +#pragma once + +#include "soca/Fortran.h" +#include "soca/Traits.h" + +// Forward declarations +namespace eckit { + class Configuration; +} + +namespace util { + class DateTime; + class Duration; +} + +namespace soca { + +extern "C" { + + void soca_ufs_create_f90(F90model &, const eckit::Configuration &, const F90geom &); + void soca_ufs_delete_f90(F90model &); + + + void soca_ufs_initialize_f90(const F90model &, const F90state &, util::DateTime * const *); + + void soca_ufs_step_f90(const F90model &, const F90state &, util::DateTime * const *, + util::DateTime * const *); + + void soca_ufs_finalize_f90(const F90model &, const F90inc &, util::DateTime * const *); + +} +// ----------------------------------------------------------------------------- +} // namespace soca diff --git a/src/soca/Model/ufs/lst b/src/soca/Model/ufs/lst new file mode 100644 index 000000000..3034522d5 --- /dev/null +++ b/src/soca/Model/ufs/lst @@ -0,0 +1,7 @@ +CMakeLists.txt +lst +ModelUFS.cc +ModelUFS.h +ModelUFS.interface.h +soca_ufs_interface_mod.F90 +soca_ufs_mod.F90 diff --git a/src/soca/Model/ufs/soca_mom6.F90 b/src/soca/Model/ufs/soca_mom6.F90 new file mode 100644 index 000000000..52df7d291 --- /dev/null +++ b/src/soca/Model/ufs/soca_mom6.F90 @@ -0,0 +1,270 @@ +! (C) Copyright 2017-2021 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. + +module soca_mom6 + +use fckit_mpi_module, only: fckit_mpi_comm +use mpp_mod, only : mpp_init +use fms_io_mod, only : fms_io_init, fms_io_exit +use fms_mod, only : read_data, write_data, fms_init, fms_end +use time_interp_external_mod, only : time_interp_external_init +use time_manager_mod, only: time_type, print_time + +use kinds, only: kind_real + +use MOM, only : initialize_MOM, step_MOM, MOM_control_struct, MOM_end, & + extract_surface_state, finish_MOM_initialization, & + get_MOM_state_elements +use MOM_diag_mediator, only : diag_ctrl +use MOM_domains, only : MOM_infra_init, MOM_infra_end, & + MOM_domains_init, clone_MOM_domain, MOM_domain_type +use MOM_error_handler, only : MOM_error, MOM_mesg, WARNING, FATAL, is_root_pe +use MOM_file_parser, only : get_param, param_file_type, close_param_file +use MOM_forcing_type, only : forcing, mech_forcing, forcing_diagnostics, & + mech_forcing_diags, MOM_forcing_chksum, & + MOM_mech_forcing_chksum +use MOM_get_input, only : directories, Get_MOM_Input, directories +use MOM_grid, only : ocean_grid_type, MOM_grid_init +use MOM_io, only : open_file, close_file, & + check_nml_error, io_infra_init, io_infra_end, & + ASCII_FILE, READONLY_FILE, open_ASCII_file +use MOM_string_functions,only : uppercase +!use MOM_surface_forcing, only : set_forcing, forcing_save_restart, & +! surface_forcing_init, surface_forcing_CS +use MOM_surface_forcing_nuopc, only : forcing_save_restart, & + surface_forcing_init, surface_forcing_CS +!use MOM_surface_forcing_nuopc, only : forcing_save_restart, & +! surface_forcing_init !, surface_forcing_CS +use MOM_time_manager, only : time_type, set_date, get_date, & + real_to_time, time_type_to_real, & + operator(+), operator(-), operator(*), operator(/), & + operator(>), operator(<), operator(>=), & + increment_date, set_calendar_type, month_name, & + JULIAN, GREGORIAN, NOLEAP, THIRTY_DAY_MONTHS, & + NO_CALENDAR +use MOM_tracer_flow_control, only : tracer_flow_control_CS +use MOM_unit_scaling, only : unit_scale_type +use MOM_variables, only : surface +use MOM_verticalGrid, only : verticalGrid_type, & + verticalGridInit, verticalGridEnd + +implicit none + +private +public :: soca_geomdomain_init, & + soca_mom6_init, soca_mom6_config, soca_mom6_end + +!> Data structure neccessary to initialize/run mom6 +type soca_mom6_config + type(mech_forcing) :: forces !< Driving mechanical surface forces + type(forcing) :: fluxes !< Pointers to the thermodynamic forcing fields + !< at the ocean surface. + type(surface) :: sfc_state !< Pointers to the ocean surface state fields. + real :: dt_forcing !< Coupling time step in seconds. + type(time_type) :: Time_step_ocean !< time_type version of dt_forcing + type(directories) :: dirs !< Relevant dirs/path + type(time_type) :: Time !< Model's time before call to step_MOM. + type(unit_scale_type), pointer :: scaling !< Unit conversion factors + type(ocean_grid_type), pointer :: grid !< Grid metrics + type(verticalGrid_type), pointer :: GV !< Vertical grid + type(MOM_control_struct), pointer :: MOM_CSp !< Tracer flow control structure. + type(surface_forcing_CS), pointer :: surface_forcing_CSp => NULL() + type(fckit_mpi_comm) :: f_comm + type(param_file_type) :: param_file +end type soca_mom6_config + +contains + +! ------------------------------------------------------------------------------ +!> Initialize mom6's domain +subroutine soca_geomdomain_init(Domain, nk, f_comm) + type(MOM_domain_type), pointer, intent(in) :: Domain !< Ocean model domain + integer, intent(out) :: nk + type(fckit_mpi_comm), intent(in) :: f_comm + + type(param_file_type) :: param_file !< Structure to parse for run-time parameters + type(directories) :: dirs !< Structure containing several relevant directory paths + character(len=40) :: mod_name = "soca_mom6" ! This module's name. + character(len=40) :: nml_filename = "fmsmpp.nml" ! This module's name. + + call mpp_init(localcomm=f_comm%communicator()) + + ! Initialize fms +! call fms_init() + call fms_init(localcomm=f_comm%communicator(), alt_input_nml_path = nml_filename) + ! Initialize fms io + call fms_io_init() + + ! Parse grid inputs + call Get_MOM_Input(param_file, dirs) + + ! Domain decomposition/Inintialize mpp domains + call MOM_domains_init(Domain, param_file) + + ! Get number of levels + call get_param(param_file, mod_name, "NK", nk, fail_if_missing=.true.) + + call close_param_file(param_file) + call fms_io_exit() + +end subroutine soca_geomdomain_init + +! ------------------------------------------------------------------------------ +!> Setup/initialize/prepare mom6 for time integration +subroutine soca_mom6_init(mom6_config, partial_init) + type(soca_mom6_config), intent(out) :: mom6_config + logical, optional, intent(in) :: partial_init + + type(time_type) :: Start_time ! The start time of the simulation. + type(time_type) :: Time_in ! + real :: dt ! The baroclinic dynamics time step, in seconds. + integer :: date_init(6)=0 ! The start date of the whole simulation. + integer :: years=0, months=0, days=0 ! These may determine the segment run + integer :: hours=0, minutes=0, seconds=0 ! length, if read from a namelist. + type(param_file_type) :: param_file ! The structure indicating the file(s) + ! containing all run-time parameters. + character(len=16) :: calendar = 'julian' + integer :: calendar_type=-1 + integer :: unit, io_status, ierr + logical :: offline_tracer_mode = .false. + + type(tracer_flow_control_CS), pointer :: tracer_flow_CSp => NULL() + type(diag_ctrl), pointer :: diag => NULL() !< Diagnostic structure + character(len=4), parameter :: vers_num = 'v2.0' + character(len=40) :: mod_name = "soca_mom6" ! This module's name. + integer :: ocean_nthreads = 1 + integer :: ncores_per_node = 1 + logical :: use_hyper_thread = .false. + !integer :: omp_get_num_threads,omp_get_thread_num,get_cpu_affinity,adder,base_cpu + namelist /ocean_solo_nml/ date_init, calendar, months, days, hours, minutes, seconds,& + ocean_nthreads, ncores_per_node, use_hyper_thread + integer :: param_int + logical :: a_partial_init = .false. + + ! Check if partial mom6 init is requiered + if (present(partial_init)) a_partial_init = partial_init + + call MOM_infra_init(localcomm=mom6_config%f_comm%communicator()) + call io_infra_init() + + ! Provide for namelist specification of the run length and calendar data. +! call open_file(unit, 'input.nml', form=ASCII_FILE, action=READONLY_FILE) + call open_ASCII_file(unit, 'input.nml', action=READONLY_FILE) + read(unit, ocean_solo_nml, iostat=io_status) + call close_file(unit) + ierr = check_nml_error(io_status,'ocean_solo_nml') + if (years+months+days+hours+minutes+seconds > 0) then + if (is_root_pe()) write(*,ocean_solo_nml) + endif + calendar = uppercase(calendar) + if (calendar(1:6) == 'JULIAN') then ; calendar_type = JULIAN + elseif (calendar(1:9) == 'GREGORIAN') then ; calendar_type = GREGORIAN + elseif (calendar(1:6) == 'NOLEAP') then ; calendar_type = NOLEAP + elseif (calendar(1:10)=='THIRTY_DAY') then ; calendar_type = THIRTY_DAY_MONTHS + elseif (calendar(1:11)=='NO_CALENDAR') then; calendar_type = NO_CALENDAR + elseif (calendar(1:1) /= ' ') then + call MOM_error(FATAL,'MOM_driver: Invalid namelist value '//trim(calendar)//' for calendar') + else + call MOM_error(FATAL,'MOM_driver: No namelist value for calendar') + endif + call set_calendar_type(calendar_type) + + Start_time = set_date(date_init(1),date_init(2), date_init(3), & + date_init(4),date_init(5),date_init(6)) + + call time_interp_external_init + + ! Nullify mom6_config pointers + mom6_config%MOM_CSp => NULL() + mom6_config%grid => NULL() + mom6_config%GV => NULL() + + ! Set mom6_config%Time to time parsed from mom6 config + mom6_config%Time = Start_time + + ! Initialize mom6 + Time_in = mom6_config%Time + + allocate(mom6_config%MOM_CSp) + + call initialize_MOM(mom6_config%Time, & + Start_time, & + param_file, & + mom6_config%dirs, & + mom6_config%MOM_CSp, & + offline_tracer_mode=offline_tracer_mode, & + diag_ptr=diag, & + tracer_flow_CSp=tracer_flow_CSp, & + Time_in=Time_in) + + ! adiabatic +! mom6_config%MOM_CSp%adiabatic = .true. +! MPchange--commented above line out for linking + !US => mom6_config%scaling + ! Continue initialization + call get_MOM_state_elements(mom6_config%MOM_CSp,& + G=mom6_config%grid,& + GV=mom6_config%GV,& + US=mom6_config%scaling,& + C_p=mom6_config%fluxes%C_p) + + mom6_config%param_file = param_file + ! Exit here for partial initialization + if (a_partial_init) return + + ! Setup surface forcing + call extract_surface_state(mom6_config%MOM_CSp, mom6_config%sfc_state) + call surface_forcing_init(mom6_config%Time,& + mom6_config%grid,& + mom6_config%scaling,& + param_file,& + diag,& + mom6_config%surface_forcing_CSp)!,& + ! tracer_flow_CSp) + + ! Get time step from MOM config. TODO: Get DT from DA config + call get_param(param_file, mod_name, "DT", param_int, fail_if_missing=.true.) + dt = real(param_int) + mom6_config%dt_forcing = dt + mom6_config%Time_step_ocean = real_to_time(real(mom6_config%dt_forcing, kind=8)) + + ! Finalize file parsing + call close_param_file(param_file) + + ! Set the forcing for the first steps. +! call set_forcing(mom6_config%sfc_state,& +! mom6_config%forces,& +! mom6_config%fluxes,& +! mom6_config%Time,& +! mom6_config%Time_step_ocean,& +! mom6_config%grid, & +! mom6_config%scaling , & +! mom6_config%surface_forcing_CSp) + + ! Do more stuff for mom init ... + call finish_MOM_initialization(mom6_config%Time,& + mom6_config%dirs,& + mom6_config%MOM_CSp) + +end subroutine soca_mom6_init + +! ------------------------------------------------------------------------------ +!> Release memory and possibly dump mom6's restart +subroutine soca_mom6_end(mom6_config) + type(soca_mom6_config), intent(inout) :: mom6_config + + ! Finalize fms + call io_infra_end + + !! as a temporary workaround to MPI_Finalize() issues, MOM_infra_end is NOT called + ! call MOM_infra_end + + ! Finalize mom6 + call MOM_end(mom6_config%MOM_CSp) + deallocate(mom6_config%MOM_CSp) + +end subroutine soca_mom6_end + +end module soca_mom6 diff --git a/src/soca/Model/ufs/soca_ufs_interface_mod.F90 b/src/soca/Model/ufs/soca_ufs_interface_mod.F90 new file mode 100644 index 000000000..41b973a75 --- /dev/null +++ b/src/soca/Model/ufs/soca_ufs_interface_mod.F90 @@ -0,0 +1,155 @@ +! (C) Copyright 2020 NOAA +! +! 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. + +module soca_ufs_interface_mod + +! iso +use iso_c_binding + +! oops +use datetime_mod +use duration_mod + +! fckit +use fckit_configuration_module, only: fckit_configuration + +! soca +use soca_geom_mod, only: soca_geom +use soca_geom_mod_c, only: soca_geom_registry +use soca_state_mod, only: soca_state +use soca_state_reg, only: soca_state_registry +use soca_ufs_mod, only: model_ufs + +implicit none +private +public :: soca_ufs_registry + +!> Linked list interface +#define LISTED_TYPE model_ufs +#include "oops/util/linkedList_i.f" +type(registry_t) :: soca_ufs_registry + +! -------------------------------------------------------------------------------------------------- + +contains + +! -------------------------------------------------------------------------------------------------- + +!> Linked list implementation +#include "oops/util/linkedList_c.f" + +! -------------------------------------------------------------------------------------------------- + +subroutine c_soca_ufs_create(c_key_self, c_conf, c_key_geom) & + bind (c,name='soca_ufs_create_f90') + +integer(c_int), intent(inout) :: c_key_self !< Key to model data +integer(c_int), intent(in) :: c_key_geom !< Geometry +type(c_ptr), value, intent(in) :: c_conf !< pointer to object of class Config + +type(model_ufs), pointer :: self +type(soca_geom), pointer :: geom +type(fckit_configuration) :: f_conf + +call soca_geom_registry%get(c_key_geom, geom) +call soca_ufs_registry%init() +call soca_ufs_registry%add(c_key_self) +call soca_ufs_registry%get(c_key_self, self) + +f_conf = fckit_configuration(c_conf) + +call self%create(f_conf, geom) +end subroutine c_soca_ufs_create + +! -------------------------------------------------------------------------------------------------- + +subroutine c_soca_ufs_delete(c_key_self) bind (c,name='soca_ufs_delete_f90') + +integer(c_int), intent(inout) :: c_key_self +type(model_ufs), pointer :: self + +call soca_ufs_registry%get(c_key_self, self) + +call self%delete() + +call soca_ufs_registry%remove(c_key_self) + +end subroutine c_soca_ufs_delete + +! -------------------------------------------------------------------------------------------------- + +subroutine c_soca_ufs_initialize(c_key_self, c_key_state, c_dt) & + bind(c,name='soca_ufs_initialize_f90') + +integer(c_int), intent(in) :: c_key_self !< Model +integer(c_int), intent(in) :: c_key_state !< Model state +type(c_ptr), intent(in) :: c_dt !< DateTime + +type(model_ufs), pointer :: self +type(soca_state), pointer :: state +type(datetime) :: fdate +call soca_state_registry%get(c_key_state,state) +call soca_ufs_registry%get(c_key_self, self) + +call c_f_datetime(c_dt, fdate) + +call self%initialize(state, fdate) + +end subroutine c_soca_ufs_initialize + +! -------------------------------------------------------------------------------------------------- + +subroutine c_soca_ufs_step(c_key_self, c_key_state, c_dt1, c_dt2) & + bind(c,name='soca_ufs_step_f90') + +integer(c_int), intent(in) :: c_key_self !< Model +integer(c_int), intent(in) :: c_key_state !< Model state +type(c_ptr), intent(in) :: c_dt1 !< DateTime +type(c_ptr), intent(in) :: c_dt2 !< DateTime + +type(model_ufs), pointer :: self +type(soca_state), pointer :: state + +type(datetime) :: fdate1 +type(datetime) :: fdate2 +character(len=20) :: vdatestrz + +call soca_ufs_registry%get(c_key_self, self) +call soca_state_registry%get(c_key_state,state) + +call c_f_datetime(c_dt1, fdate1) +call datetime_to_string(fdate1, vdatestrz) +call c_f_datetime(c_dt2, fdate2) +call datetime_to_string(fdate2, vdatestrz) +call self%step(state, fdate1, fdate2) + +end subroutine c_soca_ufs_step + +! -------------------------------------------------------------------------------------------------- + +subroutine c_soca_ufs_finalize(c_key_self, c_key_state, c_dt) & + bind(c,name='soca_ufs_finalize_f90') + +integer(c_int), intent(in) :: c_key_self !< Model +integer(c_int), intent(in) :: c_key_state !< Model state +type(c_ptr), intent(in) :: c_dt !< DateTime + +type(model_ufs), pointer :: self +type(soca_state), pointer :: state + +type(datetime) :: fdate + +call soca_state_registry%get(c_key_state,state) +call soca_ufs_registry%get(c_key_self, self) + +call c_f_datetime(c_dt, fdate) + +call self%finalize(state, fdate) + +end subroutine c_soca_ufs_finalize + +! -------------------------------------------------------------------------------------------------- + +end module soca_ufs_interface_mod diff --git a/src/soca/Model/ufs/soca_ufs_mod.F90 b/src/soca/Model/ufs/soca_ufs_mod.F90 new file mode 100644 index 000000000..1d4cf1261 --- /dev/null +++ b/src/soca/Model/ufs/soca_ufs_mod.F90 @@ -0,0 +1,661 @@ +! (C) Copyright 2020 NOAA +! +! 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. + +#define esmf_err_abort(rc) if (esmf_LogFoundError(rc, msg="Aborting UFS", line=__LINE__, file=__FILE__)) call esmf_Finalize(endflag=esmf_END_ABORT) + +module soca_ufs_mod + + ! oops + use datetime_mod + use duration_mod + + ! fckit + use fckit_configuration_module, only: fckit_configuration + + ! soca + use soca_geom_mod, only: soca_geom + use soca_state_mod, only: soca_state + use soca_fields_mod, only: soca_field + + ! ufs + use ESMF +!use ESMF, only: ESMF_FieldRedistStore, ESMF_FieldRedist, ESMF_RouteHandle + use NUOPC + use NUOPC_Driver + !use module_EARTH_GRID_COMP, only: esmSS => EARTH_REGISTER + use UFSDriver, only: esmSS => UFSDriver_SS + use mpp_mod, only: read_input_nml,mpp_pe + + + implicit none + private + + public :: model_ufs + + !> Fortran derived type to hold model definition + type :: model_ufs + type(ESMF_GridComp) :: esmComp + type(ESMF_State) :: toJedi, fromJedi + integer :: isc, iec, jsc, jec, npz + type(esmf_Clock) :: clock + type(esmf_config) :: cf_main !<-- the configure object + contains + procedure :: create + procedure :: delete + procedure :: initialize + procedure :: step + procedure :: finalize + end type model_ufs + + character(len=*), parameter :: modname='soca_ufs_mod' + + ! -------------------------------------------------------------------------------------------------- + +contains + + ! -------------------------------------------------------------------------------------------------- + + subroutine create(self, conf, geom) + + implicit none + class(model_ufs), intent(inout) :: self + type(fckit_configuration), intent(in) :: conf + type(soca_geom), intent(in) :: geom + + integer :: rc, urc, phase, i, cnt + character(len=20) :: cdate_start, cdate_stop + + type(ESMF_Time) :: startTime, stopTime + type(ESMF_TimeInterval) :: timeStep + + character(len=*),parameter :: subname = modname//' (create)' + type(ESMF_CplComp), pointer :: connectors(:) + character(len=128) :: name, msg + + ! Initialize ESMF + call ESMF_Initialize(logkindflag=esmf_LOGKIND_MULTI, & + defaultCalkind=esmf_CALKIND_GREGORIAN, & + mpiCommunicator=geom%f_comm%communicator(), rc=rc) + esmf_err_abort(rc) + ! Flush log output while debugging + call ESMF_LogSet(flush=.true., rc=rc) + esmf_err_abort(rc) + call ESMF_LogWrite("ESMF Initialized in "//subname, ESMF_LOGMSG_INFO) + + self%isc = geom%isc + self%iec = geom%iec + self%jsc = geom%jsc + self%jec = geom%jec + self%npz = geom%nzo + self%cf_main=esmf_configcreate(rc=rc) + call ESMF_ConfigLoadFile(config=self%cf_main, & + filename='model_configure', & + rc=rc) + + ! This call to read_input_nml() seems to be required + ! for CCPP. However, it does not belong at this level + ! but should be handled inside the model itself + call read_input_nml() + call ESMF_LogWrite("done reading input nml", ESMF_LOGMSG_INFO) + + ! Create the ESM component + self%esmComp = ESMF_GridCompCreate(name="esm", rc=rc) + esmf_err_abort(rc) + + ! SetServices for the ESM component + call ESMF_GridCompSetServices(self%esmComp, esmSS, userRc=urc, rc=rc) + esmf_err_abort(rc) + esmf_err_abort(urc) + + + ! Set ESM's Verbosity (High) - 32513 + call NUOPC_CompAttributeSet(self%esmComp, name="Verbosity", & + value="32513", rc=rc) + esmf_err_abort(rc) + + + + ! Initialize the clock based on contents of model_configure + ! ------------------------------------------- + call setUFSClock(self,startTime,stopTime) + call ESMF_GridCompSet(self%esmComp, clock=self%clock, rc=rc) + + ! Create import and export states from + ! perspective of the exernal system: + ! toJedi is an IMPORT into Jedi and an EXPORT from ESM + ! fromJedi is an EXPORT from Jedi and an IMPORT into ESM + + self%toJedi = ESMF_StateCreate(stateintent=ESMF_STATEINTENT_IMPORT, & + rc=rc) + esmf_err_abort(rc) + + + self%fromJedi = ESMF_StateCreate(stateintent=ESMF_STATEINTENT_EXPORT, & + rc=rc) + esmf_err_abort(rc) + + + call ESMF_LogWrite("Advertising export from ESM", ESMF_LOGMSG_INFO) + ! Advertise fields on the exportState, for data coming out of ESM component + ! Note--only certain fields are available. Check in GFS_surface_generic to see if they are filled +#if 1 + call NUOPC_Advertise(self%toJedi, & + StandardNames=(/ & + ! "tocn "/), & ! Example fields + "socn ", & ! Example fields + "tocn ", & ! Example fields + "uocn ", & ! Example fields + "vocn "/), & ! Example fields + SharePolicyField="share", & + TransferOfferGeomObject="cannot provide", rc=rc) + esmf_err_abort(rc) + +#endif + call ESMF_LogWrite("Advertising imports to ESM", ESMF_LOGMSG_INFO) + ! Advertise fields on the importState, for data going into ESM componenta + +! imports are not yet implemented +#if 0 + call NUOPC_Advertise(self%fromJedi, & + StandardNames=(/ & + "u ", & ! Example fields + "v ", & ! Example fields + "ua ", & ! Example fields + "va ", & ! Example fields + "t ", & ! Example fields + "delp ", & ! Example fields + "sphum ", & ! Example fields + "ice_wat ", & ! Example fields + "liq_wat ", & ! Example fields + "o3mr ", & ! Example fields + "phis ", & ! Example fields + "slmsk ", & ! Example fields + "weasd ", & ! Example fields + "tsea ", & ! Example fields + "vtype ", & ! Example fields + "stype ", & ! Example fields + "vfrac ", & ! Example fields + "stc ", & ! Example fields + "smc ", & ! Example fields + "snwdph ", & ! Example fields + "u_srf ", & ! Example fields + "v_srf ", & ! Example fields + "f10m "/), & ! Example fields + TransferOfferGeomObject="cannot provide", rc=rc) + + esmf_err_abort(rc) +#endif + + call ESMF_StateGet(self%toJedi, itemCount=cnt, rc=rc) + esmf_err_abort(rc) + + write(msg, "(I2)") cnt + call ESMF_LogWrite("After filling advertise toJedi state has "//trim(msg)//" items.", & + ESMF_LOGMSG_INFO) + + + ! call ExternalAdvertise phase + call NUOPC_CompSearchPhaseMap(self%esmComp, & + methodflag=ESMF_METHOD_INITIALIZE, & + phaseLabel=label_ExternalAdvertise, phaseIndex=phase, rc=rc) + esmf_err_abort(rc) + + call ESMF_LogWrite("done with CompSearchPhaseMap ", & + ESMF_LOGMSG_INFO) + + call ESMF_GridCompInitialize(self%esmComp, phase=phase, & + importState=self%fromJedi, exportState=self%toJedi, & + clock=self%clock, userRc=urc, rc=rc) + esmf_err_abort(rc) + esmf_err_abort(urc) + + call ESMF_LogWrite("done with GridCompInitialize ", & + ESMF_LOGMSG_INFO) + + call ESMF_StateGet(self%toJedi, itemCount=cnt, rc=rc) + esmf_err_abort(rc) + + write(msg, "(I2)") cnt + call ESMF_LogWrite("After calling advertise toJedi state has "//trim(msg)//" items.", & + ESMF_LOGMSG_INFO) + + + ! Set verbosity flag on connectors + nullify(connectors); + call NUOPC_DriverGetComp(self%esmComp, & + compList=connectors, rc=rc) + esmf_err_abort(rc) + + + call ESMF_LogWrite("About to set connector verbosity", ESMF_LOGMSG_INFO) + do i=lbound(connectors,1), ubound(connectors,1) + call ESMF_CplCompGet(connectors(i), name=name, rc=rc) + esmf_err_abort(rc) + + call NUOPC_CompAttributeSet(connectors(i), name="Verbosity", & + value="max", rc=rc) + esmf_err_abort(rc) + + call ESMF_LogWrite(" --> Set verbosity on connector: "//trim(name), & + ESMF_LOGMSG_INFO) + enddo + + deallocate(connectors) + + ! call ExternalRealize phase + call NUOPC_CompSearchPhaseMap(self%esmComp, & + methodflag=ESMF_METHOD_INITIALIZE, & + phaseLabel=label_ExternalRealize, phaseIndex=phase, rc=rc) + esmf_err_abort(rc) + + call ESMF_GridCompInitialize(self%esmComp, phase=phase, & + importState=self%fromJedi, exportState=self%toJedi, & + clock=self%clock, userRc=urc, rc=rc) + esmf_err_abort(rc) + esmf_err_abort(urc) + + call ESMF_StateGet(self%toJedi, itemCount=cnt, rc=rc) + esmf_err_abort(rc) + + write(msg, "(I2)") cnt + + call ESMF_LogWrite("Dumping toJedi state with "//trim(msg)//" items", & + ESMF_LOGMSG_INFO) + + ! call ExternalDataInit phase + call NUOPC_CompSearchPhaseMap(self%esmComp, & + methodflag=ESMF_METHOD_INITIALIZE, & + phaseLabel=label_ExternalDataInit, phaseIndex=phase, rc=rc) + esmf_err_abort(rc) + + call ESMF_GridCompInitialize(self%esmComp, phase=phase, & + importState=self%fromJedi, exportState=self%toJedi, & + clock=self%clock, userRc=urc, rc=rc) + esmf_err_abort(rc) + esmf_err_abort(urc) + + call ESMF_LogWrite("Exit "//subname, ESMF_LOGMSG_INFO) + + end subroutine create + +! -------------------------------------------------------------------------------------------------- + + subroutine initialize(self, state, vdate) + + implicit none + + class(model_ufs), intent(inout) :: self + type(soca_state), intent(in) :: state + type(datetime), intent(in) :: vdate + + character(len=*),parameter :: subname = modname//' (initialize)' + + call ESMF_LogWrite("Enter "//subname, ESMF_LOGMSG_INFO) + + call ESMF_LogWrite("Exit "//subname, ESMF_LOGMSG_INFO) + + end subroutine initialize + +! -------------------------------------------------------------------------------------------------- + + subroutine step(self, state, vdate_start, vdate_final) + + implicit none + + class(model_ufs), intent(inout) :: self + type(soca_state), intent(inout) :: state + type(datetime), intent(in) :: vdate_start + type(datetime), intent(in) :: vdate_final + + ! local variables + integer :: rc, urc, cnt + character(len=20) :: strStartTime, strStopTime + character(len=128) :: name, msg + type(ESMF_Time) :: startTime, stopTime + type(ESMF_TimeInterval) :: timeStep + integer, save :: tstep=1 + character(len=80) :: fileName + +!----------------------------------------------------------------------------- + + character(len=*),parameter :: subname = modname//' (step)' + call ESMF_LogWrite("Enter "//subname, ESMF_LOGMSG_INFO) + + call datetime_to_string(vdate_start, strStartTime) + call datetime_to_string(vdate_final, strStopTime) + + call ESMF_LogWrite(" --> REQUESTED START TIME:"//trim(strStartTime), ESMF_LOGMSG_INFO) + call ESMF_LogWrite(" --> REQUESTED STOP TIME:"//trim(strStopTime), ESMF_LOGMSG_INFO) + + call ESMF_ClockGet(self%clock, startTime=startTime, & + stopTime=stopTime, rc=rc) + esmf_err_abort(rc) + + + call ESMF_TimeSet(startTime, timeString=strStartTime, rc=rc) + esmf_err_abort(rc) + + + call ESMF_TimeSet(stopTime, timeString=strStopTime, rc=rc) + esmf_err_abort(rc) + + + timeStep = stopTime - startTime + + call ESMF_ClockSet(self%clock, startTime=startTime, & + stopTime=stopTime, currTime=startTime, timeStep=timeStep, rc=rc) + esmf_err_abort(rc) + + ! step the model forward + call ESMF_GridCompRun(self%esmComp, & + importState=self%fromJedi, exportState=self%toJedi, & + clock=self%clock, userRc=urc, rc=rc) + esmf_err_abort(rc) + esmf_err_abort(urc) + + call ESMF_StateGet(self%toJedi, itemCount=cnt, rc=rc) + esmf_err_abort(rc) + write(msg, "(I2)") cnt + call ESMF_LogWrite("after step toJedi state with "//trim(msg)//" items", & + ESMF_LOGMSG_INFO) + write(fileName, '("fields_in_esm_import_step",I2.2,".nc")') tstep + call mom6_to_state(self, state) + call ESMF_LogWrite("after state write "//trim(msg)//" rc", & + ESMF_LOGMSG_INFO) + + call ESMF_LogWrite("Exit "//subname, ESMF_LOGMSG_INFO) + + end subroutine step + +! -------------------------------------------------------------------------------------------------- + + subroutine delete(self) + + implicit none + class(model_ufs), intent(inout) :: self + integer :: rc + character(len=*),parameter :: subname = modname//' (delete)' + + call ESMF_LogWrite("Enter "//subname, ESMF_LOGMSG_INFO) + + call ESMF_GridCompDestroy(self%esmComp, rc=rc) + esmf_err_abort(rc) + + + call ESMF_LogWrite("About to destroy toJedi state "//subname, ESMF_LOGMSG_INFO) + + call ESMF_StateDestroy(self%toJedi, rc=rc) + esmf_err_abort(rc) + + + call ESMF_LogWrite("About to destroy fromJedi state "//subname, ESMF_LOGMSG_INFO) + + call ESMF_StateDestroy(self%fromJedi, rc=rc) + esmf_err_abort(rc) + + ! Finalize ESMF + ! ------------- + call ESMF_Finalize(endflag=ESMF_END_KEEPMPI, rc=rc) + if (rc /= ESMF_SUCCESS) then + call ESMF_LogWrite("ERROR FINALIZING ESMF "//subname, ESMF_LOGMSG_INFO) + else + call ESMF_LogWrite("SUCCESSFULLY FINALIZED ESMF"//subname, ESMF_LOGMSG_INFO) + endif + end subroutine delete + + ! -------------------------------------------------------------------------------------------------- + + subroutine finalize(self, state, vdate) + + implicit none + class(model_ufs), intent(inout) :: self + type(soca_state), intent(in) :: state + type(datetime),intent(in) :: vdate + + character(len=*),parameter :: subname = modname//' (finalize)' + ! Clean up is being done in the delete method + call ESMF_LogWrite("Enter "//subname, ESMF_LOGMSG_INFO) + + call ESMF_LogWrite("Exit "//subname, ESMF_LOGMSG_INFO) + + end subroutine finalize + + subroutine mom6_to_state( self, state ) + + implicit none + type(model_ufs), intent(in) :: self + type(soca_state), intent(inout) :: state + + integer :: num_items, i, rc, rank, lb(3), ub(3), fnpz, ib, nb + type(ESMF_Field) :: field, destField + character(len=ESMF_MAXSTR), allocatable :: item_names(:) + real(kind=ESMF_KIND_R8), pointer :: farrayPtr2(:,:) + real(kind=ESMF_KIND_R8), pointer :: farrayPtr3(:,:,:) + character(len=80) :: soca_name + type(soca_field), pointer :: field_ptr + type(ESMF_Distgrid) :: distgrid + type(ESMF_Grid) :: grid + type(ESMF_RouteHandle) :: routehandle + + real(kind=ESMF_KIND_R8),allocatable,dimension(:,:,:) :: field_mom6 + + distgrid = ESMF_DistGridCreate(minIndex=(/1,1/), maxIndex=(/360,320/), & + regDecomp=(/2,4/), & + rc=rc) + grid = ESMF_GridCreate(distgrid=distgrid, & + name="grid", rc=rc) + if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT) + + ! Array to hold output from UFS in JEDI precision + ! ------------------------------------------------ + ib = (self%isc-1)*(self%jsc-1)+1 + nb = (self%iec - self%isc + 1) * (self%jec - self%jsc + 1) + allocate(field_mom6(self%isc:self%iec,self%jsc:self%jec, self%npz)) + + + ! Get number of items + ! ------------------- + call ESMF_StateGet(self%toJedi, itemcount = num_items, rc = rc) + if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_StateGet itemcount failed") + + + ! Get names of the items + ! ---------------------- + allocate(item_names(num_items)) + call ESMF_StateGet(self%toJedi, itemnamelist = item_names, rc = rc) + if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_StateGet itemnamelist failed") + + + ! Loop over states coming from UFS and convert to JEDI state + ! ----------------------------------------------------------- + do i = 1, num_items + ! Create map between UFS name and mom6-jedi name + ! ---------------------------------------------- + soca_name = trim(item_names(i)) + call ESMF_LogWrite("item name is "//soca_name, ESMF_LOGMSG_INFO) + + ! Only need to extract field from UFS if mom6-jedi needs it + ! --------------------------------------------------------- +#if 1 +! if (state%has_field(trim(soca_name))) then + + !Get field from the state + call ESMF_StateGet(self%toJedi, item_names(i), field, rc = rc) + if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_StateGet field failed") + + !Validate the field + call ESMF_FieldValidate(field, rc = rc) + if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_FieldValidate failed") + + !Get the field rank + call ESMF_FieldGet(field, rank = rank, rc = rc) + if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_FieldGet rank failed") + + !Convert field to pointer and pointer bounds + field_mom6 = 0.0_ESMF_KIND_R8 + if (rank == 2) then + + ! this field is going to be on a 1D mesh with an ungridded dimension + call ESMF_FieldGet( field, 0, farrayPtr = farrayPtr2, totalLBound = lb(1:2), totalUBound = ub(1:2), rc = rc ) + + ! create a gridded field to redistribute the data to + destField = ESMF_FieldCreate(grid=grid, typekind=ESMF_TYPEKIND_R8, & + ungriddedLBound=(/1/), ungriddedUBound=(/75/),name='tocn', rc=rc) + if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT) + + ! 1. setup routehandle from source Field to destination Field + call ESMF_FieldRedistStore(field, destField, routehandle, rc=rc) + if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT) + + ! 2. use precomputed routehandle to redistribute data + call ESMF_FieldRedist(field, destField, routehandle, rc=rc) + if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT) + + ! verify redist + call ESMF_FieldGet(destField, localDe=0, farrayPtr=farrayPtr3, totalLBound = lb(1:3), totalUBound = ub(1:3), rc=rc) + if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT) + + + if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_FieldGet 2D failed") + + fnpz = ub(3)-lb(3)+1 + field_mom6(self%isc:self%iec,self%jsc:self%jec,1:fnpz) = farrayPtr3(lb(1):ub(1),lb(2):ub(2),:) + nullify(farrayPtr3) + +! elseif (rank == 3) then +! call ESMF_FieldGet( field, 0, farrayPtr = farrayPtr3, totalLBound = lb, totalUBound = ub, rc = rc ) +! if (rc.ne.0) call abor1_ftn("mom6_to_state: ESMF_FieldGet 3D failed",rc) + +! fnpz = ub(3)-lb(3)+1 +! field_mom6(self%isc:self%iec,self%jsc:self%jec,1:fnpz) = farrayPtr3(lb(1):ub(1),lb(2):ub(2),lb(3):ub(3)) +! nullify(farrayPtr3) + + else + deallocate(item_names) + return + call abor1_ftn("mom6_mod: can only handle rank 2 or rank 3 fields from UFS") + + endif + if(ub(1)<0) then + ! Check that dimensions match + if ((ub(1)-lb(1)+1 .ne. self%iec-self%isc+1) .or. (ub(2)-lb(2)+1 .ne. self%jec-self%jsc+1) ) then + call abor1_ftn("mom6_to_state: dimension mismatch between JEDI and UFS horizontal grid") + endif + + endif + ! Get pointer to mom6-jedi side field + call state%get(trim(soca_name), field_ptr) + + if (field_ptr%nz .ne. fnpz) & + call abor1_ftn("mom6_to_state: dimension mismatch between JEDI and UFS vertical grid") + ! Copy from UFS to mom6-jedi +! field_ptr%val(self%isc:self%iec,self%jsc:self%jec,1:fnpz) = field_mom6(self%isc:self%iec,self%jsc:self%jec,1:fnpz) +! else +! call ESMF_LogWrite("Not needed by JEDI is "//soca_name, ESMF_LOGMSG_INFO) +! endif +#endif + end do + + deallocate(item_names) + + end subroutine mom6_to_state + + + subroutine setUFSClock(self,date_start,date_final) + + class(model_ufs), intent(inout) :: self + type(esmf_time), intent(inout) :: date_start, date_final + + type(ESMF_TimeInterval) :: runDuration, timestep + integer :: yy,mm,dd,hh,mns,sec,rc + !----------------------------------------------------------------------- + !*** extract the start time from the configuration + !----------------------------------------------------------------------- + ! + call ESMF_ConfigGetAttribute(config=self%cf_main & + ,value =YY & + ,label ='start_year:' & + ,rc =RC) + esmf_err_abort(rc) + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + call ESMF_ConfigGetAttribute(config=self%cf_main & + ,value =MM & + ,label ='start_month:' & + ,rc =RC) + esmf_err_abort(rc) + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + call ESMF_ConfigGetAttribute(config=self%cf_main & + ,value =DD & + ,label ='start_day:' & + ,rc =RC) + esmf_err_abort(rc) + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + call ESMF_ConfigGetAttribute(config=self%cf_main & + ,value =HH & + ,label ='start_hour:' & + ,rc =RC) + esmf_err_abort(rc) + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + call ESMF_ConfigGetAttribute(config=self%cf_main & + ,value =MNS & + ,label ='start_minute:' & + ,rc =RC) + esmf_err_abort(rc) + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + call ESMF_ConfigGetAttribute(config=self%cf_main & + ,value =SEC & + ,label ='start_second:' & + ,rc =RC) + esmf_err_abort(rc) + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! Set date_start + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + ! + call ESMF_TimeSet(time=date_start & !<-- The start time of the forecast (ESMF) + ,yy =YY & !<-- Year from config file + ,mm =MM & !<-- Month from config file + ,dd =DD & !<-- Day from config file + ,h =HH & !<-- Hour from config file + ,m =MNS & !<-- Minute from config file + ,s =SEC & !<-- Second from config file + ,rc =RC) + esmf_err_abort(rc) + + ! Set any time interval here It will be overridden later + call ESMF_timeintervalset(runduration, d=1, rc=rc) + call ESMF_timeintervalset(timestep, h=1, rc=rc) + date_final = date_start + runduration + + self%clock = ESMF_ClockCreate(name="main_clock", & + timeStep=timestep, startTime=date_start, stopTime=date_final, rc=rc) + + esmf_err_abort(rc) + + call ESMF_ClockPrint(self%clock, options="startTime", & + preString="Printing startTime to stdout: ", rc=rc) + + + ! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + + end subroutine setUFSClock + +end module soca_ufs_mod diff --git a/src/soca/Traits.h b/src/soca/Traits.h index 32d0f4463..a7d35e5d2 100644 --- a/src/soca/Traits.h +++ b/src/soca/Traits.h @@ -38,7 +38,7 @@ struct Traits { typedef soca::GeometryIterator GeometryIterator; typedef soca::State State; typedef soca::Increment Increment; - typedef soca::ErrorCovariance Covariance; + typedef soca::ErrorCovariance Covariance; // Not actually used, just empty stubs typedef soca::ModelBias ModelAuxControl; typedef soca::ModelBiasIncrement ModelAuxIncrement; @@ -48,6 +48,34 @@ struct Traits { typedef soca::VariableChange VariableChange; typedef soca::ModelData ModelData; }; +// Geometry key type +typedef int F90geom; +// Geometry iterator key type +typedef int F90iter; +// Model key type +typedef int F90model; +// Tlm key type +typedef int F90tlm; +// Locations key type +typedef int F90locs; +// Goms key type +typedef int F90goms; +// Trajectory key type +typedef int F90traj; +// Background error covariance key type +typedef int F90bmat; +// ObOp trajectory +typedef int F90ootrj; +// State key +typedef int F90state; +// Increment key +typedef int F90inc; +// Variable change +typedef int F90varcha; +// GetValues key +typedef int F90getvalues; +typedef int F90lineargetvalues; + } // namespace soca diff --git a/src/soca/Utils/soca_convert_state_mod.F90 b/src/soca/Utils/soca_convert_state_mod.F90 index 2ec642e57..91d2baef0 100644 --- a/src/soca/Utils/soca_convert_state_mod.F90 +++ b/src/soca/Utils/soca_convert_state_mod.F90 @@ -350,12 +350,12 @@ subroutine soca_hinterp(self,field2,gdata,mask2,nz,missing,lon_in,lat_in,lon_out real(kind_real), dimension(:), allocatable :: lath_inp real(kind_real), dimension(:,:), allocatable :: lon_inp, lat_inp, tr_inp, mask_in_ real(kind_real), dimension(self%isd:self%ied,self%jsd:self%jed) :: tr_out, fill, good, prev, mask_out_ - real(kind=kind_real) :: max_lat,min_lat, pole, npole, varavg + real(kind=kind_real) :: max_lat,min_lat, pole, npole, varavg, acrit real(kind=kind_real), dimension(:), allocatable :: last_row, lonh, lath logical :: add_np, add_sp PI_180=atan(1.0d0)/45.0d0 - + acrit = 1.0e-7 isg = 1; jsg = 1; ieg = size(gdata,1); jeg = size(gdata,2) @@ -479,7 +479,7 @@ subroutine soca_hinterp(self,field2,gdata,mask2,nz,missing,lon_in,lat_in,lon_out end if if (k==1) prev(:,:) = tr_out(:,:) - call fill_miss_2d(tr_out, good, fill, prev=prev, G=grid, smooth=.true.) + call fill_miss_2d(tr_out, good, fill, prev, grid, acrit, answer_date=20181231) !TODO: In case fill_miss_2d failed at surface (k=1), use IDW to fill data pt that is located in ocean mask !Problem: IDW is compiler-dependent diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7603a46d8..65be71a40 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,20 +1,32 @@ +# This file sets up the ctests for SOCA +# +# Each ctest will be run in its own working directory (to keep tests from +# breaking when run in parallel), this working directory is available at +# "./soca/test/test_workdir/". Each test working directy has a link +# to the following directories: +# +# - data_static - input data that does NOT come from any other ctest +# - data_generated - contains the output from each ctest, and can be used as +# input for another ctest +# - data_output - a convenience link to "./data_generated/", this is +# created to easily differentiate between input and output data +# for a given ctest yaml + + set( soca_test_input - testinput/3dhyb_nicas.yml testinput/3dhyb_diffusion.yml + testinput/3dhyb.yml testinput/3dhybfgat.yml - testinput/3dvar_diffusion.yml - testinput/3dvar_godas.yml + testinput/3dvar_nicas.yml testinput/3dvar_single_ob.yml - testinput/3dvar_soca.yml testinput/3dvar_zero_ob.yml - testinput/3dvarbump.yml + testinput/3dvar.yml testinput/3dvarfgat_pseudo.yml testinput/3dvarfgat.yml testinput/3dvarlowres_soca.yml testinput/4denvar.yml testinput/4dhybenvar.yml testinput/addincrement.yml - testinput/balance_mask.yml testinput/checkpointmodel.yml testinput/convertincrement.yml testinput/convertstate_changevar.yml @@ -22,27 +34,25 @@ set( soca_test_input testinput/convertstate.yml testinput/diffstates.yml testinput/dirac_diffusion.yml - testinput/dirac_horizfilt.yml testinput/dirac_mlbalance.yml testinput/dirac_soca_cor_nicas_scales.yml testinput/dirac_soca_cov.yml - testinput/dirac_soca_mask.yml - testinput/dirac_soca_nomask.yml testinput/dirac_socahyb_cov.yml testinput/enshofx_1.yml testinput/enshofx_2.yml testinput/enshofx_3.yml testinput/enshofx.yml - testinput/enspert.yml testinput/ensmeanandvariance.yml + testinput/enspert.yml testinput/ensrecenter.yml - testinput/errorcovariance.yml testinput/forecast_identity.yml testinput/forecast_mom6_bgc.yml testinput/forecast_mom6.yml + testinput/forecast_ufs.yml testinput/forecast_mom6_ens1.yml testinput/forecast_mom6_ens2.yml testinput/forecast_mom6_ens3.yml + testinput/forecast_mom6.yml testinput/forecast_pseudo.yml testinput/geometry_iterator_2d.yml testinput/geometry_iterator_3d.yml @@ -50,15 +60,14 @@ set( soca_test_input testinput/getvalues.yml testinput/gridgen.yml testinput/hofx_3d.yml - testinput/hofx_oasim_3d.yml testinput/hofx_4d_pseudo.yml testinput/hofx_4d.yml + testinput/hofx_oasim_3d.yml testinput/hybridgain.yml testinput/increment.yml testinput/letkf_split_observer.yml testinput/letkf_split_solver.yml testinput/letkf.yml - testinput/linearmodel.yml testinput/makeobs.yml testinput/model_ufsm6c6.yml testinput/model.yml @@ -70,43 +79,34 @@ set( soca_test_input testinput/parameters_bump_cor_nicas.yml testinput/parameters_bump_cov.yml testinput/parameters_bump_loc.yml - testinput/parameters_diffusion_hz.yml - testinput/parameters_diffusion_vt.yml + testinput/parameters_diffusion.yml testinput/parametric_stddev.yml testinput/setcorscales.yml testinput/sqrtvertloc.yml testinput/state.yml - testinput/static_socaerror_init.yml - testinput/static_socaerror_test.yml - testinput/static_socaerrorlowres_init.yml testinput/varchange_ana2model.yml testinput/varchange_balance_TSSSH.yml testinput/varchange_balance.yml testinput/varchange_bkgerrfilt.yml testinput/varchange_bkgerrgodas.yml - testinput/varchange_bkgerrsoca.yml testinput/varchange_bkgerrsoca_stddev.yml - testinput/varchange_horizfilt.yml - testinput/varchange_vertconv.yml + testinput/varchange_bkgerrsoca.yml ) set( soca_test_ref - testref/3dhyb_nicas.test testref/3dhyb_diffusion.test + testref/3dhyb.test testref/3dhybfgat.test - testref/3dvar_diffusion.test - testref/3dvar_godas.test + testref/3dvar_nicas.test testref/3dvar_single_ob.test - testref/3dvar_soca.test testref/3dvar_zero_ob.test - testref/3dvarbump.test + testref/3dvar.test testref/3dvarfgat_pseudo.test testref/3dvarfgat.test testref/3dvarlowres_soca.test testref/4denvar.test testref/4dhybenvar.test testref/addincrement.test - testref/balance_mask.test testref/checkpointmodel.test testref/convertincrement.test testref/convertstate_changevar.test @@ -114,15 +114,12 @@ set( soca_test_ref testref/convertstate.test testref/diffstates.test testref/dirac_diffusion.test - testref/dirac_horizfilt.test testref/dirac_soca_cor_nicas_scales.test testref/dirac_soca_cov.test - testref/dirac_soca_mask.test - testref/dirac_soca_nomask.test testref/dirac_socahyb_cov.test testref/enshofx.test - testref/enspert.test testref/ensmeanandvariance.test + testref/enspert.test testref/ensrecenter.test testref/forecast_identity.test testref/forecast_mom6_bgc.test @@ -130,29 +127,88 @@ set( soca_test_ref testref/forecast_pseudo.test testref/gridgen.test testref/hofx_3d.test - testref/hofx_oasim_3d.test testref/hofx_4d_pseudo.test testref/hofx_4d.test + testref/hofx_oasim_3d.test testref/hybridgain.test testref/letkf_split_observer.test testref/letkf_split_solver.test testref/letkf.test testref/makeobs.test - testref/parameters_bump_loc.test testref/parameters_bump_cor_nicas_scales.test testref/parameters_bump_cor_nicas.test testref/parameters_bump_cov.test + testref/parameters_bump_loc.test testref/parametric_stddev.test testref/setcorscales.test testref/sqrtvertloc.test - testref/static_socaerror_init.test - testref/static_socaerrorlowres_init.test +) + +set( soca_data_files + Data/godas_sst_bgerr.nc + Data/soca_gridspec.nc + Data/rossrad.dat + Data/fields_metadata.yml +) + +set( soca_model_param + Data/72x35x25/diag_table + Data/72x35x25/field_table + Data/72x35x25/ice.bkgerror.nc + Data/72x35x25/ocn.bkgerror.nc + Data/72x35x25/wav.bkgerror.nc + Data/72x35x25/MOM_input + Data/72x35x25/MOM_input_small + Data/72x35x25/MOM_override_bgc +) + +set( soca_model_namelist + Data/72x35x25/input.nml + Data/72x35x25/input_bgc.nml + Data/72x35x25/input_small.nml +) + +set( soca_model_restarts + Data/72x35x25/INPUT/forcing_daily.nc + Data/72x35x25/INPUT/forcing_monthly.nc + Data/72x35x25/INPUT/hycom1_25.nc + Data/72x35x25/INPUT/cice.res.nc + Data/72x35x25/INPUT/layer_coord25.nc + Data/72x35x25/INPUT/MOM.res.nc + Data/72x35x25/INPUT/sfc.res.nc + Data/72x35x25/INPUT/wav.res.nc + Data/72x35x25/INPUT/ocean_hgrid.nc + Data/72x35x25/INPUT/ocean_topog.nc + Data/72x35x25/INPUT/ocean_mosaic.nc + Data/72x35x25/INPUT/grid_spec.nc +) + +set( soca_obs + Data/Obs/adt.nc + Data/Obs/biomass_p.nc + Data/Obs/chl.nc + Data/Obs/gmi_gpm_geoval.nc + Data/Obs/gmi_gpm_obs.nc + Data/Obs/icec.nc + Data/Obs/icefb.nc + Data/Obs/prof.nc + Data/Obs/single_ob.nc + Data/Obs/sss.nc + Data/Obs/sst.nc + Data/Obs/swh.nc + Data/Obs/uocn_surface.nc + Data/Obs/vocn_surface.nc + Data/Obs/zero_ob.nc ) # Create directory for test input/output/reference and symlink all files file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testinput) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testoutput) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testref) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Data/ModelRunDirs) +execute_process(COMMAND cmake -E create_symlink + ${CMAKE_BINARY_DIR}/_deps/testdata-src ${CMAKE_CURRENT_BINARY_DIR}/Data/ModelRunDirs/UFS +) foreach(FILENAME ${soca_test_input} ${soca_test_ref}) execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME} @@ -197,7 +253,7 @@ install(FILES ${soca_install_data} # Configurable parameters for the subsequent tests -set( SOCA_TESTS_MAX_MPI 2 CACHE STRING +set( SOCA_TESTS_MAX_MPI 8 CACHE STRING "Maximum number of PEs to use for SOCA's MPI based tests.\ NOTE: should leave this at 2 to ensure all tests pass.") @@ -277,9 +333,13 @@ function(soca_add_test) ${WORKDIR}/data_static/workdir/${FILENAME} ${WORKDIR}/${FILENAME} ) endforeach() + # setup output directory file( MAKE_DIRECTORY ${WORKDIR}/data_generated/${ARG_NAME}) - + execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink + ${WORKDIR}/data_generated/${ARG_NAME} + ${WORKDIR}/data_output + ) # Are we building a unit test / or running a soca executable? if ( ARG_SRC ) @@ -287,7 +347,7 @@ function(soca_add_test) ecbuild_add_test( TARGET test_soca_${ARG_NAME} SOURCES executables/${ARG_SRC} ARGS ${CONFIG_FILE} - LIBS soca + LIBS ${UFS_LIBS} MPI ${MPI} ENVIRONMENT ${TRAPFPE_ENV} WORKING_DIRECTORY ${WORKDIR} @@ -373,17 +433,6 @@ soca_add_test( NAME getvalues SRC TestGetValues.cc TEST_DEPENDS test_soca_gridgen ) -soca_add_test( NAME errorcovariance - SRC TestErrorCovariance.cc - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) - -soca_add_test( NAME linearmodel - SRC TestLinearModel.cc - # NOTRAPFPE - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) - # Variable changes #--------------------------------------------------------------------------------------------------- @@ -404,11 +453,6 @@ soca_add_test( NAME varchange_bkgerrfilt SRC TestVariableChange.cc TEST_DEPENDS test_soca_gridgen ) -soca_add_test( NAME varchange_horizfilt - SRC TestVariableChange.cc - NOTRAPFPE - TEST_DEPENDS test_soca_gridgen ) - soca_add_test( NAME varchange_bkgerrsoca SRC TestVariableChange.cc TEST_DEPENDS test_soca_gridgen ) @@ -421,11 +465,6 @@ soca_add_test( NAME varchange_bkgerrgodas SRC TestVariableChange.cc TEST_DEPENDS test_soca_gridgen ) -soca_add_test( NAME varchange_vertconv - SRC TestVariableChange.cc - TEST_DEPENDS test_soca_gridgen ) - - # Observation localization methods #--------------------------------------------------------------------------------------------------- soca_add_test( NAME obslocalization @@ -460,6 +499,14 @@ soca_add_test( NAME forecast_mom6 NOTRAPFPE TEST_DEPENDS test_soca_gridgen ) +# Test ufs/ng-godas forecast +soca_add_test( NAME forecast_ufs + EXE soca_forecast.x + MPI 8 + CFG forecast_ufs.yml + NOTRAPFPE + TEST_DEPENDS test_soca_gridgen ) + # Test mom6_bgc forecast (optional) if ( ENABLE_OCEAN_BGC ) soca_add_test( NAME forecast_mom6_bgc @@ -492,16 +539,6 @@ soca_add_test( NAME forecast_mom6_ens3 # background error #--------------------------------------------------------------------------------------------------- -soca_add_test( NAME static_socaerror_init - EXE soca_error_covariance_toolbox.x - # NOTRAPFPE - TEST_DEPENDS test_soca_gridgen ) - -soca_add_test( NAME static_socaerrorlowres_init - EXE soca_error_covariance_toolbox.x - # NOTRAPFPE - TEST_DEPENDS test_soca_gridgen ) - soca_add_test( NAME setcorscales EXE soca_setcorscales.x # NOTRAPFPE @@ -526,15 +563,13 @@ soca_add_test( NAME parameters_bump_cov EXE soca_error_covariance_toolbox.x NOTRAPFPE ) -soca_add_test( NAME parameters_diffusion_hz +soca_add_test( NAME parameters_diffusion EXE soca_error_covariance_toolbox.x TEST_DEPENDS test_soca_gridgen test_soca_setcorscales) -soca_add_test( NAME parameters_diffusion_vt - EXE soca_error_covariance_toolbox.x - TEST_DEPENDS test_soca_gridgen - test_soca_setcorscales) +# TODO(travis) low res diffusion init + # Misc applications #--------------------------------------------------------------------------------------------------- @@ -544,7 +579,7 @@ soca_add_test( NAME enspert EXE soca_enspert.x NOTRAPFPE TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) + test_soca_parameters_diffusion ) # Remapping MOM6 (horiz+vertical intterpolation) soca_add_test( NAME convertstate @@ -580,7 +615,7 @@ soca_add_test( NAME sqrtvertloc EXE soca_sqrtvertloc.x NOTRAPFPE TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) + test_soca_parameters_diffusion ) soca_add_test( NAME diffstates EXE soca_diffstates.x @@ -593,44 +628,28 @@ soca_add_test( NAME diffstates soca_add_test( NAME dirac_soca_cor_nicas_scales EXE soca_error_covariance_toolbox.x TEST_DEPENDS test_soca_gridgen - parameters_bump_cor_nicas_scales) + test_soca_parameters_bump_cor_nicas_scales) soca_add_test( NAME dirac_soca_cov EXE soca_error_covariance_toolbox.x TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init) + test_soca_parameters_diffusion ) soca_add_test( NAME dirac_socahyb_cov EXE soca_error_covariance_toolbox.x TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init - test_soca_parameters_bump_loc) - -soca_add_test( NAME dirac_horizfilt - EXE soca_error_covariance_toolbox.x - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init) - -soca_add_test( NAME dirac_soca_mask - EXE soca_error_covariance_toolbox.x - NOTRAPFPE - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init) - -soca_add_test( NAME dirac_soca_nomask - EXE soca_error_covariance_toolbox.x - NOTRAPFPE - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init) + test_soca_parameters_bump_loc + test_soca_parameters_diffusion ) # NOTE the following tests throws a FPE only on clang soca_add_test( NAME dirac_diffusion EXE soca_error_covariance_toolbox.x - TEST_DEPENDS test_soca_parameters_diffusion_hz - test_soca_parameters_diffusion_vt) + TEST_DEPENDS test_soca_gridgen + test_soca_parameters_diffusion ) soca_add_test( NAME dirac_mlbalance - EXE soca_error_covariance_toolbox.x) + EXE soca_error_covariance_toolbox.x + TEST_DEPENDS test_soca_gridgen ) # h(x) executables #--------------------------------------------------------------------------------------------------- @@ -642,7 +661,8 @@ soca_add_test( NAME makeobs soca_add_test( NAME hofx_3d EXE soca_hofx3d.x - TEST_DEPENDS test_soca_gridgen ) + TEST_DEPENDS test_soca_gridgen + LIBS soca stochastic_physics ccpp fv3atm esmf) if( ${oasim_FOUND} ) soca_add_test( NAME hofx_oasim_3d @@ -653,12 +673,14 @@ endif( ${oasim_FOUND} ) soca_add_test( NAME hofx_4d EXE soca_hofx.x NOTRAPFPE - TEST_DEPENDS test_soca_gridgen ) + TEST_DEPENDS test_soca_gridgen + LIBS soca stochastic_physics ccpp fv3atm esmf) soca_add_test( NAME hofx_4d_pseudo EXE soca_hofx.x TEST_DEPENDS test_soca_gridgen - test_soca_forecast_mom6 ) + test_soca_forecast_mom6 + LIBS soca stochastic_physics ccpp fv3atm esmf) # NOTE, enshofx is disabled because MOM6 always writes out some diagnostic # netcdf files (which can't be disabled). This is normally not a problem, except @@ -673,8 +695,9 @@ soca_add_test( NAME hofx_4d_pseudo # NOTRAPFPE # TEST_DEPENDS test_soca_gridgen ) - # variational methods +# (unless specifically specified, it is assumed that correlation uses +# EXPLICIT_DIFFUSION, and localization uses BUMP_NICAS ) #--------------------------------------------------------------------------------------------------- # # Following test does not work yet. IODA crashes @@ -687,67 +710,56 @@ soca_add_test( NAME hofx_4d_pseudo # soca_add_test( NAME 3dvar_single_ob # EXE soca_var.x # NOTRAPFPE -# TEST_DEPENDS test_soca_gridgen -# test_soca_static_socaerror_init ) +# TEST_DEPENDS test_soca_gridgen ) -soca_add_test( NAME 3dvar_soca +soca_add_test( NAME 3dvar EXE soca_var.x - NOTRAPFPE TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) + test_soca_parameters_diffusion + LIBS soca stochastic_physics ccpp fv3atm esmf ) -soca_add_test( NAME 3dvarbump +soca_add_test( NAME 3dvar_nicas EXE soca_var.x # NOTRAPFPE - TEST_DEPENDS test_soca_gridgen - test_soca_parameters_bump_cor_nicas ) - -soca_add_test( NAME 3dvar_diffusion - EXE soca_var.x - TEST_DEPENDS test_soca_gridgen - test_soca_parameters_diffusion_hz - test_soca_parameters_diffusion_vt) + TEST_DEPENDS test_soca_parameters_bump_cor_nicas ) -soca_add_test( NAME 3dvar_godas - EXE soca_var.x - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) -soca_add_test( NAME 3dvarlowres_soca - EXE soca_var.x - NOTRAPFPE - TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerrorlowres_init ) +## TODO(travis) fix the lowres grid dx,dy so that I can init the +## low res diffusion, and then run this test +# soca_add_test( NAME 3dvarlowres_soca +# EXE soca_var.x +# NOTRAPFPE +# TEST_DEPENDS test_soca_gridgen ) soca_add_test( NAME 3dvarfgat EXE soca_var.x NOTRAPFPE TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init ) + test_socs_parameters_diffusion ) soca_add_test( NAME 3dvarfgat_pseudo EXE soca_var.x TEST_DEPENDS test_soca_gridgen test_soca_forecast_mom6 - test_soca_static_socaerror_init ) + test_socs_parameters_diffusion ) -soca_add_test( NAME 3dhyb_nicas +soca_add_test( NAME 3dhyb EXE soca_var.x TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init - test_soca_parameters_bump_loc ) + test_soca_parameters_bump_loc + test_socs_parameters_diffusion ) soca_add_test( NAME 3dhyb_diffusion EXE soca_var.x TEST_DEPENDS test_soca_gridgen - test_soca_parameters_diffusion_hz) + test_soca_parameters_diffusion) soca_add_test( NAME 3dhybfgat EXE soca_var.x NOTRAPFPE TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init - test_soca_parameters_bump_loc ) + test_soca_parameters_bump_loc + test_socs_parameters_diffusion ) soca_add_test( NAME 4denvar EXE soca_var.x @@ -759,7 +771,8 @@ soca_add_test( NAME 4denvar soca_add_test( NAME 4dhybenvar EXE soca_var.x TEST_DEPENDS test_soca_gridgen - test_soca_static_socaerror_init + test_socs_parameters_diffusion + test_soca_forecast_mom6 test_soca_forecast_mom6_ens1 test_soca_forecast_mom6_ens2 test_soca_forecast_mom6_ens3 ) @@ -784,27 +797,27 @@ soca_add_test( NAME letkf_split_solver test_soca_letkf_split_observer ) -# other executables that depends on increments from 3dvar_godas run +# other executables that depends on increments from 3dvar_diffusion run #--------------------------------------------------------------------------------------------------- soca_add_test( NAME addincrement EXE soca_addincrement.x TEST_DEPENDS test_soca_gridgen - 3dvar_godas ) + test_soca_3dvar ) # Remapping MOM6 (horiz+vertical interpolation) soca_add_test( NAME convertincrement EXE soca_convertincrement.x NOTRAPFPE TEST_DEPENDS test_soca_gridgen - 3dvar_godas ) + test_soca_3dvar) -# restart checkpointing -soca_add_test( NAME checkpointmodel - EXE soca_checkpoint_model.x - NOTRAPFPE - TEST_DEPENDS test_soca_gridgen - test_soca_3dvar_godas) +## restart checkpointing +#soca_add_test( NAME checkpointmodel +# EXE soca_checkpoint_model.x +# NOTRAPFPE +# TEST_DEPENDS test_soca_gridgen +# test_soca_3dvar ) if( ${icepack_FOUND} ) # Apply the Soca2Cice nonlinear change of variable @@ -816,5 +829,5 @@ if( ${icepack_FOUND} ) MPI 2 NOTRAPFPE TEST_DEPENDS test_soca_gridgen - test_soca_3dvar_godas) + test_soca_3dvar ) endif() diff --git a/test/Data/72x35x25/MOM_input b/test/Data/72x35x25/MOM_input index f6174ab40..2801012ff 100644 --- a/test/Data/72x35x25/MOM_input +++ b/test/Data/72x35x25/MOM_input @@ -1,75 +1,127 @@ -! This file was written by the model and records the non-default parameters used at run-time. +! This file was written by the model and records all non-layout or debugging parameters used at run-time. ! === module MOM === ! === module MOM_unit_scaling === ! Parameters for doing unit scaling of variables. USE_REGRIDDING = True ! [Boolean] default = False - ! If True, use the ALE algorithm (regridding/remapping). - ! If False, use the layered isopycnal algorithm. + ! If True, use the ALE algorithm (regridding/remapping). If False, use the + ! layered isopycnal algorithm. THICKNESSDIFFUSE = True ! [Boolean] default = False - ! If true, interface heights are diffused with a - ! coefficient of KHTH. + ! If true, interface heights are diffused with a coefficient of KHTH. THICKNESSDIFFUSE_FIRST = True ! [Boolean] default = False - ! If true, do thickness diffusion before dynamics. - ! This is only used if THICKNESSDIFFUSE is true. -DT = 3600 ! [s] - ! The (baroclinic) dynamics time step. The time-step that - ! is actually used will be an integer fraction of the - ! forcing time-step (DT_FORCING in ocean-only mode or the - ! coupling timestep in coupled mode.) -DT_THERM = 3600.0 ! [s] default = 3600.0 - ! The thermodynamic and tracer advection time step. - ! Ideally DT_THERM should be an integer multiple of DT - ! and less than the forcing or coupling time-step, unless - ! THERMO_SPANS_COUPLING is true, in which case DT_THERM - ! can be an integer multiple of the coupling timestep. By - ! default DT_THERM is set to DT. -THERMO_SPANS_COUPLING = False ! [Boolean] default = False - ! If true, the MOM will take thermodynamic and tracer - ! timesteps that can be longer than the coupling timestep. - ! The actual thermodynamic timestep that is used in this - ! case is the largest integer multiple of the coupling - ! timestep that is less than or equal to DT_THERM. + ! If true, do thickness diffusion before dynamics. This is only used if + ! THICKNESSDIFFUSE is true. +DT = 1800 ! [s] + ! The (baroclinic) dynamics time step. The time-step that is actually used will + ! be an integer fraction of the forcing time-step (DT_FORCING in ocean-only mode + ! or the coupling timestep in coupled mode.) +DT_THERM = 3600 ! [s] default = 1800.0 + ! The thermodynamic and tracer advection time step. Ideally DT_THERM should be + ! an integer multiple of DT and less than the forcing or coupling time-step, + ! unless THERMO_SPANS_COUPLING is true, in which case DT_THERM can be an integer + ! multiple of the coupling timestep. By default DT_THERM is set to DT. +THERMO_SPANS_COUPLING = False ! [Boolean] default = False + ! If true, the MOM will take thermodynamic and tracer timesteps that can be + ! longer than the coupling timestep. The actual thermodynamic timestep that is + ! used in this case is the largest integer multiple of the coupling timestep + ! that is less than or equal to DT_THERM. +HFREEZE = 20.0 ! [m] default = -1.0 + ! If HFREEZE > 0, melt potential will be computed. The actual depth + ! over which melt potential is computed will be min(HFREEZE, OBLD) + ! where OBLD is the boundary layer depth. If HFREEZE <= 0 (default) + ! melt potential will not be computed. +DTBT_RESET_PERIOD = -1.0 ! [s] default = 7200.0 + ! The period between recalculations of DTBT (if DTBT <= 0). If DTBT_RESET_PERIOD + ! is negative, DTBT is set based only on information available at + ! initialization. If 0, DTBT will be set every dynamics time step. The default + ! is set by DT_THERM. This is only used if SPLIT is true. FRAZIL = True ! [Boolean] default = False - ! If true, water freezes if it gets too cold, and the - ! the accumulated heat deficit is returned in the - ! surface state. FRAZIL is only used if + ! If true, water freezes if it gets too cold, and the accumulated heat deficit + ! is returned in the surface state. FRAZIL is only used if ! ENABLE_THERMODYNAMICS is true. BOUND_SALINITY = True ! [Boolean] default = False - ! If true, limit salinity to being positive. (The sea-ice - ! model may ask for more salt than is available and - ! drive the salinity negative otherwise.) + ! If true, limit salinity to being positive. (The sea-ice model may ask for more + ! salt than is available and drive the salinity negative otherwise.) +MIN_SALINITY = 0.01 ! [PPT] default = 0.0 + ! The minimum value of salinity when BOUND_SALINITY=True. +C_P = 3925.0 ! [J kg-1 K-1] default = 3991.86795711963 + ! The heat capacity of sea water, approximated as a constant. This is only used + ! if ENABLE_THERMODYNAMICS is true. The default value is from the TEOS-10 + ! definition of conservative temperature. +USE_PSURF_IN_EOS = False ! [Boolean] default = True + ! If true, always include the surface pressure contributions in equation of + ! state calculations. +CHECK_BAD_SURFACE_VALS = True ! [Boolean] default = False + ! If true, check the surface state for ridiculous values. +BAD_VAL_SSH_MAX = 50.0 ! [m] default = 20.0 + ! The value of SSH above which a bad value message is triggered, if + ! CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SSS_MAX = 75.0 ! [PPT] default = 45.0 + ! The value of SSS above which a bad value message is triggered, if + ! CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SST_MAX = 55.0 ! [deg C] default = 45.0 + ! The value of SST above which a bad value message is triggered, if + ! CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SST_MIN = -3.0 ! [deg C] default = -2.1 + ! The value of SST below which a bad value message is triggered, if + ! CHECK_BAD_SURFACE_VALS is true. +DEFAULT_2018_ANSWERS = True ! [Boolean] default = False + ! This sets the default value for the various _2018_ANSWERS parameters. +WRITE_GEOM = 2 ! default = 1 + ! If =0, never write the geometry and vertical grid files. If =1, write the + ! geometry and vertical grid files only for a new simulation. If =2, always + ! write the geometry and vertical grid files. Other values are invalid. +SAVE_INITIAL_CONDS = False ! [Boolean] default = False + ! If true, write the initial conditions to a file given by IC_OUTPUT_FILE. + +! === module MOM_oda_incupd === +ODA_INCUPD = False ! [Boolean] default = False + ! If true, oda incremental updates will be applied + ! everywhere in the domain. +ODA_INCUPD_FILE = "mom6_increment.nc" ! The name of the file with the T,S,h increments. + +ODA_TEMPINC_VAR = "pt_inc" ! default = "ptemp_inc" + ! The name of the potential temperature inc. variable in + ! ODA_INCUPD_FILE. +ODA_SALTINC_VAR = "s_inc" ! default = "sal_inc" + ! The name of the salinity inc. variable in + ! ODA_INCUPD_FILE. +ODA_THK_VAR = "h_fg" ! default = "h" + ! The name of the int. depth inc. variable in + ! ODA_INCUPD_FILE. + +ODA_UINC_VAR = "u_inc" ! default = "u_inc" + ! The name of the zonal vel. inc. variable in + ! ODA_INCUPD_UV_FILE. +ODA_VINC_VAR = "v_inc" ! default = "v_inc" + ! The name of the meridional vel. inc. variable in + ! ODA_INCUPD_UV_FILE. +ODA_INCUPD_NHOURS = 6 ! default=3.0 + ! Number of hours for full update (0=direct insertion). ! === module MOM_domains === TRIPOLAR_N = True ! [Boolean] default = False - ! Use tripolar connectivity at the northern edge of the - ! domain. With TRIPOLAR_N, NIGLOBAL must be even. -NIGLOBAL = 72 ! - ! The total number of thickness grid points in the - ! x-direction in the physical domain. With STATIC_MEMORY_ - ! this is set in MOM_memory.h at compile time. -NJGLOBAL = 35 ! - ! The total number of thickness grid points in the - ! y-direction in the physical domain. With STATIC_MEMORY_ - ! this is set in MOM_memory.h at compile time. + ! Use tripolar connectivity at the northern edge of the domain. With + ! TRIPOLAR_N, NIGLOBAL must be even. +NIGLOBAL = 360 ! + ! The total number of thickness grid points in the x-direction in the physical + ! domain. With STATIC_MEMORY_ this is set in MOM_memory.h at compile time. +NJGLOBAL = 320 ! + ! The total number of thickness grid points in the y-direction in the physical + ! domain. With STATIC_MEMORY_ this is set in MOM_memory.h at compile time. ! === module MOM_hor_index === ! Sets the horizontal array index types. -! === module MOM_verticalGrid === -! Parameters providing information about the vertical grid. -NK = 25 ! [nondim] - ! The number of model layers. - ! === module MOM_fixed_initialization === INPUTDIR = "data_static/72x35x25/INPUT" ! default = "." ! The directory in which input files are found. ! === module MOM_grid_init === GRID_CONFIG = "mosaic" ! - ! A character string that determines the method for - ! defining the horizontal grid. Current options are: + ! A character string that determines the method for defining the horizontal + ! grid. Current options are: ! mosaic - read the grid from a mosaic (supergrid) ! file set by GRID_FILE. ! cartesian - use a (flat) Cartesian grid. @@ -77,6 +129,13 @@ GRID_CONFIG = "mosaic" ! ! mercator - use a Mercator spherical grid. GRID_FILE = "ocean_hgrid.nc" ! ! Name of the file from which to read horizontal grid data. +GRID_ROTATION_ANGLE_BUGS = False ! [Boolean] default = True + ! If true, use an older algorithm to calculate the sine and + ! cosines needed rotate between grid-oriented directions and + ! true north and east. Differences arise at the tripolar fold +USE_TRIPOLAR_GEOLONB_BUG = False ! [Boolean] default = True + ! If true, use older code that incorrectly sets the longitude in some points + ! along the tripolar fold to be off by 360 degrees. TOPO_CONFIG = "file" ! ! This specifies how bathymetry is specified: ! file - read bathymetric information from the file @@ -88,8 +147,9 @@ TOPO_CONFIG = "file" ! ! wall at the southern face. ! halfpipe - a zonally uniform channel with a half-sine ! profile in the meridional direction. + ! bbuilder - build topography from list of functions. ! benchmark - use the benchmark test case topography. - ! Neverland - use the Neverland test case topography. + ! Neverworld - use the Neverworld test case topography. ! DOME - use a slope and channel configuration for the ! DOME sill-overflow test case. ! ISOMIP - use a slope and channel configuration for the @@ -103,38 +163,63 @@ TOPO_CONFIG = "file" ! ! Phillips - ACC-like idealized topography used in the Phillips config. ! dense - Denmark Strait-like dense water formation and overflow. ! USER - call a user modified routine. -TOPO_FILE = "ocean_topog.nc" ! default = "topog.nc" - ! The file from which the bathymetry is read. -!MAXIMUM_DEPTH = 5801.341919389728 ! [m] - ! The (diagnosed) maximum depth of the ocean. -MINIMUM_DEPTH = 10.0 ! [m] default = 0.0 - ! If MASKING_DEPTH is unspecified, then anything shallower than - ! MINIMUM_DEPTH is assumed to be land and all fluxes are masked out. - ! If MASKING_DEPTH is specified, then all depths shallower than - ! MINIMUM_DEPTH but deeper than MASKING_DEPTH are rounded to MINIMUM_DEPTH. -USE_TRIPOLAR_GEOLONB_BUG = False -GRID_ROTATION_ANGLE_BUGS = False +TOPO_EDITS_FILE = "topo_edits_011818.nc" ! default = "" + ! The file from which to read a list of i,j,z topography overrides. +ALLOW_LANDMASK_CHANGES = False ! default = "False" + ! If true, allow topography overrides to change ocean points to land +MAXIMUM_DEPTH = 6500.0 ! [m] + ! The maximum depth of the ocean. +MINIMUM_DEPTH = 9.5 ! [m] default = 0.0 + ! If MASKING_DEPTH is unspecified, then anything shallower than MINIMUM_DEPTH is + ! assumed to be land and all fluxes are masked out. If MASKING_DEPTH is + ! specified, then all depths shallower than MINIMUM_DEPTH but deeper than + ! MASKING_DEPTH are rounded to MINIMUM_DEPTH. ! === module MOM_open_boundary === -! Controls where open boundaries are located, what kind of boundary condition to impose, and what data to apply, if any. +! Controls where open boundaries are located, what kind of boundary condition to impose, and what data to apply, +! if any. MASKING_DEPTH = 0.0 ! [m] default = -9999.0 - ! The depth below which to mask points as land points, for which all - ! fluxes are zeroed out. MASKING_DEPTH is ignored if negative. + ! The depth below which to mask points as land points, for which all fluxes are + ! zeroed out. MASKING_DEPTH is ignored if negative. +CHANNEL_CONFIG = "list" ! default = "none" + ! A parameter that determines which set of channels are + ! restricted to specific widths. Options are: + ! none - All channels have the grid width. + ! global_1deg - Sets 16 specific channels appropriate + ! for a 1-degree model, as used in CM2G. + ! list - Read the channel locations and widths from a + ! text file, like MOM_channel_list in the MOM_SIS + ! test case. + ! file - Read open face widths everywhere from a + ! NetCDF file on the model grid. +CHANNEL_LIST_FILE = "MOM_channels_SPEAR" ! default = "MOM_channel_list" + ! The file from which the list of narrowed channels is read. + +! === module MOM_verticalGrid === +! Parameters providing information about the vertical grid. +NK = 75 ! [nondim] + ! The number of model layers. ! === module MOM_tracer_registry === ! === module MOM_EOS === -DTFREEZE_DP = -7.75E-08 ! [deg C Pa-1] default = 0.0 - ! When TFREEZE_FORM=LINEAR, - ! this is the derivative of the freezing potential - ! temperature with pressure. +TFREEZE_FORM = "MILLERO_78" ! default = "LINEAR" + ! TFREEZE_FORM determines which expression should be used for the freezing + ! point. Currently, the valid choices are "LINEAR", "MILLERO_78", "TEOS10" ! === module MOM_restart === -RESTART_CHECKSUMS_REQUIRED = False +PARALLEL_RESTARTFILES = True ! [Boolean] default = False + ! If true, each processor writes its own restart file, otherwise a single + ! restart file is generated + ! === module MOM_tracer_flow_control === +USE_IDEAL_AGE_TRACER = False ! [Boolean] default = False + ! If true, use the ideal_age_example tracer package. + +! === module ideal_age_example === ! === module MOM_coord_initialization === -COORD_CONFIG = "file" ! +COORD_CONFIG = "file" ! default = "none" ! This specifies how layers are to be defined: ! ALE or none - used to avoid defining layers in ALE mode ! file - read coordinate information from the file @@ -152,28 +237,28 @@ COORD_CONFIG = "file" ! ! ts_profile - use temperature and salinity profiles ! (read from COORD_FILE) to set layer densities. ! USER - call a user modified routine. -COORD_FILE = "layer_coord25.nc" ! +COORD_FILE = "layer_coord.nc" ! ! The file from which the coordinate densities are read. +REMAP_UV_USING_OLD_ALG = True ! [Boolean] default = False + ! If true, uses the old remapping-via-a-delta-z method for remapping u and v. If + ! false, uses the new method that remaps between grids described by an old and + ! new thickness. REGRIDDING_COORDINATE_MODE = "HYCOM1" ! default = "LAYER" - ! Coordinate mode for vertical regridding. - ! Choose among the following possibilities: - ! LAYER - Isopycnal or stacked shallow water layers - ! ZSTAR, Z* - stetched geopotential z* - ! SIGMA_SHELF_ZSTAR - stetched geopotential z* ignoring shelf + ! Coordinate mode for vertical regridding. Choose among the following + ! possibilities: LAYER - Isopycnal or stacked shallow water layers + ! ZSTAR, Z* - stretched geopotential z* + ! SIGMA_SHELF_ZSTAR - stretched geopotential z* ignoring shelf ! SIGMA - terrain following coordinates ! RHO - continuous isopycnal ! HYCOM1 - HyCOM-like hybrid coordinate ! SLIGHT - stretched coordinates above continuous isopycnal ! ADAPTIVE - optimize for smooth neutral density surfaces BOUNDARY_EXTRAPOLATION = True ! [Boolean] default = False - ! When defined, a proper high-order reconstruction - ! scheme is used within boundary cells rather - ! than PCM. E.g., if PPM is used for remapping, a - ! PPM reconstruction will also be used within - ! boundary cells. -ALE_COORDINATE_CONFIG = "HYBRID:hycom1_25.nc,sigma2,FNC1:5,4000,4.5,.01" ! default = "UNIFORM" - ! Determines how to specify the coordinate - ! resolution. Valid options are: + ! When defined, a proper high-order reconstruction scheme is used within + ! boundary cells rather than PCM. E.g., if PPM is used for remapping, a PPM + ! reconstruction will also be used within boundary cells. +ALE_COORDINATE_CONFIG = "HYBRID:hycom1_75_800m.nc,sigma2,FNC1:2,4000,4.5,.01" ! default = "UNIFORM" + ! Determines how to specify the coordinate resolution. Valid options are: ! PARAM - use the vector-parameter ALE_RESOLUTION ! UNIFORM[:N] - uniformly distributed ! FILE:string - read from a file. The string specifies @@ -186,19 +271,15 @@ ALE_COORDINATE_CONFIG = "HYBRID:hycom1_25.nc,sigma2,FNC1:5,4000,4.5,.01" ! defau ! the filename and two variable names, separated ! by a comma or space, for sigma-2 and dz. e.g. ! HYBRID:vgrid.nc,sigma2,dz -!ALE_RESOLUTION = 2*5.0, 5.01, 5.07, 5.25, 5.68, 6.55, 8.1, 10.66, 14.620000000000001, 20.450000000000003, 28.73, 40.1, 55.32, 75.23, 100.8, 133.09, 173.26, 222.62, 282.56, 354.62, 440.47, 541.87, 660.76, 799.1800000000001 ! [m] +!ALE_RESOLUTION = 7*2.0, 2*2.01, 2.02, 2.03, 2.05, 2.08, 2.11, 2.15, 2.21, 2.2800000000000002, 2.37, 2.48, 2.61, 2.77, 2.95, 3.17, 3.4299999999999997, 3.74, 4.09, 4.49, 4.95, 5.48, 6.07, 6.74, 7.5, 8.34, 9.280000000000001, 10.33, 11.49, 12.77, 14.19, 15.74, 17.450000000000003, 19.31, 21.35, 23.56, 25.97, 28.580000000000002, 31.41, 34.47, 37.77, 41.32, 45.14, 49.25, 53.65, 58.370000000000005, 63.42, 68.81, 74.56, 80.68, 87.21000000000001, 94.14, 101.51, 109.33, 117.62, 126.4, 135.68, 145.5, 155.87, 166.81, 178.35, 190.51, 203.31, 216.78, 230.93, 245.8, 261.42, 277.83 ! [m] ! The distribution of vertical resolution for the target ! grid used for Eulerian-like coordinates. For example, ! in z-coordinate mode, the parameter is a list of level ! thicknesses (in m). In sigma-coordinate mode, the list ! is of non-dimensional fractions of the water column. -!TARGET_DENSITIES = 1010.0, 1020.843017578125, 1027.0274658203125, 1029.279541015625, 1030.862548828125, 1032.1572265625, 1033.27978515625, 1034.251953125, 1034.850830078125, 1035.28857421875, 1035.651123046875, 1035.967529296875, 1036.2410888671875, 1036.473876953125, 1036.6800537109375, 1036.8525390625, 1036.9417724609375, 1037.0052490234375, 1037.057373046875, 1037.1065673828125, 1037.15576171875, 1037.2060546875, 1037.26416015625, 1037.3388671875, 1037.4749755859375, 1038.0 ! [m] - ! HYBRID target densities for itnerfaces -REGRID_COMPRESSIBILITY_FRACTION = 0.01 ! [not defined] default = 0.0 - ! When interpolating potential density profiles we can add - ! some artificial compressibility solely to make homogenous - ! regions appear stratified. -MAXIMUM_INT_DEPTH_CONFIG = "FNC1:5,8000.0,1.0,.125" ! default = "NONE" +!TARGET_DENSITIES = 1010.0, 1014.3034, 1017.8088, 1020.843, 1023.5566, 1025.813, 1027.0275, 1027.9114, 1028.6422, 1029.2795, 1029.852, 1030.3762, 1030.8626, 1031.3183, 1031.7486, 1032.1572, 1032.5471, 1032.9207, 1033.2798, 1033.6261, 1033.9608, 1034.2519, 1034.4817, 1034.6774, 1034.8508, 1035.0082, 1035.1533, 1035.2886, 1035.4159, 1035.5364, 1035.6511, 1035.7608, 1035.8661, 1035.9675, 1036.0645, 1036.1554, 1036.2411, 1036.3223, 1036.3998, 1036.4739, 1036.5451, 1036.6137, 1036.68, 1036.7441, 1036.8062, 1036.8526, 1036.8874, 1036.9164, 1036.9418, 1036.9647, 1036.9857, 1037.0052, 1037.0236, 1037.0409, 1037.0574, 1037.0738, 1037.0902, 1037.1066, 1037.123, 1037.1394, 1037.1558, 1037.1722, 1037.1887, 1037.206, 1037.2241, 1037.2435, 1037.2642, 1037.2866, 1037.3112, 1037.3389, 1037.3713, 1037.4118, 1037.475, 1037.6332, 1037.8104, 1038.0 ! [m] + ! HYBRID target densities for interfaces +MAXIMUM_INT_DEPTH_CONFIG = "FNC1:5,8000.0,1.0,.01" ! default = "NONE" ! Determines how to specify the maximum interface depths. ! Valid options are: ! NONE - there are no maximum interface depths @@ -207,7 +288,7 @@ MAXIMUM_INT_DEPTH_CONFIG = "FNC1:5,8000.0,1.0,.125" ! default = "NONE" ! the filename and variable name, separated ! by a comma or space, e.g. FILE:lev.nc,Z ! FNC1:string - FNC1:dz_min,H_total,power,precision -!MAXIMUM_INT_DEPTHS = 0.0, 5.0, 36.25, 93.75, 177.5, 287.5, 423.75, 586.25, 775.0, 990.0, 1231.25, 1498.75, 1792.5, 2112.5, 2458.75, 2831.25, 3230.0, 3655.0, 4106.25, 4583.75, 5087.5, 5617.5, 6173.75, 6756.25, 7365.0, 8000.0 ! [m] +!MAXIMUM_INT_DEPTHS = 0.0, 5.0, 12.75, 23.25, 36.49, 52.480000000000004, 71.22, 92.71000000000001, 116.94000000000001, 143.92000000000002, 173.65, 206.13, 241.36, 279.33000000000004, 320.05000000000007, 363.5200000000001, 409.7400000000001, 458.7000000000001, 510.4100000000001, 564.8700000000001, 622.0800000000002, 682.0300000000002, 744.7300000000002, 810.1800000000003, 878.3800000000003, 949.3300000000004, 1023.0200000000004, 1099.4600000000005, 1178.6500000000005, 1260.5900000000006, 1345.2700000000007, 1432.7000000000007, 1522.8800000000008, 1615.8100000000009, 1711.490000000001, 1809.910000000001, 1911.080000000001, 2015.0000000000011, 2121.670000000001, 2231.080000000001, 2343.2400000000007, 2458.1500000000005, 2575.8100000000004, 2696.2200000000003, 2819.3700000000003, 2945.2700000000004, 3073.9200000000005, 3205.3200000000006, 3339.4600000000005, 3476.3500000000004, 3615.9900000000002, 3758.38, 3903.52, 4051.4, 4202.03, 4355.41, 4511.54, 4670.41, 4832.03, 4996.4, 5163.5199999999995, 5333.379999999999, 5505.989999999999, 5681.3499999999985, 5859.459999999998, 6040.319999999998, 6223.919999999998, 6410.269999999999, 6599.369999999999, 6791.219999999999, 6985.8099999999995, 7183.15, 7383.24, 7586.08, 7791.67, 8000.0 ! The list of maximum depths for each interface. MAX_LAYER_THICKNESS_CONFIG = "FNC1:400,31000.0,0.1,.01" ! default = "NONE" ! Determines how to specify the maximum layer thicknesses. @@ -218,13 +299,12 @@ MAX_LAYER_THICKNESS_CONFIG = "FNC1:400,31000.0,0.1,.01" ! default = "NONE" ! the filename and variable name, separated ! by a comma or space, e.g. FILE:lev.nc,Z ! FNC1:string - FNC1:dz_min,H_total,power,precision -!MAX_LAYER_THICKNESS = 400.0, 1094.2, 1144.02, 1174.81, 1197.42, 1215.4099999999999, 1230.42, 1243.3200000000002, 1254.65, 1264.78, 1273.94, 1282.31, 1290.02, 1297.17, 1303.85, 1310.1, 1316.0, 1321.5700000000002, 1326.85, 1331.87, 1336.67, 1341.25, 1345.6399999999999, 1349.85, 1353.88 ! [m] +!MAX_LAYER_THICKNESS = 400.0, 409.63, 410.32, 410.75, 411.07, 411.32, 411.52, 411.7, 411.86, 412.0, 412.13, 412.24, 412.35, 412.45, 412.54, 412.63, 412.71, 412.79, 412.86, 412.93, 413.0, 413.06, 413.12, 413.18, 413.24, 413.29, 413.34, 413.39, 413.44, 413.49, 413.54, 413.58, 413.62, 413.67, 413.71, 413.75, 413.78, 413.82, 413.86, 413.9, 413.93, 413.97, 414.0, 414.03, 414.06, 414.1, 414.13, 414.16, 414.19, 414.22, 414.24, 414.27, 414.3, 414.33, 414.35, 414.38, 414.41, 414.43, 414.46, 414.48, 414.51, 414.53, 414.55, 414.58, 414.6, 414.62, 414.65, 414.67, 414.69, 414.71, 414.73, 414.75, 414.77, 414.79, 414.83 ! [m] ! The list of maximum thickness for each layer. REMAPPING_SCHEME = "PPM_H4" ! default = "PLM" - ! This sets the reconstruction scheme used - ! for vertical remapping for all variables. - ! It can be one of the following schemes: - ! PCM (1st-order accurate) + ! This sets the reconstruction scheme used for vertical remapping for all + ! variables. It can be one of the following schemes: PCM (1st-order + ! accurate) ! PLM (2nd-order accurate) ! PPM_H4 (3rd-order accurate) ! PPM_IH4 (3rd-order accurate) @@ -236,69 +316,179 @@ REMAPPING_SCHEME = "PPM_H4" ! default = "PLM" ! === module MOM_state_initialization === INIT_LAYERS_FROM_Z_FILE = True ! [Boolean] default = False - ! If true, intialize the layer thicknesses, temperatures, - ! and salnities from a Z-space file on a latitude- - ! longitude grid. + ! If true, initialize the layer thicknesses, temperatures, and salinities from a + ! Z-space file on a latitude-longitude grid. ! === module MOM_initialize_layers_from_Z === -TEMP_SALT_Z_INIT_FILE = "" ! default = "temp_salt_z.nc" +TEMP_SALT_Z_INIT_FILE = "MOM6_IC_TS.nc" ! default = "temp_salt_z.nc" ! The name of the z-space input file used to initialize ! temperatures (T) and salinities (S). If T and S are not ! in the same file, TEMP_Z_INIT_FILE and SALT_Z_INIT_FILE ! must be set. -TEMP_Z_INIT_FILE = "woa13_decav_ptemp_monthly_fulldepth_01.nc" ! default = "" - ! The name of the z-space input file used to initialize - ! temperatures, only. -SALT_Z_INIT_FILE = "woa13_decav_s_monthly_fulldepth_01.nc" ! default = "" - ! The name of the z-space input file used to initialize - ! temperatures, only. -Z_INIT_FILE_PTEMP_VAR = "ptemp_an" ! default = "ptemp" +Z_INIT_FILE_PTEMP_VAR = "temp" ! default = "ptemp" ! The name of the potential temperature variable in ! TEMP_Z_INIT_FILE. -Z_INIT_FILE_SALT_VAR = "s_an" ! default = "salt" +Z_INIT_FILE_SALT_VAR = "salt" ! default = "salt" ! The name of the salinity variable in ! SALT_Z_INIT_FILE. Z_INIT_ALE_REMAPPING = True ! [Boolean] default = False ! If True, then remap straight to model coordinate from file. +Z_INIT_REMAP_OLD_ALG = True ! [Boolean] default = False + ! If false, uses the preferred remapping algorithm for initialization. If true, + ! use an older, less robust algorithm for remapping. ! === module MOM_diag_mediator === +!Jiande NUM_DIAG_COORDS = 2 ! default = 1 +NUM_DIAG_COORDS = 1 + ! The number of diagnostic vertical coordinates to use. + ! For each coordinate, an entry in DIAG_COORDS must be provided. +!Jiande DIAG_COORDS = "z Z ZSTAR", "rho2 RHO2 RHO" ! +DIAG_COORDS = "z Z ZSTAR" + ! A list of string tuples associating diag_table modules to + ! a coordinate definition used for diagnostics. Each string + ! is of the form "MODULE_SUFFIX,PARAMETER_SUFFIX,COORDINATE_NAME". +DIAG_COORD_DEF_Z="FILE:interpolate_zgrid_40L.nc,interfaces=zw" +DIAG_MISVAL = -1e34 +!AVAILABLE_DIAGS_FILE = "available_diags.002160" ! default = "available_diags.000000" + ! A file into which to write a list of all available ocean diagnostics that can + ! be included in a diag_table. +!DIAG_COORD_DEF_Z = "FILE:vgrid_75_2m.nc,dz" ! default = "WOA09" + ! Determines how to specify the coordinate resolution. Valid options are: + ! PARAM - use the vector-parameter DIAG_COORD_RES_Z + ! UNIFORM[:N] - uniformly distributed + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,dz + ! or FILE:lev.nc,interfaces=zw + ! WOA09[:N] - the WOA09 vertical grid (approximately) + ! FNC1:string - FNC1:dz_min,H_total,power,precision + ! HYBRID:string - read from a file. The string specifies + ! the filename and two variable names, separated + ! by a comma or space, for sigma-2 and dz. e.g. + ! HYBRID:vgrid.nc,sigma2,dz +!DIAG_COORD_DEF_RHO2 = "RFNC1:35,999.5,1028,1028.5,8.,1038.,0.0078125" ! default = "WOA09" + ! Determines how to specify the coordinate resolution. Valid options are: + ! PARAM - use the vector-parameter DIAG_COORD_RES_RHO2 + ! UNIFORM[:N] - uniformly distributed + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,dz + ! or FILE:lev.nc,interfaces=zw + ! WOA09[:N] - the WOA09 vertical grid (approximately) + ! FNC1:string - FNC1:dz_min,H_total,power,precision + ! HYBRID:string - read from a file. The string specifies + ! the filename and two variable names, separated + ! by a comma or space, for sigma-2 and dz. e.g. + ! HYBRID:vgrid.nc,sigma2,dz ! === module MOM_MEKE === USE_MEKE = True ! [Boolean] default = False - ! If true, turns on the MEKE scheme which calculates - ! a sub-grid mesoscale eddy kinetic energy budget. + ! If true, turns on the MEKE scheme which calculates a sub-grid mesoscale eddy + ! kinetic energy budget. +MEKE_GMCOEFF = 1.0 ! [nondim] default = -1.0 + ! The efficiency of the conversion of potential energy into MEKE by the + ! thickness mixing parameterization. If MEKE_GMCOEFF is negative, this + ! conversion is not used or calculated. +MEKE_BGSRC = 1.0E-13 ! [W kg-1] default = 0.0 + ! A background energy source for MEKE. +MEKE_KHTH_FAC = 0.8 ! [nondim] default = 0.0 + ! A factor that maps MEKE%Kh to KhTh. +MEKE_KHTR_FAC = 0.8 ! [nondim] default = 0.0 + ! A factor that maps MEKE%Kh to KhTr. +MEKE_ALPHA_RHINES = 0.05 ! [nondim] default = 0.0 + ! If positive, is a coefficient weighting the Rhines scale in the expression for + ! mixing length used in MEKE-derived diffusivity. +MEKE_ALPHA_EADY = 0.05 ! [nondim] default = 0.0 + ! If positive, is a coefficient weighting the Eady length scale in the + ! expression for mixing length used in MEKE-derived diffusivity. ! === module MOM_lateral_mixing_coeffs === USE_VARIABLE_MIXING = True ! [Boolean] default = False - ! If true, the variable mixing code will be called. This - ! allows diagnostics to be created even if the scheme is - ! not used. If KHTR_SLOPE_CFF>0 or KhTh_Slope_Cff>0, - ! this is set to true regardless of what is in the - ! parameter file. + ! If true, the variable mixing code will be called. This allows diagnostics to + ! be created even if the scheme is not used. If KHTR_SLOPE_CFF>0 or + ! KhTh_Slope_Cff>0, this is set to true regardless of what is in the parameter + ! file. +RESOLN_SCALED_KH = True ! [Boolean] default = False + ! If true, the Laplacian lateral viscosity is scaled away when the first + ! baroclinic deformation radius is well resolved. +RESOLN_SCALED_KHTH = True ! [Boolean] default = False + ! If true, the interface depth diffusivity is scaled away when the first + ! baroclinic deformation radius is well resolved. +KHTR_SLOPE_CFF = 0.25 ! [nondim] default = 0.0 + ! The nondimensional coefficient in the Visbeck formula for the epipycnal tracer + ! diffusivity +USE_STORED_SLOPES = True ! [Boolean] default = False + ! If true, the isopycnal slopes are calculated once and stored for re-use. This + ! uses more memory but avoids calling the equation of state more times than + ! should be necessary. +KH_RES_FN_POWER = 100 ! [nondim] default = 2 + ! The power of dx/Ld in the Kh resolution function. Any positive integer may be + ! used, although even integers are more efficient to calculate. Setting this + ! greater than 100 results in a step-function being used. +VISC_RES_FN_POWER = 2 ! [nondim] default = 100 + ! The power of dx/Ld in the Kh resolution function. Any positive integer may be + ! used, although even integers are more efficient to calculate. Setting this + ! greater than 100 results in a step-function being used. This function affects + ! lateral viscosity, Kh, and not KhTh. +INTERNAL_WAVE_SPEED_BETTER_EST = False ! [Boolean] default = True + ! If true, use a more robust estimate of the first mode wave speed as the + ! starting point for iterations. ! === module MOM_set_visc === CHANNEL_DRAG = True ! [Boolean] default = False - ! If true, the bottom drag is exerted directly on each - ! layer proportional to the fraction of the bottom it - ! overlies. + ! If true, the bottom drag is exerted directly on each layer proportional to the + ! fraction of the bottom it overlies. HBBL = 10.0 ! [m] - ! The thickness of a bottom boundary layer with a - ! viscosity of KVBBL if BOTTOMDRAGLAW is not defined, or - ! the thickness over which near-bottom velocities are - ! averaged for the drag law if BOTTOMDRAGLAW is defined - ! but LINEAR_DRAG is not. + ! The thickness of a bottom boundary layer with a viscosity of KVBBL if + ! BOTTOMDRAGLAW is not defined, or the thickness over which near-bottom + ! velocities are averaged for the drag law if BOTTOMDRAGLAW is defined but + ! LINEAR_DRAG is not. +DRAG_BG_VEL = 0.1 ! [m s-1] default = 0.0 + ! DRAG_BG_VEL is either the assumed bottom velocity (with LINEAR_DRAG) or an + ! unresolved velocity that is combined with the resolved velocity to estimate + ! the velocity magnitude. DRAG_BG_VEL is only used when BOTTOMDRAGLAW is + ! defined. +BBL_USE_EOS = True ! [Boolean] default = False + ! If true, use the equation of state in determining the properties of the bottom + ! boundary layer. Otherwise use the layer target potential densities. +BBL_THICK_MIN = 0.1 ! [m] default = 0.0 + ! The minimum bottom boundary layer thickness that can be used with + ! BOTTOMDRAGLAW. This might be Kv/(cdrag*drag_bg_vel) to give Kv as the minimum + ! near-bottom viscosity. KV = 1.0E-04 ! [m2 s-1] - ! The background kinematic viscosity in the interior. - ! The molecular value, ~1e-6 m2 s-1, may be used. + ! The background kinematic viscosity in the interior. The molecular value, ~1e-6 + ! m2 s-1, may be used. +KV_BBL_MIN = 0.0 ! [m2 s-1] default = 1.0E-04 + ! The minimum viscosities in the bottom boundary layer. +KV_TBL_MIN = 0.0 ! [m2 s-1] default = 1.0E-04 + ! The minimum viscosities in the top boundary layer. + +! === module MOM_thickness_diffuse === +USE_GM_WORK_BUG = True ! [Boolean] default = False + ! If true, compute the top-layer work tendency on the u-grid with the incorrect + ! sign, for legacy reproducibility. + +! === module MOM_dynamics_split_RK2 === ! === module MOM_continuity === ! === module MOM_continuity_PPM === +ETA_TOLERANCE = 1.0E-06 ! [m] default = 3.75E-09 + ! The tolerance for the differences between the barotropic and baroclinic + ! estimates of the sea surface height due to the fluxes through each face. The + ! total tolerance for SSH is 4 times this value. The default is + ! 0.5*NK*ANGSTROM, and this should not be set less than about + ! 10^-15*MAXIMUM_DEPTH. +ETA_TOLERANCE_AUX = 0.001 ! [m] default = 1.0E-06 + ! The tolerance for free-surface height discrepancies between the barotropic + ! solution and the sum of the layer thicknesses when calculating the auxiliary + ! corrected velocities. By default, this is the same as ETA_TOLERANCE, but can + ! be made larger for efficiency. ! === module MOM_CoriolisAdv === CORIOLIS_SCHEME = "SADOURNY75_ENSTRO" ! default = "SADOURNY75_ENERGY" - ! CORIOLIS_SCHEME selects the discretization for the - ! Coriolis terms. Valid values are: + ! CORIOLIS_SCHEME selects the discretization for the Coriolis terms. Valid + ! values are: ! SADOURNY75_ENERGY - Sadourny, 1975; energy cons. ! ARAKAWA_HSU90 - Arakawa & Hsu, 1990 ! SADOURNY75_ENSTRO - Sadourny, 1975; enstrophy cons. @@ -306,136 +496,104 @@ CORIOLIS_SCHEME = "SADOURNY75_ENSTRO" ! default = "SADOURNY75_ENERGY" ! ARAKAWA_LAMB_BLEND - A blend of Arakawa & Lamb with ! Arakawa & Hsu and Sadourny energy BOUND_CORIOLIS = True ! [Boolean] default = False - ! If true, the Coriolis terms at u-points are bounded by - ! the four estimates of (f+rv)v from the four neighboring - ! v-points, and similarly at v-points. This option would - ! have no effect on the SADOURNY Coriolis scheme if it - ! were possible to use centered difference thickness fluxes. + ! If true, the Coriolis terms at u-points are bounded by the four estimates of + ! (f+rv)v from the four neighboring v-points, and similarly at v-points. This + ! option would have no effect on the SADOURNY Coriolis scheme if it were + ! possible to use centered difference thickness fluxes. ! === module MOM_PressureForce === ! === module MOM_PressureForce_AFV === MASS_WEIGHT_IN_PRESSURE_GRADIENT = True ! [Boolean] default = False - ! If true, use mass weighting when interpolating T/S for - ! integrals near the bathymetry in AFV pressure gradient - ! calculations. + ! If true, use mass weighting when interpolating T/S for integrals near the + ! bathymetry in AFV pressure gradient calculations. ! === module MOM_hor_visc === LAPLACIAN = True ! [Boolean] default = False ! If true, use a Laplacian horizontal viscosity. -KH_VEL_SCALE = 0.01 ! [m s-1] default = 0.0 - ! The velocity scale which is multiplied by the grid - ! spacing to calculate the Laplacian viscosity. - ! The final viscosity is the largest of this scaled - ! viscosity, the Smagorinsky and Leith viscosities, and KH. -KH_SIN_LAT = 2000.0 ! [m2 s-1] default = 0.0 - ! The amplitude of a latidutinally-dependent background - ! viscosity of the form KH_SIN_LAT*(SIN(LAT)**KH_PWR_OF_SINE). SMAGORINSKY_KH = True ! [Boolean] default = False ! If true, use a Smagorinsky nonlinear eddy viscosity. SMAG_LAP_CONST = 0.15 ! [nondim] default = 0.0 - ! The nondimensional Laplacian Smagorinsky constant, - ! often 0.15. -AH_VEL_SCALE = 0.01 ! [m s-1] default = 0.0 - ! The velocity scale which is multiplied by the cube of - ! the grid spacing to calculate the biharmonic viscosity. - ! The final viscosity is the largest of this scaled - ! viscosity, the Smagorinsky and Leith viscosities, and AH. + ! The nondimensional Laplacian Smagorinsky constant, often 0.15. +AH_VEL_SCALE = 0.05 ! [m s-1] default = 0.0 + ! The velocity scale which is multiplied by the cube of the grid spacing to + ! calculate the biharmonic viscosity. The final viscosity is the largest of this + ! scaled viscosity, the Smagorinsky and Leith viscosities, and AH. SMAGORINSKY_AH = True ! [Boolean] default = False - ! If true, use a biharmonic Smagorinsky nonlinear eddy - ! viscosity. + ! If true, use a biharmonic Smagorinsky nonlinear eddy viscosity. SMAG_BI_CONST = 0.06 ! [nondim] default = 0.0 - ! The nondimensional biharmonic Smagorinsky constant, - ! typically 0.015 - 0.06. -USE_LAND_MASK_FOR_HVISC = True ! [Boolean] default = False - ! If true, use Use the land mask for the computation of thicknesses - ! at velocity locations. This eliminates the dependence on arbitrary - ! values over land or outside of the domain. Default is False in order to - ! maintain answers with legacy experiments but should be changed to True - ! for new experiments. + ! The nondimensional biharmonic Smagorinsky constant, typically 0.015 - 0.06. +USE_KH_BG_2D = True ! [Boolean] default = False + ! If true, read a file containing 2-d background harmonic viscosities. The final + ! viscosity is the maximum of the other terms and this background value. ! === module MOM_vert_friction === HMIX_FIXED = 0.5 ! [m] - ! The prescribed depth over which the near-surface - ! viscosity and diffusivity are elevated when the bulk - ! mixed layer is not used. -MAXVEL = 5.0 ! [m s-1] default = 3.0E+08 - ! The maximum velocity allowed before the velocity - ! components are truncated. + ! The prescribed depth over which the near-surface viscosity and diffusivity are + ! elevated when the bulk mixed layer is not used. +MAXVEL = 6.0 ! [m s-1] default = 3.0E+08 + ! The maximum velocity allowed before the velocity components are truncated. ! === module MOM_barotropic === BOUND_BT_CORRECTION = True ! [Boolean] default = False - ! If true, the corrective pseudo mass-fluxes into the - ! barotropic solver are limited to values that require - ! less than maxCFL_BT_cont to be accommodated. + ! If true, the corrective pseudo mass-fluxes into the barotropic solver are + ! limited to values that require less than maxCFL_BT_cont to be accommodated. BT_PROJECT_VELOCITY = True ! [Boolean] default = False - ! If true, step the barotropic velocity first and project - ! out the velocity tendancy by 1+BEBT when calculating the - ! transport. The default (false) is to use a predictor - ! continuity step to find the pressure field, and then - ! to do a corrector continuity step using a weighted - ! average of the old and new velocities, with weights - ! of (1-BEBT) and BEBT. -DYNAMIC_SURFACE_PRESSURE = True ! [Boolean] default = False - ! If true, add a dynamic pressure due to a viscous ice - ! shelf, for instance. + ! If true, step the barotropic velocity first and project out the velocity + ! tendency by 1+BEBT when calculating the transport. The default (false) is to + ! use a predictor continuity step to find the pressure field, and then to do a + ! corrector continuity step using a weighted average of the old and new + ! velocities, with weights of (1-BEBT) and BEBT. +BT_STRONG_DRAG = True ! [Boolean] default = False + ! If true, use a stronger estimate of the retarding effects of strong bottom + ! drag, by making it implicit with the barotropic time-step instead of implicit + ! with the baroclinic time-step and dividing by the number of barotropic steps. BEBT = 0.2 ! [nondim] default = 0.1 - ! BEBT determines whether the barotropic time stepping - ! uses the forward-backward time-stepping scheme or a - ! backward Euler scheme. BEBT is valid in the range from - ! 0 (for a forward-backward treatment of nonrotating - ! gravity waves) to 1 (for a backward Euler treatment). - ! In practice, BEBT must be greater than about 0.05. + ! BEBT determines whether the barotropic time stepping uses the forward-backward + ! time-stepping scheme or a backward Euler scheme. BEBT is valid in the range + ! from 0 (for a forward-backward treatment of nonrotating gravity waves) to 1 + ! (for a backward Euler treatment). In practice, BEBT must be greater than about + ! 0.05. DTBT = -0.9 ! [s or nondim] default = -0.98 - ! The barotropic time step, in s. DTBT is only used with - ! the split explicit time stepping. To set the time step - ! automatically based the maximum stable value use 0, or - ! a negative value gives the fraction of the stable value. - ! Setting DTBT to 0 is the same as setting it to -0.98. - ! The value of DTBT that will actually be used is an - ! integer fraction of DT, rounding down. - -! === module MOM_thickness_diffuse === + ! The barotropic time step, in s. DTBT is only used with the split explicit time + ! stepping. To set the time step automatically based the maximum stable value + ! use 0, or a negative value gives the fraction of the stable value. Setting + ! DTBT to 0 is the same as setting it to -0.98. The value of DTBT that will + ! actually be used is an integer fraction of DT, rounding down. ! === module MOM_mixed_layer_restrat === MIXEDLAYER_RESTRAT = True ! [Boolean] default = False - ! If true, a density-gradient dependent re-stratifying - ! flow is imposed in the mixed layer. Can be used in ALE mode - ! without restriction but in layer mode can only be used if - ! BULKMIXEDLAYER is true. -FOX_KEMPER_ML_RESTRAT_COEF = 1.0 ! [nondim] default = 0.0 - ! A nondimensional coefficient that is proportional to - ! the ratio of the deformation radius to the dominant - ! lengthscale of the submesoscale mixed layer - ! instabilities, times the minimum of the ratio of the - ! mesoscale eddy kinetic energy to the large-scale - ! geostrophic kinetic energy or 1 plus the square of the - ! grid spacing over the deformation radius, as detailed - ! by Fox-Kemper et al. (2010) -MLE_FRONT_LENGTH = 200.0 ! [m] default = 0.0 - ! If non-zero, is the frontal-length scale used to calculate the - ! upscaling of buoyancy gradients that is otherwise represented - ! by the parameter FOX_KEMPER_ML_RESTRAT_COEF. If MLE_FRONT_LENGTH is - ! non-zero, it is recommended to set FOX_KEMPER_ML_RESTRAT_COEF=1.0. + ! If true, a density-gradient dependent re-stratifying flow is imposed in the + ! mixed layer. Can be used in ALE mode without restriction but in layer mode can + ! only be used if BULKMIXEDLAYER is true. +FOX_KEMPER_ML_RESTRAT_COEF = 60.0 ! [nondim] default = 0.0 + ! A nondimensional coefficient that is proportional to the ratio of the + ! deformation radius to the dominant lengthscale of the submesoscale mixed layer + ! instabilities, times the minimum of the ratio of the mesoscale eddy kinetic + ! energy to the large-scale geostrophic kinetic energy or 1 plus the square of + ! the grid spacing over the deformation radius, as detailed by Fox-Kemper et al. + ! (2010) MLE_USE_PBL_MLD = True ! [Boolean] default = False - ! If true, the MLE parameterization will use the mixed-layer - ! depth provided by the active PBL parameterization. If false, - ! MLE will estimate a MLD based on a density difference with the - ! surface using the parameter MLE_DENSITY_DIFF. + ! If true, the MLE parameterization will use the mixed-layer depth provided by + ! the active PBL parameterization. If false, MLE will estimate a MLD based on a + ! density difference with the surface using the parameter MLE_DENSITY_DIFF. MLE_MLD_DECAY_TIME = 2.592E+06 ! [s] default = 0.0 - ! The time-scale for a running-mean filter applied to the mixed-layer - ! depth used in the MLE restratification parameterization. When - ! the MLD deepens below the current running-mean the running-mean - ! is instantaneously set to the current MLD. - -! === module MOM_diag_to_Z === + ! The time-scale for a running-mean filter applied to the mixed-layer depth used + ! in the MLE restratification parameterization. When the MLD deepens below the + ! current running-mean the running-mean is instantaneously set to the current + ! MLD. ! === module MOM_diabatic_driver === ! The following parameters are used for diabatic processes. ENERGETICS_SFC_PBL = True ! [Boolean] default = False - ! If true, use an implied energetics planetary boundary - ! layer scheme to determine the diffusivity and viscosity - ! in the surface boundary layer. + ! If true, use an implied energetics planetary boundary layer scheme to + ! determine the diffusivity and viscosity in the surface boundary layer. +EPBL_IS_ADDITIVE = False ! [Boolean] default = True + ! If true, the diffusivity from ePBL is added to all other diffusivities. + ! Otherwise, the larger of kappa-shear and ePBL diffusivities are used. +KD_MIN_TR = 2.0E-06 ! [m2 s-1] default = 2.0E-06 + ! A minimal diffusivity that should always be applied to tracers, especially in + ! massless layers near the bottom. The default is 0.1*KD. ! === module MOM_CVMix_KPP === ! This is the MOM wrapper to CVMix:KPP @@ -443,35 +601,86 @@ ENERGETICS_SFC_PBL = True ! [Boolean] default = False ! === module MOM_tidal_mixing === ! Vertical Tidal Mixing Parameterization +INT_TIDE_DISSIPATION = True ! [Boolean] default = False + ! If true, use an internal tidal dissipation scheme to drive diapycnal mixing, + ! along the lines of St. Laurent et al. (2002) and Simmons et al. (2004). +INT_TIDE_PROFILE = "POLZIN_09" ! default = "STLAURENT_02" + ! INT_TIDE_PROFILE selects the vertical profile of energy dissipation with + ! INT_TIDE_DISSIPATION. Valid values are: + ! STLAURENT_02 - Use the St. Laurent et al exponential + ! decay profile. + ! POLZIN_09 - Use the Polzin WKB-stretched algebraic + ! decay profile. +KAPPA_ITIDES = 6.28319E-04 ! [m-1] default = 6.283185307179586E-04 + ! A topographic wavenumber used with INT_TIDE_DISSIPATION. The default is 2pi/10 + ! km, as in St.Laurent et al. 2002. +KAPPA_H2_FACTOR = 0.84 ! [nondim] default = 1.0 + ! A scaling factor for the roughness amplitude with INT_TIDE_DISSIPATION. +TKE_ITIDE_MAX = 0.1 ! [W m-2] default = 1000.0 + ! The maximum internal tide energy source available to mix above the bottom + ! boundary layer with INT_TIDE_DISSIPATION. +READ_TIDEAMP = True ! [Boolean] default = False + ! If true, read a file (given by TIDEAMP_FILE) containing the tidal amplitude + ! with INT_TIDE_DISSIPATION. +TIDEAMP_FILE = "tidal_amplitude.nc" ! default = "tideamp.nc" + ! The path to the file containing the spatially varying tidal amplitudes with + ! INT_TIDE_DISSIPATION. +H2_FILE = "topog.nc" ! + ! The path to the file containing the sub-grid-scale topographic roughness + ! amplitude with INT_TIDE_DISSIPATION. ! === module MOM_CVMix_conv === ! Parameterization of enhanced mixing due to convection via CVMix -! === module MOM_entrain_diffusive === - ! === module MOM_set_diffusivity === +BBL_MIXING_AS_MAX = False ! [Boolean] default = True + ! If true, take the maximum of the diffusivity from the BBL mixing and the other + ! diffusivities. Otherwise, diffusivity from the BBL_mixing is simply added. +USE_LOTW_BBL_DIFFUSIVITY = True ! [Boolean] default = False + ! If true, uses a simple, imprecise but non-coordinate dependent, model of BBL + ! mixing diffusivity based on Law of the Wall. Otherwise, uses the original BBL + ! scheme. +SIMPLE_TKE_TO_KD = True ! [Boolean] default = False + ! If true, uses a simple estimate of Kd/TKE that will work for arbitrary + ! vertical coordinates. If false, calculates Kd/TKE and bounds based on exact + ! energetics for an isopycnal layer-formulation. ! === module MOM_bkgnd_mixing === ! Adding static vertical background mixing coefficients -KD = 1.5E-05 ! [m2 s-1] - ! The background diapycnal diffusivity of density in the - ! interior. Zero or the molecular value, ~1e-7 m2 s-1, - ! may be used. -KD_MIN = 2.0E-06 ! [m2 s-1] default = 1.5E-07 +KD = 2.0E-05 ! [m2 s-1] default = 0.0 + ! The background diapycnal diffusivity of density in the interior. Zero or the + ! molecular value, ~1e-7 m2 s-1, may be used. +KD_MIN = 2.0E-06 ! [m2 s-1] default = 2.0E-07 ! The minimum diapycnal diffusivity. HENYEY_IGW_BACKGROUND = True ! [Boolean] default = False - ! If true, use a latitude-dependent scaling for the near - ! surface background diffusivity, as described in - ! Harrison & Hallberg, JPO 2008. + ! If true, use a latitude-dependent scaling for the near surface background + ! diffusivity, as described in Harrison & Hallberg, JPO 2008. +KD_MAX = 0.1 ! [m2 s-1] default = -1.0 + ! The maximum permitted increment for the diapycnal diffusivity from TKE-based + ! parameterizations, or a negative value for no limit. ! === module MOM_kappa_shear === ! Parameterization of shear-driven turbulence following Jackson, Hallberg and Legg, JPO 2008 USE_JACKSON_PARAM = True ! [Boolean] default = False - ! If true, use the Jackson-Hallberg-Legg (JPO 2008) - ! shear mixing parameterization. -MAX_RINO_IT = 205 ! [nondim] default = 50 - ! The maximum number of iterations that may be used to - ! estimate the Richardson number driven mixing. + ! If true, use the Jackson-Hallberg-Legg (JPO 2008) shear mixing + ! parameterization. +MAX_RINO_IT = 25 ! [nondim] default = 50 + ! The maximum number of iterations that may be used to estimate the Richardson + ! number driven mixing. +VERTEX_SHEAR = False ! [Boolean] default = False + ! If true, do the calculations of the shear-driven mixing + ! at the cell vertices (i.e., the vorticity points). +KD_TRUNC_KAPPA_SHEAR = 2.0E-07 ! [m2 s-1] default = 2.0E-07 + ! The value of shear-driven diffusivity that is considered negligible and is + ! rounded down to 0. The default is 1% of KD_KAPPA_SHEAR_0. +KAPPA_SHEAR_ITER_BUG = True ! [Boolean] default = False + ! If true, use an older, dimensionally inconsistent estimate of the derivative + ! of diffusivity with energy in the Newton's method iteration. The bug causes + ! undercorrections when dz > 1 m. +KAPPA_SHEAR_ALL_LAYER_TKE_BUG = True ! [Boolean] default = False + ! If true, report back the latest estimate of TKE instead of the time average + ! TKE when there is mass in all layers. Otherwise always report the time + ! averaged TKE, as is currently done when there are some massless layers. ! === module MOM_CVMix_shear === ! Parameterization of shear-driven turbulence via CVMix (various options) @@ -481,15 +690,109 @@ MAX_RINO_IT = 205 ! [nondim] default = 50 ! === module MOM_diabatic_aux === ! The following parameters are used for auxiliary diabatic processes. +PRESSURE_DEPENDENT_FRAZIL = False ! [Boolean] default = False + ! If true, use a pressure dependent freezing temperature when making frazil. The + ! default is false, which will be faster but is inappropriate with ice-shelf + ! cavities. +VAR_PEN_SW = True ! [Boolean] default = False + ! If true, use one of the CHL_A schemes specified by OPACITY_SCHEME to determine + ! the e-folding depth of incoming short wave radiation. +CHL_FILE = seawifs_1998-2006_smoothed_2X.nc ! + ! CHL_FILE is the file containing chl_a concentrations in the variable CHL_A. It + ! is used when VAR_PEN_SW and CHL_FROM_FILE are true. ! === module MOM_energetic_PBL === -EPBL_USTAR_MIN = 1.45842E-18 ! [m s-1] - ! The (tiny) minimum friction velocity used within the - ! ePBL code, derived from OMEGA and ANGSTROM. +ML_OMEGA_FRAC = 0.001 ! [nondim] default = 0.0 + ! When setting the decay scale for turbulence, use this fraction of the absolute + ! rotation rate blended with the local value of f, as sqrt((1-of)*f^2 + + ! of*4*omega^2). +TKE_DECAY = 0.01 ! [nondim] default = 2.5 + ! TKE_DECAY relates the vertical rate of decay of the TKE available for + ! mechanical entrainment to the natural Ekman depth. +EPBL_MSTAR_SCHEME = "OM4" ! default = "CONSTANT" + ! EPBL_MSTAR_SCHEME selects the method for setting mstar. Valid values are: + ! CONSTANT - Use a fixed mstar given by MSTAR + ! OM4 - Use L_Ekman/L_Obukhov in the sabilizing limit, as in OM4 + ! REICHL_H18 - Use the scheme documented in Reichl & Hallberg, 2018. +MSTAR_CAP = 10.0 ! [nondim] default = -1.0 + ! If this value is positive, it sets the maximum value of mstar allowed in ePBL. + ! (This is not used if EPBL_MSTAR_SCHEME = CONSTANT). +MSTAR2_COEF1 = 0.29 ! [nondim] default = 0.3 + ! Coefficient in computing mstar when rotation and stabilizing effects are both + ! important (used if EPBL_MSTAR_SCHEME = OM4). +MSTAR2_COEF2 = 0.152 ! [nondim] default = 0.085 + ! Coefficient in computing mstar when only rotation limits the total mixing + ! (used if EPBL_MSTAR_SCHEME = OM4) +NSTAR = 0.06 ! [nondim] default = 0.2 + ! The portion of the buoyant potential energy imparted by surface fluxes that is + ! available to drive entrainment at the base of mixed layer when that energy is + ! positive. +MSTAR_CONV_ADJ = 0.667 ! [nondim] default = 0.0 + ! Coefficient used for reducing mstar during convection due to reduction of + ! stable density gradient. +USE_MLD_ITERATION = False ! [Boolean] default = True + ! A logical that specifies whether or not to use the distance to the bottom of + ! the actively turbulent boundary layer to help set the EPBL length scale. +EPBL_TRANSITION_SCALE = 0.01 ! [nondim] default = 0.1 + ! A scale for the mixing length in the transition layer at the edge of the + ! boundary layer as a fraction of the boundary layer thickness. +MIX_LEN_EXPONENT = 1.0 ! [nondim] default = 2.0 + ! The exponent applied to the ratio of the distance to the MLD and the MLD depth + ! which determines the shape of the mixing length. This is only used if + ! USE_MLD_ITERATION is True. +USE_LA_LI2016 = False ! [nondim] default = False + ! A logical to use the Li et al. 2016 (submitted) formula to determine the + ! Langmuir number. +USE_WAVES = False ! [Boolean] default = False + ! If true, enables surface wave modules. +WAVE_METHOD = "SURFACE_BANDS" ! default = "EMPTY" + ! Choice of wave method, valid options include: + ! TEST_PROFILE - Prescribed from surface Stokes drift + ! and a decay wavelength. + ! SURFACE_BANDS - Computed from multiple surface values + ! and decay wavelengths. + ! DHH85 - Uses Donelan et al. 1985 empirical + ! wave spectrum with prescribed values. + ! LF17 - Infers Stokes drift profile from wind + ! speed following Li and Fox-Kemper 2017. +SURFBAND_SOURCE = "COUPLER" ! default = "EMPTY" + ! Choice of SURFACE_BANDS data mode, valid options include: + ! DATAOVERRIDE - Read from NetCDF using FMS DataOverride. + ! COUPLER - Look for variables from coupler pass + ! INPUT - Testing with fixed values. +STK_BAND_COUPLER = 3 ! default = 1 + ! STK_BAND_COUPLER is the number of Stokes drift bands in the coupler. This has + ! to be consistent with the number of Stokes drift bands in WW3, or the model + ! will fail. +SURFBAND_WAVENUMBERS = 0.04, 0.11, 0.3305 ! [rad/m] default = 0.12566 + ! Central wavenumbers for surface Stokes drift bands. +EPBL_LANGMUIR_SCHEME = "ADDITIVE" ! default = "NONE" + ! EPBL_LANGMUIR_SCHEME selects the method for including Langmuir turbulence. + ! Valid values are: + ! NONE - Do not do any extra mixing due to Langmuir turbulence + ! RESCALE - Use a multiplicative rescaling of mstar to account for Langmuir + ! turbulence + ! ADDITIVE - Add a Langmuir turblence contribution to mstar to other + ! contributions +LT_ENHANCE_COEF = 0.044 ! [nondim] default = 0.447 + ! Coefficient for Langmuir enhancement of mstar +LT_ENHANCE_EXP = -1.5 ! [nondim] default = -1.33 + ! Exponent for Langmuir enhancementt of mstar +LT_MOD_LAC1 = 0.0 ! [nondim] default = -0.87 + ! Coefficient for modification of Langmuir number due to MLD approaching Ekman + ! depth. +LT_MOD_LAC4 = 0.0 ! [nondim] default = 0.95 + ! Coefficient for modification of Langmuir number due to ratio of Ekman to + ! stable Obukhov depth. +LT_MOD_LAC5 = 0.22 ! [nondim] default = 0.95 + ! Coefficient for modification of Langmuir number due to ratio of Ekman to + ! unstable Obukhov depth. ! === module MOM_regularize_layers === ! === module MOM_opacity === +PEN_SW_NBANDS = 3 ! default = 1 + ! The number of bands of penetrating shortwave radiation. ! === module MOM_tracer_advect === TRACER_ADVECTION_SCHEME = "PPM:H3" ! default = "PLM" @@ -499,92 +802,64 @@ TRACER_ADVECTION_SCHEME = "PPM:H3" ! default = "PLM" ! PPM - Piecewise Parabolic Method (Colella-Woodward) ! === module MOM_tracer_hor_diff === -KHTR = 50.0 ! [m2 s-1] default = 0.0 - ! The background along-isopycnal tracer diffusivity. CHECK_DIFFUSIVE_CFL = True ! [Boolean] default = False - ! If true, use enough iterations the diffusion to ensure - ! that the diffusive equivalent of the CFL limit is not - ! violated. If false, always use the greater of 1 or - ! MAX_TR_DIFFUSION_CFL iteration. -MAX_TR_DIFFUSION_CFL = 2.0 ! [nondim] default = -1.0 - ! If positive, locally limit the along-isopycnal tracer - ! diffusivity to keep the diffusive CFL locally at or - ! below this value. The number of diffusive iterations - ! is often this value or the next greater integer. + ! If true, use enough iterations the diffusion to ensure that the diffusive + ! equivalent of the CFL limit is not violated. If false, always use the greater + ! of 1 or MAX_TR_DIFFUSION_CFL iteration. ! === module MOM_neutral_diffusion === ! This module implements neutral diffusion of tracers USE_NEUTRAL_DIFFUSION = True ! [Boolean] default = False ! If true, enables the neutral diffusion module. +! === module MOM_lateral_boundary_diffusion === +! This module implements lateral diffusion of tracers near boundaries + ! === module MOM_sum_output === -MAXTRUNC = 1000 ! [truncations save_interval-1] default = 0 - ! The run will be stopped, and the day set to a very - ! large value if the velocity is truncated more than - ! MAXTRUNC times between energy saves. Set MAXTRUNC to 0 +CALCULATE_APE = False ! [Boolean] default = True + ! If true, calculate the available potential energy of the interfaces. Setting + ! this to false reduces the memory footprint of high-PE-count models + ! dramatically. +MAXTRUNC = 100000 ! [truncations save_interval-1] default = 0 + ! The run will be stopped, and the day set to a very large value if the velocity + ! is truncated more than MAXTRUNC times between energy saves. Set MAXTRUNC to 0 ! to stop if there is any truncation of velocities. +ENERGYSAVEDAYS = 0.25 ! [days] default = 1.0 + ! The interval in units of TIMEUNIT between saves of the energies of the run and + ! other globally summed diagnostics. ! === module ocean_model_init === ! === module MOM_surface_forcing === -BUOY_CONFIG = "file" ! - ! The character string that indicates how buoyancy forcing - ! is specified. Valid options include (file), (zero), - ! (linear), (USER), (BFB) and (NONE). -ARCHAIC_OMIP_FORCING_FILE = False ! [Boolean] default = True - ! If true, use the forcing variable decomposition from - ! the old German OMIP prescription that predated CORE. If - ! false, use the variable groupings available from MOM - ! output diagnostics of forcing variables. -LONGWAVE_FILE = "forcing_daily.nc" ! - ! The file with the longwave heat flux, in the variable - ! given by LONGWAVE_FORCING_VAR. -SHORTWAVE_FILE = "forcing_daily.nc" ! - ! The file with the shortwave heat flux, in the variable - ! given by SHORTWAVE_FORCING_VAR. -EVAPORATION_FILE = "forcing_daily.nc" ! - ! The file with the evaporative moisture flux, in the - ! variable given by EVAP_FORCING_VAR. -LATENTHEAT_FILE = "forcing_daily.nc" ! - ! The file with the latent heat flux, in the variable - ! given by LATENT_FORCING_VAR. -SENSIBLEHEAT_FILE = "forcing_daily.nc" ! - ! The file with the sensible heat flux, in the variable - ! given by SENSIBLE_FORCING_VAR. -RAIN_FILE = "forcing_monthly.nc" ! - ! The file with the liquid precipitation flux, in the - ! variable given by RAIN_FORCING_VAR. -SNOW_FILE = "forcing_monthly.nc" ! - ! The file with the frozen precipitation flux, in the - ! variable given by SNOW_FORCING_VAR. -RUNOFF_FILE = "forcing_monthly.nc" ! - ! The file with the fresh and frozen runoff/calving - ! fluxes, in variables given by LIQ_RUNOFF_FORCING_VAR - ! and FROZ_RUNOFF_FORCING_VAR. -SSTRESTORE_FILE = "forcing_daily.nc" ! - ! The file with the SST toward which to restore in the - ! variable given by SST_RESTORE_VAR. -SALINITYRESTORE_FILE = "forcing_daily.nc" ! - ! The file with the surface salinity toward which to - ! restore in the variable given by SSS_RESTORE_VAR. -WIND_CONFIG = "file" ! - ! The character string that indicates how wind forcing - ! is specified. Valid options include (file), (2gyre), - ! (1gyre), (gyres), (zero), and (USER). -WIND_FILE = "forcing_daily.nc" ! - ! The file in which the wind stresses are found in - ! variables STRESS_X and STRESS_Y. -WINDSTRESS_X_VAR = "taux" ! default = "STRESS_X" - ! The name of the x-wind stress variable in WIND_FILE. -WINDSTRESS_Y_VAR = "tauy" ! default = "STRESS_Y" - ! The name of the y-wind stress variable in WIND_FILE. -WINDSTRESS_STAGGER = "C" ! default = "A" - ! A character indicating how the wind stress components - ! are staggered in WIND_FILE. This may be A or C for now. -FLUXCONST = 0.5 ! [m day-1] - ! The constant that relates the restoring surface fluxes - ! to the relative surface anomalies (akin to a piston - ! velocity). Note the non-MKS units. +OCEAN_SURFACE_STAGGER = "A" ! default = "C" + ! A case-insensitive character string to indicate the + ! staggering of the surface velocity field that is + ! returned to the coupler. Valid values include + ! 'A', 'B', or 'C'. + +MAX_P_SURF = 0.0 ! [Pa] default = -1.0 + ! The maximum surface pressure that can be exerted by the atmosphere and + ! floating sea-ice or ice shelves. This is needed because the FMS coupling + ! structure does not limit the water that can be frozen out of the ocean and the + ! ice-ocean heat fluxes are treated explicitly. No limit is applied if a + ! negative value is used. +WIND_STAGGER = "A" ! default = "C" + ! A case-insensitive character string to indicate the + ! staggering of the input wind stress field. Valid + ! values are 'A', 'B', or 'C'. +CD_TIDES = 0.0018 ! [nondim] default = 1.0E-04 + ! The drag coefficient that applies to the tides. +GUST_CONST = 0.02 ! [Pa] default = 0.0 + ! The background gustiness in the winds. +FIX_USTAR_GUSTLESS_BUG = False ! [Boolean] default = True + ! If true correct a bug in the time-averaging of the gustless wind friction + ! velocity +! === module ocean_stochastics === +DO_SPPT = False ! [Boolean] default = False + ! If true perturb the diabatic tendencies in MOM_diabadic_driver +PERT_EPBL = False ! [Boolean] default = False + ! If true perturb the KE dissipation and destruction in MOM_energetic_PBL + ! === module MOM_restart === ! === module MOM_file_parser === diff --git a/test/Data/72x35x25/input.nml b/test/Data/72x35x25/input.nml index 76052db81..128240acf 100644 --- a/test/Data/72x35x25/input.nml +++ b/test/Data/72x35x25/input.nml @@ -24,5 +24,5 @@ &fms_nml clock_grain='MODULE' - domains_stack_size = 2000000 + domains_stack_size = 10000000 clock_flags='SYNC' / diff --git a/test/Data/72x35x25/restarts/cice.res.nc b/test/Data/72x35x25/restarts/cice.res.nc index 6177b8e2a..517615fd3 100644 --- a/test/Data/72x35x25/restarts/cice.res.nc +++ b/test/Data/72x35x25/restarts/cice.res.nc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:25c17826a4504fb6aca3b08904eb4bca58612a69cee49478817a13b8f88f783e -size 84759 +oid sha256:c127aeb21a0fe152485551e4701d56f01ec0438364cc52d2f4012fc7d3a2d686 +size 146536948 diff --git a/test/Data/fields_metadata.yml b/test/Data/fields_metadata.yml index f805cd1ea..02d992fd0 100644 --- a/test/Data/fields_metadata.yml +++ b/test/Data/fields_metadata.yml @@ -258,4 +258,3 @@ - name: phaeo getval name: phaeocystis_concentration constant value: 0 #5.3e-24 - diff --git a/test/Data/soca_gridspec.nc b/test/Data/soca_gridspec.nc new file mode 100644 index 000000000..e65e56190 --- /dev/null +++ b/test/Data/soca_gridspec.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b38482cd3029d46f2ad67cc7068a30fa44ff7734069ba5922ac14d9ba3c29830 +size 114321500 diff --git a/test/executables/TestLinearModel.cc b/test/executables/TestLinearModel.cc deleted file mode 100644 index ca6924d5d..000000000 --- a/test/executables/TestLinearModel.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* - * (C) Copyright 2009-2016 ECMWF. - * (C) Copyright 2017-2021 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. - * In applying this licence, ECMWF does not waive the privileges and immunities - * granted to it by virtue of its status as an intergovernmental organisation nor - * does it submit to any jurisdiction. - */ - -#include "soca/Traits.h" -#include "oops/runs/Run.h" -#include "test/interface/LinearModel.h" - -int main(int argc, char ** argv) { - oops::Run run(argc, argv); - test::LinearModel tests; - return run.execute(tests); -} - diff --git a/test/testinput/3dhyb_nicas.yml b/test/testinput/3dhyb.yml similarity index 81% rename from test/testinput/3dhyb_nicas.yml rename to test/testinput/3dhyb.yml index 083274464..9ffaa3598 100644 --- a/test/testinput/3dhyb_nicas.yml +++ b/test/testinput/3dhyb.yml @@ -23,20 +23,24 @@ cost function: covariance model: hybrid components: - covariance: - covariance model: SocaError - analysis variables: [cicen, hicen, hsnon, socn, tocn, uocn, vocn, ssh] - date: *bkg_date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [hsnon, socn, tocn, uocn, vocn, ssh] - - name: ice - variables: [cicen, hicen] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [cicen, hicen, hsnon, tocn, socn, ssh, uocn, vocn] + geometry: *geom + group mapping: + - name: group1 + variables: [tocn, socn, cicen, hicen, hsnon, uocn, vocn, ssh] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc + - name: group2 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc linear variable change: input variables: *soca_vars @@ -64,12 +68,6 @@ cost function: hicen_min: 10.0 hicen_max: 100.0 - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - - linear variable change name: BalanceSOCA kst: dsdtmax: 0.1 @@ -127,7 +125,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dhyb_nicas/adt.3dhyb_nicas.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -152,14 +150,14 @@ variational: write increment: true increment: state component: - datadir: data_generated/3dhyb_nicas + datadir: data_output/ date: *bkg_date - exp: 3dhyb_nicas.iter1 + exp: 3dhyb.iter1 type: incr output: - datadir: data_generated/3dhyb_nicas - exp: 3dhyb_nicas + datadir: data_output/ + exp: 3dhyb type: an final: @@ -167,6 +165,6 @@ final: departures: oman test: - reference filename: testref/3dhyb_nicas.test - test output filename: testoutput/3dhyb_nicas.test + reference filename: testref/3dhyb.test + test output filename: testoutput/3dhyb.test float relative tolerance: 1e-5 diff --git a/test/testinput/3dhyb_diffusion.yml b/test/testinput/3dhyb_diffusion.yml index 396a82610..387f23d6e 100644 --- a/test/testinput/3dhyb_diffusion.yml +++ b/test/testinput/3dhyb_diffusion.yml @@ -37,12 +37,12 @@ cost function: groups: - name: group1 horizontal: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_generated/parameters_diffusion/hz_smaller.nc vertical: - filename: data_generated/parameters_diffusion_vt/vt_5lvls.nc + filename: data_generated/parameters_diffusion/vt_5lvls.nc - name: group2 horizontal: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_generated/parameters_diffusion/hz_smaller.nc date: *bkg_date linear variable change: input variables: *soca_vars @@ -120,7 +120,7 @@ cost function: - name: group1 multivariate strategy: duplicated horizontal: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_generated/parameters_diffusion/hz_smaller.nc vertical: strategy: duplicated @@ -134,7 +134,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dhyb_diffusion/adt.3dhyb_diffusion.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -159,13 +159,13 @@ variational: write increment: true increment: state component: - datadir: data_generated/3dhyb_diffusion + datadir: data_output/ date: *bkg_date exp: 3dhyb_diffusion.iter1 type: incr output: - datadir: data_generated/3dhyb_diffusion + datadir: data_output/ exp: 3dhyb_diffusion type: an diff --git a/test/testinput/3dhybfgat.yml b/test/testinput/3dhybfgat.yml index b91f6fe18..b92505d64 100644 --- a/test/testinput/3dhybfgat.yml +++ b/test/testinput/3dhybfgat.yml @@ -1,6 +1,6 @@ _date_begin: &date_begin 2018-04-15T00:00:00Z cost function: - cost type: 4D-Var + cost type: 3D-FGAT time window: begin: *date_begin length: PT6H @@ -15,7 +15,7 @@ cost function: name: MOM6solo tstep: PT1H advance_mom6: 1 - model variables: &model_vars [cicen, hicen, socn, uocn, vocn, tocn, ssh, hocn, sw, lhf, shf, lw, us, mld, layer_depth] + model variables: &model_vars [cicen, hicen, socn, uocn, vocn, tocn, ssh, hocn, mld, layer_depth] variable change: variable change name: Model2Ana @@ -37,20 +37,21 @@ cost function: covariance model: hybrid components: - covariance: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, uocn, vocn, ssh, sw, lhf, shf, lw, us] - date: *date_begin - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh, sw, lhf, shf, lw, us] - - name: ice - variables: [cicen, hicen] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [tocn, socn, ssh, cicen, hicen] + geometry: *geom + group mapping: + - name: group1 + variables: [tocn, socn, ssh, cicen, hicen] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: input variables: *soca_vars @@ -78,12 +79,6 @@ cost function: hicen_min: 10.0 hicen_max: 100.0 - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - - linear variable change name: BalanceSOCA dsdtmax: 0.1 dsdzmin: 3.0e-6 @@ -138,7 +133,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dhybfgat/adt.3dhybfgat.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -154,11 +149,6 @@ variational: algorithm: RPCG iterations: - geometry: *geom - linear model: - name: Identity - increment variables: *soca_vars - variable change: Identity - tstep: PT1H ninner: 5 gradient norm reduction: 1e-15 test: on @@ -168,13 +158,13 @@ variational: write increment: true increment: state component: - datadir: data_generated/3dhybfgat + datadir: data_output/ date: *date_begin exp: 3dhybfgat.iter1 type: incr output: - datadir: data_generated/3dhybfgat + datadir: data_output/ exp: 3dhybfgat type: an diff --git a/test/testinput/3dvar_diffusion.yml b/test/testinput/3dvar.yml similarity index 86% rename from test/testinput/3dvar_diffusion.yml rename to test/testinput/3dvar.yml index 6fc947d37..5a2ede56e 100644 --- a/test/testinput/3dvar_diffusion.yml +++ b/test/testinput/3dvar.yml @@ -40,12 +40,12 @@ cost function: groups: - name: group1 horizontal: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_generated/parameters_diffusion/hz_smaller.nc vertical: - filename: data_generated/parameters_diffusion_vt/vt_5lvls.nc + filename: data_generated/parameters_diffusion/vt_5lvls.nc - name: group2 horizontal: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_generated/parameters_diffusion/hz_smaller.nc date: *bkg_date @@ -95,7 +95,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/sst_coolskin.3dvar_diffusion.nc + obsfile: data_output/sst_coolskin.nc obsdatain: engine: type: H5File @@ -111,7 +111,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/sst.3dvar_diffusion.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -133,7 +133,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/sss.3dvar_diffusion.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -159,7 +159,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/adt.3dvar_diffusion.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -190,7 +190,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/prof_T.3dvar_diffusion.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -210,7 +210,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/prof_S.3dvar_diffusion.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File @@ -232,7 +232,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvar_diffusion/icec.3dvar_diffusion.nc + obsfile: data_output/icec.nc obsdatain: engine: type: H5File @@ -260,14 +260,14 @@ variational: write increment: true increment: state component: - datadir: data_generated/3dvar_diffusion + datadir: data_output date: *bkg_date - exp: 3dvar_diffusion.iter1 + exp: 3dvar.iter1 type: incr output: - datadir: data_generated/3dvar_diffusion - exp: 3dvar_diffusion + datadir: data_output + exp: 3dvar type: an final: @@ -275,6 +275,6 @@ final: departures: oman test: - reference filename: testref/3dvar_diffusion.test - test output filename: testoutput/3dvar_diffusion.test + reference filename: testref/3dvar.test + test output filename: testoutput/3dvar.test float relative tolerance: 1e-5 \ No newline at end of file diff --git a/test/testinput/3dvar_godas.yml b/test/testinput/3dvar_godas.yml deleted file mode 100644 index 672cf4f90..000000000 --- a/test/testinput/3dvar_godas.yml +++ /dev/null @@ -1,279 +0,0 @@ -# common filters used later on -_: &land_mask - filter: Domain Check - where: - - variable: {name: GeoVaLs/sea_area_fraction} - minvalue: 0.5 - -cost function: - cost type: 3D-Var - time window: - begin: 2018-04-14T00:00:00Z - length: P2D - analysis variables: &soca_vars [cicen, hicen, hsnon, socn, tocn, ssh, hocn, sw, lhf, shf, lw, us, mld, layer_depth] - geometry: &geom - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - - background: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - sfc_filename: sfc.res.nc - date: &bkg_date 2018-04-15T00:00:00Z - state variables: *soca_vars - - background error: - covariance model: SocaError - analysis variables: [cicen, hicen, hsnon, socn, tocn, ssh, sw, lhf, shf, lw, us] - date: *bkg_date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [hsnon, socn, tocn, ssh, sw, lhf, shf, lw, us] - - name: ice - variables: [cicen, hicen] - - linear variable change: - input variables: *soca_vars - output variables: *soca_vars - linear variable changes: - - linear variable change name: BkgErrFILT - ocean_depth_min: 1000 # [m] - rescale_bkgerr: 1.0 - efold_z: 2500.0 # [m] - - - linear variable change name: BkgErrGODAS - # optionally save the calculated parameters to a file - output: - filename: data_generated/3dvar_godas/bkgerrgodas.nc - sst_bgerr_file: data_static/godas_sst_bgerr.nc - t_min: 0.1 - t_max: 2.0 - t_dz: 20.0 - t_efold: 500.0 - s_min: 0.0 - s_max: 0.25 - ssh_min: 0.0 # value at EQ - ssh_max: 0.1 # value in Extratropics - ssh_phi_ex: 20 # lat of transition from extratropics - cicen_min: 0.1 - cicen_max: 0.5 - hicen_min: 10.0 - hicen_max: 100.0 - - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - - - linear variable change name: BalanceSOCA - kst: - dsdtmax: 0.1 - dsdzmin: 3.0e-6 - dtdzmin: 1.0e-6 - nlayers: 999 - ksshts: - nlayers: 10 - dcdt: - filename: data_static/72x35x25/dcdt.nc - name: dcdt - - observations: - observers: - - obs space: - name: CoolSkin - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/sst_coolskin.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/sst.nc - simulated variables: [seaSurfaceTemperature] - obs operator: - name: CoolSkin - obs error: - covariance model: diagonal - - - obs space: - name: SeaSurfaceTemp - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/sst.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/sst.nc - simulated variables: [seaSurfaceTemperature] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Thinning - amount: 0.1 - random seed: 0 - - - obs space: - name: SeaSurfaceSalinity - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/sss.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/sss.nc - simulated variables: [seaSurfaceSalinity] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - filter: Domain Check - where: - - variable: {name: GeoVaLs/distance_from_coast} - minvalue: 1500e3 - - filter: Domain Check - where: - - variable: {name: GeoVaLs/sea_surface_temperature} - minvalue: 15 - - - obs space: - name: ADT - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/adt.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/adt.nc - simulated variables: [absoluteDynamicTopography] - obs operator: - name: ADT - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Bounds Check - minvalue: -2.0 - maxvalue: 2.0 - - filter: Perform Action - action: - name: assign error - error function: - name: ObsFunction/LinearCombination - options: - variables: [GeoVaLs/mesoscale_representation_error, - ObsError/absoluteDynamicTopography] - coefs: [1.0, - 1.0] - - - obs space: - name: InsituTemperature - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/prof_T.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/prof.nc - simulated variables: [waterTemperature] - obs operator: - name: InsituTemperature - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Background Check - threshold: 5 - - - obs space: - name: InsituSalinity - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/prof_S.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/prof.nc - simulated variables: [salinity] - obs operator: - name: VertInterp - observation alias file: testinput/obsop_name_map.yml - vertical coordinate: sea_water_depth - observation vertical coordinate: depth - interpolation method: linear - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - - obs space: - name: SeaIceFraction - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_godas/icec.3dvar_godas.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/icec.nc - simulated variables: [seaIceFraction] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - -variational: - minimizer: - algorithm: RPCG - iterations: - - geometry: *geom - ninner: 5 - gradient norm reduction: 1e-15 - test: on - diagnostics: - departures: ombg - online diagnostics: - write increment: true - increment: - state component: - datadir: data_generated/3dvar_godas - date: *bkg_date - exp: 3dvar_godas.iter1 - type: incr - -output: - datadir: data_generated/3dvar_godas - exp: 3dvar_godas - type: an - -final: - diagnostics: - departures: oman - -test: - reference filename: testref/3dvar_godas.test - test output filename: testoutput/3dvar_godas.test - float relative tolerance: 1e-5 diff --git a/test/testinput/3dvarbump.yml b/test/testinput/3dvar_nicas.yml similarity index 91% rename from test/testinput/3dvarbump.yml rename to test/testinput/3dvar_nicas.yml index c54ef83af..7666ea0bd 100644 --- a/test/testinput/3dvarbump.yml +++ b/test/testinput/3dvar_nicas.yml @@ -87,7 +87,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarbump/sst.3dvarbump.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -114,7 +114,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarbump/sss.3dvarbump.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -137,7 +137,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarbump/adt.3dvarbump.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -158,7 +158,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarbump/prof_T.3dvarbump.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -178,7 +178,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarbump/prof_S.3dvarbump.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File @@ -208,8 +208,8 @@ variational: departures: ombg output: - datadir: data_generated/3dvarbump - exp: 3dvarbump + datadir: data_output/ + exp: 3dvar_nicas type: an final: @@ -217,6 +217,6 @@ final: departures: oman test: - reference filename: testref/3dvarbump.test - test output filename: testoutput/3dvarbump.test + reference filename: testref/3dvar_nicas.test + test output filename: testoutput/3dvar_nicas.test float relative tolerance: 1e-4 diff --git a/test/testinput/3dvar_soca.yml b/test/testinput/3dvar_soca.yml deleted file mode 100644 index 2c90d5374..000000000 --- a/test/testinput/3dvar_soca.yml +++ /dev/null @@ -1,359 +0,0 @@ -# common filters used later on -_: &land_mask - filter: Domain Check - where: - - variable: {name: GeoVaLs/sea_area_fraction} - minvalue: 0.5 - -cost function: - cost type: 3D-Var - time window: - begin: &date_begin 2018-04-14T00:00:00Z - length: P2D - analysis variables: &a_vars [cicen, hicen, socn, tocn, ssh, sw, lhf, shf, lw, us, chl, biop, swh] - geometry: &geom - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - - background: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - sfc_filename: sfc.res.nc - wav_filename: wav.res.nc - date: &bkg_date 2018-04-15T00:00:00Z - state variables: &b_vars [cicen, hicen, socn, tocn, ssh, hocn, sw, lhf, shf, lw, us, chl, biop, swh, mld, layer_depth] - - background error: - covariance model: SocaError - analysis variables: *a_vars - date: 2018-04-15T00:00:00Z - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, ssh, sw, lhf, shf, lw, us, chl, biop] - - name: ice - variables: [cicen, hicen] - - name: wav - variables: [swh] - - linear variable change: - input variables: *a_vars - output variables: *a_vars - linear variable changes: - - - linear variable change name: BkgErrFILT - ocean_depth_min: 1000 # [m] - rescale_bkgerr: 1.0 - efold_z: 2500.0 # [m] - - - linear variable change name: BkgErrSOCA - read_from_file: 3 - basename: data_static/72x35x25/ - ocn_filename: ocn.bkgerror.nc - ice_filename: ice.bkgerror.nc - wav_filename: wav.bkgerror.nc - date: *bkg_date - t_min: 0.0 - t_max: 2.5 - s_min: 0.0 - s_max: 0.2 - ssh_min: 0.0 # std ssh=0 => ssh balance applied as - ssh_max: 0.0 # strong constraint - cicen_min: 0.1 - cicen_max: 0.5 - hicen_min: 10.0 - hicen_max: 100.0 - chl_min: 0.003 - chl_max: 10.0 - biop_min: 0.0 - biop_max: 1.0e-6 - swh_min: 0.1 - swh_max: 1.0 - #fixed_std_sst: 0.005 # OK to create pretty increments - #fixed_std_sss: 0.001 # but that option should not exist! - - - linear variable change name: VertConvSOCA - Lz_min: 10.0 - Lz_mld: 1 - Lz_mld_max: 500 - scale_layer_thick: 1.5 - - - linear variable change name: BalanceSOCA - dsdtmax: 0.1 - dsdzmin: 3.0e-6 - dtdzmin: 1.0e-6 - nlayers: 10 - dcdt: - filename: data_static/72x35x25/dcdt.nc - name: dcdt - - observations: - observers: - - obs space: - name: CoolSkin - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/sst_coolskin.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/sst.nc - simulated variables: [seaSurfaceTemperature] - obs operator: - name: CoolSkin - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Thinning - amount: 0.1 - random seed: 0 - - - obs space: - name: SeaSurfaceTemp - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/sst.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/sst.nc - simulated variables: [seaSurfaceTemperature] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Bounds Check - minvalue: 5.0 - maxvalue: 30.0 - - filter: Background Check - threshold: 8 - - filter: Thinning - amount: 0.1 - random seed: 0 - - - obs space: - name: SeaSurfaceSalinity - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/sss.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/sss.nc - simulated variables: [seaSurfaceSalinity] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - filter: Domain Check - where: - - variable: {name: GeoVaLs/distance_from_coast} - minvalue: 1500e3 - - filter: Domain Check - where: - - variable: {name: GeoVaLs/sea_surface_temperature} - minvalue: 15 - - - obs space: - name: ADT - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/adt.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/adt.nc - simulated variables: [absoluteDynamicTopography] - obs operator: - name: ADT - obs error: - covariance model: diagonal - obs filters: - - filter: Domain Check - where: - - variable: {name: GeoVaLs/sea_floor_depth_below_sea_surface} - minvalue: 2000 - - - obs space: - name: InsituTS - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/prof.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/prof.nc - simulated variables: [waterTemperature, salinity] - obs operator: - name: Composite - components: - - name: InsituTemperature - variables: - - name: waterTemperature - - name: VertInterp - observation alias file: testinput/obsop_name_map.yml - variables: - - name: salinity - vertical coordinate: sea_water_depth - observation vertical coordinate: depth - interpolation method: linear - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Background Check - threshold: 5 - filter variables: - - name: waterTemperature - - - obs space: - name: SeaIceFraction - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/icec.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/icec.nc - simulated variables: [seaIceFraction] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - - obs space: - name: SeaSurfaceChlorophyll - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/chl.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/chl.nc - simulated variables: [seaSurfaceChlorophyllMassConcentration] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - filter: Gaussian_Thinning - horizontal_mesh: 111 - use_reduced_horizontal_grid: false - - filter: BlackList - filter variables: - - name: seaSurfaceChlorophyllMassConcentration - where: - - variable: - name: ObsValue/seaSurfaceChlorophyllMassConcentration - minvalue: 0.001 - maxvalue: 10.0 - - variable: - name: MetaData/latitude - minvalue: -60.0 - maxvalue: 60.0 - action: - name: reject - where: - - variable: - name: PreQC/seaSurfaceChlorophyllMassConcentration - any_bit_set_of: 0,1,3,4,5,8,9,10,12,14,15,16,19,21,22,25 - action: - name: inflate error - inflation factor: 2.0 - - - obs space: - name: SeaSurfaceBiomassP - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/biomass_p.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/biomass_p.nc - simulated variables: [oceanSurfaceBiomassContent] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - - - obs space: - name: SeaSurfaceHS - obsdataout: - engine: - type: H5File - obsfile: data_generated/3dvar_soca/swh.3dvar_soca.nc - obsdatain: - engine: - type: H5File - obsfile: data_static/obs/swh.nc - simulated variables: [waveHeightSignificant] - obs operator: - name: Identity - observation alias file: testinput/obsop_name_map.yml - obs error: - covariance model: diagonal - obs filters: - - *land_mask - -variational: - minimizer: - algorithm: RPCG - iterations: - - geometry: *geom - ninner: 5 - gradient norm reduction: 1e-15 - test: on - diagnostics: - departures: ombg - online diagnostics: - write increment: true - increment: - state component: - datadir: data_generated/3dvar_soca - date: *bkg_date - exp: 3dvar_soca.iter1 - type: incr - -output: - datadir: data_generated/3dvar_soca - exp: 3dvar_soca - type: an - -final: - diagnostics: - departures: oman - -test: - reference filename: testref/3dvar_soca.test - test output filename: testoutput/3dvar_soca.test - float relative tolerance: 1e-4 diff --git a/test/testinput/3dvarfgat.yml b/test/testinput/3dvarfgat.yml index 2fa686d98..bd4608bc2 100644 --- a/test/testinput/3dvarfgat.yml +++ b/test/testinput/3dvarfgat.yml @@ -6,7 +6,7 @@ _: &land_mask minvalue: 0.5 cost function: - cost type: 4D-Var + cost type: 3D-FGAT time window: begin: &date_begin 2018-04-15T00:00:00Z length: PT6H @@ -39,20 +39,21 @@ cost function: state variables: *model_vars background error: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, uocn, vocn, ssh, sw, lhf, shf, lw, us] - date: 2018-04-15T00:00:00Z - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh, sw, lhf, shf, lw, us] - - name: ice - variables: [cicen, hicen] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [tocn, socn, ssh, uocn, vocn, cicen, hicen, sw, lhf, shf, lw, us] + geometry: *geom + group mapping: + - name: group1 + variables: [tocn, socn, ssh, uocn, vocn, cicen, hicen, sw, lhf, shf, lw, us] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: input variables: *soca_vars @@ -79,12 +80,6 @@ cost function: hicen_min: 10.0 hicen_max: 100.0 - - linear variable change name: VertConvSOCA - Lz_min: 10.0 - Lz_mld: 1 - Lz_mld_max: 500 - scale_layer_thick: 1.5 - - linear variable change name: BalanceSOCA kst: dsdtmax: 0.1 @@ -104,7 +99,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/sst_coolskin.3dvarfgat.nc + obsfile: data_output/sst_coolskin.nc obsdatain: engine: type: H5File @@ -120,7 +115,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/sst.3dvarfgat.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -142,7 +137,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/sss.3dvarfgat.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -165,7 +160,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/adt.3dvarfgat.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -183,7 +178,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/prof_T.3dvarfgat.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -203,7 +198,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/prof_S.3dvarfgat.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File @@ -225,7 +220,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/icec.3dvarfgat.nc + obsfile: data_output/icec.nc obsdatain: engine: type: H5File @@ -244,7 +239,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat/uocn_surface.3dvarfgat.nc + obsfile: data_output/uocn_surface.nc obsdatain: engine: type: H5File @@ -259,11 +254,7 @@ variational: algorithm: RPCG iterations: - geometry: *geom - linear model: - name: Identity - increment variables: *soca_vars - tstep: PT1H - ninner: 1 + ninner: 5 gradient norm reduction: 1e-15 test: on diagnostics: @@ -272,13 +263,13 @@ variational: write increment: true increment: state component: - datadir: data_generated/3dvarfgat + datadir: data_output/ date: *bkg_date exp: 3dvarfgat.iter1 type: incr output: - datadir: data_generated/3dvarfgat + datadir: data_output/ exp: 3dvarfgat type: an diff --git a/test/testinput/3dvarfgat_pseudo.yml b/test/testinput/3dvarfgat_pseudo.yml index 8e343bb8f..e3e63495b 100644 --- a/test/testinput/3dvarfgat_pseudo.yml +++ b/test/testinput/3dvarfgat_pseudo.yml @@ -6,7 +6,7 @@ _: &land_mask minvalue: 0.5 cost function: - cost type: 4D-Var + cost type: 3D-FGAT time window: begin: &date_begin 2018-04-15T00:00:00Z length: PT6H @@ -58,18 +58,21 @@ cost function: state variables: [socn, tocn, ssh, hocn, uocn, vocn, mld, layer_depth] background error: - covariance model: SocaError - analysis variables: *soca_vars - date: 2018-04-15T00:00:00Z - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [tocn, socn, ssh] + geometry: *geom + group mapping: + - name: group1 + variables: [tocn, socn, ssh] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: input variables: *soca_vars @@ -81,12 +84,6 @@ cost function: rescale_bkgerr: 1.0 efold_z: 2500.0 # [m] - - linear variable change name: VertConvSOCA - Lz_min: 10.0 - Lz_mld: 1 - Lz_mld_max: 500 - scale_layer_thick: 1.5 - - linear variable change name: BalanceSOCA kst: dsdtmax: 0.1 @@ -106,7 +103,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat_pseudo/sst.3dvarfgat_pseudo.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -128,7 +125,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat_pseudo/sss.3dvarfgat_pseudo.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -151,7 +148,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat_pseudo/adt.3dvarfgat_pseudo.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -169,7 +166,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat_pseudo/prof_T.3dvarfgat_pseudo.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -189,7 +186,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/3dvarfgat_pseudo/prof_S.3dvarfgat_pseudo.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File @@ -212,11 +209,6 @@ variational: algorithm: RPCG iterations: - geometry: *geom - linear model: - name: Identity - increment variables: *soca_vars - variable change: Identity - tstep: PT1H ninner: 5 gradient norm reduction: 1e-15 test: on @@ -227,7 +219,7 @@ minimizer: algorithm: RPCG output: - datadir: data_generated/3dvarfgat_pseudo + datadir: data_output/ exp: 3dvarfgat_pseudo type: an @@ -238,4 +230,4 @@ final: test: reference filename: testref/3dvarfgat_pseudo.test test output filename: testoutput/3dvarfgat_pseudo.test - float relative tolerance: 1e-5 + float relative tolerance: 1e-3 diff --git a/test/testinput/4denvar.yml b/test/testinput/4denvar.yml index 34f27166c..163f98713 100644 --- a/test/testinput/4denvar.yml +++ b/test/testinput/4denvar.yml @@ -61,7 +61,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/4denvar/sst.4denvar.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -85,7 +85,7 @@ variational: departures: ombg output: - datadir: data_generated/4denvar + datadir: data_output/ exp: 4denvar type: an diff --git a/test/testinput/4dhybenvar.yml b/test/testinput/4dhybenvar.yml index 407f6e944..08febd6aa 100644 --- a/test/testinput/4dhybenvar.yml +++ b/test/testinput/4dhybenvar.yml @@ -34,18 +34,21 @@ cost function: - weight: value: 0.5 covariance: - covariance model: SocaError - analysis variables: [socn, tocn, uocn, vocn, ssh] - date: 2018-04-15T00:00:00Z - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [tocn, socn, ssh] + geometry: *geom + group mapping: + - name: group1 + variables: [tocn, socn, ssh] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc - weight: value: 0.5 @@ -82,7 +85,7 @@ cost function: obsdataout: engine: type: H5File - obsfile: data_generated/4dhybenvar/sst.4dhybenvar.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -106,7 +109,7 @@ variational: departures: ombg output: - datadir: data_generated/4dhybenvar + datadir: data_output/ exp: 4dhybenvar type: an diff --git a/test/testinput/addincrement.yml b/test/testinput/addincrement.yml index fd4624dfa..14bd05aa6 100644 --- a/test/testinput/addincrement.yml +++ b/test/testinput/addincrement.yml @@ -16,14 +16,14 @@ state: increment: read_from_file: 1 - basename: data_generated/3dvar_godas/ - ocn_filename: ocn.3dvar_godas.iter1.incr.2018-04-15T00:00:00Z.nc - ice_filename: ice.3dvar_godas.iter1.incr.2018-04-15T00:00:00Z.nc + basename: data_generated/3dvar/ + ocn_filename: ocn.3dvar.iter1.incr.2018-04-15T00:00:00Z.nc + ice_filename: ice.3dvar.iter1.incr.2018-04-15T00:00:00Z.nc date: *bkg_date added variables: [hsnon, socn, tocn] output: - datadir: data_generated/addincrement + datadir: data_output/ exp: addincrement type: an diff --git a/test/testinput/checkpointmodel.yml b/test/testinput/checkpointmodel.yml index 7392c9557..515389adc 100644 --- a/test/testinput/checkpointmodel.yml +++ b/test/testinput/checkpointmodel.yml @@ -21,8 +21,8 @@ background: analysis: read_from_file: 1 date: *date - basename: data_generated/3dvar_godas/ - ocn_filename: ocn.3dvar_godas.an.2018-04-15T00:00:00Z.nc + basename: data_generated/3dvar/ + ocn_filename: ocn.3dvar.an.2018-04-15T00:00:00Z.nc state variables: [socn, tocn, hocn] test: diff --git a/test/testinput/convertincrement.yml b/test/testinput/convertincrement.yml index ef30f46c1..b1cf1d3b8 100644 --- a/test/testinput/convertincrement.yml +++ b/test/testinput/convertincrement.yml @@ -23,8 +23,8 @@ increments: input variables: [tocn, socn, ssh, hocn] input: read_from_file: 1 - basename: data_generated/3dvar_godas/ - ocn_filename: ocn.3dvar_godas.iter1.incr.2018-04-15T00:00:00Z.nc + basename: data_generated/3dvar/ + ocn_filename: ocn.3dvar.iter1.incr.2018-04-15T00:00:00Z.nc date: 2018-04-15T00:00:00Z state variables: [ssh, tocn, socn, hocn] trajectory: @@ -34,7 +34,7 @@ increments: date: 2018-04-15T00:00:00Z state variables: [ssh, tocn, socn, hocn, layer_depth, mld] output: - datadir: data_generated/convertincrement + datadir: data_output/ exp: convertincrement type: incr date: 2018-04-15T00:00:00Z diff --git a/test/testinput/convertstate.yml b/test/testinput/convertstate.yml index 6406260ca..cc236f9b1 100644 --- a/test/testinput/convertstate.yml +++ b/test/testinput/convertstate.yml @@ -18,7 +18,7 @@ states: date: &bkg_date 2018-04-15T00:00:00Z state variables: [ssh, tocn, socn, uocn, vocn, hocn, cicen, layer_depth] output: - datadir: data_generated/convertstate + datadir: data_output/ exp: convertstate type: fc date: *bkg_date diff --git a/test/testinput/convertstate_changevar.yml b/test/testinput/convertstate_changevar.yml index 70b2c2a75..70d950058 100644 --- a/test/testinput/convertstate_changevar.yml +++ b/test/testinput/convertstate_changevar.yml @@ -30,7 +30,7 @@ states: date: &bkg_date 2018-04-15T00:00:00Z state variables: *soca_vars output: - datadir: data_generated/convertstate_changevar + datadir: data_output/ exp: convertstate_changevar type: fc date: *bkg_date @@ -43,7 +43,7 @@ states: date: *bkg_date state variables: *soca_vars output: - datadir: data_generated/convertstate_changevar + datadir: data_output/ exp: convertstate_changevar.dummy_member type: fc date: *bkg_date diff --git a/test/testinput/convertstate_soca2cice.yml b/test/testinput/convertstate_soca2cice.yml index 85e91e540..5e2b09f64 100644 --- a/test/testinput/convertstate_soca2cice.yml +++ b/test/testinput/convertstate_soca2cice.yml @@ -21,19 +21,19 @@ variable change: sno_lev: 1 tstep: PT1H cice output: - restart: data_generated/convertstate_soca2cice/iced.2018-04-15-00000.nc + restart: data_output/iced.2018-04-15-00000.nc output variables: [tocn, socn, hocn, cicen, hicen, hsnon] states: - input: read_from_file: 1 - basename: data_generated/3dvar_godas/ - ocn_filename: ocn.3dvar_godas.an.2018-04-15T00:00:00Z.nc - ice_filename: ice.3dvar_godas.an.2018-04-15T00:00:00Z.nc + basename: data_generated/3dvar/ + ocn_filename: ocn.3dvar.an.2018-04-15T00:00:00Z.nc + ice_filename: ice.3dvar.an.2018-04-15T00:00:00Z.nc date: &bkg_date 2018-04-15T00:00:00Z state variables: [tocn, socn, hocn, cicen, hicen, hsnon] output: - datadir: data_generated/convertstate_soca2cice/ + datadir: data_output/ exp: soca2cice type: fc date: *bkg_date diff --git a/test/testinput/diffstates.yml b/test/testinput/diffstates.yml index 8d5373b04..e0ef52c0b 100644 --- a/test/testinput/diffstates.yml +++ b/test/testinput/diffstates.yml @@ -24,7 +24,7 @@ state2: state variables: [cicen, hicen, hsnon, socn, tocn, ssh, hocn, uocn, vocn] output: # state1 - state2 - datadir: data_generated/diffstates + datadir: data_output/ exp: diffstates type: an diff --git a/test/testinput/dirac_diffusion.yml b/test/testinput/dirac_diffusion.yml index ea425a58b..682b07e45 100644 --- a/test/testinput/dirac_diffusion.yml +++ b/test/testinput/dirac_diffusion.yml @@ -31,13 +31,13 @@ background error: multivariate strategy: univariate # or duplicated, if dealing with localization instead # the default is "univariate" horizontal: - filename: data_generated/parameters_diffusion_hz/hz_large.nc + filename: data_generated/parameters_diffusion/hz_large.nc vertical: - filename: data_generated/parameters_diffusion_vt/vt_5lvls.nc + filename: data_generated/parameters_diffusion/vt_5lvls.nc - name: group2 horizontal: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_generated/parameters_diffusion/hz_smaller.nc dirac: ixdir: [1, 17, 51, 31, 51, 63, 81, 14, 16, 43] @@ -46,7 +46,7 @@ dirac: ifdir: [1, 1, 3, 2, 1, 1, 1, 4, 5, 5] output dirac: - datadir: data_generated/dirac_diffusion + datadir: data_output/ date: *date exp: dirac_diffusion_%id% type: an diff --git a/test/testinput/dirac_horizfilt.yml b/test/testinput/dirac_horizfilt.yml deleted file mode 100644 index 709253ebd..000000000 --- a/test/testinput/dirac_horizfilt.yml +++ /dev/null @@ -1,58 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - date: &date 2018-04-15T00:00:00Z - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: &soca_vars [cicen, hicen, socn, tocn, ssh, hocn, mld, layer_depth] - -background error: - covariance model: SocaError - analysis variables: [none] - date: *date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [] - - name: ice - variables: [] - - linear variable change: - - input variables: *soca_vars - output variables: *soca_vars - - linear variable changes: - - linear variable change name: HorizFiltSOCA - niter: 2 - scale_dist: 1000e3 - scale_flow: 1.0 - filter variables: [tocn, socn, ssh, cicen, hicen] - input variables: *soca_vars - output variables: *soca_vars - -dirac: - ixdir: [1, 17, 41, 31, 51, 63, 81, 14, 16, 43] - iydir: [8, 21, 19, 33, 29, 26, 16, 41, 5, 43] - izdir: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - ifdir: [1, 2, 3, 3, 3, 3, 3, 3, 4, 5] - -output dirac: - datadir: data_generated/dirac_horizfilt - date: *date - exp: dirac_horizfilt_%id% - type: an - -test: - reference filename: testref/dirac_horizfilt.test - test output filename: testoutput/dirac_horizfilt.test \ No newline at end of file diff --git a/test/testinput/dirac_mlbalance.yml b/test/testinput/dirac_mlbalance.yml index d5d1321e6..ad0e2a99d 100644 --- a/test/testinput/dirac_mlbalance.yml +++ b/test/testinput/dirac_mlbalance.yml @@ -29,7 +29,7 @@ dirac: ifdir: [1, 1, 3, 2, 1, 1, 1, 4, 5, 5] output dirac: - datadir: data_generated/dirac_mlbalance + datadir: data_output/ date: *date exp: dirac_mlbalance_%id% type: an diff --git a/test/testinput/dirac_soca_cor_nicas_scales.yml b/test/testinput/dirac_soca_cor_nicas_scales.yml index 49e78c75f..3779d5ffd 100644 --- a/test/testinput/dirac_soca_cor_nicas_scales.yml +++ b/test/testinput/dirac_soca_cor_nicas_scales.yml @@ -40,7 +40,7 @@ dirac: ifdir: [1, 1, 3, 2, 1, 1, 1, 4, 5, 5] output dirac: - datadir: data_generated/dirac_soca_cor_nicas_scales + datadir: data_output/ date: *date exp: dirac_soca_cor_nicas_scales%id% type: an diff --git a/test/testinput/dirac_soca_cov.yml b/test/testinput/dirac_soca_cov.yml index bdc849be8..cf936501b 100644 --- a/test/testinput/dirac_soca_cov.yml +++ b/test/testinput/dirac_soca_cov.yml @@ -1,4 +1,4 @@ -geometry: +geometry: &geom geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc mom6_input_nml: data_static/72x35x25/input.nml fields metadata: data_static/fields_metadata.yml @@ -12,23 +12,23 @@ background: state variables: &soca_vars [cicen, hicen, socn, tocn, uocn, vocn, ssh, hocn, mld, layer_depth] background error: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, uocn, vocn, ssh] - date: *date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh] - - name: ice - variables: [cicen, hicen] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [cicen, hicen, uocn, vocn, tocn, socn, ssh] + geometry: *geom + group mapping: + - name: group1 + variables: [cicen, hicen, uocn, vocn, tocn, socn, ssh] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: - input variables: *soca_vars output variables: *soca_vars @@ -58,14 +58,6 @@ background error: input variables: *soca_vars output variables: *soca_vars - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - input variables: *soca_vars - output variables: *soca_vars - - linear variable change name: BalanceSOCA kst: dsdtmax: 0.1 @@ -87,7 +79,7 @@ dirac: ifdir: [1, 1, 3, 2, 1, 1, 1, 4, 5, 5, 8] output dirac: - datadir: data_generated/dirac_soca_cov + datadir: data_output/ date: *date exp: dirac_soca_cov.%id% type: an diff --git a/test/testinput/dirac_soca_mask.yml b/test/testinput/dirac_soca_mask.yml deleted file mode 100644 index fbcc126f3..000000000 --- a/test/testinput/dirac_soca_mask.yml +++ /dev/null @@ -1,54 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - date: &date 2018-04-15T00:00:00Z - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: &soca_vars [cicen, hicen, socn, tocn, ssh, hocn, mld, layer_depth] - -background error: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, ssh] - date: *date - bump: - drivers: - multivariate strategy: univariate - compute nicas: true - model: - do not cross mask boundaries: true - nicas: - resolution: 6.0 - correlation: - - name: ocn - base value: 1500.0e3 - rossby mult: 0.3 - variables: [tocn, socn, ssh] # I don't think variable names actually matter - # here, it just needs something - - name: ice - base value: 560224.089635854 - variables: [cicen, hicen] - - - name: wav - base value: 600.0e3 - variables: [swh] - -dirac: - ixdir: [37, 12, 64, 23, 61, 59] - iydir: [20, 15, 22, 29, 30, 11] - izdir: [1, 1, 1, 1, 1, 1] - ifdir: [1, 1, 1, 1, 1, 1] - -output dirac: - datadir: data_generated/dirac_soca_mask - date: *date - exp: dirac_soca_mask_%id% - type: an - -test: - reference filename: testref/dirac_soca_mask.test - test output filename: testoutput/dirac_soca_mask.test diff --git a/test/testinput/dirac_soca_nomask.yml b/test/testinput/dirac_soca_nomask.yml deleted file mode 100644 index 35b6d1ddc..000000000 --- a/test/testinput/dirac_soca_nomask.yml +++ /dev/null @@ -1,54 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - date: &date 2018-04-15T00:00:00Z - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: &soca_vars [cicen, hicen, socn, tocn, ssh, hocn, mld, layer_depth] - -background error: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, ssh] - date: *date - bump: - drivers: - multivariate strategy: univariate - compute nicas: true - model: - do not cross mask boundaries: 0 - nicas: - resolution: 6.0 - correlation: - - name: ocn - base value: 1500.0e3 - rossby mult: 0.3 - variables: [tocn, socn, ssh] # I don't think variable names actually matter - # here, it just needs something - - name: ice - base value: 560224.089635854 - variables: [cicen, hicen] - - - name: wav - base value: 600.0e3 - variables: [swh] - -dirac: - ixdir: [37, 12, 64, 23, 61, 59] - iydir: [20, 15, 22, 29, 30, 11] - izdir: [1, 1, 1, 1, 1, 1] - ifdir: [1, 1, 1, 1, 1, 1] - -output dirac: - datadir: data_generated/dirac_soca_nomask - date: *date - exp: dirac_soca_nomask_%id% - type: an - -test: - reference filename: testref/dirac_soca_nomask.test - test output filename: testoutput/dirac_soca_nomask.test diff --git a/test/testinput/dirac_socahyb_cov.yml b/test/testinput/dirac_socahyb_cov.yml index 2aa5ff49c..403f2984d 100644 --- a/test/testinput/dirac_socahyb_cov.yml +++ b/test/testinput/dirac_socahyb_cov.yml @@ -1,4 +1,4 @@ -geometry: +geometry: &geom geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc mom6_input_nml: data_static/72x35x25/input.nml fields metadata: data_static/fields_metadata.yml @@ -22,20 +22,21 @@ background error: covariance model: hybrid components: - covariance: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, uocn, vocn, ssh] - date: *date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh] - - name: ice - variables: [cicen, hicen] + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: [cicen, hicen, uocn, vocn, tocn, socn, ssh] + geometry: *geom + group mapping: + - name: group1 + variables: [cicen, hicen, uocn, vocn, tocn, socn, ssh] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: input variables: *soca_vars @@ -47,6 +48,7 @@ background error: efold_z: 2500.0 # [m] input variables: *soca_vars output variables: *soca_vars + - linear variable change name: BkgErrGODAS sst_bgerr_file: data_static/godas_sst_bgerr.nc t_min: 0.1 @@ -64,13 +66,7 @@ background error: hicen_max: 100.0 input variables: *soca_vars output variables: *soca_vars - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - input variables: *soca_vars - output variables: *soca_vars + - linear variable change name: BalanceSOCA kst: dsdtmax: 0.1 @@ -86,6 +82,7 @@ background error: output variables: *soca_vars weight: value: 0.5 + - covariance: covariance model: ensemble members: @@ -122,7 +119,7 @@ dirac: ifdir: [1, 1, 3, 2, 1, 1, 1, 5, 5, 8] output dirac: - datadir: data_generated/dirac_socahyb_cov + datadir: data_output/ date: *date exp: dirac_socahyb_cov_%id% type: an diff --git a/test/testinput/ensmeanandvariance.yml b/test/testinput/ensmeanandvariance.yml index 05e481971..7a26a617d 100644 --- a/test/testinput/ensmeanandvariance.yml +++ b/test/testinput/ensmeanandvariance.yml @@ -26,19 +26,19 @@ ensemble: ice_filename: restarts_ens/ice.enspert.ens.4.2018-04-15T00:00:00Z.PT0S.nc variance output: - datadir: data_generated/ensmeanandvariance + datadir: data_output/ exp: variance type: fc date: *date_bkg standard deviation output: - datadir: data_generated/ensmeanandvariance + datadir: data_output/ exp: stddev type: fc date: *date_bkg mean output: - datadir: data_generated/ensmeanandvariance + datadir: data_output/ exp: mean type: fc date: *date_bkg diff --git a/test/testinput/enspert.yml b/test/testinput/enspert.yml index d385c6688..578da455f 100644 --- a/test/testinput/enspert.yml +++ b/test/testinput/enspert.yml @@ -1,4 +1,4 @@ -geometry: +geometry: &geom geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc mom6_input_nml: data_static/72x35x25/input.nml fields metadata: data_static/fields_metadata.yml @@ -18,44 +18,25 @@ initial condition: state variables: *model_vars background error: - covariance model: SocaError - date: *date - analysis variables: &soca_vars [ssh, cicen, hicen, tocn, socn, uocn, vocn, chl, biop] - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - perturbation scales: - tocn: 1.0 - socn: 1.0 - ssh: 0.0 - cicen: 0.1 - hicen: 0.05 - chl: 0.1 - biop: 0.1 - uocn: 0.1 - vocn: 0.1 - correlation: - - name: ocn - variables: [tocn, ssh, socn, chl, biop, uocn, vocn] - - name: ice - variables: [cicen, hicen] - + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: &soca_vars [tocn, socn, ssh, uocn, vocn, cicen, hicen, chl, biop] + geometry: *geom + group mapping: + - name: group1 + variables: [tocn, socn, ssh, uocn, vocn, cicen, hicen,chl, biop] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: - linear variable changes: - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - input variables: *soca_vars - output variables: *soca_vars - - linear variable change name: BkgErrFILT ocean_depth_min: 1000 # [m] rescale_bkgerr: 1.0 @@ -72,22 +53,16 @@ background error: s_min: 0.0 s_max: 0.25 ssh_min: 0.0 # value at EQ - ssh_max: 0.1 # value in Extratropics + ssh_max: 0.0 # value in Extratropics ssh_phi_ex: 20 # lat of transition from extratropics - cicen_min: 0.1 - cicen_max: 0.5 - hicen_min: 10.0 - hicen_max: 100.0 - chl_min: 0.001 - chl_max: 30.0 + cicen_min: 0.01 + cicen_max: 0.05 + hicen_min: 0.5 + hicen_max: 5.0 + chl_min: 0.0001 + chl_max: 3.0 biop_min: 0.0 - biop_max: 1.0e-6 - input variables: *soca_vars - output variables: *soca_vars - - - linear variable change name: HorizFiltSOCA - niter: 1 - filter variables: *soca_vars + biop_max: 1.0e-7 input variables: *soca_vars output variables: *soca_vars @@ -111,7 +86,7 @@ forecast length: PT6H output: frequency: PT6H - datadir: data_generated/enspert + datadir: data_output/ exp: enspert type: ens date: *date diff --git a/test/testinput/ensrecenter.yml b/test/testinput/ensrecenter.yml index a65d247f5..33526f9e3 100644 --- a/test/testinput/ensrecenter.yml +++ b/test/testinput/ensrecenter.yml @@ -27,7 +27,7 @@ ensemble: nmembers: 4 recentered output: - datadir: data_generated/ensrecenter + datadir: data_output/ exp: ensrecenter type: ens date: *date_bkg diff --git a/test/testinput/errorcovariance.yml b/test/testinput/errorcovariance.yml deleted file mode 100644 index 9bf0d4836..000000000 --- a/test/testinput/errorcovariance.yml +++ /dev/null @@ -1,34 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -analysis variables: &soca_vars [cicen, hicen, socn, tocn, uocn, vocn, ssh] - -background: - read_from_file: 1 - date: &date 2018-04-15T00:00:00Z - basename: data_static/72x35x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: [cicen, hicen, socn, tocn, uocn, vocn, ssh, hocn] - -background error: - covariance model: SocaError - analysis variables: *soca_vars - date: *date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, uocn, vocn, ssh] - - name: ice - variables: [cicen, hicen] - -covariance test: - tolerance: 1e-10 - testinverse: false diff --git a/test/testinput/forecast_identity.yml b/test/testinput/forecast_identity.yml index 9894b197f..d16632d9a 100644 --- a/test/testinput/forecast_identity.yml +++ b/test/testinput/forecast_identity.yml @@ -22,7 +22,7 @@ forecast length: PT6H output: frequency: PT6H - datadir: data_generated/forecast_identity + datadir: data_output/ exp: forecast_identity date: 2018-04-15T00:00:00Z type: fc diff --git a/test/testinput/forecast_mom6.yml b/test/testinput/forecast_mom6.yml index 984c55abb..4bf299187 100644 --- a/test/testinput/forecast_mom6.yml +++ b/test/testinput/forecast_mom6.yml @@ -4,7 +4,7 @@ geometry: fields metadata: data_static/fields_metadata.yml model: - name: MOM6solo + name: UFS tstep: PT1H advance_mom6: 1 model variables: [cicen, hicen, socn, tocn, ssh, hocn, uocn, vocn, sw, lhf, shf, lw, us] @@ -21,7 +21,7 @@ forecast length: PT6H output: frequency: PT1H - datadir: data_generated/forecast_mom6 + datadir: data_output/ exp: forecast_mom6 date: *date type: fc diff --git a/test/testinput/forecast_mom6_bgc.yml b/test/testinput/forecast_mom6_bgc.yml index d000b9c99..fe7a33970 100644 --- a/test/testinput/forecast_mom6_bgc.yml +++ b/test/testinput/forecast_mom6_bgc.yml @@ -21,7 +21,7 @@ forecast length: PT6H output: frequency: PT6H - datadir: data_generated/forecast_mom6_bgc + datadir: data_output/ exp: forecast_mom6_bgc date: *date type: fc diff --git a/test/testinput/forecast_mom6_ens1.yml b/test/testinput/forecast_mom6_ens1.yml index 93b6942c3..d087819ec 100644 --- a/test/testinput/forecast_mom6_ens1.yml +++ b/test/testinput/forecast_mom6_ens1.yml @@ -21,7 +21,7 @@ forecast length: PT6H output: frequency: PT1H - datadir: data_generated/forecast_mom6_ens1 + datadir: data_output/ exp: fcst_ens1 date: *date type: fc \ No newline at end of file diff --git a/test/testinput/forecast_mom6_ens2.yml b/test/testinput/forecast_mom6_ens2.yml index 6ebc4eaaf..e80f5f43c 100644 --- a/test/testinput/forecast_mom6_ens2.yml +++ b/test/testinput/forecast_mom6_ens2.yml @@ -21,7 +21,7 @@ forecast length: PT6H output: frequency: PT1H - datadir: data_generated/forecast_mom6_ens2 + datadir: data_output/ exp: fcst_ens2 date: *date type: fc \ No newline at end of file diff --git a/test/testinput/forecast_mom6_ens3.yml b/test/testinput/forecast_mom6_ens3.yml index bd6bde079..4a72cf4b3 100644 --- a/test/testinput/forecast_mom6_ens3.yml +++ b/test/testinput/forecast_mom6_ens3.yml @@ -21,7 +21,7 @@ forecast length: PT6H output: frequency: PT1H - datadir: data_generated/forecast_mom6_ens3 + datadir: data_output/ exp: fcst_ens3 date: *date type: fc \ No newline at end of file diff --git a/test/testinput/forecast_pseudo.yml b/test/testinput/forecast_pseudo.yml index dc9606b1d..b5de54d8d 100644 --- a/test/testinput/forecast_pseudo.yml +++ b/test/testinput/forecast_pseudo.yml @@ -43,7 +43,7 @@ forecast length: PT6H output: frequency: PT6H - datadir: data_generated/forecast_pseudo + datadir: data_output/ exp: forecast_pseudo date: *date type: fc diff --git a/test/testinput/forecast_ufs.yml b/test/testinput/forecast_ufs.yml new file mode 100644 index 000000000..d16558806 --- /dev/null +++ b/test/testinput/forecast_ufs.yml @@ -0,0 +1,27 @@ +geometry: + mom6_input_nml: ./inputnml/input.nml + fields metadata: ./fields_metadata.yml + geom_grid_file: ./soca_gridspec.nc + +model: + name: UFS + tstep: PT1H + ufs_run_directory: Data/ModelRunDirs/UFS + model variables: [socn, tocn, uocn, vocn, ssh, hocn, sw, lhf, shf, lw, us] + +initial condition: + read_from_file: 1 + date: &date 2011-10-02T00:00:00Z + basename: ./Data/ModelRunDirs/UFS/INPUT/ + ocn_filename: MOM.res.nc + ice_filename: ../INPUT/iced.2011-10-02-00000.nc + state variables: [socn, tocn, uocn, vocn, ssh, hocn, sw, lhf, shf, lw, us] + +forecast length: PT6H + +output: + frequency: PT6H + datadir: Data + exp: mom6 + date: *date + type: fc diff --git a/test/testinput/gridgen.yml b/test/testinput/gridgen.yml index 80fc88575..f4aec0e09 100644 --- a/test/testinput/gridgen.yml +++ b/test/testinput/gridgen.yml @@ -1,5 +1,5 @@ geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc + geom_grid_file: data_output/soca_gridspec.72x35x25.nc save_local_domain: true full_init: true mom6_input_nml: data_static/72x35x25/input.nml @@ -8,7 +8,7 @@ geometry: # save the atlas mesh for viewing in gmsh gmsh save: true - gmsh filename: data_generated/gridgen/gmsh.msh + gmsh filename: data_output/gmsh.msh test: reference filename: testref/gridgen.test diff --git a/test/testinput/hofx_3d.yml b/test/testinput/hofx_3d.yml index a61537d8a..2a48fa705 100644 --- a/test/testinput/hofx_3d.yml +++ b/test/testinput/hofx_3d.yml @@ -23,7 +23,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/sst_coolskin.hofx_3d.nc + obsfile: data_output/sst_coolskin.nc obsdatain: engine: type: H5File @@ -37,7 +37,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/sst.hofx_3d.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -52,7 +52,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/sss.hofx_3d.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -67,7 +67,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/adt.hofx_3d.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -82,7 +82,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/prof.hofx_3d.nc + obsfile: data_output/prof.nc obsdatain: engine: type: H5File @@ -104,7 +104,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/prof_T.hofx_3d.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -120,7 +120,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/prof_S.hofx_3d.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File @@ -137,7 +137,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/icec.hofx_3d.nc + obsfile: data_output/icec.nc obsdatain: engine: type: H5File @@ -151,7 +151,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/icefb.hofx_3d.nc + obsfile: data_output/icefb.nc obsdatain: engine: type: H5File @@ -165,7 +165,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/chl.hofx_3d.nc + obsfile: data_output/chl.nc obsdatain: engine: type: H5File @@ -204,7 +204,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/uocn_surface.hofx_3d.nc + obsfile: data_output/uocn_surface.nc obsdatain: engine: type: H5File @@ -219,7 +219,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_3d/vocn_surface.hofx_3d.nc + obsfile: data_output/vocn_surface.nc obsdatain: engine: type: H5File diff --git a/test/testinput/hofx_4d.yml b/test/testinput/hofx_4d.yml index b35e640a2..074513cff 100644 --- a/test/testinput/hofx_4d.yml +++ b/test/testinput/hofx_4d.yml @@ -30,7 +30,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/sst_coolskin.hofx_4d.nc + obsfile: data_output/sst_coolskin.nc obsdatain: engine: type: H5File @@ -44,7 +44,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/sst.hofx_4d.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -59,7 +59,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/sss.hofx_4d.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -74,7 +74,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/adt.hofx_4d.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -88,7 +88,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/prof_T.hofx_4d.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -102,7 +102,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/prof_S.hofx_4d.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File @@ -120,7 +120,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/icec.hofx_4d.nc + obsfile: data_output/icec.nc obsdatain: engine: type: H5File @@ -134,7 +134,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/uocn_surface.hofx_4d.nc + obsfile: data_output/uocn_surface.nc obsdatain: engine: type: H5File @@ -149,7 +149,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d/vocn_surface.hofx_4d.nc + obsfile: data_output/vocn_surface.nc obsdatain: engine: type: H5File diff --git a/test/testinput/hofx_4d_pseudo.yml b/test/testinput/hofx_4d_pseudo.yml index 6c87df3a4..bf020ca62 100644 --- a/test/testinput/hofx_4d_pseudo.yml +++ b/test/testinput/hofx_4d_pseudo.yml @@ -39,7 +39,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d_pseudo/sst.hofx_4d_pseudo.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -54,7 +54,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d_pseudo/sss.hofx_4d_pseudo.nc + obsfile: data_output/sss.nc obsdatain: engine: type: H5File @@ -69,7 +69,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d_pseudo/adt.hofx_4d_pseudo.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -83,7 +83,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d_pseudo/prof_T.hofx_4d_pseudo.nc + obsfile: data_output/prof_T.nc obsdatain: engine: type: H5File @@ -97,7 +97,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_4d_pseudo/prof_S.hofx_4d_pseudo.nc + obsfile: data_output/prof_S.nc obsdatain: engine: type: H5File diff --git a/test/testinput/hofx_oasim_3d.yml b/test/testinput/hofx_oasim_3d.yml index ba8c70d21..2cf5c0ddc 100644 --- a/test/testinput/hofx_oasim_3d.yml +++ b/test/testinput/hofx_oasim_3d.yml @@ -25,7 +25,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/hofx_oasim_3d/pace_oasim.hofx_oasim_3d.nc + obsfile: data_output/pace_oasim.nc obsdatain: engine: type: H5File diff --git a/test/testinput/hybridgain.yml b/test/testinput/hybridgain.yml index 890c8eddc..d14e6ebf1 100644 --- a/test/testinput/hybridgain.yml +++ b/test/testinput/hybridgain.yml @@ -41,7 +41,7 @@ ensemble: ice_filename: restarts_ens/ice.enspert.ens.4.2018-04-15T00:00:00Z.PT0S.nc recentered output: - datadir: data_generated/hybridgain + datadir: data_output/ exp: hybridgain type: ens date: *date_bkg diff --git a/test/testinput/letkf.yml b/test/testinput/letkf.yml index 23e76f305..a159fbff3 100644 --- a/test/testinput/letkf.yml +++ b/test/testinput/letkf.yml @@ -28,7 +28,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/letkf/sst.letkf.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -60,7 +60,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/letkf/adt.letkf.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -99,31 +99,31 @@ local ensemble DA: mult: 1.1 output: - datadir: data_generated/letkf + datadir: data_output/ date: *date exp: letkf type: ens output mean prior: - datadir: data_generated/letkf + datadir: data_output/ date: *date exp: letkf type: fc output variance prior: - datadir: data_generated/letkf + datadir: data_output/ date: *date exp: letkf type: fc output variance posterior: - datadir: data_generated/letkf + datadir: data_output/ date: *date exp: letkf type: an output increment: - datadir: data_generated/letkf + datadir: data_output/ date: *date exp: letkf.inc type: an diff --git a/test/testinput/letkf_split_observer.yml b/test/testinput/letkf_split_observer.yml index 2d7107649..fd02fd283 100644 --- a/test/testinput/letkf_split_observer.yml +++ b/test/testinput/letkf_split_observer.yml @@ -35,7 +35,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/letkf_split_observer/sst.letkf_split_observer.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File @@ -64,7 +64,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/letkf_split_observer/adt.letkf_split_observer.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File @@ -89,7 +89,7 @@ local ensemble DA: solver: LETKF output: - datadir: data_generated/letkf_split_observer + datadir: data_output/ date: *date exp: letkf_split_observer type: ens diff --git a/test/testinput/letkf_split_solver.yml b/test/testinput/letkf_split_solver.yml index 6928ef796..7bc81248c 100644 --- a/test/testinput/letkf_split_solver.yml +++ b/test/testinput/letkf_split_solver.yml @@ -36,11 +36,11 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/letkf_split_solver/sst.letkf_split_solver.nc + obsfile: data_output/sst.nc obsdatain: engine: type: H5File - obsfile: data_generated/letkf_split_observer/sst.letkf_split_observer.nc + obsfile: data_generated/letkf_split_observer/sst.nc simulated variables: [seaSurfaceTemperature] obs operator: name: Identity @@ -63,11 +63,11 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/letkf_split_solver/adt.letkf_split_solver.nc + obsfile: data_output/adt.nc obsdatain: engine: type: H5File - obsfile: data_generated/letkf_split_observer/adt.letkf_split_observer.nc + obsfile: data_generated/letkf_split_observer/adt.nc simulated variables: [absoluteDynamicTopography] obs operator: name: ADT @@ -98,31 +98,31 @@ local ensemble DA: mult: 1.1 output: - datadir: data_generated/letkf_split_solver + datadir: data_output/ date: *date exp: letkf_split_solver type: ens output mean prior: - datadir: data_generated/letkf_split_solver + datadir: data_output/ date: *date exp: letkf_split_solver type: fc output variance prior: - datadir: data_generated/letkf_split_solver + datadir: data_output/ date: *date exp: letkf_split_solver.var type: fc output variance posterior: - datadir: data_generated/letkf_split_solver + datadir: data_output/ date: *date exp: letkf_split_solver.var type: an output increment: - datadir: data_generated/letkf_split_solver + datadir: data_output/ date: *date exp: letkf_split_solver.inc type: an diff --git a/test/testinput/linearmodel.yml b/test/testinput/linearmodel.yml deleted file mode 100644 index aab4eef8f..000000000 --- a/test/testinput/linearmodel.yml +++ /dev/null @@ -1,51 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -analysis variables: &soca_vars [cicen, hicen, socn, tocn, uocn, vocn, ssh, hocn, sw, lhf, shf, lw, us] - -model: - name: MOM6solo - tstep: PT1H - advance_mom6: 0 - model variables: *soca_vars - -model aux control: - -initial condition: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - ocn_sfc_filename: MOM.res.nc - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - date: &date 2018-04-15T00:00:00Z - state variables: *soca_vars - -linear model: - name: Identity - increment variables: *soca_vars - tstep: PT1H - -linear model test: - forecast length: PT2H - first multiplier TL: 0.01 - iterations TL: 1 - tolerance TL: 999.9e1 # Not testing tlm - tolerance AD: 1.0e-12 - -background error: - covariance model: SocaError - analysis variables: *soca_vars - date: *date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - correlation: - - name: ocn - variables: [socn, tocn, ssh, uocn, vocn, sw, lhf, shf, lw, us] - - name: ice - variables: [cicen, hicen] diff --git a/test/testinput/makeobs.yml b/test/testinput/makeobs.yml index 8e43c2c59..9a3f52dc4 100644 --- a/test/testinput/makeobs.yml +++ b/test/testinput/makeobs.yml @@ -30,7 +30,7 @@ observations: obsdataout: engine: type: H5File - obsfile: data_generated/makeobs/prof.nc + obsfile: data_output/prof.nc obsdatain: engine: type: H5File diff --git a/test/testinput/model.yml b/test/testinput/model.yml index c7331e9e4..273eff034 100644 --- a/test/testinput/model.yml +++ b/test/testinput/model.yml @@ -12,7 +12,7 @@ model test: test reforecast: false model: - name: MOM6solo + name: UFS tstep: PT1H advance_mom6: 1 # TODO issues with ustar/us changing after a forecast of len=0 diff --git a/test/testinput/model_ufs.yml b/test/testinput/model_ufs.yml new file mode 100644 index 000000000..79f3e7522 --- /dev/null +++ b/test/testinput/model_ufs.yml @@ -0,0 +1,32 @@ +geometry: + mom6_input_nml: ./inputnml/input.nml + fields metadata: ./fields_metadata.yml + +model aux control: + +model test: + forecast length: PT6H + final norm: 46525.68798221067845589 + tolerance: 1e-12 + test reforecast: false + +model: + name: UFS + tstep: PT1H + model variables: &soca_vars [cicen, hicen, socn, tocn, ssh, hocn] + +initial condition: + read_from_file: 1 + date: &date 2018-04-15T00:00:00Z + basename: ./INPUT/ + ocn_filename: MOM.res.nc + ice_filename: cice.res.nc + sfc_filename: sfc.res.nc + state variables: *soca_vars + +output: + frequency: PT3H + datadir: Data + exp: example + date: *date + type: fc diff --git a/test/testinput/parameters_bump_cor_nicas.yml b/test/testinput/parameters_bump_cor_nicas.yml index cd7ab8bf2..f22b25ad8 100644 --- a/test/testinput/parameters_bump_cor_nicas.yml +++ b/test/testinput/parameters_bump_cor_nicas.yml @@ -18,7 +18,7 @@ background error: saber block name: BUMP_NICAS calibration: io: - data directory: data_generated/parameters_bump_cor_nicas + data directory: data_output/ files prefix: bump drivers: multivariate strategy: univariate @@ -58,13 +58,13 @@ background error: output model files: - parameter: cor_rh file: - datadir: data_generated/parameters_bump_cor_nicas + datadir: data_output/ date: *date exp: parameters_bump_cor_nicas.cor_rh type: an - parameter: cor_rv file: - datadir: data_generated/parameters_bump_cor_nicas + datadir: data_output/ date: *date exp: parameters_bump_cor_nicas.cor_rv type: an diff --git a/test/testinput/parameters_bump_cor_nicas_scales.yml b/test/testinput/parameters_bump_cor_nicas_scales.yml index 47ffd5bb1..b5199aab3 100644 --- a/test/testinput/parameters_bump_cor_nicas_scales.yml +++ b/test/testinput/parameters_bump_cor_nicas_scales.yml @@ -17,7 +17,7 @@ background error: saber block name: BUMP_NICAS calibration: io: - data directory: data_generated/parameters_bump_cor_nicas_scales + data directory: data_output/ files prefix: bump drivers: multivariate strategy: univariate diff --git a/test/testinput/parameters_bump_cov.yml b/test/testinput/parameters_bump_cov.yml index f7781d1b5..264b92181 100644 --- a/test/testinput/parameters_bump_cov.yml +++ b/test/testinput/parameters_bump_cov.yml @@ -26,7 +26,7 @@ background error: saber block name: BUMP_NICAS calibration: io: - data directory: data_generated/parameters_bump_cov + data directory: data_output/ drivers: compute covariance: true compute correlation: true @@ -55,19 +55,19 @@ background error: output model files: - parameter: cor_rh file: - datadir: data_generated/parameters_bump_cov + datadir: data_output/ date: *date exp: parameters_bump_cov.cor_rh type: an - parameter: cor_rv file: - datadir: data_generated/parameters_bump_cov + datadir: data_output/ date: *date exp: parameters_bump_cov.cor_rv type: an - parameter: stddev file: - datadir: data_generated/parameters_bump_cov + datadir: data_output/ date: *date exp: parameters_bump_cov.stddev type: an diff --git a/test/testinput/parameters_bump_loc.yml b/test/testinput/parameters_bump_loc.yml index 0f92d2a98..dafab8cf7 100644 --- a/test/testinput/parameters_bump_loc.yml +++ b/test/testinput/parameters_bump_loc.yml @@ -17,7 +17,7 @@ background error: saber block name: BUMP_NICAS calibration: io: - data directory: data_generated/parameters_bump_loc + data directory: data_output/ files prefix: soca_bump_loc drivers: multivariate strategy: duplicated diff --git a/test/testinput/parameters_diffusion_hz.yml b/test/testinput/parameters_diffusion.yml similarity index 82% rename from test/testinput/parameters_diffusion_hz.yml rename to test/testinput/parameters_diffusion.yml index 41e4f9034..f24ba013a 100644 --- a/test/testinput/parameters_diffusion_hz.yml +++ b/test/testinput/parameters_diffusion.yml @@ -28,7 +28,7 @@ background error: filename: data_generated/setcorscales/ocn.cor_rh.incr.2018-04-15T00:00:00Z.nc variable name: ave_ssh write: - filename: data_generated/parameters_diffusion_hz/hz_large.nc + filename: data_output/hz_large.nc - name: hz_smaller horizontal: @@ -36,5 +36,11 @@ background error: as gaussian: true fixed value: 840336.134453782 write: - filename: data_generated/parameters_diffusion_hz/hz_smaller.nc + filename: data_output/hz_smaller.nc + - name: vt_5lvls + vertical: + as gaussian: true + fixed value: 5.0 + write: + filename: data_output/vt_5lvls.nc diff --git a/test/testinput/parameters_diffusion_vt.yml b/test/testinput/parameters_diffusion_vt.yml deleted file mode 100644 index 0895fad2f..000000000 --- a/test/testinput/parameters_diffusion_vt.yml +++ /dev/null @@ -1,31 +0,0 @@ -geometry: &geom - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - basename: data_static/72x35x25/restarts/ - date: &date 2018-04-15T06:00:00Z - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: &stateVariables [cicen, hicen, hsnon, socn, tocn, uocn, vocn, ssh] - -background error: - covariance model: SABER - saber central block: - saber block name: EXPLICIT_DIFFUSION - geometry: *geom - calibration: - normalization: - # NOTE, not actually used here, since the normalization spec is only used for hz - method: randomization #< other option is "brute force" - iterations: 1000 #< in the real world you'll want to use 1e4 or so - - groups: - - name: vt_5lvls - vertical: - as gaussian: true - fixed value: 5.0 - write: - filename: data_generated/parameters_diffusion_vt/vt_5lvls.nc \ No newline at end of file diff --git a/test/testinput/parametric_stddev.yml b/test/testinput/parametric_stddev.yml index 21140545c..004778d47 100644 --- a/test/testinput/parametric_stddev.yml +++ b/test/testinput/parametric_stddev.yml @@ -44,7 +44,7 @@ increments: date: 2018-04-15T00:00:00Z state variables: [ssh, tocn, socn, hocn, layer_depth, mld] output: - datadir: data_generated/parametric_stddev + datadir: data_output/ exp: parametric_stddev type: incr date: 2018-04-15T00:00:00Z diff --git a/test/testinput/setcorscales.yml b/test/testinput/setcorscales.yml index 183695769..0b9487cae 100644 --- a/test/testinput/setcorscales.yml +++ b/test/testinput/setcorscales.yml @@ -34,12 +34,12 @@ scales: min value: 5000000 rh output: - datadir: data_generated/setcorscales + datadir: data_output/ exp: cor_rh type: incr rv output: - datadir: data_generated/setcorscales + datadir: data_output/ exp: cor_rv type: incr diff --git a/test/testinput/sqrtvertloc.yml b/test/testinput/sqrtvertloc.yml index 90dd2ca04..dd8d4a2ef 100644 --- a/test/testinput/sqrtvertloc.yml +++ b/test/testinput/sqrtvertloc.yml @@ -1,4 +1,4 @@ -geometry: +geometry: &geom geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc mom6_input_nml: data_static/72x35x25/input.nml fields metadata: data_static/fields_metadata.yml @@ -14,29 +14,21 @@ background: state variables: *model_vars background error: - covariance model: SocaError - date: *date - analysis variables: &soca_vars [ssh, tocn, socn, uocn, vocn] - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - read local nicas: true - perturbation scales: - tocn: 1.0 - socn: 1.0 - ssh: 0.0 - cicen: 0.1 - hicen: 0.05 - chl: 0.1 - biop: 0.1 - uocn: 0.1 - vocn: 0.1 - correlation: - - name: ocn - variables: [tocn, ssh, socn, uocn, vocn] - + covariance model: SABER + saber central block: + saber block name: EXPLICIT_DIFFUSION + active variables: &soca_vars [ssh, tocn, socn, uocn, vocn] + geometry: *geom + group mapping: + - name: group1 + variables: [ssh, tocn, socn, uocn, vocn] + read: + groups: + - name: group1 + horizontal: + filename: data_generated/parameters_diffusion/hz_smaller.nc + vertical: + filename: data_generated/parameters_diffusion/vt_5lvls.nc linear variable change: @@ -44,13 +36,6 @@ background error: output variables: *soca_vars linear variable changes: - - linear variable change name: VertConvSOCA - Lz_min: 2.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 - input variables: *soca_vars - output variables: *soca_vars - linear variable change name: BkgErrFILT ocean_depth_min: 1000 # [m] @@ -81,12 +66,6 @@ background error: input variables: *soca_vars output variables: *soca_vars - - linear variable change name: HorizFiltSOCA - niter: 1 - filter variables: *soca_vars - input variables: *soca_vars - output variables: *soca_vars - - linear variable change name: BalanceSOCA kst: dsdtmax: 0.1 @@ -112,7 +91,7 @@ print test for each member: false output: frequency: PT6H - datadir: data_generated/sqrtvertloc + datadir: data_output/ exp: sqrtvertloc type: ens date: *date diff --git a/test/testinput/static_socaerror_init.yml b/test/testinput/static_socaerror_init.yml deleted file mode 100644 index dade97fb5..000000000 --- a/test/testinput/static_socaerror_init.yml +++ /dev/null @@ -1,46 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - date: &date 2018-04-15T00:00:00Z - basename: data_static/72x35x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - wav_filename: wav.res.nc - state variables: [cicen, hicen, hocn, socn, tocn, ssh, swh] - -background error: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, ssh, swh] - date: *date - bump: - io: - data directory: data_generated/static_socaerror_init - drivers: - multivariate strategy: univariate - compute nicas: true - write local nicas: true - model: - do not cross mask boundaries: true - nicas: - resolution: 6.0 - correlation: - - name: ocn - base value: 840336.134453782 - rossby mult: 0.280112045 - variables: [tocn, socn, ssh] # I don't think variable names actually matter - # here, it just needs something - - name: ice - base value: 560224.089635854 - variables: [cicen, hicen] - - - name: wav - base value: 600.0e3 - variables: [swh] - -test: - reference filename: testref/static_socaerror_init.test - test output filename: testoutput/static_socaerror_init.test \ No newline at end of file diff --git a/test/testinput/static_socaerrorlowres_init.yml b/test/testinput/static_socaerrorlowres_init.yml deleted file mode 100644 index 9d0352bfa..000000000 --- a/test/testinput/static_socaerrorlowres_init.yml +++ /dev/null @@ -1,40 +0,0 @@ -geometry: - geom_grid_file: data_static/36x17x25/soca_gridspec.nc - mom6_input_nml: data_static/36x17x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - date: &date 2018-04-15T00:00:00Z - basename: data_static/36x17x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: [cicen, hicen, hocn, socn, tocn, ssh] - -background error: - covariance model: SocaError - analysis variables: [cicen, hicen, socn, tocn, ssh] - date: *date - bump: - io: - data directory: data_generated/static_socaerrorlowres_init - drivers: - multivariate strategy: univariate - compute nicas: true - write local nicas: true - model: - do not cross mask boundaries: true - nicas: - resolution: 6.0 - correlation: - - name: ocn - base value: 840336.134453782 - rossby mult: 0.280112045 - variables: [tocn, socn, ssh] - - name: ice - base value: 560224.089635854 - variables: [cicen, hicen] - -test: - reference filename: testref/static_socaerrorlowres_init.test - test output filename: testoutput/static_socaerrorlowres_init.test diff --git a/test/testinput/varchange_horizfilt.yml b/test/testinput/varchange_horizfilt.yml deleted file mode 100644 index ae584d215..000000000 --- a/test/testinput/varchange_horizfilt.yml +++ /dev/null @@ -1,25 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - date: 2018-04-15T00:00:00Z - basename: data_static/72x35x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: &soca_vars [cicen, hicen, socn, tocn, uocn, vocn, ssh, hocn] - -linear variable change tests: -- tolerance inverse: 1e-12 - test inverse: 0 - linear variable change: - input variables: *soca_vars - output variables: *soca_vars - linear variable changes: - - linear variable change name: HorizFiltSOCA - niter: 3 - scale_flow: 0.5 - scale_dist: 1e6 - filter variables: *soca_vars diff --git a/test/testinput/varchange_vertconv.yml b/test/testinput/varchange_vertconv.yml deleted file mode 100644 index acb7b5895..000000000 --- a/test/testinput/varchange_vertconv.yml +++ /dev/null @@ -1,25 +0,0 @@ -geometry: - geom_grid_file: data_generated/gridgen/soca_gridspec.72x35x25.nc - mom6_input_nml: data_static/72x35x25/input.nml - fields metadata: data_static/fields_metadata.yml - -background: - read_from_file: 1 - date: &date 2018-04-15T00:00:00Z - basename: data_static/72x35x25/restarts/ - ocn_filename: MOM.res.nc - ice_filename: cice.res.nc - state variables: &soca_vars [cicen, hicen, socn, tocn, uocn, vocn, ssh, hocn, mld, layer_depth] - -linear variable change tests: -- tolerance inverse: 1e-12 - test inverse: 0 - linear variable change: - input variables: *soca_vars - output variables: *soca_vars - linear variable changes: - - linear variable change name: VertConvSOCA - Lz_min: 10.0 - Lz_mld: 1 - Lz_mld_max: 500.0 - scale_layer_thick: 1.5 diff --git a/test/testref/3dhyb_nicas.test b/test/testref/3dhyb.test similarity index 58% rename from test/testref/3dhyb_nicas.test rename to test/testref/3dhyb.test index 925ec6251..170e76e13 100644 --- a/test/testref/3dhyb_nicas.test +++ b/test/testref/3dhyb.test @@ -1,17 +1,17 @@ CostJb : Nonlinear Jb = 0.0000000000000000e+00 CostJo : Nonlinear Jo(ADT) = 2.1585990691658122e+02, nobs = 99, Jo/n = 2.1804031001674873e+00, err = 1.0000000149011613e-01 CostFunction: Nonlinear J = 2.1585990691658122e+02 -RPCGMinimizer: reduction in residual norm = 2.0278542668483262e-02 +RPCGMinimizer: reduction in residual norm = 3.9870354978736110e-02 CostFunction::addIncrement: Analysis: Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0056146432667122 max=1.0000434480583600 mean=0.1175242246348486 - hicen min=-0.1413856419177771 max=4.0326724340398767 mean=0.4667511916819216 + cicen min=-0.0034668556769321 max=1.0000172065042263 mean=0.1175139005298868 + hicen min=-0.1005327245329497 max=4.0326699282661229 mean=0.4688863516710726 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5752411330748970 - tocn min=-1.9023144155652594 max=31.7004647316036170 mean=6.0126723323091653 - uocn min=-0.8581829479207662 max=0.7001475429325790 mean=-0.0002551931980354 - vocn min=-0.7656538171046787 max=1.4377766492228294 mean=0.0021998376036591 - ssh min=-2.1694176164601044 max=0.9000136183949327 mean=-0.2940548329132784 + socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5500251890043870 + tocn min=-1.8829302786029214 max=31.7004646502589829 mean=6.0179841849602651 + uocn min=-0.8581754644046036 max=0.7001236525130016 mean=-0.0002574730692498 + vocn min=-0.7659202452377645 max=1.4377766540441910 mean=0.0021986265657238 + ssh min=-2.2047887174883636 max=0.8761143680955212 mean=-0.2999838219694667 hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 sw min=-225.0977630615234375 max=-0.0000000000000000 mean=-71.7393205198725354 lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100402226406899 @@ -23,6 +23,6 @@ layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.522 -CostJb : Nonlinear Jb = 6.5547828627305975 -CostJo : Nonlinear Jo(ADT) = 114.6707726257995716, nobs = 99, Jo/n = 1.1582906325838340, err = 0.1000000014901161 -CostFunction: Nonlinear J = 121.2255554885301763 +CostJb : Nonlinear Jb = 1.2080455649053341 +CostJo : Nonlinear Jo(ADT) = 50.2704673354596707, nobs = 99, Jo/n = 0.5077824983379765, err = 0.1000000014901161 +CostFunction: Nonlinear J = 51.4785129003650042 diff --git a/test/testref/3dhybfgat.test b/test/testref/3dhybfgat.test index cbd8b51a5..ece9f6b27 100644 --- a/test/testref/3dhybfgat.test +++ b/test/testref/3dhybfgat.test @@ -1,27 +1,22 @@ CostJb : Nonlinear Jb = 0.0000000000000000e+00 CostJo : Nonlinear Jo(ADT) = 8.9263199495715384e+01, nobs = 31, Jo/n = 2.8794580482488832e+00, err = 1.0000000149011612e-01 CostFunction: Nonlinear J = 8.9263199495715384e+01 -RPCGMinimizer: reduction in residual norm = 2.2974579865453482e-03 +RPCGMinimizer: reduction in residual norm = 1.4980217769370795e-02 CostFunction::addIncrement: Analysis: - Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0055835768576505 max=1.0000000247374747 mean=0.1174843286065790 - hicen min=-0.0904135934870815 max=4.0326673084246947 mean=0.4695664192299835 - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5591969472174938 - uocn min=-0.8581694072579173 max=0.7001571489147213 mean=-0.0002536877886094 - vocn min=-0.7661101226337028 max=1.4377766409421606 mean=0.0021980788786207 - tocn min=-1.8883899367430028 max=31.7004645720658580 mean=6.0146342801152750 - ssh min=-1.9233114908733457 max=0.8929429832935600 mean=-0.2876667952783921 - hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 - sw min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - lhf min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - shf min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - lw min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - us min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 + Valid time: 2018-04-15T03:00:00Z + cicen min=-0.0033030536158987 max=1.0000000158694204 mean=0.1175029873670623 + hicen min=-0.0545728056070210 max=4.0326673084246947 mean=0.4703279114085800 + socn min=10.7210460395083924 max=40.4416591681037119 mean=34.5499340634548631 + uocn min=-0.8496117828509079 max=0.6891013339628880 mean=0.0000348497562169 + vocn min=-0.9319463183228819 max=0.9467331746277857 mean=0.0016148089045849 + tocn min=-1.8879950754088255 max=31.6932489128285653 mean=6.0153354551597769 + ssh min=-1.9094019232348816 max=0.8552645878360341 mean=-0.2945184642421328 + hocn min=0.0009178261947465 max=1346.5803472041777695 mean=128.6280879778919370 mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 -CostJb : Nonlinear Jb = 2.3393789469964523 -CostJo : Nonlinear Jo(ADT) = 72.5294885813376595, nobs = 31, Jo/n = 2.3396609219786342, err = 0.1000000014901161 -CostFunction: Nonlinear J = 74.8688675283341070 +CostJb : Nonlinear Jb = 0.5896333178646905 +CostJo : Nonlinear Jo(ADT) = 20.0755581679565189, nobs = 31, Jo/n = 0.6475986505792426, err = 0.1000000014901161 +CostFunction: Nonlinear J = 20.6651914858212109 diff --git a/test/testref/3dvar_diffusion.test b/test/testref/3dvar.test similarity index 100% rename from test/testref/3dvar_diffusion.test rename to test/testref/3dvar.test diff --git a/test/testref/3dvar_godas.test b/test/testref/3dvar_godas.test deleted file mode 100644 index a36a198b4..000000000 --- a/test/testref/3dvar_godas.test +++ /dev/null @@ -1,44 +0,0 @@ -CostJb : Nonlinear Jb = 0.0000000000000000e+00 -CostJo : Nonlinear Jo(CoolSkin) = 1.6662193028378610e+04, nobs = 199, Jo/n = 8.3729613207932715e+01, err = 3.6419991997020579e-01 -CostJo : Nonlinear Jo(SeaSurfaceTemp) = 1.6138515459546179e+03, nobs = 174, Jo/n = 9.2750088847966552e+00, err = 3.6280357515271239e-01 -CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 5.5606890102213500e+00, nobs = 29, Jo/n = 1.9174789690418448e-01, err = 1.0000000000000000e+00 -CostJo : Nonlinear Jo(ADT) = 1.0183179843106859e-02, nobs = 94, Jo/n = 1.0833170045858361e-04, err = 2.7969331641360029e+01 -CostJo : Nonlinear Jo(InsituTemperature) = 3.5224618031508840e+02, nobs = 206, Jo/n = 1.7099329141509145e+00, err = 8.9914415723945484e-01 -CostJo : Nonlinear Jo(InsituSalinity) = 3.4706220681200762e+02, nobs = 218, Jo/n = 1.5920284716147139e+00, err = 6.0819699545777528e-01 -CostJo : Nonlinear Jo(SeaIceFraction) = 5.9780675099388782e+02, nobs = 89, Jo/n = 6.7169297864481781e+00, err = 1.0000000149011612e-01 -CostFunction: Nonlinear J = 1.9578730584644272e+04 -RPCGMinimizer: reduction in residual norm = 1.3835204684592348e-01 -CostFunction::addIncrement: Analysis: - Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0000754351015983 max=1.0003473321988883 mean=0.1175504050745892 - hicen min=0.0000000000000000 max=4.0326673084246947 mean=0.4712515705773916 - hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5443926214474004 - tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0184359934491134 - ssh min=-1.9244129564152344 max=0.9272827077132950 mean=-0.2767862293413312 - hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 - sw min=-225.0944189546596022 max=0.0000000000000000 mean=-71.7382886319574595 - lhf min=-38.1375462432529417 max=256.5949858143854385 mean=42.0096925172668492 - shf min=-58.9492932951061732 max=201.3742507522742926 mean=6.0753280052543435 - lw min=0.0000000000000000 max=88.0360941609201433 mean=31.3955350224489038 - us min=0.0044035807951232 max=0.0196691484916628 mean=0.0086904765642143 - mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 -layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 - - - - - - - - - -CostJb : Nonlinear Jb = 0.4608661630977090 -CostJo : Nonlinear Jo(CoolSkin) = 16105.3314205920578388, nobs = 199, Jo/n = 80.9313136713168717, err = 0.3641999199702058 -CostJo : Nonlinear Jo(SeaSurfaceTemp) = 1581.1942000180506511, nobs = 174, Jo/n = 9.0873229886094862, err = 0.3628035751527124 -CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 5.5600831894793306, nobs = 29, Jo/n = 0.1917270065337700, err = 1.0000000000000000 -CostJo : Nonlinear Jo(ADT) = 0.0101835734665084, nobs = 94, Jo/n = 0.0001083358879416, err = 27.9693316413600286 -CostJo : Nonlinear Jo(InsituTemperature) = 349.7151439586605193, nobs = 206, Jo/n = 1.6976463298964102, err = 0.8991441572394548 -CostJo : Nonlinear Jo(InsituSalinity) = 345.6508595190978212, nobs = 218, Jo/n = 1.5855544014637515, err = 0.6081969954577753 -CostJo : Nonlinear Jo(SeaIceFraction) = 596.9325970112806772, nobs = 89, Jo/n = 6.7071078315874235, err = 0.1000000014901161 -CostFunction: Nonlinear J = 18984.8553540251923550 diff --git a/test/testref/3dvarbump.test b/test/testref/3dvar_nicas.test similarity index 100% rename from test/testref/3dvarbump.test rename to test/testref/3dvar_nicas.test diff --git a/test/testref/3dvar_soca.test b/test/testref/3dvar_soca.test deleted file mode 100644 index cddb2b136..000000000 --- a/test/testref/3dvar_soca.test +++ /dev/null @@ -1,52 +0,0 @@ -CostJb : Nonlinear Jb = 0.0000000000000000e+00 -CostJo : Nonlinear Jo(CoolSkin) = 1.4157601528361320e+04, nobs = 174, Jo/n = 8.1365526025065051e+01, err = 3.6280357515271239e-01 -CostJo : Nonlinear Jo(SeaSurfaceTemp) = 7.5931295131110767e+02, nobs = 147, Jo/n = 5.1653942266061748e+00, err = 3.6246510156485134e-01 -CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 5.5606890102213500e+00, nobs = 29, Jo/n = 1.9174789690418448e-01, err = 1.0000000000000000e+00 -CostJo : Nonlinear Jo(ADT) = 1.4372757157930062e+02, nobs = 91, Jo/n = 1.5794238635087980e+00, err = 1.0000000149011612e-01 -CostJo : Nonlinear Jo(InsituTS) = 6.9930838712709647e+02, nobs = 424, Jo/n = 1.6493122337903219e+00, err = 7.6352859169821519e-01 -CostJo : Nonlinear Jo(SeaIceFraction) = 5.9780675099388782e+02, nobs = 89, Jo/n = 6.7169297864481781e+00, err = 1.0000000149011612e-01 -CostJo : Nonlinear Jo(SeaSurfaceChlorophyll) = 1.4458385226088194e+03, nobs = 129, Jo/n = 1.1208050562859064e+01, err = 6.1865027747001339e-02 -CostJo : Nonlinear Jo(SeaSurfaceBiomassP) = 4.1314922104098389e+02, nobs = 112, Jo/n = 3.6888323307230704e+00, err = 1.1692603016453901e-08 -CostJo : Nonlinear Jo(SeaSurfaceHS) = 1.0896018677668044e+03, nobs = 6, Jo/n = 1.8160031129446739e+02, err = 1.0000000149011612e-01 -CostFunction: Nonlinear J = 1.9311907489799538e+04 -RPCGMinimizer: reduction in residual norm = 1.3402618654497631e-01 -CostFunction::addIncrement: Analysis: - Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0002282886867696 max=1.0005179719830262 mean=0.1175678671098138 - hicen min=0.0000000000000000 max=4.0326673084246947 mean=0.4712515705773916 - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5444211660595002 - tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0196030008517063 - ssh min=-1.9246382205580554 max=0.9272962729193626 mean=-0.2767130691769688 - hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 - sw min=-225.0945891510099557 max=0.0000000000000000 mean=-71.7381140163989670 - lhf min=-38.1375737514043962 max=256.5946551277779122 mean=42.0096224129795885 - shf min=-58.9492919527147166 max=201.3742279803042834 mean=6.0753258412895699 - lw min=0.0000000000000000 max=88.0360975609150671 mean=31.3955360810577524 - us min=0.0044068623480315 max=0.0196746441302030 mean=0.0086958479050523 - chl min=-0.0000167125599378 max=4.6719899196170607 mean=0.1184781301658333 - biop min=0.0000000000000000 max=0.0000001868533390 mean=0.0000000065395176 - swh min=0.0000996535891318 max=6.7491955757141104 mean=1.0621548838297779 - mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 -layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 - - - - - - - - - - - -CostJb : Nonlinear Jb = 5.0766926207036915 -CostJo : Nonlinear Jo(CoolSkin) = 13614.4025134652438283, nobs = 174, Jo/n = 78.2436926061220959, err = 0.3628035751527124 -CostJo : Nonlinear Jo(SeaSurfaceTemp) = 754.5052266934287672, nobs = 147, Jo/n = 5.1326886169621009, err = 0.3624651015648513 -CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 5.5601406509535618, nobs = 29, Jo/n = 0.1917289879639159, err = 1.0000000000000000 -CostJo : Nonlinear Jo(ADT) = 143.6910481205183032, nobs = 91, Jo/n = 1.5790225068188823, err = 0.1000000014901161 -CostJo : Nonlinear Jo(InsituTS) = 697.7958429828694307, nobs = 424, Jo/n = 1.6457449126954469, err = 0.7635285916982152 -CostJo : Nonlinear Jo(SeaIceFraction) = 596.5019199614746412, nobs = 89, Jo/n = 6.7022687636120750, err = 0.1000000014901161 -CostJo : Nonlinear Jo(SeaSurfaceChlorophyll) = 1426.1607951953308202, nobs = 129, Jo/n = 11.0555100402738820, err = 0.0618650277470013 -CostJo : Nonlinear Jo(SeaSurfaceBiomassP) = 408.8405781144248294, nobs = 112, Jo/n = 3.6503623045930786, err = 0.0000000116926030 -CostJo : Nonlinear Jo(SeaSurfaceHS) = 1086.4561029445733311, nobs = 6, Jo/n = 181.0760171574288790, err = 0.1000000014901161 -CostFunction: Nonlinear J = 18738.9908607495199249 diff --git a/test/testref/3dvarfgat.test b/test/testref/3dvarfgat.test index f3e6f1503..d24aca68e 100644 --- a/test/testref/3dvarfgat.test +++ b/test/testref/3dvarfgat.test @@ -8,22 +8,22 @@ CostJo : Nonlinear Jo(InsituSalinity) = 1.6508706355428757e+01, nobs = 33, Jo/ CostJo : Nonlinear Jo(SeaIceFraction) = 2.1321063827480032e+02, nobs = 24, Jo/n = 8.8837765947833471e+00, err = 1.0000000149011612e-01 CostJo : Nonlinear Jo(SurfaceU) = 4.3460942444785389e-01, nobs = 47, Jo/n = 9.2470090308054021e-03, err = 3.8763169345842458e-01 CostFunction: Nonlinear J = 5.6461327645193933e+03 -RPCGMinimizer: reduction in residual norm = 5.6178702552446091e-01 +RPCGMinimizer: reduction in residual norm = 4.6112676030006933e-02 CostFunction::addIncrement: Analysis: - Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0022725342326849 max=1.0071714999055685 mean=0.1183105445866739 + Valid time: 2018-04-15T03:00:00Z + cicen min=-0.0000005760778840 max=1.0000409982510869 mean=0.1175184988134157 hicen min=0.0000000000000000 max=4.0326673084246947 mean=0.4712515705773916 - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5447117137308908 - tocn min=-1.8883899372702533 max=35.0173379463343792 mean=6.0317923556482098 - uocn min=-0.8581727353768411 max=0.7001168259257196 mean=-0.0002591032215534 - vocn min=-0.7661101215480253 max=1.4377766409421606 mean=0.0021972630399530 - ssh min=-1.9231541458800032 max=0.9261896006978204 mean=-0.2765593352101705 - hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 - sw min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - lhf min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - shf min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - lw min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - us min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 + socn min=10.7210460395083924 max=40.4416591681037119 mean=34.5459714907122546 + tocn min=-1.8879950757380115 max=31.6932489128285653 mean=6.0156782559892310 + uocn min=-0.8496117760638658 max=0.6890666989074180 mean=0.0000321918195046 + vocn min=-0.9321576238931384 max=0.9467331169326910 mean=0.0016143192702768 + ssh min=-1.9092721861416226 max=0.9091625673630059 mean=-0.2765778738380595 + hocn min=0.0009178261947465 max=1346.5803472041777695 mean=128.6280879778919370 + sw min=-225.0977630615234375 max=0.0000000000000000 mean=-71.7392389260509162 + lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100143121205249 + shf min=-58.9492949566478615 max=201.3742981964446983 mean=6.0753342975462568 + lw min=0.0000000000000000 max=88.0360870534941711 mean=31.3955294750297895 + us min=0.0000000000000000 max=0.0191600705253541 mean=0.0072078703473840 mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 @@ -36,13 +36,13 @@ layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.522 -CostJb : Nonlinear Jb = 296.6626681147955082 -CostJo : Nonlinear Jo(CoolSkin) = 3464.8709900691237635, nobs = 47, Jo/n = 73.7206593631728424, err = 0.3876316934584246 -CostJo : Nonlinear Jo(SeaSurfaceTemp) = 1007.5664244251975106, nobs = 43, Jo/n = 23.4317773122138959, err = 0.3858153492966185 -CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 1.8650987567220949, nobs = 16, Jo/n = 0.1165686722951309, err = 1.0000000000000000 -CostJo : Nonlinear Jo(ADT) = 33.7366124865940051, nobs = 28, Jo/n = 1.2048790173783572, err = 0.1000000014901161 -CostJo : Nonlinear Jo(InsituTemperature) = 35.6268586770523115, nobs = 31, Jo/n = 1.1492535057113649, err = 0.9089399165824681 -CostJo : Nonlinear Jo(InsituSalinity) = 16.2643999881490444, nobs = 33, Jo/n = 0.4928606057014862, err = 0.6104299683323671 -CostJo : Nonlinear Jo(SeaIceFraction) = 204.0624792604356514, nobs = 24, Jo/n = 8.5026033025181516, err = 0.1000000014901161 -CostJo : Nonlinear Jo(SurfaceU) = 0.4387891603871751, nobs = 47, Jo/n = 0.0093359395827059, err = 0.3876316934584246 -CostFunction: Nonlinear J = 5061.0943209384577131 +CostJb : Nonlinear Jb = 0.0000029576648265 +CostJo : Nonlinear Jo(CoolSkin) = 4963.8330973286119843, nobs = 47, Jo/n = 105.6134701559279137, err = 0.3876316934584246 +CostJo : Nonlinear Jo(SeaSurfaceTemp) = 316.5603460257121355, nobs = 43, Jo/n = 7.3618685122258638, err = 0.3858153492966185 +CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 1.8675903348020022, nobs = 16, Jo/n = 0.1167243959251251, err = 1.0000000000000000 +CostJo : Nonlinear Jo(ADT) = 33.6558868043491515, nobs = 28, Jo/n = 1.2019959572981840, err = 0.1000000014901161 +CostJo : Nonlinear Jo(InsituTemperature) = 36.8007218825831899, nobs = 31, Jo/n = 1.1871200607284900, err = 0.9089399165824681 +CostJo : Nonlinear Jo(InsituSalinity) = 16.5054035799724659, nobs = 33, Jo/n = 0.5001637448476505, err = 0.6104299683323671 +CostJo : Nonlinear Jo(SeaIceFraction) = 213.1614466523695057, nobs = 24, Jo/n = 8.8817269438487294, err = 0.1000000014901161 +CostJo : Nonlinear Jo(SurfaceU) = 0.5287339777547750, nobs = 47, Jo/n = 0.0112496591011654, err = 0.3876316934584246 +CostFunction: Nonlinear J = 5582.9132295438212168 diff --git a/test/testref/3dvarfgat_pseudo.test b/test/testref/3dvarfgat_pseudo.test index f8258c2fb..51a0e9c86 100644 --- a/test/testref/3dvarfgat_pseudo.test +++ b/test/testref/3dvarfgat_pseudo.test @@ -5,17 +5,17 @@ CostJo : Nonlinear Jo(ADT) = 3.3642363906175710e+01, nobs = 28, Jo/n = 1.20151 CostJo : Nonlinear Jo(InsituTemperature) = 3.6796005403262150e+01, nobs = 31, Jo/n = 1.1869679162342630e+00, err = 9.0893991658246809e-01 CostJo : Nonlinear Jo(InsituSalinity) = 1.6508706355428757e+01, nobs = 33, Jo/n = 5.0026382895238652e-01, err = 6.1042996833236707e-01 CostFunction: Nonlinear J = 4.0537754836284546e+02 -RPCGMinimizer: reduction in residual norm = 1.8182689565095317e-01 +RPCGMinimizer: reduction in residual norm = 4.7495290319153927e-01 CostFunction::addIncrement: Analysis: - Valid time: 2018-04-15T00:00:00Z - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5452665776760668 - tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0092886251965192 - ssh min=-1.9234536812972050 max=0.8630006309218333 mean=-0.2808622146415468 - hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 - uocn min=-0.8581693992488438 max=0.7000954286848975 mean=-0.0002591771954069 - vocn min=-0.7661101215480253 max=1.4377766409421606 mean=0.0021972630399530 - mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 -layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 + Valid time: 2018-04-15T03:00:00Z + socn min=10.7210460395083924 max=40.4416591681037119 mean=34.5478694054705926 + tocn min=-1.8879950757380115 max=31.6932489128285653 mean=6.0059916691693926 + ssh min=-1.9139500304546440 max=0.8583109965626627 mean=-0.2851516224770917 + hocn min=0.0009178261947465 max=1346.5803472041777695 mean=128.6280879778919370 + uocn min=-0.8496117748396494 max=0.6890666856088563 mean=0.0000321916028576 + vocn min=-0.9321576238931384 max=0.9467331169326910 mean=0.0016143192702768 + mld min=2.2774359470406269 max=4593.1214862189353880 mean=192.6371623604598540 +layer_depth min=2.2774359470406269 max=5658.2958090376268956 mean=1200.5228825300762310 @@ -23,10 +23,10 @@ layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.522 -CostJb : Nonlinear Jb = 894.2119641389274420 -CostJo : Nonlinear Jo(SeaSurfaceTemp) = 310.7629122178200305, nobs = 43, Jo/n = 7.2270444701818608, err = 0.3858153492966185 -CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 1.8677352690905340, nobs = 16, Jo/n = 0.1167334543181584, err = 1.0000000000000000 -CostJo : Nonlinear Jo(ADT) = 33.3927331518513029, nobs = 28, Jo/n = 1.1925976125661180, err = 0.1000000014901161 -CostJo : Nonlinear Jo(InsituTemperature) = 36.7960054032621500, nobs = 31, Jo/n = 1.1869679162342630, err = 0.9089399165824681 -CostJo : Nonlinear Jo(InsituSalinity) = 16.5087063554287568, nobs = 33, Jo/n = 0.5002638289523865, err = 0.6104299683323671 -CostFunction: Nonlinear J = 1293.5400565363802343 +CostJb : Nonlinear Jb = 7.2594347961551886 +CostJo : Nonlinear Jo(SeaSurfaceTemp) = 69.8552661381236391, nobs = 43, Jo/n = 1.6245410729796195, err = 0.3858153492966185 +CostJo : Nonlinear Jo(SeaSurfaceSalinity) = 1.8040081107455399, nobs = 16, Jo/n = 0.1127505069215962, err = 1.0000000000000000 +CostJo : Nonlinear Jo(ADT) = 20.6794236513937193, nobs = 28, Jo/n = 0.7385508446926329, err = 0.1000000014901161 +CostJo : Nonlinear Jo(InsituTemperature) = 31.7213229681504849, nobs = 31, Jo/n = 1.0232684828435641, err = 0.9089399165824681 +CostJo : Nonlinear Jo(InsituSalinity) = 10.4361719430766851, nobs = 33, Jo/n = 0.3162476346386874, err = 0.6104299683323671 +CostFunction: Nonlinear J = 141.7556276076452377 diff --git a/test/testref/4dhybenvar.test b/test/testref/4dhybenvar.test index e7b45325a..cc20e418e 100644 --- a/test/testref/4dhybenvar.test +++ b/test/testref/4dhybenvar.test @@ -1,11 +1,11 @@ CostJb : Nonlinear Jb = 0.0000000000000000e+00 CostJo : Nonlinear Jo(SeaSufaceTemp) = 3.4432086113911851e+02, nobs = 47, Jo/n = 7.3259757689174148e+00, err = 3.8763169345842458e-01 CostFunction: Nonlinear J = 3.4432086113911851e+02 -RPCGMinimizer: reduction in residual norm = 1.7912022886176753e-02 +RPCGMinimizer: reduction in residual norm = 1.6672442760066197e-02 CostFunction::addIncrement: Analysis: Valid time: 2018-04-15T00:00:00Z socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5443897261524953 - tocn min=-1.8884036663191468 max=31.7004645720338800 mean=6.0161022045356045 + tocn min=-1.8882105135350051 max=31.7004833980417260 mean=6.0073633688812693 uocn min=-0.8581693992488438 max=0.7000954286848975 mean=-0.0002591771954069 vocn min=-0.7661101215480253 max=1.4377766409421606 mean=0.0021972630399530 ssh min=-1.9244847628277935 max=0.9272826517867588 mean=-0.2767903423591662 @@ -13,7 +13,7 @@ CostFunction::addIncrement: Analysis: layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 Valid time: 2018-04-15T03:00:00Z socn min=10.7210460395083924 max=40.4416591681037119 mean=34.5459713920834233 - tocn min=-1.8880088047869050 max=31.6932489127965873 mean=6.0142100184646248 + tocn min=-1.8878156520027634 max=31.6932677388044333 mean=6.0054711779263448 uocn min=-0.8496117748396494 max=0.6890666856088563 mean=0.0000321916028576 vocn min=-0.9321576238931384 max=0.9467331169326910 mean=0.0016143192702768 ssh min=-1.9092725357352314 max=0.9091665415750726 mean=-0.2765781634769230 @@ -21,7 +21,7 @@ layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.522 layer_depth min=2.2774359470406269 max=5658.2958090376268956 mean=1200.5228825300762310 Valid time: 2018-04-15T06:00:00Z socn min=10.7210460395083924 max=40.4416591598428923 mean=34.5467399790273930 - tocn min=-1.8875058356652230 max=31.6858695414262215 mean=6.0137196534919584 + tocn min=-1.8873126828810813 max=31.6858883674340674 mean=6.0049808072031103 uocn min=-0.8416820355059554 max=0.6786386084306094 mean=0.0002717176669510 vocn min=-1.1593584500375382 max=0.9487438635750088 mean=0.0003618099374769 ssh min=-1.9078432544437094 max=0.9075559090823697 mean=-0.2765830659083295 @@ -30,6 +30,6 @@ layer_depth min=2.2683307266867532 max=5658.3141547773811908 mean=1200.522 -CostJb : Nonlinear Jb = 25.3689383254706229 -CostJo : Nonlinear Jo(SeaSufaceTemp) = 14.1177176994760902, nobs = 47, Jo/n = 0.3003769723292785, err = 0.3876316934584246 -CostFunction: Nonlinear J = 39.4866560249467113 +CostJb : Nonlinear Jb = 23.6993180524819245 +CostJo : Nonlinear Jo(SeaSufaceTemp) = 12.1259583754454567, nobs = 47, Jo/n = 0.2579991143711799, err = 0.3876316934584246 +CostFunction: Nonlinear J = 35.8252764279273777 diff --git a/test/testref/addincrement.test b/test/testref/addincrement.test index a92d53cb9..3a3136678 100644 --- a/test/testref/addincrement.test +++ b/test/testref/addincrement.test @@ -14,15 +14,15 @@ layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.522 Increment: Valid time: 2018-04-15T00:00:00Z hsnon min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=-0.0001690995347179 max=0.0038940161787005 mean=0.0000028952948985 - tocn min=-0.0937972082266029 max=0.0997618261536270 mean=0.0008710350957508 + socn min=-0.0003650232880738 max=0.0121100304079027 mean=0.0000121413142709 + tocn min=-0.2288274475241922 max=0.1912045489894477 mean=0.0017103542723563 State plus increment: Valid time: 2018-04-15T00:00:00Z cicen min=0.0000000000000000 max=1.0000000000000000 mean=0.1175125761012928 hicen min=0.0000000000000000 max=4.0326673084246947 mean=0.4712515705773916 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5443926214474004 - tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0184359934491134 + socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5444018674667745 + tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0192753126257168 ssh min=-1.9244847628277935 max=0.9272826517867588 mean=-0.2767903423591662 hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 uocn min=-0.8581693992488438 max=0.7000954286848975 mean=-0.0002591771954069 diff --git a/test/testref/checkpointmodel.test b/test/testref/checkpointmodel.test index d927be231..9f5a34a14 100644 --- a/test/testref/checkpointmodel.test +++ b/test/testref/checkpointmodel.test @@ -7,12 +7,12 @@ input background: analysis: Valid time: 2018-04-15T00:00:00Z - socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5443926214474004 - tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0184359934491134 + socn min=10.7210460395083924 max=40.4416591897031168 mean=34.5444018674667745 + tocn min=-1.8883899372702533 max=31.7004645720658580 mean=6.0192753126257168 hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 output background: Valid time: 2018-04-15T00:00:00Z - socn min=10.7210460395083924 max=38.0000000000000000 mean=34.5397730325752050 - tocn min=-1.8000000000000000 max=31.7004645720658580 mean=6.0185743158039484 + socn min=10.7210460395083924 max=38.0000000000000000 mean=34.5397822785945863 + tocn min=-1.8000000000000000 max=31.7004645720658580 mean=6.0194137897063893 hocn min=0.0009999999999977 max=1345.6400000000003274 mean=128.6280642065023017 diff --git a/test/testref/convertincrement.test b/test/testref/convertincrement.test index baf2afc23..fb504d96e 100644 --- a/test/testref/convertincrement.test +++ b/test/testref/convertincrement.test @@ -1,8 +1,8 @@ Input increment: Valid time: 2018-04-15T00:00:00Z - tocn min=-0.0937972082266029 max=0.0997618261536270 mean=0.0008710350957508 - socn min=-0.0001690995347179 max=0.0038940161787005 mean=0.0000028952948985 - ssh min=-0.0001526377801940 max=0.0006307438564272 mean=0.0000041130178348 + tocn min=-0.2288274475241922 max=0.1912045489894477 mean=0.0017103542723563 + socn min=-0.0003650232880738 max=0.0121100304079027 mean=0.0000121413142709 + ssh min=-0.0004316711867977 max=0.0007832967709081 mean=0.0000269161355756 hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 Trajectory state: Valid time: 2018-04-15T00:00:00Z @@ -14,7 +14,7 @@ layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.522 mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 Output increment: Valid time: 2018-04-15T00:00:00Z - tocn min=-0.0937972082266029 max=0.0997618261536270 mean=0.0008710350957508 - socn min=-0.0001690995347179 max=0.0038940161787005 mean= -nan - ssh min=-0.0005499802226468 max=0.0017030540476014 mean=0.0000319457667209 + tocn min=-0.2288274475241922 max=0.1912045489894477 mean=0.0017103542723563 + socn min=-0.0003650232880738 max=0.0121100304079027 mean= -nan + ssh min=-0.0062629389176039 max=0.0042019447975279 mean=0.0002526550079651 hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 diff --git a/test/testref/dirac_horizfilt.test b/test/testref/dirac_horizfilt.test deleted file mode 100644 index 644274907..000000000 --- a/test/testref/dirac_horizfilt.test +++ /dev/null @@ -1,20 +0,0 @@ -Input Dirac increment: - Valid time: 2018-04-15T00:00:00Z - cicen min=0.0000000000000000 max=1.0000000000000000 mean=0.0006086427267194 - hicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=0.0000000000000000 max=1.0000000000000000 mean=0.0000243457090688 - tocn min=0.0000000000000000 max=1.0000000000000000 mean=0.0000243457090688 - ssh min=0.0000000000000000 max=1.0000000000000000 mean=0.0018259281801582 - hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -Covariance(SocaError) * Increment: - Valid time: 2018-04-15T00:00:00Z - cicen min=0.0000000000000000 max=0.0706209843078967 mean=0.0006196773314960 - hicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=0.0000000000000000 max=0.0612176275842096 mean=0.0000243884350009 - tocn min=0.0000000000000000 max=0.0650411300919666 mean=0.0000235579338913 - ssh min=0.0000000000000000 max=0.4761893337418804 mean=0.0018541991132237 - hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 diff --git a/test/testref/dirac_soca_cov.test b/test/testref/dirac_soca_cov.test index 4f254ef52..430546902 100644 --- a/test/testref/dirac_soca_cov.test +++ b/test/testref/dirac_soca_cov.test @@ -10,15 +10,15 @@ Input Dirac increment: hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -Covariance(SocaError) * Increment: +Covariance(SABER) * Increment: Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0036089461537001 max=0.0000000000000000 mean=-0.0000275624556497 - hicen min=0.0000000000000000 max=100.0000000000000142 mean=0.9283225798949805 - socn min=-0.0335232487284927 max=0.1085429089450220 mean=0.0003666358672174 - tocn min=0.0000000000000000 max=5.2687160390820855 mean=0.0249020307148332 - uocn min=0.0000000000000000 max=0.0023306838654550 mean=0.0000004409841843 + cicen min=-0.0005949909856056 max=0.0000000000000000 mean=-0.0000036006102555 + hicen min=0.0000000000000000 max=615.1546749956272606 mean=9.5785791047564803 + socn min=-0.0413116584393935 max=0.0674942186631986 mean=0.0002792512559901 + tocn min=0.0000000000000000 max=0.8482253405484985 mean=0.0040160007526648 + uocn min=0.0000000000000000 max=0.0022172566619542 mean=0.0000013295339758 vocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - ssh min=-0.0014883931115266 max=0.0505217197847120 mean=0.0009123179536632 + ssh min=-0.0022671420987840 max=0.0749977063334916 mean=0.0006005922076009 hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 diff --git a/test/testref/dirac_soca_mask.test b/test/testref/dirac_soca_mask.test deleted file mode 100644 index 47d081f5a..000000000 --- a/test/testref/dirac_soca_mask.test +++ /dev/null @@ -1,20 +0,0 @@ -Input Dirac increment: - Valid time: 2018-04-15T00:00:00Z - cicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - tocn min=0.0000000000000000 max=1.0000000000000000 mean=0.0001460742544127 - ssh min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -Covariance(SocaError) * Increment: - Valid time: 2018-04-15T00:00:00Z - cicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - tocn min=0.0000000000000000 max=1.0000000000000007 mean=0.0047334082530769 - ssh min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 diff --git a/test/testref/dirac_soca_nomask.test b/test/testref/dirac_soca_nomask.test deleted file mode 100644 index ef16ef75e..000000000 --- a/test/testref/dirac_soca_nomask.test +++ /dev/null @@ -1,20 +0,0 @@ -Input Dirac increment: - Valid time: 2018-04-15T00:00:00Z - cicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - tocn min=0.0000000000000000 max=1.0000000000000000 mean=0.0001460742544127 - ssh min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -Covariance(SocaError) * Increment: - Valid time: 2018-04-15T00:00:00Z - cicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hicen min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - socn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - tocn min=0.0000000000000000 max=1.0086683962751792 mean=0.0067775864035004 - ssh min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 diff --git a/test/testref/dirac_socahyb_cov.test b/test/testref/dirac_socahyb_cov.test index 2470ec560..e14110a64 100644 --- a/test/testref/dirac_socahyb_cov.test +++ b/test/testref/dirac_socahyb_cov.test @@ -12,25 +12,25 @@ Input Dirac increment: layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 Covariance(hybrid) * Increment: Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0037817675761708 max=0.0033988463061122 mean=-0.0000256316823098 - hicen min=-0.0741129795689144 max=50.1073013980972135 mean=0.4660442760971388 - socn min=-0.2824804962843228 max=0.4340045998546954 mean=0.0012619628223484 - tocn min=-0.1762875582777306 max=3.5877887758283329 mean=0.0173674161728604 - uocn min=-0.0019323054461836 max=0.0022913098573106 mean=-0.0000004686539247 + cicen min=-0.0025626988243994 max=0.0037581892186641 mean=-0.0000159969520637 + hicen min=-0.0741129795689144 max=307.6846388959108367 mean=4.7911725385278894 + socn min=-0.2824804962843228 max=0.4340045998546954 mean=0.0012720994669400 + tocn min=-0.1762874548360663 max=1.3823514073856429 mean=0.0082524533718289 + uocn min=-0.0019323054461836 max=0.0022913098573106 mean=-0.0000000243790289 vocn min=-0.0009570793926929 max=0.0011305048458118 mean=0.0000002771043880 - ssh min=-0.0905081118371923 max=0.0589716992294776 mean=-0.0001573659445746 + ssh min=-0.0981613610996295 max=0.0483202855620447 mean=-0.0002598270731813 hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 mld min=-68.9457053290824149 max=531.2265534461570269 mean=1.3585694060809876 layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 -Covariance(hybrid1_SocaError) * Increment: +Covariance(hybrid1_SABER) * Increment: Valid time: 2018-04-15T00:00:00Z - cicen min=-0.0036091083138408 max=0.0000000000000000 mean=-0.0000222570776912 - hicen min=0.0000000000000000 max=100.0000000000000142 mean=0.9283225798949803 - socn min=-0.0236417547391914 max=0.0472145291855424 mean=0.0000026262434480 - tocn min=0.0000000000000000 max=5.2687160390820855 mean=0.0220591322073391 - uocn min=0.0000000000000000 max=0.0023306838654550 mean=0.0000004409841843 + cicen min=-0.0005949909856056 max=0.0000000000000000 mean=-0.0000029876171989 + hicen min=0.0000000000000000 max=615.1546749956272606 mean=9.5785791047564803 + socn min=-0.0413116584393936 max=0.0460589239077206 mean=0.0000228995326311 + tocn min=0.0000000000000000 max=0.8482253405484985 mean=0.0038292066052762 + uocn min=0.0000000000000000 max=0.0022172566619542 mean=0.0000013295339758 vocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 - ssh min=0.0000000000000000 max=0.0505217197847120 mean=0.0008077940159867 + ssh min=0.0000000000000000 max=0.0749977063334916 mean=0.0006028717587734 hocn min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 mld min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 layer_depth min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 diff --git a/test/testref/enspert.test b/test/testref/enspert.test index bf32b6988..107f4bdbc 100644 --- a/test/testref/enspert.test +++ b/test/testref/enspert.test @@ -20,17 +20,17 @@ Initial state: layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 Member 0 final state: Valid time: 2018-04-15T06:00:00Z - cicen min=-0.0179477307495673 max=1.0153169498091159 mean=0.1165466656301739 - hicen min=-1.2273773517586548 max=4.4384636058585212 mean=0.4836261711443992 + cicen min=-0.0652330460776296 max=1.0484683398308130 mean=0.1144223556808335 + hicen min=-4.3728381330792514 max=6.9607644810528271 mean=0.3688905177496374 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591783000712 mean=34.5473300596784441 - tocn min=-2.9515690032983817 max=31.6987106993547698 mean=6.0915201611419727 - uocn min=-0.8620325384384893 max=0.6951486388404980 mean=-0.0003028019202650 - vocn min=-0.8096150692197427 max=1.1786796751629223 mean=0.0020621981887290 - ssh min=-1.8879012293466213 max=0.9170828155466502 mean=-0.2767795213473463 - hocn min=0.0009718981829507 max=1345.9655010853768999 mean=128.6280651987137560 - chl min=-0.0347096422502860 max=4.6656789459435739 mean=0.1184735932868957 - biop min=-0.0000000010670083 max=0.0000001882111536 mean=0.0000000065412874 + socn min=10.7210460395083924 max=40.4416591815566449 mean=34.5512695946635162 + tocn min=-3.5745711370152957 max=32.8590225629484465 mean=6.0043332715416247 + uocn min=-0.9631534230291001 max=0.7705505008837619 mean=-0.0007074397788418 + vocn min=-0.9081393636883180 max=1.8298872025405089 mean=0.0027429317917932 + ssh min=-1.9480289667870965 max=0.8842153346068957 mean=-0.2770696716820670 + hocn min=0.0009573960297328 max=1345.7763645071554492 mean=128.6280429387163053 + chl min=-0.0002602629226586 max=5.3802288348470304 mean=0.1191065538287583 + biop min=0.0000000000000000 max=0.0000002958568571 mean=0.0000000064663277 sw min=-225.0977630615234375 max=-0.0000000000000000 mean=-71.7393205198725354 lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100402226406899 shf min=-58.9492950439453125 max=201.3742980957031250 mean=6.0753344854805622 @@ -40,17 +40,17 @@ Member 0 final state: layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 Member 1 final state: Valid time: 2018-04-15T06:00:00Z - cicen min=-0.0232472901189155 max=1.0122847550416991 mean=0.1167257873201370 - hicen min=-1.0660578510882317 max=4.6241796010597822 mean=0.5312867971814633 + cicen min=-0.0820225639115724 max=1.0273272687350581 mean=0.1177847469404785 + hicen min=-4.1202535181073179 max=6.6725622937426268 mean=0.5143216170034320 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591799142537 mean=34.5053688155191409 - tocn min=-4.3506301350009116 max=32.2042125513730468 mean=5.9988769154588981 - uocn min=-0.8614391377078680 max=0.6956445378249836 mean=-0.0001691264533084 - vocn min=-0.8098303351350450 max=1.1404127828961510 mean=0.0019618738177159 - ssh min=-1.8653863905924200 max=0.9116542010344340 mean=-0.2767100679432496 - hocn min=0.0009445692826222 max=1346.2515603948361331 mean=128.6280818753485846 - chl min=-0.0295705225910349 max=4.6513062465585113 mean=0.1185495590525884 - biop min=-0.0000000014227649 max=0.0000001886103201 mean=0.0000000065389500 + socn min=10.7210460395083924 max=40.4416591812376893 mean=34.5488545751350102 + tocn min=-2.3721757035508819 max=31.6968001574361438 mean=6.0189185668138565 + uocn min=-0.8394533438605681 max=0.5752407915434371 mean=-0.0002744145890155 + vocn min=-1.0500096308970495 max=0.6571974283372647 mean=0.0024392599409237 + ssh min=-1.9441036954209583 max=0.9131049036933895 mean=-0.2769787403193089 + hocn min=0.0009432313031085 max=1346.0396142468771359 mean=128.6280855234545868 + chl min=-0.0003307875492064 max=4.4905129657337302 mean=0.1165528549108761 + biop min=0.0000000000000000 max=0.0000002686868064 mean=0.0000000066271094 sw min=-225.0977630615234375 max=-0.0000000000000000 mean=-71.7393205198725354 lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100402226406899 shf min=-58.9492950439453125 max=201.3742980957031250 mean=6.0753344854805622 @@ -60,17 +60,17 @@ Member 1 final state: layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 Member 2 final state: Valid time: 2018-04-15T06:00:00Z - cicen min=-0.0240114302715288 max=1.0134258249588350 mean=0.1171379101209238 - hicen min=-1.0731683257961575 max=4.2637166258387866 mean=0.5242428246457037 + cicen min=-0.0706739653178427 max=1.0268252155702335 mean=0.1188664323217232 + hicen min=-3.8738462584484705 max=5.9535906480102518 mean=0.4299712008697106 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591813473900 mean=34.5180354479406262 - tocn min=-3.6550415350812973 max=31.7303623333074931 mean=6.1038745493177933 - uocn min=-0.8527354111047408 max=0.6899570004276523 mean=-0.0002331691871794 - vocn min=-0.8082836103758393 max=1.2213721318293778 mean=0.0019622232505525 - ssh min=-1.8542140529770612 max=0.9099969529067288 mean=-0.2765945891721018 - hocn min=0.0009179199629318 max=1346.5391996900173126 mean=128.6280815294041133 - chl min=-0.0242344918332649 max=4.6854539925550318 mean=0.1184658525731263 - biop min=-0.0000000008753226 max=0.0000001878964701 mean=0.0000000065377026 + socn min=10.7210460395083924 max=40.4416591739573761 mean=34.5377351780651907 + tocn min=-2.5489557660481399 max=32.3257549097358350 mean=6.0097180200637768 + uocn min=-0.9800501340377999 max=0.8006128954883849 mean=-0.0008855621639701 + vocn min=-0.7787090359666698 max=0.9335359468197624 mean=0.0032329452367215 + ssh min=-1.9023948561930997 max=0.9389154216912911 mean=-0.2768966627256989 + hocn min=0.0009200122217266 max=1346.2297443613554151 mean=128.6280490593360639 + chl min=-0.0003539854117379 max=5.0611493466285946 mean=0.1175715776996488 + biop min=0.0000000000000000 max=0.0000002241638191 mean=0.0000000067022354 sw min=-225.0977630615234375 max=-0.0000000000000000 mean=-71.7393205198725354 lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100402226406899 shf min=-58.9492950439453125 max=201.3742980957031250 mean=6.0753344854805622 @@ -80,17 +80,17 @@ Member 2 final state: layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 Member 3 final state: Valid time: 2018-04-15T06:00:00Z - cicen min=-0.0217194858086926 max=1.0147606235466318 mean=0.1173610124689396 - hicen min=-1.2568327839592690 max=4.4544028614335236 mean=0.5230276029529948 + cicen min=-0.0615883643173291 max=1.0492751040192974 mean=0.1220794905037402 + hicen min=-4.2442562080498716 max=6.7680861503658729 mean=0.6409495104501891 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591824269531 mean=34.5335504385732079 - tocn min=-2.9603827293771343 max=31.7375756291442492 mean=6.0348515736570718 - uocn min=-0.8568785328366367 max=0.6985426223296826 mean=-0.0001952346659818 - vocn min=-0.8030924790206806 max=1.1962722596214554 mean=0.0020544229255305 - ssh min=-1.8474816349167924 max=0.9121588912797869 mean=-0.2765272001340992 - hocn min=0.0008919956143453 max=1346.8077367450123347 mean=128.6280866039721218 - chl min=-0.0338003707368620 max=4.6945596057779229 mean=0.1184960634942794 - biop min=-0.0000000007022308 max=0.0000001877512722 mean=0.0000000065404235 + socn min=10.7210460395083924 max=40.4416591897031239 mean=34.5384910346501854 + tocn min=-3.2957173084736082 max=31.6978104736174906 mean=6.0122653325162911 + uocn min=-0.7845024154037150 max=0.6924739575589713 mean=0.0002752215169624 + vocn min=-0.9761494134174579 max=1.0944957768031982 mean=0.0020434344705764 + ssh min=-1.8962379760060080 max=0.9205482111449286 mean=-0.2768218698684791 + hocn min=0.0008930637959389 max=1346.5456938754741714 mean=128.6281064307361817 + chl min=-0.0003038129490014 max=4.8635125453032968 mean=0.1166389396738258 + biop min=0.0000000000000000 max=0.0000002261743928 mean=0.0000000066350231 sw min=-225.0977630615234375 max=-0.0000000000000000 mean=-71.7393205198725354 lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100402226406899 shf min=-58.9492950439453125 max=201.3742980957031250 mean=6.0753344854805622 @@ -100,17 +100,17 @@ Member 3 final state: layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 Member 4 final state: Valid time: 2018-04-15T06:00:00Z - cicen min=-0.0197718401128528 max=1.0091688136045813 mean=0.1172909033586223 - hicen min=-1.1155308717945622 max=4.7092122161910979 mean=0.4994453858606065 + cicen min=-0.0774429788312054 max=1.0687702375156638 mean=0.1206738681345331 + hicen min=-4.4391137027088172 max=6.8077003218405903 mean=0.3445202812018121 hsnon min=0.0000000000000000 max=1.2712833951042413 mean=0.0886865877527975 - socn min=10.7210460395083924 max=40.4416591834597057 mean=34.5385488607189828 - tocn min=-4.8171336223355574 max=31.7744438625563212 mean=5.9939229008064574 - uocn min=-0.8554285548104850 max=0.6981012703078521 mean=-0.0002457408300107 - vocn min=-0.8097634889891272 max=1.1477557612142797 mean=0.0019882065569462 - ssh min=-1.8491618668484704 max=0.9121236566706767 mean=-0.2764747660188870 - hocn min=0.0008668009166667 max=1347.1244907586342379 mean=128.6280850949892169 - chl min=-0.0339841299535465 max=4.6753649218027249 mean=0.1185674716150973 - biop min=-0.0000000008837080 max=0.0000001882608358 mean=0.0000000065373823 + socn min=10.7210460395083924 max=40.4416591897031239 mean=34.5268184245201084 + tocn min=-3.6566864494229296 max=31.8556677315050614 mean=6.0253576073756614 + uocn min=-1.2013717728532998 max=0.6527593647591228 mean=-0.0001828978128614 + vocn min=-0.7457317143992984 max=1.2051977361397159 mean=0.0023412362425249 + ssh min=-1.8691732330635278 max=0.9042908152480489 mean=-0.2765432653003158 + hocn min=0.0008723772340869 max=1346.8996334599542024 mean=128.6281309495731762 + chl min=-0.0002749974437174 max=5.2832145039966942 mean=0.1196846813645184 + biop min=0.0000000000000000 max=0.0000002268139028 mean=0.0000000063732421 sw min=-225.0977630615234375 max=-0.0000000000000000 mean=-71.7393205198725354 lhf min=-38.1373977661132812 max=256.5976562500000000 mean=42.0100402226406899 shf min=-58.9492950439453125 max=201.3742980957031250 mean=6.0753344854805622 diff --git a/test/testref/sqrtvertloc.test b/test/testref/sqrtvertloc.test index 8a813614a..7083795ad 100644 --- a/test/testref/sqrtvertloc.test +++ b/test/testref/sqrtvertloc.test @@ -18,52 +18,52 @@ Background: us min=0.0000000000000000 max=0.0000000000000000 mean=0.0000000000000000 mld min=2.2854716757984130 max=4593.1533423819937525 mean=192.4109073940401515 layer_depth min=2.2854716757984130 max=5658.3057467114012979 mean=1200.5229536158392420 -Variance Explained=0.1096171922047231 -0.1986045034050992 -0.2573630058393613 -0.3107532581005915 -0.3600780060478236 -0.4059975614845806 -0.4490255138467362 -0.4894032540103357 -0.5273444827790712 -0.5630156249719891 -0.5965844561275099 -0.6281574792731044 -0.6579214811897764 -0.6859300928663781 -0.7122863664054074 -0.7370566011117995 -0.7602902451356316 -0.7821106494633983 -0.8025341459758836 -0.8216709226214103 -0.8395648493506132 -0.8562730805264062 -0.8718656586524712 -0.8863760896935975 -0.8998514179821113 -0.9123239263040823 -0.9238245469735469 -0.9343962082766479 -0.9440956359493268 -0.9529448218556020 -0.9610054068704874 -0.9682971797452863 -0.9748623012308331 -0.9807032802887200 -0.9858742155762905 -0.9903946222754951 -0.9942664231712092 -0.9974860947539266 -1.0000000000000002 -1.0000000000000002 -Number of retained columns=10 -Retained fraction of the variance=0.5630156249719890 +Variance Explained=0.2170869103304957 +0.3853995126962893 +0.5191300748802294 +0.6245507062285205 +0.7082508814077046 +0.7754086859688079 +0.8287130620291833 +0.8708460155426395 +0.9036239285948264 +0.9293521452468891 +0.9486860899709457 +0.9630830846619034 +0.9737798858225107 +0.9816872981021527 +0.9873593508667808 +0.9914672746369781 +0.9944202157540855 +0.9964802976628258 +0.9978836408049583 +0.9987616440322967 +0.9993010464004334 +0.9995975249256837 +0.9997817320040719 +0.9998855024147656 +0.9999445244879241 +0.9999707357042824 +0.9999860045930331 +0.9999937183889517 +0.9999975747695140 +0.9999988583414732 +0.9999995272073808 +0.9999998167006787 +0.9999999427422764 +0.9999999778592330 +0.9999999925750825 +0.9999999979104610 +0.9999999995966463 +0.9999999999256394 +0.9999999999999997 +0.9999999999999997 +Number of retained columns=5 +Retained fraction of the variance=0.7082508814077048 Variance for truncated correlation matrix Valid time: 2018-04-15T00:00:00Z - ssh min=0.0000000000000000 max=0.9956679957030570 mean=0.7856432972140444 - tocn min=0.0000000000000000 max=0.9966481594658692 mean=0.5420609030408824 - socn min=0.0000000000000000 max=0.9967239058640776 mean=0.5488927040853910 - uocn min=0.0471870359614622 max=0.8507511804330994 mean=0.4712163828151314 - vocn min=0.0000000000000000 max=0.8504443347852177 mean=0.4718981764054079 + ssh min=0.0000000000000000 max=0.9993211547911076 mean=0.2877327906827201 + tocn min=0.0000000000000000 max=0.9989199905177697 mean=0.4976051689320881 + socn min=0.0000000000000000 max=0.9995056599361946 mean=0.4710793148216433 + uocn min=0.0565178922073773 max=0.9999770593557000 mean=0.7043214835347630 + vocn min=0.0000000000000000 max=0.9999829756820410 mean=0.6706269624420356 diff --git a/test/testref/static_socaerror_init.test b/test/testref/static_socaerror_init.test deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/testref/static_socaerrorlowres_init.test b/test/testref/static_socaerrorlowres_init.test deleted file mode 100644 index e69de29bb..000000000