Skip to content

Commit

Permalink
Merge pull request #986 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Merge develop into main for 2.8.3 Release
  • Loading branch information
tclune authored Aug 19, 2021
2 parents 0873af1 + c156dfe commit 0ca59e5
Show file tree
Hide file tree
Showing 72 changed files with 1,102 additions and 809 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog-enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: dangoslen/changelog-enforcer@v2
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'Skip Changelog,0 diff trivial'
skipLabels: 'Skip Changelog,0 diff trivial,automatic'
missingUpdateErrorMessage: >
No update to CHANGELOG.md found! Please add a changelog
entry to it describing your change. Please note that the
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: develop
target_branch: release/MAPL-v3
label: automatic,MAPL3
label: automatic,MAPL3,Skip Changelog
template: .github/PULL_REQUEST_TEMPLATE/auto_pr_to_mapl3.md
get_diff: true
assignee: ${{ github.actor }}
Expand Down
12 changes: 9 additions & 3 deletions Apps/MAPL_GridCompSpecs_ACG.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import sys
import os
import csv
import pandas as pd


###############################################################
Expand Down Expand Up @@ -183,6 +182,13 @@ def csv_record_reader(csv_reader):
elif not prev_row_blank:
return

def dataframe(reader, columns):
""" Read a reader iterator and return a list of dictionaries, each including column name and value. """
df = []
for row in reader:
df.append(dict(zip(columns, row)))
return df

column_aliases = {
'NAME' : 'short_name',
'LONG NAME' : 'long_name',
Expand Down Expand Up @@ -217,7 +223,7 @@ def csv_record_reader(csv_reader):
columns.append(column_aliases[c])
else:
columns.append(c)
specs[category] = pd.DataFrame(gen, columns=columns)
specs[category] = dataframe(gen, columns)
except StopIteration:
break

Expand Down Expand Up @@ -310,7 +316,7 @@ def open_with_header(filename):

# Generate code from specs (processed above with pandas)
for category in ("IMPORT","EXPORT","INTERNAL"):
for item in specs[category].to_dict("records"):
for item in specs[category]:
spec = MAPL_DataSpec(category.lower(), item)
if f_specs[category]:
f_specs[category].write(spec.emit_specs())
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

### Added

### Changed

### Fixed

## [2.8.3] - 2021-08-19

### Removed

- Removed Pandas dependency
- Removed unused functions from NominalOrbits Module

### Added

- Added error message to pFIO_NetCDF4_FileFormatterMod if nf90_open() fails.
- Add option to flip native level output in History relative to input
- Added `MAPL_AllocNodeArray_6DR8` and `MAPL_DeAllocNodeArray_6DR8` to Shmem
- Refactors Constants into its own library and consolidated mathematical/physical constants used throughout code to use those from library
- Added single precision Degrees to Radian Conversion

### Changed

- Simplified implementation of MAPL_FieldCopyAttributes
- Updated `components.yaml`
- ESMA_cmake v3.5.3

### Fixed

- Added npes for pfio_MAPL_demo.F90 when --npes_model is not specified in command line
- Fixed bug in ExtData when doing vector pairs

## [2.8.2] - 2021-07-29

### Removed
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.8.2
VERSION 2.8.3
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# mepo can now clone subrepos in three styles
Expand Down
2 changes: 0 additions & 2 deletions MAPL_cfio/ESMF_CFIOUtilMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ module ESMF_CFIOUtilMod
integer, parameter :: NDIMS_MAX = 4
integer, parameter :: MAX_VAR_DIMS = 32
character*7, parameter :: GRID_NAME='EOSGRID'
integer, parameter :: NFILES_MAX = 64
integer, parameter :: NVARS_MAX = 128
integer, parameter :: MAXCHR = 256
integer, parameter :: PACK_BITS = 32766
integer, parameter :: PACK_FILL = 32767
Expand Down
146 changes: 127 additions & 19 deletions Python/MAPL/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,32 @@
MAPL_DEGREES_TO_RADIANS = MAPL_PI / 180.0
MAPL_RADIANS_TO_DEGREES = 180.0 / MAPL_PI

MAPL_UNDEF = 1.0e15

MAPL_PSDRY = 98305.0

MAPL_PSDRY = 98305.0 # dry surface pressure [Pa]
MAPL_SECONDS_PER_SIDEREAL_DAY = 86164.0 #s
MAPL_GRAV = 9.80665 # m^2/s
MAPL_RADIUS = 6371.0E3 # m
MAPL_OMEGA = 2.0*MAPL_PI/86164.0 # 1/s
MAPL_STFBOL = 5.6734E-8 # W/(m^2 K^4)
MAPL_AIRMW = 28.965 # kg/Kmole
MAPL_H2OMW = 18.015 # kg/Kmole
MAPL_O3MW = 47.9982 # kg/Kmole
MAPL_RUNIV = 8314.47 # J/(Kmole K)
MAPL_ALHL = 2.4665E6 # J/kg @15C
MAPL_ALHF = 3.3370E5 # J/kg
MAPL_ALHS = MAPL_ALHL+MAPL_ALHF # J/kg
MAPL_OMEGA = 2.0*MAPL_PI/MAPL_SECONDS_PER_SIDEREAL_DAY # 1/s
MAPL_EARTH_ECCENTRICITY = 8.1819190842622E-2 # --
MAPL_EARTH_SEMIMAJOR_AXIS = 6378137 # m
MAPL_KM_PER_DEG = (1.0/(MAPL_RADIUS/1000.)) * MAPL_RADIANS_TO_DEGREES
MAPL_DEG_PER_KM = (MAPL_RADIUS/1000.) * MAPL_DEGREES_TO_RADIANS

MAPL_AIRMW = 28.965 # kg/Kmole
MAPL_RDRY = MAPL_RUNIV/MAPL_AIRMW # J/(kg K)
MAPL_CPDRY = 3.5*MAPL_RDRY # J/(kg K)
MAPL_CVDRY = MAPL_CPDRY-MAPL_RDRY # J/(kg K)

MAPL_RVAP = MAPL_RUNIV/MAPL_H2OMW # J/(kg K)
MAPL_CPVAP = 4.*MAPL_RVAP # J/(kg K)
MAPL_CVVAP = MAPL_CPVAP-MAPL_RVAP # J/(kg K)

MAPL_KAPPA = MAPL_RDRY/MAPL_CPDRY # (2.0/7.0)

MAPL_EPSILON = MAPL_H2OMW/MAPL_AIRMW # --
MAPL_DELTAP = MAPL_CPVAP/MAPL_CPDRY # --
MAPL_DELTAV = MAPL_CVVAP/MAPL_CVDRY # --
MAPL_GAMMAD = MAPL_CPDRY/MAPL_CVDRY # --

MAPL_RGAS = MAPL_RDRY # J/(kg K) (DEPRECATED)
MAPL_CP = MAPL_RGAS/MAPL_KAPPA # J/(kg K) (DEPRECATED)
MAPL_VIREPS = 1.0/MAPL_EPSILON-1.0 # (DEPRECATED)

MAPL_P00 = 100000.0 # Pa
MAPL_CAPICE = 2000. # J/(K kg)
MAPL_CAPWTR = 4218. # J/(K kg)
Expand All @@ -50,9 +41,126 @@
MAPL_SRFPRS = 98470 # Pa
MAPL_KARMAN = 0.40 # --
MAPL_USMIN = 1.00 # m/s
MAPL_AVOGAD = 6.023E26 # 1/kmol

MAPL_RHO_SEAWATER = 1026.0 # sea water density [kg/m^3]. SA: should it be = 1026 kg/m^3?
MAPL_RHO_SEAICE = 917.0 # sea ice density [kg/m^3]. SA: should it be = 917 kg/m^3?
MAPL_RHO_SNOW = 330.0 # snow density [kg/m^3]. SA: should it be = 330 kg/m^3?
MAPL_CELSIUS_TO_KELVIN = 273.15 # K

MAPL_STFBOL = 5.6734E-8 # W/(m^2 K^4)
MAPL_AVOGAD = 6.023E26 # 1/kmol
MAPL_RUNIV = 8314.47 # J/(Kmole K)

MAPL_H2OMW = 18.015 # kg/Kmole
MAPL_O3MW = 47.9982 # kg/Kmole
MAPL_ALHL = 2.4665E6 # J/kg @15C
MAPL_ALHF = 3.3370E5 # J/kg
MAPL_ALHS = MAPL_ALHL+MAPL_ALHF # J/kg


#Internal constants
MAPL_GRID_NAME_DEFAULT = 'UNKNOWN'
MAPL_GRID_FILE_NAME_DEFAULT = 'UNKNOWN'
MAPL_CF_COMPONENT_SEPARATOR = '.'

MAPL_TimerModeOld = 0
MAPL_TimerModeRootOnly = 1
MAPL_TimerModeMax = 2
MAPL_TimerModeMinMax = 3

MAPL_UseStarrQsat = 1
MAPL_UseGoffGratchQsat = 2
MAPL_UseMurphyKoopQsat =3
MAPL_UseCAMQsat =4

MAPL_Unknown = 0
MAPL_IsGather = 1
MAPL_IsScatter = 2

MAPL_TileNameLength = 128

MAPL_NoShm = 255

MAPL_SUCCESS = 0
MAPL_FILE_NOT_FOUND = 1

MAPL_DimTopoEdge = -1
MAPL_DimTopoCyclic = 0
MAPL_DimTopoCenter = 1

MAPL_CplUNKNOWN = 0
MAPL_CplSATISFIED = 1
MAPL_CplNEEDED = 2
MAPL_Cpl_NOTNEEDED = 4
MAPL_FriendlyVariable = 8
MAPL_FieldItem = 8
MAPL_BundleItem = 16
MAPL_StateItem = 32
MAPL_NoRestart = 64

MAPL_Write2Disk = 0
MAPL_Write2RAM = 1

MAPL_VLocationNone = 0
MAPL_VLocationEdge = 1
MAPL_VLocationCenter = 2

MAPL_DimsUnknown = 0
MAPL_DimsVertOnly = 1
MAPL_DimsHorzOnly = 2
MAPL_DimsHorzVert = 3
MAPL_DimsTileOnly = 4
MAPL_DimsTileTile = 5
MAPL_DimsNone = 6

MAPL_ScalarField = 1
MAPL_VectorField = 2

MAPL_CplAverage = 0
MAPL_CplMin = 1
MAPL_CplMax = 2
MAPL_CplAccumulate = 3
MAPL_MinMaxUnknown = 4

MAPL_AttrGrid = 1
MAPl_AttrTile = 2

MAPL_Uninitialized = 0
MAPL_InitialDefault = 1
MAPL_InitialRestart = 2

MAPL_DuplicateEntry = -99
MAPL_ConnUnknown = -1
MAPL_Self = 0
MAPL_Import = 1
MAPL_Export = 2

MAPL_FirstPhase = 1
MAPL_SecondPhase = MAPL_FirstPhase + 1
MAPL_ThirdPhase = MAPL_SecondPhase + 1
MAPL_FourthPhase = MAPL_ThirdPhase + 1
MAPL_FifthPhase = MAPL_FourthPhase + 1

MAPL_Ocean = 0
MAPL_Lake = 19
MAPL_LandIce = 20
MAPL_Land = 100
MAPL_Vegetated = 101
MAPL_NumVegTypes = 6

MAPL_AGrid = 0
MAPL_CGrid = 1
MAPL_DGrid = 2

MAPL_RotateLL = 0
MAPL_RotateCube = 1

MAPL_HorzTransOrderBinning = 0
MAPL_HorzTransOrderBilinear = 1
MAPL_HorzTransOrderFraction = 98
MAPL_HorzTransOrderSample = 99

MAPL_RestartOptional = 0
MAPL_RestartSkip = 1
MAPL_RestartRequired = 2
MAPL_Restart_Bootstrap = 3
MAPL_RestartSkipInitial = 4
7 changes: 6 additions & 1 deletion Tests/pfio_MAPL_demo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ program main
cap_options = MAPL_CapOptions(cli)

call MPI_init(ierror)


call MPI_Comm_size(MPI_COMM_WORLD, npes, ierror)
if ( cap_options%npes_model == -1) then
cap_options%npes_model = npes
endif

! Initialize the IO Server Manager using parameters defined above
call ioserver_manager%initialize(MPI_COMM_WORLD, &
application_size = cap_options%npes_model, &
Expand Down
3 changes: 1 addition & 2 deletions base/Base/Base.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ module MAPL_Base

real, public, parameter :: MAPL_UNDEF = 1.0e15

integer, public, parameter :: MAPL_TileNameLength = 128

character(len=ESMF_MAXSTR), public, parameter :: MAPL_StateItemOrderList = 'MAPL_StateItemOrderList'
character(len=ESMF_MAXSTR), public, parameter :: MAPL_BundleItemOrderList = 'MAPL_BundleItemOrderList'
Expand Down Expand Up @@ -807,7 +806,7 @@ module MAPL_BaseMod
use MAPL_Base
use MAPL_RangeMod, only: MAPL_Range
use MaplGeneric, only: MAPL_GridGet, MAPL_DistGridGet, MAPL_GetImsJms, MAPL_GridHasDE
use Mapl_Enumerators
use MAPL_Constants



Expand Down
Loading

0 comments on commit 0ca59e5

Please sign in to comment.