From fa72b53562f86b89f4d32cfbfabe9e6f0a9119fc Mon Sep 17 00:00:00 2001 From: scivision Date: Thu, 30 Jul 2026 12:06:48 -0400 Subject: [PATCH 1/8] MSIS2: consistency lint --- cmake/libraries.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/libraries.json b/cmake/libraries.json index 35d1c25f..9330caaf 100644 --- a/cmake/libraries.json +++ b/cmake/libraries.json @@ -17,10 +17,10 @@ }, "msis": { "stem": "https://github.com/gemini3d/msis/archive/", - "archive": "1577d765f86f4bb180e589236be3336d1dbbc26f.tar.gz" + "archive": "586c9b96931d80011db417bcb34140580258e786.tar.gz" }, "mumps": { - "stem": "https://github.com/scivision/mumps/archive/", + "stem": "https://github.com/scivision/mumps-superbuild/archive/", "archive": "595ad9b758411da45a2cfd272e2164a55e7eae11.tar.gz" } } From a4c1d7055da8c2480f21f3f4363bee7b8a3f1e68 Mon Sep 17 00:00:00 2001 From: scivision Date: Fri, 31 Jul 2026 20:19:59 -0400 Subject: [PATCH 2/8] h5fortran: FindHDF5 programmatic support library search. HDF5 2.2.0 release --- cmake/libraries.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/libraries.json b/cmake/libraries.json index 9330caaf..a4fe4419 100644 --- a/cmake/libraries.json +++ b/cmake/libraries.json @@ -9,7 +9,7 @@ }, "h5fortran": { "stem": "https://github.com/ECLAIRWaveS/h5fortran/archive/", - "archive": "641a527b1aaf5a9503e7324481c79503e091a6c4.tar.gz" + "archive": "5db3c2efc6425a2219cfb3c1365fcc206b807cfd.tar.gz" }, "hwm14": { "stem": "https://github.com/gemini3d/hwm14/archive/", From 65e13e789f8cd5bb1352d71be6ceaa86eb8f60e9 Mon Sep 17 00:00:00 2001 From: scivision Date: Mon, 3 Aug 2026 11:49:06 -0400 Subject: [PATCH 3/8] add gemini3d_msis2 option to enable MSIS2.x Must also specifiy MSIS 2.x if desired in config.nml --- CMakeLists.txt | 3 +++ options.cmake | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ee940a0..8b0f327c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,9 @@ if(gemini3d_hwm14) endif() # --- MSISE00 / MSIS 2.x +if(gemini3d_msis2) + set(msis2 on) +endif() set(msis_BUILD_UTILS on) string(JSON _stem GET "${json}" "msis" "stem") string(JSON _archive GET "${json}" "msis" "archive") diff --git a/options.cmake b/options.cmake index 844a59fd..66d741ad 100644 --- a/options.cmake +++ b/options.cmake @@ -30,6 +30,8 @@ option(gemini3d_python "Python-based self-checks") # Matlab checks take much longer than Python, and Python covers much more option(gemini3d_matlab "Matlab-based self-checks") +option(gemini3d_msis2 "enable MSIS2 neutral atmosphere model (must specify in config.nml as well)" on) + # append .debug to debug libraries, because the computation speed penalty is so great set(CMAKE_DEBUG_POSTFIX .debug) From 903f8c149a17bfba74c548b77246e756bd591456 Mon Sep 17 00:00:00 2001 From: scivision Date: Mon, 3 Aug 2026 12:11:42 -0400 Subject: [PATCH 4/8] msis_setup: -features outputs MSIS2 if present, and puts msis_setup in top binary dir --- CMakeLists.txt | 1 + cmake/libraries.json | 2 +- cmake/summary.cmake | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b0f327c..29f0f8fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,7 @@ string(JSON _archive GET "${json}" "msis" "archive") set(msis_url "${_stem}${_archive}") FetchContent_Declare(msis URL ${msis_url}) FetchContent_MakeAvailable(msis) +set_target_properties(msis_setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) # --- Gemini3D library add_subdirectory(src) diff --git a/cmake/libraries.json b/cmake/libraries.json index a4fe4419..4754fbfa 100644 --- a/cmake/libraries.json +++ b/cmake/libraries.json @@ -17,7 +17,7 @@ }, "msis": { "stem": "https://github.com/gemini3d/msis/archive/", - "archive": "586c9b96931d80011db417bcb34140580258e786.tar.gz" + "archive": "e8437eb61ff0bdb3ef336d96fd279dd75d9aec98.tar.gz" }, "mumps": { "stem": "https://github.com/scivision/mumps-superbuild/archive/", diff --git a/cmake/summary.cmake b/cmake/summary.cmake index f1e4ac68..01df7ab8 100644 --- a/cmake/summary.cmake +++ b/cmake/summary.cmake @@ -4,6 +4,7 @@ if(gemini3d_IS_TOP_LEVEL) add_feature_info(GLOW gemini3d_glow "airglow / aurora model") add_feature_info(HWM14 gemini3d_hwm14 "HWM14 neutral winds model") +add_feature_info(MSIS2 gemini3d_msis2 "enable MSIS 2.x neutral atmosphere model") add_feature_info(PyGemini gemini3d_python "simulation generation, HPC script generator and plotting") add_feature_info(MatGemini gemini3d_matlab "checks not as extensive as Python, and slow") From e01ce60bc3ab39934fa6faafa78e4eda1de064ea Mon Sep 17 00:00:00 2001 From: scivision Date: Mon, 3 Aug 2026 16:58:30 -0400 Subject: [PATCH 5/8] MSIS2 needs msis21.parm copied to gemini.bin directory --- CMakeLists.txt | 4 ++++ test/sim.cmake | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29f0f8fb..ab7d4901 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,10 @@ set(msis_url "${_stem}${_archive}") FetchContent_Declare(msis URL ${msis_url}) FetchContent_MakeAvailable(msis) set_target_properties(msis_setup PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) +if(gemini3d_msis2) + set(msis2_parm_file ${msis_SOURCE_DIR}/src/msis2/msis21.parm) + configure_file(${msis2_parm_file} msis21.parm COPYONLY) +endif() # --- Gemini3D library add_subdirectory(src) diff --git a/test/sim.cmake b/test/sim.cmake index 3aea4046..7436d95a 100644 --- a/test/sim.cmake +++ b/test/sim.cmake @@ -24,6 +24,9 @@ else() endif() endif() +if(gemini3d_msis2) + list(APPEND gemini_test_sim_names mini2dns_msis2_fang) +endif() foreach(_s IN LISTS gemini_test_sim_names) setup_gemini_test(${_s}) From d9c65438fb54dfeb66400fbae62a9569972eef31 Mon Sep 17 00:00:00 2001 From: scivision Date: Mon, 3 Aug 2026 17:24:32 -0400 Subject: [PATCH 6/8] ci: add msis 2.x test --- .github/workflows/ci.yml | 20 ++++++++++++++++++- CMakePresets.json | 43 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6449485..054afb7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,6 @@ jobs: strategy: fail-fast: false matrix: - hwm14: [false] os: [ubuntu-latest] gcc: [11, 12, 13, 14] @@ -58,6 +57,25 @@ jobs: - &linux-build uses: ./.github/workflows/composite-unix + hwm-msis: + strategy: + matrix: + model: [msis2] + + env: + CMAKE: cmake + CTEST: ctest + + runs-on: ubuntu-latest + + steps: + - *checkout + + - *pkg + + - name: workflow ${{ matrix.model }} + run: cmake --workflow ${{ matrix.model }} + cmake-oldest: timeout-minutes: 30 diff --git a/CMakePresets.json b/CMakePresets.json index 35adcde8..5ec528e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -16,7 +16,20 @@ { "name": "gmake", "inherits": "default", "generator": "Unix Makefiles", "binaryDir": "build-${presetName}", "displayName": "GNU generator", - "description": "this helps catch GNU Make-specific bugs that might not appear with Ninja" }, + "description": "this helps catch GNU Make-specific bugs that might not appear with Ninja" +}, +{ "name": "msis2", "inherits": "default", + "displayName": "Use MSIS2 model", + "cacheVariables": { + "gemini3d_msis2": true + } +}, +{ "name": "hwm14", "inherits": "default", + "displayName": "Use HWM14 model", + "cacheVariables": { + "gemini3d_hwm14": true + } +}, { "name": "linux", "inherits": "default", "displayName": "Linux build (for WSL on GHA)", @@ -54,6 +67,8 @@ "buildPresets": [ { "name": "default", "configurePreset": "default", "configuration": "Release" }, { "name": "no-build-hdf5", "configurePreset": "no-build-hdf5", "inherits": "default" }, + { "name": "msis2", "configurePreset": "msis2", "inherits": "default" }, + { "name": "hwm14", "configurePreset": "hwm14", "inherits": "default" }, { "name": "gmake", "inherits": "default", "configurePreset": "gmake", "jobs": 4 }, { "name": "linux", "configurePreset": "linux", "inherits": "default" }, { "name": "release", "inherits": "default", "configurePreset": "release" }, @@ -75,6 +90,18 @@ "stopOnFailure": false } }, +{ "name": "msis2", "configurePreset": "msis2", "inherits": "default", + "displayName": "Tests for MSIS 2.x", + "filter": { + "include": {"name": "msis2"} + } +}, +{ "name": "hwm14", "configurePreset": "hwm14", "inherits": "default", + "displayName": "Tests for HWM14", + "filter": { + "include": {"name": "hwm14"} + } +}, { "name": "download", "inherits": "default", "displayName": "download reference data for subsequent offline tests", @@ -148,6 +175,20 @@ { "type": "build", "name": "default" } ] }, + { "name": "msis2", "displayName": "MSIS 2.x workflow", + "steps": [ + { "type": "configure", "name": "msis2" }, + { "type": "build", "name": "msis2" }, + { "type": "test", "name": "msis2" } + ] + }, + { "name": "hwm14", "displayName": "HWM14 workflow", + "steps": [ + { "type": "configure", "name": "hwm14" }, + { "type": "build", "name": "hwm14" }, + { "type": "test", "name": "hwm14" } + ] + }, { "name": "no-build-hdf5", "displayName": "Only find, don't build HDF5 library from source if not found", "steps": [ From a1356b21676885a96c4f3a2e3d34dc1194fde007 Mon Sep 17 00:00:00 2001 From: zettergm Date: Mon, 3 Aug 2026 18:38:00 -0400 Subject: [PATCH 7/8] add C interface for alternate energy solution method --- include/gemini3d.h | 1 + src/libgemini_c.f90 | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/include/gemini3d.h b/include/gemini3d.h index 2012ca91..5b7066a7 100644 --- a/include/gemini3d.h +++ b/include/gemini3d.h @@ -85,6 +85,7 @@ extern void VNRicht_artvisc_C(double**, void**); extern void compression_C(double**, double**, void**, int*, void**, double*); extern void rhoe2T_C(double**, double**); extern void energy_diffusion_C(void**, int*, void**, double**, double**, void**, double*); +extern void diffusion_source_loss_energy_C(void**, int*, void**, double**, double**, void**, double*); extern void source_loss_allparams_C(void**, double**, double**, double**, void**, int*, void**, double*); extern void source_loss_mass_C(void**, double**,double**,double**,void**,int*,void**,double*); diff --git a/src/libgemini_c.f90 b/src/libgemini_c.f90 index c7512916..317eb58f 100644 --- a/src/libgemini_c.f90 +++ b/src/libgemini_c.f90 @@ -42,7 +42,7 @@ module gemini3d_C sweep1_allspec_mass_in,sweep1_allspec_momentum_in,sweep1_allspec_energy_in, & sweep2_allspec_mass_in,sweep2_allspec_momentum_in,sweep2_allspec_energy_in, & rhov12v1_in, VNRicht_artvisc_in, compression_in, rhoe2T_in, clean_param_in, & - energy_diffusion_in, source_loss_allparams_in, & + energy_diffusion_in, diffusion_source_loss_energy_in, source_loss_allparams_in, & source_loss_mass_in, source_loss_momentum_in, source_loss_energy_in, & clear_ionization_arrays, impact_ionization_in, solar_ionization_in, & dateinc_in, get_subgrid_size,get_fullgrid_size,get_config_vars, get_species_size, fluidvar_pointers, & @@ -935,6 +935,32 @@ subroutine energy_diffusion_C(cfgC,xtype,xC,fluidvarsC,electrovarsC,intvarsC,dt) end subroutine energy_diffusion_C + !> diffusion of energy + subroutine diffusion_source_loss_energy_C(cfgC,xtype,xC,fluidvarsC,electrovarsC,intvarsC,dt) & + bind(C,name="diffusion_source_loss_energy_C") + type(c_ptr), intent(in) :: cfgC + integer(C_INT), intent(in) :: xtype + type(c_ptr), intent(in) :: xC + type(c_ptr), intent(inout) :: fluidvarsC + type(c_ptr), intent(in) :: electrovarsC + type(c_ptr), intent(in) :: intvarsC + real(wp), intent(in) :: dt + + type(gemini_cfg), pointer :: cfg + class(curvmesh), pointer :: x + real(wp), dimension(:,:,:,:), pointer :: fluidvars + real(wp), dimension(:,:,:,:), pointer :: electrovars + type(gemini_work), pointer :: intvars + + call c_f_pointer(cfgC, cfg) + x=>set_gridpointer_dyntype(xtype, xC) + call c_f_pointer(fluidvarsC,fluidvars,[(lx1+4),(lx2+4),(lx3+4),(5*lsp)]) + call c_f_pointer(electrovarsC,electrovars,[(lx1+4),(lx2+4),(lx3+4),7]) + call c_f_pointer(intvarsC,intvars) + call diffusion_source_loss_energy_in(cfg,x,fluidvars,electrovars,intvars,dt) + end subroutine diffusion_source_loss_energy_C + + !> source/loss numerical solutions subroutine source_loss_allparams_C(cfgC,fluidvarsC,fluidauxvarsC,electrovarsC,intvarsC,xtype,xC,dt) & bind(C, name="source_loss_allparams_C") From c32bdcbefc54a15f2838d1cb6544c3f91ce4e2c0 Mon Sep 17 00:00:00 2001 From: zettergm Date: Thu, 6 Aug 2026 19:11:37 -0400 Subject: [PATCH 8/8] revert altnull to default to 80km --- src/numerical/mesh/meshobj.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numerical/mesh/meshobj.f90 b/src/numerical/mesh/meshobj.f90 index a7d34861..d6576b6f 100644 --- a/src/numerical/mesh/meshobj.f90 +++ b/src/numerical/mesh/meshobj.f90 @@ -159,7 +159,7 @@ module meshobj !> contains information about where to assign null cells, most uses will assume default value - real(wp) :: altnull=0 !80e3 + real(wp) :: altnull=80e3 !80e3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! type-bound procedures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! contains