Skip to content

Commit ce78c32

Browse files
committed
Merge branch 'hotfix-v6.2'
This merge addresses minor issues in the MPAS infrastructure with how character strings are read from netCDF files via PIO, and it adds the 'recursive' attribute to the mpas_log_write routine to avoid errors raised by several newer compilers when critical errors are written. * hotfix-v6.2: Add missing 'recursive' attribute to MPAS_log_write(...) routine Increment version number to 6.2 Remove C null characters from strings read by PIO Add new MPAS_sanitize_string routine to mpas_c_interfacing Change length of xtime variables to ShortStrKIND to match netCDF files
2 parents c970b61 + acce87d commit ce78c32

File tree

13 files changed

+58
-17
lines changed

13 files changed

+58
-17
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013-2018, Los Alamos National Security, LLC (LANS) (Ocean: LA-CC-13-047;
1+
Copyright (c) 2013-2019, Los Alamos National Security, LLC (LANS) (Ocean: LA-CC-13-047;
22
Land Ice: LA-CC-13-117) and the University Corporation for Atmospheric Research (UCAR).
33

44
All rights reserved.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v6.1
1+
MPAS-v6.2
22
====
33

44
The Model for Prediction Across Scales (MPAS) is a collaborative project for

src/core_atmosphere/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="6.1">
2+
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="6.2">
33

44
<!-- **************************************************************************************** -->
55
<!-- ************************************** Dimensions ************************************** -->

src/core_init_atmosphere/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="6.1">
2+
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="6.2">
33

44
<!-- **************************************************************************************** -->
55
<!-- ************************************** Dimensions ************************************** -->

src/core_landice/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="landice" core_abbrev="li" version="6.1">
2+
<registry model="mpas" core="landice" core_abbrev="li" version="6.2">
33

44

55
<!-- ======================================================================= -->

src/core_ocean/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="ocean" core_abbrev="ocn" version="6.1">
2+
<registry model="mpas" core="ocean" core_abbrev="ocn" version="6.2">
33

44
<dims>
55
<dim name="nCells" units="unitless"

src/core_seaice/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="seaice" core_abbrev="seaice" version="6.1">
2+
<registry model="mpas" core="seaice" core_abbrev="seaice" version="6.2">
33

44
<dims>
55
<dim name="nCells"

src/core_sw/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="sw" core_abbrev="sw" version="6.1">
2+
<registry model="mpas" core="sw" core_abbrev="sw" version="6.2">
33
<dims>
44
<dim name="nCells"/>
55
<dim name="nEdges"/>

src/core_test/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="test" core_abbrev="test" version="6.1">
2+
<registry model="mpas" core="test" core_abbrev="test" version="6.2">
33
<dims>
44
<dim name="nCells"/>
55
<dim name="nEdges"/>

src/framework/mpas_c_interfacing.F

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ module mpas_c_interfacing
44
contains
55

66

7+
!-----------------------------------------------------------------------
8+
! routine mpas_sanitize_string
9+
!
10+
!> \brief Converts C null characters in a Fortran string to spaces
11+
!> \author Michael Duda
12+
!> \date 19 February 2019
13+
!> \details
14+
!> Converts all C null characters in a Fortran string to spaces.
15+
!> This may be useful for strings that were provided by C code through other
16+
!> Fortran code external to MPAS.
17+
!
18+
!-----------------------------------------------------------------------
19+
subroutine mpas_sanitize_string(str)
20+
21+
use iso_c_binding, only : c_null_char
22+
23+
implicit none
24+
25+
character(len=*), intent(inout) :: str
26+
27+
integer :: i
28+
29+
do i=1,len(str)
30+
if (str(i:i) == c_null_char) then
31+
str(i:i) = ' '
32+
end if
33+
end do
34+
35+
end subroutine mpas_sanitize_string
36+
37+
738
!-----------------------------------------------------------------------
839
! routine mpas_c_to_f_string
940
!

0 commit comments

Comments
 (0)