Skip to content

Commit

Permalink
Merge branch 'develop' into feature/atrayano/history_start_stop
Browse files Browse the repository at this point in the history
  • Loading branch information
atrayano committed Jan 2, 2025
2 parents ec7e897 + d4ab188 commit 0f22f6b
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parameters:
default: ""

# Anchors to prevent forgetting to update a version
os_version: &os_version ubuntu20
os_version: &os_version ubuntu24
baselibs_version: &baselibs_version v7.27.0
bcs_version: &bcs_version v11.6.0
tag_build_arg_name: &tag_build_arg_name maplversion
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: Build and Test MAPL GNU
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v7.27.0-openmpi_5.0.5-gcc_14.2.0
image: gmao/ubuntu24-geos-env-mkl:v7.27.0-openmpi_5.0.5-gcc_14.2.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 @@ -86,7 +86,7 @@ jobs:
name: Build and Test MAPL Intel
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env:v7.27.0-intelmpi_2021.13-ifort_2021.13
image: gmao/ubuntu24-geos-env:v7.27.0-intelmpi_2021.13-ifort_2021.13
# 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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
Added optional start_date and start_time to control the output window for each History collection. No output will be written before then. If not specified, these default to the beginning of the experiment.

- Added loggers when writing or reading weight files
- Added new option to AGCM.rc `overwrite_checkpoint` to allow checkpoint files to be overwritten. By default still will not overwrite checkpoints

### Changed

- Increased formatting width of time index in ExtData2G diagnostic print

### Fixed

- Fixed bug with return codes and macros in udunits2f

### Removed

### Deprecated

## [2.51.2] - 2024-12-19

### Changed

- Removed restriction that vector regridding in ExtData2G must be bilinear
- Update CI to use Ubuntu 24 images

### Fixed

- Fixed by when using multiple rules for a vector item in ExtData2G
- Fix profiler ExclusiveColumn test for GCC 14

## [2.51.1] - 2024-12-10

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

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

# Set the possible values of build type for cmake-gui
Expand Down
11 changes: 7 additions & 4 deletions base/MAPL_EsmfRegridder.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module MAPL_EsmfRegridderMod
use MAPL_RegridderSpecRouteHandleMap
use MAPL_MAPLGrid
use MAPL_ConstantsMod
use MAPL_CommsMod
use pFlogger, only: logging, Logger
implicit none
private

Expand Down Expand Up @@ -1443,6 +1443,9 @@ subroutine create_route_handle(this, kind, rc)
character(len=ESMF_MAXPATHLEN) :: rh_file,rh_trans_file
logical :: rh_file_exists, file_weights, compute_transpose

type(Logger), pointer :: lgr
lgr => logging%get_logger('MAPL')

if (kind == ESMF_TYPEKIND_R4) then
route_handles => route_handles_r4
transpose_route_handles => transpose_route_handles_r4
Expand All @@ -1469,7 +1472,7 @@ subroutine create_route_handle(this, kind, rc)
rh_file_exists = .false.
end if
if (rh_file_exists) then
if (mapl_am_I_root()) write(*,*) "reading weight file "//trim(rh_file)
call lgr%info('Reading weight file: %a', trim(rh_file))
route_handle = ESMF_RouteHandleCreate(rh_file,_RC)
call route_handles%insert(spec, route_handle)
if (compute_transpose) then
Expand Down Expand Up @@ -1588,10 +1591,10 @@ subroutine create_route_handle(this, kind, rc)
call ESMF_FieldDestroy(dst_field, rc=status)
_VERIFY(status)
if (file_weights) then
if (mapl_am_I_root()) write(*,*) " writing weight file "//trim(rh_file)
call lgr%info('Writing weight file: %a', trim(rh_file))
call ESMF_RouteHandleWrite(route_handle,rh_file,_RC)
if (compute_transpose) then
if (mapl_am_I_root()) write(*,*) " writing transpose weight file "//trim(rh_trans_file)
call lgr%info('Writing transpose weight file: %a', trim(rh_trans_file))
call ESMF_RouteHandleWrite(transpose_route_handle,rh_trans_file,_RC)
end if
end if
Expand Down
27 changes: 15 additions & 12 deletions base/NCIO.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,6 @@ subroutine MAPL_VarWriteNCpar_R4_2d(formatter, name, A, ARRDES, lev, offset2, oC
call mpi_gatherv( a, size(a), MPI_REAL, recvbuf, recvcounts, displs, MPI_REAL, &
0, arrdes%iogathercomm, status )
_VERIFY(STATUS)
call MPI_Barrier(arrdes%iogathercomm,status)
_VERIFY(STATUS)

if(myiorank==0) then

Expand Down Expand Up @@ -2706,8 +2704,6 @@ subroutine MAPL_VarWriteNCpar_R8_2d(formatter, name, A, ARRDES, lev, offset2, oC
call mpi_gatherv( a, size(a), MPI_DOUBLE_PRECISION, recvbuf, recvcounts, displs, &
MPI_DOUBLE_PRECISION, 0, arrdes%iogathercomm, status )
_VERIFY(STATUS)
call MPI_Barrier(arrdes%iogathercomm,status)
_VERIFY(STATUS)

if(myiorank==0) then

Expand Down Expand Up @@ -3516,11 +3512,12 @@ subroutine MAPL_ArrayReadNCpar_3d(varn,filename,farrayPtr,arrDes,rc)
_RETURN(ESMF_SUCCESS)
end subroutine MAPL_ArrayReadNCpar_3d

subroutine MAPL_BundleWriteNCPar(Bundle, arrdes, CLOCK, filename, oClients, rc)
subroutine MAPL_BundleWriteNCPar(Bundle, arrdes, CLOCK, filename, clobber, oClients, rc)
type(ESMF_FieldBundle), intent(inout) :: Bundle
type(ArrDescr), intent(inout) :: arrdes
type(ESMF_Clock), intent(in) :: CLOCK
character(len=*), intent(in ) :: filename
logical, intent(in) :: clobber
type (ClientManager), optional, intent(inout) :: oClients
integer, optional, intent(out) :: rc

Expand Down Expand Up @@ -3586,6 +3583,8 @@ subroutine MAPL_BundleWriteNCPar(Bundle, arrdes, CLOCK, filename, oClients, rc)
type(ESMF_Field) :: lons_field, lats_field
logical :: isGridCapture, have_oclients
real(kind=ESMF_KIND_R8), pointer :: grid_lons(:,:), grid_lats(:,:), lons_field_ptr(:,:), lats_field_ptr(:,:)
integer :: pfio_mode

have_oclients = present(oClients)

call ESMF_FieldBundleGet(Bundle,FieldCount=nVars, name=BundleName, rc=STATUS)
Expand Down Expand Up @@ -4178,9 +4177,11 @@ subroutine MAPL_BundleWriteNCPar(Bundle, arrdes, CLOCK, filename, oClients, rc)

else

pfio_mode = PFIO_NOCLOBBER
if (clobber) pfio_mode = PFIO_CLOBBER
if (arrdes%writers_comm /= mpi_comm_null) then
if (arrdes%num_writers == 1) then
call formatter%create(trim(filename), rc=status)
call formatter%create(trim(filename), mode=pfio_mode, rc=status)
_VERIFY(status)
call formatter%write(cf,rc=status)
_VERIFY(STATUS)
Expand All @@ -4193,7 +4194,7 @@ subroutine MAPL_BundleWriteNCPar(Bundle, arrdes, CLOCK, filename, oClients, rc)
_VERIFY(status)
call cf%add_attribute("Split_Cubed_Sphere", writer_rank, _RC)
else
call formatter%create_par(trim(filename),comm=arrdes%writers_comm,info=info,rc=status)
call formatter%create_par(trim(filename),mode=pfio_mode,comm=arrdes%writers_comm,info=info,rc=status)
_VERIFY(status)
endif
call formatter%write(cf,rc=status)
Expand Down Expand Up @@ -4311,13 +4312,14 @@ end subroutine add_fvar

end subroutine MAPL_BundleWriteNCPar

subroutine MAPL_StateVarWriteNCPar(filename, STATE, ARRDES, CLOCK, NAME, forceWriteNoRestart, oClients, RC)
subroutine MAPL_StateVarWriteNCPar(filename, STATE, ARRDES, CLOCK, NAME, forceWriteNoRestart, clobber, oClients, RC)
character(len=*) , intent(IN ) :: filename
type (ESMF_State) , intent(IN ) :: STATE
type(ArrDescr) , intent(INOUT) :: ARRDES
type(ESMF_Clock) , intent(IN ) :: CLOCK
character(len=*), optional, intent(IN ) :: NAME
logical, optional, intent(IN ) :: forceWriteNoRestart
logical, optional, intent(in ) :: clobber
type (ClientManager), optional, intent(inout) :: oClients
integer, optional, intent( OUT) :: RC

Expand All @@ -4343,6 +4345,7 @@ subroutine MAPL_StateVarWriteNCPar(filename, STATE, ARRDES, CLOCK, NAME, forceWr
logical :: is_test_framework, isGridCapture
integer :: fieldIsValid
type(ESMF_Array) :: array
logical :: local_clobber

call ESMF_StateGet(STATE,ITEMCOUNT=ITEMCOUNT,RC=STATUS)
_VERIFY(STATUS)
Expand All @@ -4362,9 +4365,9 @@ subroutine MAPL_StateVarWriteNCPar(filename, STATE, ARRDES, CLOCK, NAME, forceWr
_VERIFY(STATUS)

forceWriteNoRestart_ = .false.
if(present(forceWriteNoRestart)) then
forceWriteNoRestart_ = forceWriteNoRestart
endif
if(present(forceWriteNoRestart)) forceWriteNoRestart_ = forceWriteNoRestart
local_clobber = .false.
if (present(clobber)) local_clobber = clobber

if(present(NAME)) then
DOIT = ITEMNAMES==NAME
Expand Down Expand Up @@ -4498,7 +4501,7 @@ subroutine MAPL_StateVarWriteNCPar(filename, STATE, ARRDES, CLOCK, NAME, forceWr
call ESMF_AttributeSet(bundle_write, name="MAPL_GridCapture", value=isGridCapture, _RC)
end if

call MAPL_BundleWriteNCPar(Bundle_Write, arrdes, CLOCK, filename, oClients=oClients, rc=status)
call MAPL_BundleWriteNCPar(Bundle_Write, arrdes, CLOCK, filename, clobber=local_clobber, oClients=oClients, rc=status)
_VERIFY(STATUS)

_RETURN(ESMF_SUCCESS)
Expand Down
Loading

0 comments on commit 0f22f6b

Please sign in to comment.