Skip to content

Commit

Permalink
Merge branch 'main' of github.com:NOAA-GFDL/FMS into dmUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-robinson committed Nov 15, 2021
2 parents 7c9881b + 90583ae commit 2322990
Show file tree
Hide file tree
Showing 32 changed files with 2,237 additions and 932 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SUBDIRS = \
fms2_io \
mosaic2 \
fms \
parser \
affinity \
mosaic \
time_manager \
Expand Down
21 changes: 21 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ AC_ARG_WITH([mpi],
AS_IF([test ${with_mpi:-yes} = yes],
[with_mpi=yes],
[with_mpi=no])
AC_ARG_WITH([yaml],
[AS_HELP_STRING([--with-yaml],
[Build with YAML support. This option will be ignored if --disable-fortran-flag-setting is also given. (Default no)])])
AS_IF([test ${with_yaml:-no} = no],
[with_yaml=no],
[with_yaml=yes])
AC_ARG_ENABLE([setting-flags],
[AS_HELP_STRING([--enable-setting-flags],
[Allow configure to set some compiler flags. Disabling this will also disable any other --with or --enable options that set flags, and will only use user-provided falgs. (Default yes)])])
Expand Down Expand Up @@ -122,6 +128,19 @@ if test $with_mpi = yes; then
AC_CHECK_FUNC([MPI_Init], [], [AC_MSG_ERROR([Can't find the MPI C library. Set CC/LDFLAGS/LIBS])])
fi

# Require yaml
if test $with_yaml = yes; then
AC_CHECK_HEADERS([yaml.h], [], [AC_MSG_ERROR(["Can't find the libYAML C header file. Set CC/CPPFLAGS/CFLAGS"])])
AC_SEARCH_LIBS([yaml_parser_initialize], [yaml], [], [AC_MSG_ERROR(["Can't find the libYAML C library. Set CC/LDFLAGS/LIBS"])])

#If the test pass, define use_yaml macro
AC_DEFINE([use_yaml], [1], [This is required to use yaml parser])

AM_CONDITIONAL([SKIP_PARSER_TESTS], false )
else
AM_CONDITIONAL([SKIP_PARSER_TESTS], true )
fi

# Require netCDF
AC_CHECK_HEADERS([netcdf.h], [], [AC_MSG_ERROR([Can't find the netCDF C header file. Set CPPFLAGS/CFLAGS])])
AC_SEARCH_LIBS([nc_create], [netcdf], [], [AC_MSG_ERROR([Can't find the netCDF C library. Set LDFLAGS/LIBS])])
Expand Down Expand Up @@ -337,6 +356,7 @@ AC_CONFIG_FILES([
random_numbers/Makefile
libFMS/Makefile
docs/Makefile
parser/Makefile
test_fms/test_common.sh
test_fms/Makefile
test_fms/diag_manager/Makefile
Expand All @@ -357,6 +377,7 @@ AC_CONFIG_FILES([
test_fms/mosaic/Makefile
test_fms/affinity/Makefile
test_fms/coupler/Makefile
test_fms/parser/Makefile
FMS.pc
])

Expand Down
304 changes: 187 additions & 117 deletions data_override/data_override.F90

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions diag_manager/diag_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ MODULE diag_data_mod

USE time_manager_mod, ONLY: time_type
USE mpp_domains_mod, ONLY: domain1d, domain2d, domainUG
USE mpp_io_mod, ONLY: fieldtype
USE fms_mod, ONLY: WARNING, write_version_number
#ifdef use_netCDF
! NF90_FILL_REAL has value of 9.9692099683868690e+36.
Expand Down Expand Up @@ -148,12 +147,12 @@ MODULE diag_data_mod
!> @brief Diagnostic field type
!> @ingroup diag_data_mod
TYPE diag_fieldtype
TYPE(fieldtype) :: Field
TYPE(domain2d) :: Domain
TYPE(domainUG) :: DomainU
REAL :: miss, miss_pack
LOGICAL :: miss_present, miss_pack_present
INTEGER :: tile_count
character(len=128) :: fieldname !< Fieldname
END TYPE diag_fieldtype

!> @brief Attribute type for diagnostic fields
Expand Down
17 changes: 3 additions & 14 deletions diag_manager/diag_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,12 @@ MODULE diag_manager_mod
USE time_manager_mod, ONLY: set_time, set_date, get_time, time_type, OPERATOR(>=), OPERATOR(>),&
& OPERATOR(<), OPERATOR(==), OPERATOR(/=), OPERATOR(/), OPERATOR(+), ASSIGNMENT(=), get_date, &
& get_ticks_per_second
USE mpp_io_mod, ONLY: mpp_open, mpp_close, mpp_get_maxunits
USE mpp_mod, ONLY: mpp_get_current_pelist, mpp_pe, mpp_npes, mpp_root_pe, mpp_sum

USE mpp_mod, ONLY: input_nml_file

USE fms_mod, ONLY: error_mesg, FATAL, WARNING, NOTE, stdout, stdlog, write_version_number,&
& file_exist, fms_error_handler, check_nml_error, get_mosaic_tile_file, lowercase
& fms_error_handler, check_nml_error, lowercase
USE fms_io_mod, ONLY: get_instance_filename
USE diag_axis_mod, ONLY: diag_axis_init, get_axis_length, get_axis_num, get_domain2d, get_tile_count,&
& diag_axis_add_attribute, axis_compatible_check, CENTER, NORTH, EAST
Expand Down Expand Up @@ -3462,7 +3461,7 @@ SUBROUTINE diag_manager_end(time)
INTEGER :: file

IF ( do_diag_field_log ) THEN
CALL mpp_close (diag_log_unit)
close (diag_log_unit)
END IF
DO file = 1, num_files
CALL closing_file(file, time)
Expand Down Expand Up @@ -3632,16 +3631,6 @@ SUBROUTINE diag_manager_init(diag_model_subset, time_init, err_msg)
CALL error_mesg('diag_manager_mod::diag_manager_init', 'Using CMOR missing value ('//TRIM(err_msg_local)//').', NOTE)
END IF

! Issue note if attempting to set diag_manager_nml::max_files larger than
! mpp_get_maxunits() -- Default is 1024 set in mpp_io.F90
IF ( max_files .GT. mpp_get_maxunits() ) THEN
err_msg_local = ''
WRITE (err_msg_local,'(A,I6,A,I6,A,I6,A)') "DIAG_MANAGER_NML variable 'max_files' (",max_files,") is larger than '",&
& mpp_get_maxunits(),"'. Forcing 'max_files' to be ",mpp_get_maxunits(),"."
CALL error_mesg('diag_manager_mod::diag_managet_init', TRIM(err_msg_local), NOTE)
max_files = mpp_get_maxunits()
END IF

! How to handle Out of Range Warnings.
IF ( oor_warnings_fatal ) THEN
oor_warning = FATAL
Expand Down Expand Up @@ -3707,7 +3696,7 @@ SUBROUTINE diag_manager_init(diag_model_subset, time_init, err_msg)

! open diag field log file
IF ( do_diag_field_log.AND.mpp_pe().EQ.mpp_root_pe() ) THEN
CALL mpp_open(diag_log_unit, 'diag_field_log.out', nohdrs=.TRUE.)
open(newunit=diag_log_unit, file='diag_field_log.out', action='WRITE')
WRITE (diag_log_unit,'(777a)') &
& 'Module', SEP, 'Field', SEP, 'Long Name', SEP,&
& 'Units', SEP, 'Number of Axis', SEP, 'Time Axis', SEP,&
Expand Down
Loading

0 comments on commit 2322990

Please sign in to comment.