Skip to content

Commit

Permalink
Merge pull request #2116 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge Develop into Main for release
  • Loading branch information
mathomp4 authored May 1, 2023
2 parents d6b49c8 + 99cd6cc commit a78c1ce
Show file tree
Hide file tree
Showing 35 changed files with 2,279 additions and 88 deletions.
40 changes: 8 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ workflows:
checkout_mapl_branch: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra, retained for one day

# Build GEOSgcm -- GCC -- only to main
# Build GEOSgcm -- GCC
- ci/build:
filters:
branches:
only:
- main
name: build-GEOSgcm-on-<< matrix.compiler >>
context:
- docker-hub-creds
Expand Down Expand Up @@ -135,12 +131,8 @@ workflows:
fixture_branch: develop
checkout_mapl_branch: true

# Build GEOSldas on gfortran -- only to main
# Build GEOSldas on gfortran
- ci/build:
filters:
branches:
only:
- main
name: build-GEOSldas-on-<< matrix.compiler >>
context:
- docker-hub-creds
Expand All @@ -154,12 +146,8 @@ workflows:
fixture_branch: develop
checkout_mapl_branch: true

# Build GEOSadas (ifort only, needs a couple develop branches) -- only to main
# Build GEOSadas (ifort only, needs a couple develop branches)
- ci/build:
filters:
branches:
only:
- main
name: build-GEOSadas-on-<< matrix.compiler >>
context:
- docker-hub-creds
Expand All @@ -172,17 +160,13 @@ workflows:
checkout_fixture: true
# This branch on GEOSadas will be used to track subrepos needed
# for GEOSadas + MAPL develop much like how we do with MAPL 3
fixture_branch: feature/mathomp4/mapldevelop
#fixture_branch: feature/mathomp4/mapldevelop
checkout_mapl_branch: true
mepodevelop: false
rebuild_procs: 1

# Run GCM (1 hour, no ExtData) -- only to main
# Run GCM (1 hour, no ExtData)
- ci/run_gcm:
filters:
branches:
only:
- main
name: run-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
Expand All @@ -195,18 +179,14 @@ workflows:
baselibs_version: *baselibs_version
bcs_version: *bcs_version

# Run Coupled GCM (1 hour, no ExtData) -- only to main
# Run Coupled GCM (1 hour, no ExtData)
- ci/run_gcm:
filters:
branches:
only:
- main
name: run-coupled-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [ifort]
compiler: [gfortran, ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
Expand All @@ -215,12 +195,8 @@ workflows:
gcm_ocean_type: MOM6
change_layout: false

# Run MAPL Tutorials -- only to main
# Run MAPL Tutorials
- ci/run_mapl_tutorial:
filters:
branches:
only:
- main
name: run-<< matrix.tutorial_name >>-Tutorial-with-<< matrix.compiler >>
context:
- docker-hub-creds
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@v3
- uses: mheap/github-action-required-labels@v4
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@v3
- uses: mheap/github-action-required-labels@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger-circleci-pipeline-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
steps:
- name: CircleCI Trigger on Release
id: docker-build
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.7
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.1.0
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.38.0] - 2023-05-01

### Added

- Printed time to write files to the disk in MultiGroupServer
- Added merge function to Filemetadata to merge two meta objects
- Added support for "DEPENDS_ON" and "DEPENDS_ON_CHILDREN" for export_specs. The typical usage on this feature is when the calculation of a variable involves other export variables, either from the same component (DEPENDS_ON specifies the list on such variables), or in the children (in this case the expectation is that all of the children have the SAME export). In both cases MAPL performs automatic allocation of these export variables.
- Added support for use of pFlogger simTime in logging (only if `-DBUILD_WITH_PFLOGGER=ON`)
- Note: Due to bug in pFlogger v1.9.3 and older, you *must* specify a `dateFmt` in your logging configuration file in the
formatter when using `simTime` (see [pFlogger issue #90](https://github.com/Goddard-Fortran-Ecosystem/pFlogger/issues/90)).
This is fixed in pFlogger v1.10.0
- Add geom subdirectory and contents for MAPL Geom framework

### Changed

- Add logic to GriddedIO class so that if an uninitialized time object is passed, the resulting file will not depend on time
- Make sure the pfio files are closed when the time and speed appear in logfile
- Enable more tests in CircleCI

### Fixed

- Move ioserver_profiler%stop call to the right place
- Caught an untrapped error condition when writing to NetCDF

## [2.37.3] - 2023-04-25

### Fixed
Expand Down Expand Up @@ -46,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed message in _ASSERT statement in ESMFL_Mod.F90
- Fixed bug in CubedSphereGridFactory when constructing a grid from a file
- Cleaned up cubed-sphere grid factory and NCIO to produce files with consistent capitalization and types for the stretching factor

Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_policy (SET CMP0054 NEW)

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

# Set the default build type to release
Expand Down Expand Up @@ -202,6 +202,7 @@ add_subdirectory (MAPL_cfio MAPL_cfio_r8)
add_subdirectory (pfio)
add_subdirectory (profiler)
add_subdirectory (generic)
add_subdirectory (geom)
add_subdirectory (oomph) # temporary - will rename to generic when done
add_subdirectory (shared)
add_subdirectory (include)
Expand Down
3 changes: 3 additions & 0 deletions base/ApplicationSupport.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ subroutine initialize_pflogger(unusable,comm,logging_config,rc)
use pflogger, only: StreamHandler, FileHandler, HandlerVector
use pflogger, only: MpiLock, MpiFormatter
use pflogger, only: INFO, WARNING
use PFL_Formatter, only: get_sim_time
use mapl_SimulationTime, only: fill_time_dict

use, intrinsic :: iso_fortran_env, only: OUTPUT_UNIT

Expand Down Expand Up @@ -109,6 +111,7 @@ subroutine initialize_pflogger(unusable,comm,logging_config,rc)
end if

call pfl_initialize()
get_sim_time => fill_time_dict

if (logging_configuration_file /= '') then
call logging%load_file(logging_configuration_file)
Expand Down
6 changes: 5 additions & 1 deletion base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ set (srcs
# tstqsat.F90
)

# Add SimulationTime.F90 to srcs if we are building with pflogger
if (BUILD_WITH_PFLOGGER)
list(APPEND srcs SimulationTime.F90)
endif()

esma_add_library(
${this} SRCS ${srcs}
DEPENDENCIES MAPL.shared MAPL.constants MAPL.profiler MAPL.pfio MAPL_cfio_r4 PFLOGGER::pflogger
DEPENDENCIES MAPL.shared MAPL.constants MAPL.profiler MAPL.pfio MAPL_cfio_r4 PFLOGGER::pflogger
GFTL_SHARED::gftl-shared-v2 GFTL_SHARED::gftl-shared-v1 GFTL::gftl-v2 GFTL::gftl-v1
esmf NetCDF::NetCDF_Fortran MPI::MPI_Fortran
TYPE ${MAPL_LIBRARY_TYPE})
Expand Down
2 changes: 1 addition & 1 deletion base/ESMFL_Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ subroutine ESMFL_StateGetField(State, FieldName, Bundle, FieldAlias, RC)

call ESMF_FieldBundleGet(BUNDLE, FIELDNAME=NameInBundle, isPresent=isPresent, rc=STATUS)
_VERIFY(STATUS)
_ASSERT(.not. isPresent, trim(NameInBundle) // ' not found in bundle.')
_ASSERT(.not. isPresent, trim(NameInBundle) // ' found in bundle.')

! Get Field from State

Expand Down
28 changes: 19 additions & 9 deletions base/MAPL_TimeMethods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,28 @@ module MAPL_TimeDataMod
type(ESMF_TimeInterval) :: offset
character(len=:), allocatable :: funits
logical :: integer_time
logical :: is_initialized = .false.
contains
procedure :: add_time_to_metadata
procedure :: define_time_variable
procedure :: compute_time_vector
procedure :: get_start_time
procedure :: get
procedure :: setFrequency
procedure :: am_i_initialized
end type timeData

interface timeData
module procedure new_time_data
end interface timeData
contains

function am_i_initialized(this) result(logical_temp)
logical :: logical_temp
class(TimeData), intent(inout) :: this
logical_temp = this%is_initialized
end

function new_time_data(clock,ntime,frequency,offset,funits,integer_time,rc) result(tData)
type(timeData) :: tData
type(ESMF_Clock),intent(inout) :: clock
Expand All @@ -44,6 +52,7 @@ function new_time_data(clock,ntime,frequency,offset,funits,integer_time,rc) resu
logical, optional, intent(in) :: integer_time
integer, optional, intent(Out) :: rc

tData%is_initialized = .true.
tdata%clock=clock
tdata%ntime=ntime
tdata%frequency=frequency
Expand Down Expand Up @@ -230,16 +239,17 @@ subroutine add_time_to_metadata(this,metadata,rc)
integer :: tdim
integer :: status

if (this%ntime==-1) then
tdim = pFIO_UNLIMITED
else
tdim = this%ntime
if (this%is_initialized) then
if (this%ntime==-1) then
tdim = pFIO_UNLIMITED
else
tdim = this%ntime
end if
call metadata%add_dimension('time',tdim)
v = this%define_time_variable(_RC)
call metadata%add_variable('time',v,_RC)
end if
call metadata%add_dimension('time',tdim)
v = this%define_time_variable(rc=status)
_VERIFY(status)
call metadata%add_variable('time',v,rc=status)
_VERIFY(status)
_RETURN(_SUCCESS)

end subroutine add_time_to_metadata

Expand Down
5 changes: 3 additions & 2 deletions base/ServerManager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,16 @@ end subroutine initialize
subroutine finalize(this,rc)
class(ServerManager), intent(inout) :: this
integer, optional, intent(out) :: rc
integer :: status
! reporting here is for client_server in the same process which don't call start()
! problem here: all servers should coordinate to report one by one to avoid messy output
if (associated(this%i_server)) then
call this%i_server%report_profile()
call this%i_server%report_profile(_RC)
deallocate(this%i_server)
endif

if (associated(this%o_server)) then
call this%o_server%report_profile()
call this%o_server%report_profile(_RC)
deallocate(this%o_server)
endif
call this%directory_service%free_directory_resources()
Expand Down
52 changes: 52 additions & 0 deletions base/SimulationTime.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
! This module allows pFlogger to access the current simulation time in
! MAPL and thereby annotate log entries with the current simulation
! time. To accomplish this, the module hold a (shallow) copy
! of the clock in CapGridComp.

module mapl_SimulationTime
use pflogger, only: StringUnlimitedMap
use ESMF
implicit none
private

public :: set_reference_clock
public :: fill_time_dict

type(ESMF_Clock), save :: reference_clock

contains

subroutine set_reference_clock(clock)
type(ESMF_Clock), intent(in) :: clock
reference_clock = clock
end subroutine set_reference_clock

subroutine fill_time_dict(dict)
type (StringUnlimitedmap), intent(out) :: dict

integer :: status
type(ESMF_Time) :: time

integer :: yy, mm, dd, h, m, s

call ESMF_ClockValidate(reference_clock, rc=status)
if (status /= 0) error stop "Must pass reference via set_reference_clock() before use."

call ESMF_ClockGet(reference_clock, currTime=time, rc=status)
if (status /= 0) error stop "could not get current time in SimulationTime.F90"

call ESMF_TimeGet(time, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, rc=status)
if (status /= 0) error stop "Failed to get data from ESMF_TimeGet()."

call dict%insert('Y',yy)
call dict%insert('M',mm)
call dict%insert('D',dd)
call dict%insert('HH',h)
call dict%insert('MM',m)
call dict%insert('SS',s)
call dict%insert('MS',0)

end subroutine Fill_Time_Dict

end module mapl_SimulationTime

Loading

0 comments on commit a78c1ce

Please sign in to comment.