Skip to content

Commit

Permalink
Merge pull request #560 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Pull Develop into Main for MAPL 2.3 Release
  • Loading branch information
tclune authored Oct 1, 2020
2 parents 8e1ce36 + 4c71ac4 commit becc833
Show file tree
Hide file tree
Showing 85 changed files with 5,253 additions and 2,580 deletions.
177 changes: 177 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
version: 2.1

executors:
gcc-build-env:
docker:
- image: gmao/ubuntu20-geos-env-mkl:6.0.16-openmpi_4.0.5-gcc_10.2.0
environment:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
resource_class: xlarge

jobs:
build-and-test-MAPL:
executor: gcc-build-env
working_directory: /root/project
steps:
- checkout:
path: MAPL
- run:
name: "Versions etc"
command: mpirun --version && gfortran --version && echo $BASEDIR && pwd && ls
- run:
name: "Mepo clone external repos"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/MAPL
mepo clone
mepo status
- run:
name: "CMake"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/MAPL
mkdir build
cd build
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DMPIEXEC_PREFLAGS='--oversubscribe'
- run:
name: "Build and install"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/MAPL/build
make -j"$(nproc)" install
- run:
name: "Run MAPL Unit Tests"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/MAPL/build
make -j"$(nproc)" build-tests
# skip Performance tests (maybe doable on CircleCI?)
ctest -R MAPL -LE PERFORMANCE --output-on-failure
build-GEOSgcm:
executor: gcc-build-env
working_directory: /root/project
steps:
- run:
name: "Checkout GEOSgcm fixture"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}
git clone https://github.com/GEOS-ESM/GEOSgcm.git
- run:
name: "Mepo clone external repos"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm
mepo clone
mepo develop GEOSgcm_GridComp GEOSgcm_App
mepo status
- run:
name: "Mepo checkout MAPL branch"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm
mepo checkout ${CIRCLE_BRANCH} MAPL
mepo status
- run:
name: "CMake"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm
mkdir build
cd build
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-GEOSgcm -DUSE_F2PY=OFF
- run:
name: "Build and install"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm/build
make -j"$(nproc)" install
# We need to persist the install for the next step
- persist_to_workspace:
root: workspace
paths:
- install-GEOSgcm

make-FV3-experiment:
executor: gcc-build-env
working_directory: /root/project
steps:
- attach_workspace:
at: workspace
- run:
name: "Run fv3_setup"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/install-GEOSgcm/bin
INPUT_FOR_SETUP=$(cat \<<END_HEREDOC
test-fv3-c12
test-fv3-c12
12
72
NO
NO
${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
NULL
END_HEREDOC
)
echo "$INPUT_FOR_SETUP" > /tmp/input.txt
cat /tmp/input.txt | ./fv3_setup
- run:
name: "Change FV_NX, FV_NY, and RUN_CMD"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
sed -i.bak -e '/set FV_NX/ s/\([0-9]\+\)/1/' -e '/set FV_NY/ s/\([0-9]\+\)/6/' -e '/set RUN_CMD/ c\set RUN_CMD = "mpirun -np "' fv3.j
- run:
name: "Cat fv3.j"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
cat fv3.j
# We need to persist the install for the next step
- persist_to_workspace:
root: workspace
paths:
- test-fv3-c12

run-FV3-standalone:
executor: gcc-build-env
working_directory: /root/project
steps:
- attach_workspace:
at: workspace
- run:
name: "Run fv3.j"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
./fv3.j
- run:
name: "Check for EGRESS"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
# The scratch directory for fv3 standalone isn't consistent
SCRDIR=$(find . -type d -name 'scratch*')
if [[ -f $SCRDIR/EGRESS ]]
then
echo "EGRESS found!"
else
echo "EGRESS not found!"
exit 1
fi
- run:
name: "Cat log file"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
cat *.log
workflows:
version: 2.1
build-and-test:
jobs:
- build-and-test-MAPL
- build-GEOSgcm
- make-FV3-experiment:
requires:
- build-GEOSgcm
- run-FV3-standalone:
requires:
- make-FV3-experiment

16 changes: 16 additions & 0 deletions .github/workflows/changelog-enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Enforce Changelog"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dangoslen/[email protected]
with:
changeLogPath: 'CHANGELOG.md'
skipLabel: 'Skip Changelog'

2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build_test_mapl:
name: Build and Test MAPL
runs-on: ubuntu-latest
container: gmao/geos-build-env-gcc-source:6.0.13-openmpi_4.0.3-gcc_9.3.0
container: gmao/ubuntu20-geos-env-mkl:6.0.13-openmpi_4.0.4-gcc_10.2.0
env:
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
Expand Down
7 changes: 4 additions & 3 deletions Apps/MAPL_GridCompSpecs_ACG.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ def internal_name(name):
return name[:-1]
else:
return name

@staticmethod
def mangled_name(name):
if name[-1] == '*':
return "'" + name[:-1] + "'//trim(comp_name)"
else:
return "'" + name + "'"


def emit_declare_pointers(self):
text = self.emit_header()
Expand Down Expand Up @@ -137,7 +135,10 @@ def emit_arg(self, option):
return ''
text = text + option + "="
if option in MAPL_DataSpec.stringlike_options:
value = MAPL_DataSpec.mangled_name(value)
if option == 'short_name':
value = MAPL_DataSpec.mangled_name(value)
else:
value = "'"+value+"'"
elif option in MAPL_DataSpec.arraylike_options:
value = '[' + value + ']' # convert to Fortran 1D array
else:
Expand Down
1 change: 0 additions & 1 deletion Apps/mapl_stub.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
#----------------------------------------------------------------------------

use Env; # make env vars readily available
use Getopt::Std; # command line options

# Command line options
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Removed


## [2.3.0] - 2020-09-29

### Added

- Add MultiComm, MultiGroupi and MultiLayer to include front ends and back ends in the oserver
- Added routine to finalize the ioservers so that it can be called by another application using cap, like JEDI
- Re-added CircleCI with FV3 standalone test
- Add ability to run multiple forward time integrations within one execution for JEDI (#529)
- Added mpeu `StrTemplate` replacement to MAPL

### Changed

- Automate the server pool split and history work distribution when there are multiple oservers
- Moved more code to use pFlogger
- Update to ESMA_cmake v3.2.1 and ESMA_env v3.0.0
- Update GitHub Actions to use Ubuntu 20/GCC 10 image
- Updated CircleCI image to use 6.0.16 Baselibs
- Refactor the option WRITE_RESTART_BY_OSERVER
- Change the writing rank calculation in ServerThread.F90
- Cleanup of the NUOPC Wrapper's error handling using macros


### Fixed

- Removed non-standard OpenMP pragma
- Fixed problem with name mangling in ACG
- Fix MAPL comm bug with NUOPC
- Fixed pointer issue exposed by GNU
- Fixed ESMF logging errors with non-72-level runs (#480)
- Remove unneeded `use Env;` in stub generator
- Fixed tripolar metadata output (#528)
- Fixed `MAPL_ErrLogMain.h` for use with GSI_App
- Added MAPL_CFIOReadParallel change from Ricardo for TimeList

### Removed

- Remove MAPL_ioClients.F90 and move some subroutines to ClientManager.F90
- Remove unneeded GNU make file

## [2.2.7] - 2020-06-26

### Changed
Expand Down
2 changes: 1 addition & 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.2.7
VERSION 2.3.0
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/ESMA_cmake)
Expand Down
4 changes: 2 additions & 2 deletions Tests/ExtDataDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function newExtDataDriver(name,set_services, unusable, cap_options, rc) result(d
call driver%initialize_mpi()
call MAPL_Initialize(rc=status)
_VERIFY(status)
_RETURN(_SUCCESS)
end function newExtDataDriver

subroutine run(this,RC)
Expand Down Expand Up @@ -136,8 +137,7 @@ subroutine run(this,RC)
call iter%next()
enddo

call i_Clients%terminate()
call o_Clients%terminate()
call this%cap_server%finalize()
end select

call MPI_Barrier(CommCap,status)
Expand Down
10 changes: 5 additions & 5 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ endif()


set (srcs
AbstractCommSplitter.F90 MAPL_ExtData_IOBundleMod.F90 MAPL_Profiler.F90
MAPL_ExtData_IOBundleMod.F90 MAPL_Profiler.F90
CFIOCollection.F90 MAPL_ExtData_IOBundleVectorMod.F90 MAPL_RegridderManager.F90
CommGroupDescription.F90 MAPL_RegridderSpec.F90
MAPL_RegridderSpec.F90
MAPL_FractionalRegridder.F90 MAPL_RegridderTypeSpecRegridderMap.F90
ESMF_CFIOPtrVectorMod.F90 MAPL_GenericCplComp.F90 MAPL_RegridderVector.F90
ESMFL_Mod.F90 MAPL_Generic.F90 MAPL_SatVapor.F90
Expand All @@ -24,7 +24,7 @@ set (srcs
MAPL_Base.F90 MAPL_HistoryGridComp.F90 MAPL_StringRouteHandleMap.F90
MAPL_Cap.F90 MAPL_IdentityRegridder.F90 MAPL_stubs.F90
MAPL_CapGridComp.F90 MAPL_Integer64GridFactoryMap.F90 MAPL_sun_uc.F90
MAPL_CapOptions.F90 MAPL_ioClients.F90 MAPL_TilingRegridder.F90
MAPL_CapOptions.F90 MAPL_TilingRegridder.F90
MAPL_CFIO.F90 MAPL_IO.F90 MAPL_TimeMethods.F90
MAPL_CFIOServer.F90 MAPL_LatLonGridFactory.F90 MAPL_TransposeRegridder.F90
MAPL_Comms.F90 MAPL_LatLonToLatLonRegridder.F90 MAPL_TripolarGridFactory.F90
Expand All @@ -36,8 +36,8 @@ set (srcs
MAPL_EsmfRegridder.F90 MAPL_NewArthParser.F90
MAPL_ESMFTimeVectorMod.F90 MAPL_newCFIO.F90 Regrid_Functions_Mod.F90
MAPL_EtaHybridVerticalCoordinate.F90 MAPL_newCFIOitem.F90
MAPL_ExtDataCollection.F90 MAPL_NominalOrbitsMod.F90 SimpleCommSplitter.F90
MAPL_ExtDataCollectionManager.F90 MAPL_NUOPCWrapperMod.F90 SplitCommunicator.F90
MAPL_ExtDataCollection.F90 MAPL_NominalOrbitsMod.F90
MAPL_ExtDataCollectionManager.F90 MAPL_NUOPCWrapperMod.F90
MAPL_ExtDataGridCompMod.F90 MAPL_OrbGridCompMod.F90 tstqsat.F90
MAPL_LocStreamFactoryMod.F90 MAPL_HistoryTrajectoryMod.F90 MAPL_LocstreamRegridder.F90
ServerManager.F90 ApplicationSupport.F90
Expand Down
3 changes: 2 additions & 1 deletion base/FileMetadataUtilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,15 @@ function get_variable_attribute(this,var_name,attr_name,rc) result(units)
isPresent = var%is_attribute_present(trim(attr_name))
if (isPresent) then
attr => var%get_attribute(trim(attr_name))
!if (associated(attr)) then
vunits => attr%get_value()
select type(vunits)
type is (character(*))
units => vunits
class default
_ASSERT(.false.,'units must be string')
end select
else
units => null()
end if
_RETURN(_SUCCESS)

Expand Down
19 changes: 16 additions & 3 deletions base/MAPL_AbstractGridFactory.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module MAPL_AbstractGridFactoryMod
procedure(get_grid_vars), deferred :: get_grid_vars
procedure(append_variable_metadata), deferred :: append_variable_metadata
procedure(generate_file_bounds), deferred :: generate_file_bounds
procedure(generate_file_corner_bounds), deferred :: generate_file_corner_bounds
procedure(generate_file_reference2D), deferred :: generate_file_reference2D
procedure(generate_file_reference3D), deferred :: generate_file_reference3D
end type AbstractGridFactory
Expand Down Expand Up @@ -176,13 +177,25 @@ subroutine generate_file_bounds(this,grid,local_start,global_start,global_count,
import AbstractGridFactory
class (AbstractGridFactory), intent(inout) :: this
type(ESMF_Grid), intent(inout) :: grid
integer, allocatable, intent(inout) :: local_start(:)
integer, allocatable, intent(inout) :: global_start(:)
integer, allocatable, intent(inout) :: global_count(:)
integer, allocatable, intent(out) :: local_start(:)
integer, allocatable, intent(out) :: global_start(:)
integer, allocatable, intent(out) :: global_count(:)
integer, optional, intent(out) :: rc

end subroutine generate_file_bounds

subroutine generate_file_corner_bounds(this,grid,local_start,global_start,global_count,rc)
use esmf
import AbstractGridFactory
class (AbstractGridFactory), intent(inout) :: this
type(ESMF_Grid), intent(inout) :: grid
integer, allocatable, intent(out) :: local_start(:)
integer, allocatable, intent(out) :: global_start(:)
integer, allocatable, intent(out) :: global_count(:)
integer, optional, intent(out) :: rc

end subroutine generate_file_corner_bounds

function generate_file_reference2D(this,fpointer) result(ref)
use pFIO
import AbstractGridFactory
Expand Down
Loading

0 comments on commit becc833

Please sign in to comment.