Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7d77de7
add gpu2gpu mpi transer with flag for do_group_update
edoyango Aug 28, 2025
5a85ab4
add missing collapse(3) clauses
edoyango Sep 2, 2025
aa8f22b
Use __NVCOMPILER macro for target regions
edoyango Oct 10, 2025
1e82747
add back old omp directive wrapped in #ifndef __NVCOMPILER
edoyango Oct 10, 2025
dc36e57
port remaining un/pack loops
edoyango Oct 10, 2025
972a97c
add multi gpu support (#2)
JorgeG94 Oct 30, 2025
78b436d
sub __NVCOMPILER with __NVCOMPILER_OPENMP_GPU
edoyango Oct 14, 2025
5ac547f
allow choice of gpu or cpu parallel
edoyango Dec 16, 2025
85ae7ef
fix omp set device call
edoyango Jan 15, 2026
b4993f5
Revert "allow choice of gpu or cpu parallel"
edoyango Feb 16, 2026
baa8d88
OMP MPI: Minor cleanups
marshallward Mar 16, 2026
8d83224
OMP target MPI: line length compliance
marshallward Mar 16, 2026
236aef3
OMP MPI: Update nocomm interface
marshallward Mar 17, 2026
e3116ef
use openmp cpu if ompoffload=.false.
edoyango Apr 17, 2026
4152115
Linting clean-up
mnlevy1981 May 6, 2026
d26f787
One more lint clean-up
mnlevy1981 May 6, 2026
6b71b2d
One more linting commit
mnlevy1981 May 6, 2026
1d377f2
Update github actions
mnlevy1981 May 8, 2026
695a88b
Turn off autoconf CI testing
mnlevy1981 May 8, 2026
a440407
Update containers for intel and coupler CI tests
mnlevy1981 May 8, 2026
207a465
Drop FMS coupler CI test
mnlevy1981 May 8, 2026
f88a095
Drop YAML from configure.ac
mnlevy1981 May 11, 2026
b018921
Drop SKIP_PARSER_TESTS from makefiles
mnlevy1981 May 11, 2026
67cafb5
Add mppnccombine.c to diag_manager makefile
mnlevy1981 May 11, 2026
9369bf0
Remove bad test
mnlevy1981 May 11, 2026
9a76ece
Increase filename size
mnlevy1981 May 11, 2026
e68d003
Revert "Drop SKIP_PARSER_TESTS from makefiles"
mnlevy1981 May 11, 2026
5284362
Revert "Drop YAML from configure.ac"
mnlevy1981 May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_cmake_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
omp-flags: [ -DOPENMP=on, -DOPENMP=off ]
libyaml-flag: [ "", -DWITH_YAML=on ]
container:
image: noaagfdl/hpc-me.ubuntu-minimal:cmake
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:15.1.0
env:
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.libyaml-flag }} -D64BIT=on"
steps:
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/build_ubuntu_gnu.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/coupler.yml

This file was deleted.

16 changes: 7 additions & 9 deletions .github/workflows/intel_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ jobs:
intel-autotools:
runs-on: ubuntu-latest
container:
image: intel/oneapi-hpckit:2022.2-devel-ubuntu20.04
image: intel/oneapi-hpckit:2025.2.2-0-devel-ubuntu24.04
env:
CC: mpiicc
FC: mpiifort
CC: mpicc
FC: mpiifx
CFLAGS: "-I/libs/include"
FCFLAGS: "-I/libs/include -g -traceback"
LDFLAGS: "-L/libs/lib"
TEST_VERBOSE: 1
I_MPI_FABRICS: "shm" # needed for mpi in image
# intel bug causes some failures with shm option(required in container)
SKIP_TESTS: "test_mpp_update_domains.1 test_update_domains_performance.1 test_diag_manager2.23"
SKIP_TESTS: "test_fms2_io.1 test_mpp_update_domains.1 test_update_domains_performance.1 test_diag_manager2.23"
steps:
- name: Cache dependencies
id: cache
Expand All @@ -22,7 +22,7 @@ jobs:
path: /libs
key: ${{ runner.os }}-intel-libs
- name: Install packages for building
run: apt update && apt install -y autoconf libtool automake zlibc zlib1g-dev
run: apt update && apt install -y autoconf libtool automake zlib1g-dev
- if: steps.cache.outputs.cache-hit != 'true'
name: Build netcdf
run: |
Expand All @@ -33,20 +33,18 @@ jobs:
make -j install && cd ..
wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.8.1.tar.gz
tar xf v4.8.1.tar.gz && cd netcdf-c-4.8.1
./configure --prefix=/libs --enable-remote-fortran-bootstrap
./configure --prefix=/libs --enable-remote-fortran-bootstrap --disable-libxml2
make -j install
# sets this here to pass embeded configure checks
export LD_LIBRARY_PATH="/libs/lib:$LD_LIBRARY_PATH"
make -j -k build-netcdf-fortran
make -j install-netcdf-fortran
wget https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz
tar xf yaml-0.2.5.tar.gz && cd yaml-0.2.5
./configure --prefix=/libs
make -j install && cd
- name: checkout
uses: actions/checkout@v2
- name: Configure
run: autoreconf -if ./configure.ac && ./configure --with-yaml
run: autoreconf -if ./configure.ac && ./configure
- name: Compile
run: make -j || make
- name: Run test suite
Expand Down
37 changes: 23 additions & 14 deletions constants/cesm_constants.fh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ character(len=18), public, parameter :: constants_version = 'FMSConstants: CESM'
! Constants below use CESM shr values

real(R8), public, parameter :: KAPPA = RDGAS/CP_AIR !< RDGAS / CP_AIR [dimensionless]
real(R8), public, parameter :: RHO0R = 1.0_r8/RHO0 !< Reciprocal of average density of sea water [m^3/kg]
real(R8), public, parameter :: RHO0R = 1.0_r8/RHO0 !< Reciprocal of average density of sea water
!! [m^3/kg]
real(R8), public, parameter :: RHO_CP = RHO0*CP_OCEAN !< (kg/m^3)*(cal/kg/deg C)(joules/cal) =
!<(joules/m^3/deg C) [J/m^3/deg]
real(R8), public, parameter :: ES0 = 1.0_r8 !< Humidity factor. Controls the humidity content of the
!< atmosphere through the Saturation Vapour Pressure
!< expression when using DO_SIMPLE. [dimensionless]
real(R8), public, parameter :: ES0 = 1.0_r8 !< Humidity factor. Controls the humidity content of
!! the atmosphere through the Saturation Vapour
!! Pressure expression when using DO_SIMPLE.
!! [dimensionless]
real(R8), public, parameter :: HLS = HLV + HLF !< Latent heat of sublimation [J/kg]
real(R8), public, parameter :: WTMOZONE = 47.99820_r8 !< Molecular weight of ozone [AMU]
real(R8), public, parameter :: WTMC = 12.00000_r8 !< Molecular weight of carbon [AMU]
Expand All @@ -49,15 +51,22 @@ real(R8), public, parameter :: SECONDS_PER_HOUR = 3600._r8 !< Seconds in
real(R8), public, parameter :: SECONDS_PER_MINUTE = 60._r8 !< Seconds in a minute [s]
real(R8), public, parameter :: RAD_TO_DEG = 180._r8/PI !< Degrees per radian [deg/rad]
real(R8), public, parameter :: DEG_TO_RAD = PI/180._r8 !< Radians per degree [rad/deg]
real(R8), public, parameter :: RADIAN = RAD_TO_DEG !< Equal to RAD_TO_DEG for backward compatability. [rad/deg]
real(R8), public, parameter :: ALOGMIN = -50.0_r8 !< Minimum value allowed as argument to log function [N/A]
real(R8), public, parameter :: EPSLN = 1.0e-40_r8 !< A small number to prevent divide by zero exceptions [N/A]
real(R8), public, parameter :: RADCON = ((1.0E+02_r8*GRAV)/(1.0E+04_r8*CP_AIR))*SECONDS_PER_DAY !< convert flux divergence
!to heating rate in degrees per day [deg sec/(cm day)]
real(R8), public, parameter :: RADCON_MKS = (GRAV/CP_AIR)*SECONDS_PER_DAY !< Factor used to convert flux divergence to
!< heating rate in degrees per day [deg sec/(m day)]
real(R8), public, parameter :: O2MIXRAT = 2.0953E-01_r8 !< Mixing ratio of molecular oxygen in air [dimensionless]
real(R8), public, parameter :: C2DBARS = 1.e-4_r8 !< rho*g*z(mks) to dbars: 1dbar = 10^4 (kg/m^3)(m/s^2)m [dbars]
real(R8), public, parameter :: RADIAN = RAD_TO_DEG !< Equal to RAD_TO_DEG for backward compatability.
!! [rad/deg]
real(R8), public, parameter :: ALOGMIN = -50.0_r8 !< Minimum value allowed as argument to log function
!! [N/A]
real(R8), public, parameter :: EPSLN = 1.0e-40_r8 !< A small number to prevent divide by zero
!! exceptions [N/A]
real(R8), public, parameter :: RADCON = ((1.0E+02_r8*GRAV)/(1.0E+04_r8*CP_AIR))*SECONDS_PER_DAY !< convert flux
!! divergence to heating rate in degrees per day
!! [deg sec/(cm day)]
real(R8), public, parameter :: RADCON_MKS = (GRAV/CP_AIR)*SECONDS_PER_DAY !< Factor used to convert flux divergence
!! to heating rate in degrees per day
!! [deg sec/(m day)]
real(R8), public, parameter :: O2MIXRAT = 2.0953E-01_r8 !< Mixing ratio of molecular oxygen in air
!! [dimensionless]
real(R8), public, parameter :: C2DBARS = 1.e-4_r8 !< rho*g*z(mks) to dbars: 1dbar = 10^4
!! (kg/m^3)(m/s^2)m [dbars]
real(R8), public, parameter :: KELVIN = 273.15_r8 !< Degrees Kelvin at zero Celsius [K]

#ifdef SMALL_EARTH
Expand All @@ -70,4 +79,4 @@ real(R8), public, parameter :: KELVIN = 273.15_r8 !< Degrees Ke
#endif
#else
real, public, parameter :: small_fac = 1._r8
#endif
#endif
1 change: 0 additions & 1 deletion constants/fmsconstants.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ module FMSconstants

use platform_mod, only: r4_kind, r8_kind

#define CESM_CONSTANTS
#if defined(CESM_CONSTANTS)
use shr_kind_mod, only : R8 => shr_kind_r8
use shr_const_mod, only : &
Expand Down
1 change: 1 addition & 0 deletions diag_manager/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ noinst_LTLIBRARIES = libdiag_manager.la
libdiag_manager_la_SOURCES = \
diag_axis.F90 \
diag_data.F90 \
mppnccombine.c \
diag_grid.F90 \
diag_manager.F90 \
diag_output.F90 \
Expand Down
19 changes: 11 additions & 8 deletions diag_manager/diag_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ MODULE diag_manager_mod
USE fms_diag_outfield_mod, ONLY: fmsDiagOutfieldIndex_type, fmsDiagOutfield_type
USE fms_diag_fieldbuff_update_mod, ONLY: fieldbuff_update, fieldbuff_copy_missvals, &
& fieldbuff_copy_fieldvals
use netcdf_io_mod, ONLY: filepath_list_type, partitioned_global_files, partitioned_section_files, append_to_filepath_list
use netcdf_io_mod, ONLY: filepath_list_type, partitioned_global_files, partitioned_section_files, &
& append_to_filepath_list

#ifdef use_netCDF
USE netcdf, ONLY: NF90_INT, NF90_FLOAT, NF90_CHAR
Expand Down Expand Up @@ -376,7 +377,7 @@ MODULE diag_manager_mod
END INTERFACE diag_field_add_attribute

! ----- interface to the C function -----
interface
interface
function exec_mppnccombine(outfile) bind(C)
use, intrinsic :: iso_c_binding, only: c_int, c_char
implicit none
Expand Down Expand Up @@ -3733,7 +3734,7 @@ subroutine combine_files()
integer(c_int) :: smallest_pix ! The smallest IO PE index of the set of IO PEs writing the current section file.
integer(c_int) :: ireturn ! Return code from mppnccombine
integer(c_int) :: niopes ! Number of IO PEs participating in writing of global files
integer :: f ! File index for the global diagnostic files
integer :: f ! File index for the global diagnostic files
integer :: pix_order ! 0-based order of the IO PE in the list of all IO PEs writing the file.
type(filepath_list_type), pointer :: current
type(filepath_list_type), pointer :: files_to_combine ! list of files to combined by this PE
Expand All @@ -3754,8 +3755,8 @@ subroutine combine_files()
filepath = trim(adjustl(current%path))
outfile = filepath(1:len(filepath)-5) // c_null_char

! get the number of files to combine (for the first global file only). The number of files is the
! same for all global files. Similarly, get pix and pix_order for the first file only, since for
! get the number of files to combine (for the first global file only). The number of files is the
! same for all global files. Similarly, get pix and pix_order for the first file only, since for
! all global files, the pix and pix_order are the same.
if (niopes == 0) then
niopes = num_partitioned_files(outfile)
Expand Down Expand Up @@ -3806,7 +3807,9 @@ subroutine combine_files()
do while (associated(current))
!write(stdout_unit,*) ' Combining file ' // filepath(1:len(filepath)-5)
ireturn = exec_mppnccombine(current%path)
if (ireturn /= 0) call error_mesg('diag_manager_mod::combine_files', 'mppnccombine failed for file ' // trim(current%path), FATAL)
if (ireturn /= 0) &
call error_mesg('diag_manager_mod::combine_files', 'mppnccombine failed for file ' // &
trim(current%path), FATAL)
current => current%next
end do
end if
Expand All @@ -3825,10 +3828,10 @@ function get_pix_order(filename, num_files, pix) result(pix_order)
! local
integer :: pix_order ! 0-based order of the pix in the list of all IO PEs writing the file
character(len=4) :: suffix ! 0000, 0001, etc.
integer :: npes ! total number of all PEs
integer :: npes ! total number of all PEs
integer :: i, f
logical :: exists

npes = mpp_npes()
pix_order = -1

Expand Down
8 changes: 4 additions & 4 deletions diag_manager/diag_util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1726,8 +1726,8 @@ SUBROUTINE opening_file(file, time, filename_time)
INTEGER, ALLOCATABLE :: axesc(:) ! indices if compressed axes associated with the field
LOGICAL :: time_ops, aux_present, match_aux_name, req_present, match_req_fields
CHARACTER(len=7) :: avg_name = 'average'
CHARACTER(len=MAX_NAME_LENGTH) :: time_units, timeb_units, avg, error_string, filename, aux_name, req_fields, fieldname
CHARACTER(len=MAX_NAME_LENGTH) :: suffix, base_name
CHARACTER(len=MAX_NAME_LENGTH) :: time_units, timeb_units, avg, error_string, filename, aux_name, req_fields
CHARACTER(len=MAX_NAME_LENGTH) :: fieldname, suffix, base_name
CHARACTER(len=32) :: time_name, timeb_name,time_longname, timeb_longname, cart_name
CHARACTER(len=MAX_FILENAME_LENGTH) :: fname
CHARACTER(len=24) :: start_date
Expand Down Expand Up @@ -2290,10 +2290,10 @@ integer function find_first_fms_percent(filename)
integer :: i
integer :: first_percent
integer :: first_percent_loc

first_percent = INDEX(filename, '%1')
do i=2,9
write(first_fms_percent,"('%',i1)") i
write(first_fms_percent,"('%',i1)") i
first_percent_loc = INDEX(filename, first_fms_percent)
if (first_percent_loc > 0) then
if (first_percent == 0) then
Expand Down
Loading
Loading