Skip to content

Commit

Permalink
Merge pull request #2504 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 committed Dec 21, 2023
2 parents ed117a2 + 01600d3 commit 65c37d3
Show file tree
Hide file tree
Showing 40 changed files with 4,763 additions and 568 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ parameters:

# Anchors to prevent forgetting to update a version
os_version: &os_version ubuntu20
baselibs_version: &baselibs_version v7.14.0
baselibs_version: &baselibs_version v7.17.0
bcs_version: &bcs_version v11.3.0
tag_build_arg_name: &tag_build_arg_name maplversion

orbs:
ci: geos-esm/circleci-tools@1
ci: geos-esm/circleci-tools@2

workflows:
build-and-test:
Expand Down Expand Up @@ -221,7 +221,7 @@ workflows:
when:
equal: [ "release", << pipeline.parameters.GHA_Event >> ]
jobs:
- ci/publish-docker:
- ci/publish_docker:
filters:
tags:
only: /^v.*$/
Expand All @@ -238,7 +238,7 @@ workflows:
compiler_version: 2022.1.0
image_name: geos-env
tag_build_arg_name: *tag_build_arg_name
- ci/publish-docker:
- ci/publish_docker:
filters:
tags:
only: /^v.*$/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate_yaml_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
format: colored
config_file: .yamllint.yml

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: yamllint-logfile
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.14.0-openmpi_4.1.4-gcc_12.1.0
image: gmao/ubuntu20-geos-env-mkl:v7.17.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.14.0-intelmpi_2021.6.0-intel_2022.1.0
image: gmao/ubuntu20-geos-env:v7.17.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
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.43.0] - 2023-12-21

### Added

- Station sampler: add support to Global Historical Climatology Network Daily (GHCN-D)
- Add to trajectory sampler DEFINE_OBS_PLATFORM for reading multiple IODA files. To do this, we add union_platform function for observation.
- New directory (`docs/tutorial/grid_comps/automatic_code_generator`) containing an example showing how to automatically generate the source code using the `MAPL_GridCompSpecs_ACG.py` tool.
- Added/modified a few _ASSERT calls in ExtData, to better explain what is wrong in .yaml file

### Changed

- Change the verification of the grid in MAPL_GetGlobalHorzIJIndex to avoid collective call
- Swath grid step 1: allow for destroying and regenerating swath grid and regenerating regridder route handle, and creating
allocatable metadata in griddedIO. Modifications are made to GriddedIO.F90, MAPL_AbstractRegridder.F90, and MAPL_EsmfRegridder.F90.
- Swath grid step 2: add control keywords for swath grid. Allow for filename template with DOY. Allow for missing obs files. User needs to specify index_name_lon/lat, var_name_lon/lat/time, tunit, obs_file_begin/end/interval, Epoch and Epoch_init.
- Update CI to Baselibs 7.17.0 (for future MAPL3 work) and the BCs v11.3.0 (to fix coupled run)
- Update `components.yaml`
- ESMA_env v4.24.0 (Baselibs 7.17.0)
- Update CI to use circleci-tools v2
- Changed the Python MAPL `__init__.py` file to restore behavior from pre-Python3 transition where we did `from foo import *`. Also fix up other Python2 code to Python3.

### Fixed

- Fixed bug broken multi-step file output in History under certain template conditions
- [#2433] Implemented workarounds for gfortran-13
- Missing TARGET in GriddedIO - exposed runtime error when using NAG + debug.
- Allow ExtData2G to be built as SHARED or STATIC

## [2.42.4] - 2023-12-10

### Changed
Expand Down
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

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

# Set the possible values of build type for cmake-gui
Expand Down Expand Up @@ -207,6 +207,11 @@ endif ()

add_definitions(-Dsys${CMAKE_SYSTEM_NAME})

# Support for automated code generation
include(mapl_acg)
include(mapl_create_stub_component)
add_subdirectory (Apps)

# Special case - MAPL_cfio is built twice with two different precisions.
add_subdirectory (MAPL_cfio MAPL_cfio_r4)
add_subdirectory (MAPL_cfio MAPL_cfio_r8)
Expand Down Expand Up @@ -245,12 +250,6 @@ if (PFUNIT_FOUND)
add_subdirectory (pfunit EXCLUDE_FROM_ALL)
endif ()


# Support for automated code generation
include(mapl_acg)
include(mapl_create_stub_component)
add_subdirectory (Apps)

add_subdirectory (Tests)

# @env will exist here if MAPL is built as itself but not as part of, say, GEOSgcm
Expand Down
28 changes: 14 additions & 14 deletions Python/MAPL/Date.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def copy(self):
def __iter__(self):
return self

def next(self):
def __next__(self):
#Last day of the month.
if self.day == NumberDaysMonth(self.month, self.year):
self.day = 1
Expand Down Expand Up @@ -230,7 +230,7 @@ def __add__(self, n):
#Convert back to date format.
return DateFromJDNumber(temp)
else:
raise TypeError, "%s is not an integer." % str(n)
raise TypeError("%s is not an integer." % str(n))

def __sub__(self, date):
"""Returns the (signed) difference of days between the dates."""
Expand All @@ -253,7 +253,7 @@ def __sub__(self, date):
ret += NumberDaysYear(year)
return ret
else:
raise TypeError, "%s is neither an integer nor a Date." % str(date)
raise TypeError("%s is neither an integer nor a Date." % str(date))

#Adding an integer is "commutative".
def __radd__(self, n):
Expand Down Expand Up @@ -283,7 +283,7 @@ def ToCOMTime(self):
def DateFromJDNumber(n):
"""Returns a date corresponding to the given Julian day number."""
if not isinstance(n, int):
raise TypeError, "%s is not an integer." % str(n)
raise TypeError("%s is not an integer." % str(n))

a = n + 32044
b = (4*a + 3)//146097
Expand Down Expand Up @@ -320,21 +320,21 @@ def strpdate(s):
temp = Date()
curr_month = temp.month
while temp.month == curr_month:
print temp
temp.next()
print(temp)
next(temp)

print "\n"
print("\n")

#How many days until the end of the year?
temp = Date()
temp.day, temp.month = 1, 1
curr_year = temp.year
while temp.year == curr_year:
print "%s is %d days away from the end of the year." % (str(temp),
temp.DaysToEndYear())
print("%s is %d days away from the end of the year." % (str(temp),
temp.DaysToEndYear()))
temp += NumberDaysMonth(temp.month)

print "\n"
print("\n")

#Playing with __sub__.
temp = Date()
Expand All @@ -344,11 +344,11 @@ def strpdate(s):
temp_list.append(temp)
temp += NumberDaysMonth(temp.month)
for elem in temp_list:
print "%s differs %d days from current date: %s" % (str(elem),
print("%s differs %d days from current date: %s" % (str(elem),
elem - Date(),
str(Date()))
str(Date())))

print "\n"
print("\n")

#Swapping arguments works?
print 23 + Date()
print(23 + Date())
8 changes: 8 additions & 0 deletions Python/MAPL/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@
"""

__version__ = "1.0.0"

from .exp import *
from .job import *
from .run import *
from .config import *
from .history import *
from .Date import *
from .filelock import *
6 changes: 3 additions & 3 deletions Python/MAPL/exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __del__(self):
self.submit() # resubmit itsef

def submit(self):
raise NotImplementedError, "Not implemented yet"
raise NotImplementedError("Not implemented yet")


# --------------
Expand Down Expand Up @@ -74,15 +74,15 @@ def setup(inConfigFiles=None):
os.mkdir(tmpdir)
os.chdir(tmpdir)
if os.system(cmd):
raise IOerror, "red_ma.pl did not complete successfully"
raise IOerror("red_ma.pl did not complete successfully")

# Resources as specified by user
# ------------------------------
cf = Config(ConfigFiles)

# Setup directory tree
# --------------------
for dir in cf.regex('Dir$').values():
for dir in list(cf.regex('Dir$').values()):
os.mkdir(dir)

# Populate Resources
Expand Down
13 changes: 6 additions & 7 deletions Python/MAPL/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A special class for handling history resources.
"""

from config import *
from .config import *

class History(Config):

Expand Down Expand Up @@ -35,15 +35,14 @@ def arc(self,outFile):
*.temkplate resources.
"""
dict = self.regex('template$')
Tmpl = [str.replace("'","").replace(",","") for str in dict.values()]
Coll = [ str.split('.')[0].replace(",","") for str in dict.keys() ]
Tmpl = [str.replace("'","").replace(",","") for str in list(dict.values())]
Coll = [ str.split('.')[0].replace(",","") for str in list(dict.keys()) ]
Arch = [str.replace("'","").replace(",","") \
for str in self.regex('archive$').values()]
for str in list(self.regex('archive$').values())]

if len(Tmpl) != len(Arch):
raise IOError,\
"There are %d template resources but only %d archive resources."\
%(len(Tmpl),len(Arch))
raise IOError("There are %d template resources but only %d archive resources."\
%(len(Tmpl),len(Arch)))

header = '# PESTO resource for History Collections ' + \
'(automatically generated - do not edit)'
Expand Down
10 changes: 5 additions & 5 deletions Python/MAPL/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"""

import Abstract
from exp import Exp
from . import Abstract
from .exp import Exp

class Job(Exp):

Expand Down Expand Up @@ -72,13 +72,13 @@ def __del__(self):
# -----------------

def getResources(self):
raise NotImplementedError, "Not implemented yet"
raise NotImplementedError("Not implemented yet")

def getRecyclables(self):
raise NotImplementedError, "Not implemented yet"
raise NotImplementedError("Not implemented yet")

def putRecyclables(self):
raise NotImplementedError, "Not implemented yet"
raise NotImplementedError("Not implemented yet")


# ----------------
Expand Down
2 changes: 1 addition & 1 deletion Python/MAPL/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from job import Job
from .job import Job

class Run(Job):

Expand Down
12 changes: 7 additions & 5 deletions base/Base/Base_Base_implementation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3210,17 +3210,19 @@ function grid_is_ok(grid) result(OK)
type(ESMF_Grid), intent(inout) :: grid
logical :: OK
integer :: I1, I2, J1, J2, j
real(ESMF_KIND_R8), allocatable :: corner_lons(:,:), corner_lats(:,:)
real(ESMF_KIND_R8), pointer :: corner_lons(:,:), corner_lats(:,:)
real(ESMF_KIND_R8) :: accurate_lat, accurate_lon
real :: tolerance

tolerance = epsilon(1.0)
call MAPL_GridGetInterior(grid,I1,I2,J1,J2)
OK = .true.
! check the edge of face 1 along longitude
allocate(corner_lons(I2-I1+2, J2-J1+2))
allocate(corner_lats(I2-I1+2, J2-J1+2))
call MAPL_GridGetCorners(Grid,corner_lons,corner_lats)
call ESMF_GridGetCoord(grid,localDE=0,coordDim=1,staggerloc=ESMF_STAGGERLOC_CORNER, &
farrayPtr=corner_lons, rc=status)
call ESMF_GridGetCoord(grid,localDE=0,coordDim=2,staggerloc=ESMF_STAGGERLOC_CORNER, &
farrayPtr=corner_lats, rc=status)

if ( I1 ==1 .and. J2<=IM_WORLD ) then
if (J1 == 1) then
accurate_lon = 1.750d0*MAPL_PI_R8 - shift
Expand All @@ -3233,7 +3235,7 @@ function grid_is_ok(grid) result(OK)
endif
endif

do j = J1, J2+1
do j = J1+1, J2
accurate_lat = -alpha + (j-1)*dalpha
if ( abs(accurate_lat - corner_lats(1,j-J1+1)) > 5.0*tolerance) then
print*, "accurate_lat: ", accurate_lat
Expand Down
4 changes: 2 additions & 2 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set (srcs
MAPL_IO.F90
MAPL_LatLonGridFactory.F90 MAPL_TransposeRegridder.F90
MAPL_Comms.F90 MAPL_LatLonToLatLonRegridder.F90 MAPL_TripolarGridFactory.F90
MAPL_LlcGridFactory.F90
MAPL_LlcGridFactory.F90 MAPL_SwathGridFactory.F90
MAPL_Config.F90 MAPL_LocStreamMod.F90
MAPL_ConservativeRegridder.F90 MAPL_MaxMinMod.F90 MAPL_VerticalInterpMod.F90
MAPL_CubedSphereGridFactory.F90 MAPL_MemUtils.F90 MAPL_VerticalMethods.F90
Expand All @@ -55,7 +55,7 @@ set (srcs
MAPL_Resource.F90
MAPL_XYGridFactory.F90
MAPL_NetCDF.F90 Plain_netCDF_Time.F90
MAPL_DateTime_Parsing_ESMF.F90
MAPL_DateTime_Parsing_ESMF.F90 MAPL_ObsUtil.F90
# Orphaned program: should not be in this library.
# tstqsat.F90
)
Expand Down
Loading

0 comments on commit 65c37d3

Please sign in to comment.