Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ygyu/logging_config_to_extdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 authored Jun 9, 2023
2 parents 3a0d120 + a027c83 commit 3cc7aa5
Show file tree
Hide file tree
Showing 31 changed files with 1,765 additions and 845 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parameters:

# Anchors to prevent forgetting to update a version
os_version: &os_version ubuntu20
baselibs_version: &baselibs_version v7.7.0
baselibs_version: &baselibs_version v7.13.0
bcs_version: &bcs_version v11.00.0
tag_build_arg_name: &tag_build_arg_name maplversion

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
require-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -21,7 +21,7 @@ jobs:
blocking-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Build and Test MAPL GNU
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v7.7.0-openmpi_4.1.4-gcc_12.1.0
image: gmao/ubuntu20-geos-env-mkl:v7.13.0-openmpi_4.1.4-gcc_12.1.0
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
name: Build and Test MAPL Intel
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env:v7.7.0-intelmpi_2021.6.0-intel_2022.1.0
image: gmao/ubuntu20-geos-env:v7.13.0-intelmpi_2021.6.0-intel_2022.1.0
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
Expand Down
24 changes: 19 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added field utilities to perform basic numeric operations on fields
- For ExtDataDriver.x only, added logging config to Tests/ExtDataDriverMod.F90 to enable Logger there

### Changed

- Updated programs using FLAP for command line parsing to use fArgParse instead
- Updated `components.yaml` to match GEOSgcm v11.1.0
- ESMA_env v4.9.1 → v4.17.0
- Baselibs 7.13.0
- esmf v8.5.0b22
- GFE v1.10.0
- curl 8.1.1
- HDF5 1.10.10
- netCDF-C 4.9.2
- netCDF-Fortran 4.6.1
- CDO 2.2.0
- NCO 5.1.5
- Move to MPT 2.28 at NAS, and other various changes for TOSS4 at NAS
- ESMA_cmake v3.28.0 → v3.29.0
- Clean up for TOSS4 changes at NAS
- Make the GEOSadas CI build separate as it often fails due to race conditions in GSI

### Fixed
Expand All @@ -21,11 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.39.3] - 2023-06-07

### Add

- For ExtDataDriver.x only, added logging config to Tests/ExtDataDriverMod.F90 to enable Logger there
- Deprecate the use of FLAP for command line parsing in favor of fArgParse. FLAP support will be removed in MAPL 3

## [2.39.2] - 2023-05-30

Expand Down
19 changes: 9 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
cmake_minimum_required (VERSION 3.17)
cmake_policy (SET CMP0053 NEW)
cmake_policy (SET CMP0054 NEW)

get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT is_multi_config AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE}))
message (STATUS "Setting build type to 'Release' as none was specified.")
set (CMAKE_BUILD_TYPE Release CACHE STRING "Default Release-Choose the type of build.")
endif ()

project (
MAPL
VERSION 2.39.2
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the default build type to release
if (NOT CMAKE_BUILD_TYPE)
message (STATUS "Setting build type to 'Release' as none was specified.")
set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "Aggressive")
endif ()
# Set the possible values of build type for cmake-gui
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "Aggressive")

# mepo can now clone subrepos in three styles
set (ESMA_CMAKE_DIRS
Expand Down
2 changes: 1 addition & 1 deletion MAPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ esma_set_this()

esma_add_library (${this}
SRCS MAPL.F90
DEPENDENCIES MAPL.base MAPL.generic MAPL.pfio MAPL_cfio_r4 MAPL.gridcomps MAPL.orbit MAPL.griddedio ${EXTDATA_TARGET}
DEPENDENCIES MAPL.base MAPL.generic MAPL.pfio MAPL_cfio_r4 MAPL.gridcomps MAPL.orbit MAPL.griddedio MAPL.geom ${EXTDATA_TARGET}
esmf NetCDF::NetCDF_Fortran MPI::MPI_Fortran
$<$<BOOL:${BUILD_WITH_FLAP}>:FLAP::FLAP>
TYPE ${MAPL_LIBRARY_TYPE}
Expand Down
1 change: 1 addition & 0 deletions MAPL/MAPL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module MAPL
use MAPL_OpenMP_Support, only : MAPL_find_bounds => find_bounds
use MAPL_OpenMP_Support, only : MAPL_Interval => Interval
use MAPL_Profiler, initialize_profiler =>initialize, finalize_profiler =>finalize
use MAPL_Geom
implicit none
end module MAPL

Expand Down
4 changes: 2 additions & 2 deletions Tests/ExtDataDriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ program ExtData_Driver
character(len=*), parameter :: Iam="ExtData_Driver"
type(ExtDataDriver) :: Driver
type (MAPL_CapOptions) :: cap_options
type (MAPL_FlapCLI) :: cli
type (MAPL_FargparseCLI) :: cli

cli = MAPL_FlapCLI(description='extdata driver',authors='gmao')
cli = MAPL_FargparseCLI()
cap_options=MAPL_CapOptions(cli)

driver = ExtDataDriver('ExtDataApp',Root_SetServices,cap_options=cap_options,_RC)
Expand Down
16 changes: 8 additions & 8 deletions Tests/ExtDataRoot_GridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function evaluate_time(this,currTime,rc) result(dt)
class(timeVar), intent(in) :: this
type(ESMF_Time), intent(inout) :: currTime
integer, optional, intent(out) :: rc
real(REAL64) :: dt
real(kind=ESMF_KIND_R8) :: dt

integer :: status

Expand Down Expand Up @@ -482,6 +482,7 @@ subroutine FillState(inState,outState,time,grid,Synth,rc)
type(ESMF_State) :: pstate
character(len=:), pointer :: fexpr
integer :: i1,in,j1,jn,ldims(3),i,j
real(kind=ESMF_KIND_R8) :: doy,time_delta

call MAPL_GridGet(grid,localcellcountperdim=ldims,_RC)
call MAPL_Grid_Interior(grid,i1,in,j1,jn)
Expand All @@ -490,9 +491,6 @@ subroutine FillState(inState,outState,time,grid,Synth,rc)
_VERIFY(status)
call ESMF_StateGet(outState,itemNameList=outNameList,_RC)

call MAPL_GetPointer(inState,exPtr2,'time',_RC)
exPtr2=synth%tFunc%evaluate_time(Time,_RC)

call MAPL_GetPointer(inState,exPtr2,'i_index',_RC)
do j = 1,ldims(2)
do i=1,ldims(1)
Expand All @@ -505,15 +503,17 @@ subroutine FillState(inState,outState,time,grid,Synth,rc)
exPtr2(i,j)=j1+j-1
enddo
enddo
call MAPL_GetPointer(inState,exPtr2,'doy',_RC)
exPtr2 = compute_doy(time,_RC)

call ESMF_StateGet(inState,'time',farray(1),_RC)
time_delta = synth%tFunc%evaluate_time(Time,_RC)
call FieldSet(farray(1), time_delta,_RC)
call ESMF_StateGet(inState,'lons',farray(2),_RC)
call ESMF_StateGet(inState,'lats',farray(3),_RC)
call ESMF_StateGet(inState,'i_index',farray(4),_RC)
call ESMF_StateGet(inState,'j_index',farray(5),_RC)
call ESMF_StateGet(inState,'doy',farray(6),_RC)
doy = compute_doy(time,_RC)
call FieldSet(farray(6), doy,_RC)
pstate = ESMF_StateCreate(_RC)
call ESMF_StateAdd(pstate,farray,_RC)

Expand Down Expand Up @@ -556,8 +556,8 @@ subroutine CompareState(State1,State2,tol,rc)
call ESMF_StateGet(State2,trim(nameList(i)),field2,_RC)
call ESMF_FieldGet(field1,rank=rank1,_RC)
call ESMF_FieldGet(field2,rank=rank2,_RC)
all_undef1 = is_field_undef(field1,_RC)
all_undef2 = is_field_undef(field2,_RC)
all_undef1 = FieldIsConstant(field1,MAPL_UNDEF,_RC)
all_undef2 = FieldIsConstant(field2,MAPL_UNDEF,_RC)
if (all_undef1 .or. all_undef2) then
exit
end if
Expand Down
53 changes: 26 additions & 27 deletions Tests/pfio_MAPL_demo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
!
!#### Usage:
!
! If we reserve 2 haswell nodes (28 cores in each), want to run the model on 28 cores
! If we reserve 2 haswell nodes (28 cores in each), want to run the model on 28 cores
! and use 1 MultiGroup with 5 backend processes, then the execution command is:
!```
! mpiexec -np 56 pfio_MAPL_demo.x --npes_model 28 --oserver_type multigroup --nodes_output_server 1 --npes_backend_pernode 5
Expand Down Expand Up @@ -38,7 +38,7 @@ program main
integer, parameter :: num_dims = 2 ! number of dimension to decompose

! PFIO specific variables
type(MAPL_FlapCLI) :: cli
type(MAPL_FargparseCLI) :: cli
type(MAPL_CapOptions) :: cap_options
type(ServerManager) :: ioserver_manager
type(SplitCommunicator) :: split_comm
Expand Down Expand Up @@ -85,8 +85,7 @@ program main
!------------------------------------------------------------------------------

! Read and parse the command line, and set parameters
cli = MAPL_FlapCLI(description = 'GEOS AGCM', &
authors = 'GMAO')
cli = MAPL_FargparseCLI()
cap_options = MAPL_CapOptions(cli)

! Initialize MPI if MPI_Init has not been called
Expand Down Expand Up @@ -123,22 +122,22 @@ program main
! ---> Perform domain decomposition for the model
!------------------------------------------------
call perform_domain_deposition()

! Allocate model variables
!-------------------------
ALLOCATE(local_tracer(i1:i2, j1:j2))
ALLOCATE(local_temp(i1:i2, j1:j2, k1:k2))

! if there are multiple oserver, split it into large and small pool
call o_clients%split_server_pools()

call create_file_metada()

!---------------------------------------------
! ---> Model time stepping and writing outputs
!---------------------------------------------
call run_model()

deallocate(local_temp)
deallocate(local_tracer)
deallocate(points_per_procX)
Expand All @@ -157,11 +156,11 @@ program main
call ioserver_manager%finalize()

call MPI_finalize(ierror)

!------------------------------------------------------------------------------
CONTAINS
!------------------------------------------------------------------------------
!>
!>
! `create_member_subcommunicator` -- Create a subcommunicator
!
integer function create_member_subcommunicator(comm, n_members, npes_member, rc) result(subcommunicator)
Expand All @@ -183,7 +182,7 @@ integer function create_member_subcommunicator(comm, n_members, npes_member, rc)

end function create_member_subcommunicator
!------------------------------------------------------------------------------
!>
!>
! `initialize_mpi` -- Initialized MPI is MPI_Init has not been called yet.
!
subroutine initialize_mpi(comm)
Expand All @@ -204,7 +203,7 @@ subroutine initialize_mpi(comm)

end subroutine initialize_mpi
!------------------------------------------------------------------------------
!>
!>
! `initialize_ioserver` -- Initialize the IO Server using the command line options
!
subroutine initialize_ioserver(comm)
Expand All @@ -224,7 +223,7 @@ subroutine initialize_ioserver(comm)
_VERIFY(status)
end subroutine initialize_ioserver
!------------------------------------------------------------------------------
!>
!>
! `perform_domain_deposition` -- Perfom the domain decomposition
!
subroutine perform_domain_deposition()
Expand Down Expand Up @@ -267,7 +266,7 @@ subroutine perform_domain_deposition()
print '(a7,i5,a5,4i5)', 'pe_id: ', pe_id, '-->', i1, i2, j1, j2
end subroutine perform_domain_deposition
!------------------------------------------------------------------------------
!>
!>
! `create_file_metada` -- Create the file metada using PFIO methods and the file collection identifier
!
subroutine create_file_metada()
Expand Down Expand Up @@ -348,7 +347,7 @@ subroutine create_file_metada()
hist_id = o_clients%add_hist_collection(fmd)
end subroutine create_file_metada
!------------------------------------------------------------------------------
!>
!>
! `run_model` -- Run the model and write out the data
!
subroutine run_model()
Expand Down Expand Up @@ -415,7 +414,7 @@ subroutine run_model()
enddo
end subroutine run_model
!------------------------------------------------------------------------------
!>
!>
! `add_fvar` -- PFIO utility routine to create a variable and set attributes
!
subroutine add_fvar(cf, vname, vtype, dims, units, long_name ,rc)
Expand Down Expand Up @@ -449,10 +448,10 @@ subroutine add_fvar(cf, vname, vtype, dims, units, long_name ,rc)
_VERIFY(status)
end subroutine add_fvar
!------------------------------------------------------------------------------
!>
! `decompose_dim` --
! For a given number of grid points along a dimension and a number of
! available processors for that diemsion,, !! determine the number of
!>
! `decompose_dim` --
! For a given number of grid points along a dimension and a number of
! available processors for that diemsion,, !! determine the number of
! grid points assigned to each processor.
!
subroutine decompose_dim(dim_world, dim_array, num_procs )
Expand All @@ -472,7 +471,7 @@ subroutine decompose_dim(dim_world, dim_array, num_procs )
end subroutine decompose_dim
!------------------------------------------------------------------------------
!>
! `decompose_proc` --
! `decompose_proc` --
! Given the total number of available processors and the number of dimensions,
! determine the number of processors along each dimension.
!
Expand All @@ -491,10 +490,10 @@ subroutine decompose_proc(num_procs, proc_sizes)
END DO
end subroutine decompose_proc
!------------------------------------------------------------------------------
!>
! `mapping_domain` --
!>
! `mapping_domain` --
! Determime the indices of the local domain corners
! with respect to the global domain.
! with respect to the global domain.
!
subroutine mapping_domain(map_proc, map_domainX, map_domainY, &
points_per_procX, points_per_procY, NX, NY, &
Expand Down Expand Up @@ -550,7 +549,7 @@ subroutine mapping_domain(map_proc, map_domainX, map_domainY, &
enddo
end subroutine mapping_domain
!------------------------------------------------------------------------------
!>
!>
! `set_tracer` -- Arbitrary set values for a field
!
subroutine set_tracer(var)
Expand All @@ -566,7 +565,7 @@ subroutine set_tracer(var)

end subroutine set_tracer
!------------------------------------------------------------------------------
!>
!>
! `set_temperature` -- Arbitrary set values for the temperature field.
!
subroutine set_temperature(var)
Expand Down
1 change: 0 additions & 1 deletion base/Base.F90
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ module MAPLBase_Mod
use MAPL_ServerManager
use MAPL_FileMetadataUtilsMod
use MAPL_VerticalDataMod
use MAPL_FieldUtilities
use MAPL_SphericalGeometry
logical, save, private :: mapl_is_initialized = .false.

Expand Down
1 change: 0 additions & 1 deletion base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ set (srcs
Base/Base_Base.F90 Base/Base_Base_implementation.F90
TimeStringConversion.F90
MAPL_ISO8601_DateTime_ESMF.F90
FieldUtilities.F90
MAPL_Resource.F90
MAPL_XYGridFactory.F90
MAPL_NetCDF.F90
Expand Down
Loading

0 comments on commit 3cc7aa5

Please sign in to comment.