diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c3673bb1..19bcbed55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -663,6 +663,7 @@ list(APPEND TEST_SRC_SINGLE_TARGET test_fms/diag_manager/test_diag_attribute_add.F90 test_fms/diag_manager/check_new_file_freq.F90 test_fms/diag_manager/test_zbounds_limits.F90 + test_fms/diag_manager/test_multiple_zbounds.F90 test_fms/drifters/test_cloud_interpolator.F90 test_fms/drifters/test_drifters_io.F90 test_fms/drifters/test_drifters_input.F90 diff --git a/diag_manager/fms_diag_axis_object.F90 b/diag_manager/fms_diag_axis_object.F90 index 7edb28855..e13ae7551 100644 --- a/diag_manager/fms_diag_axis_object.F90 +++ b/diag_manager/fms_diag_axis_object.F90 @@ -40,7 +40,7 @@ module fms_diag_axis_object_mod use mpp_mod, only: FATAL, mpp_error, uppercase, mpp_pe, mpp_root_pe, stdout use fms2_io_mod, only: FmsNetcdfFile_t, FmsNetcdfDomainFile_t, FmsNetcdfUnstructuredDomainFile_t, & & register_axis, register_field, register_variable_attribute, write_data - use fms_diag_yaml_mod, only: subRegion_type, diag_yaml, MAX_SUBAXES + use fms_diag_yaml_mod, only: subRegion_type, diag_yaml, MAX_SUBAXES, diagYamlFilesVar_type use diag_grid_mod, only: get_local_indices_cubesphere => get_local_indexes use axis_utils2_mod, only: nearest_index implicit none @@ -52,7 +52,7 @@ module fms_diag_axis_object_mod & DIAGDOMAIN2D_T, fmsDiagSubAxis_type, fmsDiagAxisContainer_type, fmsDiagFullAxis_type, DIAGDOMAINUG_T public :: define_new_axis, parse_compress_att, get_axis_id_from_name, define_diurnal_axis, & & fmsDiagDiurnalAxis_type, create_new_z_subaxis, is_parent_axis, define_new_subaxis_latlon, & - & define_new_subaxis_index + & define_new_subaxis_index, find_z_sub_axis_name !> @} @@ -124,6 +124,7 @@ module fms_diag_axis_object_mod procedure :: get_starting_index procedure :: get_ending_index procedure :: get_compute_indices + procedure :: is_same_zbounds END TYPE fmsDiagSubAxis_type !> @brief Type to hold the diurnal axis @@ -934,6 +935,16 @@ function get_compute_indices(this) result(indx) indx = this%compute_idx end function get_compute_indices + !> @brief Determines if the zbounds passed in are the same as those in the file + !! @return .True. if the zbounds are the same + function is_same_zbounds(this, zbounds) result(is_same) + class(fmsDiagSubAxis_type), intent(in) :: this !< diag_sub_axis object + real(kind=r4_kind), intent(in) :: zbounds(2) !< zbounds to compare with + logical :: is_same + + is_same = zbounds(1) .eq. this%zbounds(1) .and. zbounds(2) .eq. this%zbounds(2) + end function + !> @brief Get the ntiles in a domain !> @return the number of tiles in a domain function get_ntiles(this) & @@ -1434,7 +1445,8 @@ subroutine write_diurnal_metadata(this, fms2io_fileobj) end subroutine write_diurnal_metadata !> @brief Creates a new z subaxis to use - subroutine create_new_z_subaxis(zbounds, var_axis_ids, diag_axis, naxis, file_axis_id, nfile_axis, nz_subaxis) + subroutine create_new_z_subaxis(zbounds, var_axis_ids, diag_axis, naxis, file_axis_id, nfile_axis, nz_subaxis, & + error_mseg) real(kind=r4_kind), intent(in) :: zbounds(2) !< Bounds of the Z axis integer, intent(inout) :: var_axis_ids(:) !< The variable's axis_ids class(fmsDiagAxisContainer_type), target, intent(inout) :: diag_axis(:) !< Array of diag_axis objects @@ -1445,58 +1457,69 @@ subroutine create_new_z_subaxis(zbounds, var_axis_ids, diag_axis, naxis, file_ax !! defined in file integer, intent(inout) :: nz_subaxis !< The number of z subaxis currently !! defined in the file + character(len=*), intent(inout) :: error_mseg !! Message to include in error message + !! if there is an error class(*), pointer :: zaxis_data(:) !< The data of the full zaxis integer :: subaxis_indices(2) !< The starting and ending indices of the subaxis relative to the full !! axis integer :: i !< For do loops integer :: subaxis_id !< The id of the new z subaxis - logical :: axis_found !< Flag that indicated if the zsubaxis already exists + integer :: parent_axis_id !< Id of parent axis id + integer :: zaxis_index !< Index of the z axis (i.e 3 if the variable is x,y,z) + type(fmsDiagFullAxis_type), pointer :: parent_axis !< Pointer to the parent axis + + parent_axis_id = diag_null + zaxis_index = diag_null + + !< Determine which axis is the z axis: + do i = 1, size(var_axis_ids) + select type (parent_axis => diag_axis(var_axis_ids(i))%axis) + type is (fmsDiagFullAxis_type) + if (parent_axis%cart_name .eq. "Z") then + parent_axis_id = var_axis_ids(i) + zaxis_index = i + endif + end select + enddo + + if (parent_axis_id .eq. DIAG_NULL) then + call mpp_error(FATAL, "create_new_z_subaxis:: unable to find the zaxis for "//trim(error_mseg)) + endif !< Determine if the axis was already created - axis_found = .false. do i = 1, nfile_axis select type (axis => diag_axis(file_axis_id(i))%axis) type is (fmsDiagSubAxis_type) + if (axis%parent_axis_id .ne. parent_axis_id) cycle if (axis%zbounds(1) .eq. zbounds(1) .and. axis%zbounds(2) .eq. zbounds(2)) then - axis_found = .true. - subaxis_id = file_axis_id(i) - exit + var_axis_ids(zaxis_index) = file_axis_id(i) + return endif end select enddo - !< Determine which of the variable's axis is the zaxis! - do i = 1, size(var_axis_ids) - select type (parent_axis => diag_axis(var_axis_ids(i))%axis) - type is (fmsDiagFullAxis_type) - if (parent_axis%cart_name .eq. "Z") then - !< If the axis was previously defined set the var_axis_ids and leave - if (axis_found) then - var_axis_ids(i) = subaxis_id - return - endif - zaxis_data => parent_axis%axis_data - - select type(zaxis_data) - type is (real(kind=r4_kind)) - !TODO need to include the conversion to "real" because nearest_index doesn't take r4s and r8s - subaxis_indices(1) = nearest_index(real(zbounds(1)), real(zaxis_data)) - subaxis_indices(2) = nearest_index(real(zbounds(2)), real(zaxis_data)) - type is (real(kind=r8_kind)) - subaxis_indices(1) = nearest_index(real(zbounds(1)), real(zaxis_data)) - subaxis_indices(2) = nearest_index(real(zbounds(2)), real(zaxis_data)) - end select - - nz_subaxis = nz_subaxis + 1 - call define_new_axis(diag_axis, parent_axis, naxis, parent_axis%axis_id, & + select type (axis => diag_axis(parent_axis_id)%axis) + type is (fmsDiagFullAxis_type) + zaxis_data => axis%axis_data + parent_axis => axis + end select + + select type(zaxis_data) + type is (real(kind=r4_kind)) + !TODO need to include the conversion to "real" because nearest_index doesn't take r4s and r8s + subaxis_indices(1) = nearest_index(real(zbounds(1)), real(zaxis_data)) + subaxis_indices(2) = nearest_index(real(zbounds(2)), real(zaxis_data)) + type is (real(kind=r8_kind)) + subaxis_indices(1) = nearest_index(real(zbounds(1)), real(zaxis_data)) + subaxis_indices(2) = nearest_index(real(zbounds(2)), real(zaxis_data)) + end select + + nz_subaxis = nz_subaxis + 1 + call define_new_axis(diag_axis, parent_axis, naxis, parent_axis%axis_id, & &subaxis_indices(1), subaxis_indices(2), (/lbound(zaxis_data,1), ubound(zaxis_data,1)/), & &new_axis_id=subaxis_id, zbounds=zbounds, nz_subaxis=nz_subaxis) - var_axis_ids(i) = subaxis_id - return - endif - end select - enddo + var_axis_ids(zaxis_index) = subaxis_id end subroutine @@ -1517,6 +1540,34 @@ function is_parent_axis(axis_id, parent_axis_id, diag_axis) & end select end function is_parent_axis + !> @brief Determine the name of the z subaxis by matching the parent axis id and the zbounds + !! in the diag table yaml + subroutine find_z_sub_axis_name(dim_name, parent_axis_id, file_axis_id, field_yaml, diag_axis) + character(len=*), intent(inout) :: dim_name !< Name of z subaxis + integer, intent(in) :: parent_axis_id !< Axis id of the parent + integer, intent(in) :: file_axis_id(:) !< Axis ids of the file + type(diagYamlFilesVar_type), intent(in) :: field_yaml !< Field info from diag_table yaml + class(fmsDiagAxisContainer_type),intent(in) :: diag_axis(:) !< Array of axis objections + + integer :: id + integer :: i + + do i = 1, size(file_axis_id) + id = file_axis_id(i) + select type (axis_ptr => diag_axis(id)%axis) + type is (fmsDiagSubAxis_type) + if (axis_ptr%parent_axis_id .eq. parent_axis_id) then + if (axis_ptr%is_same_zbounds(field_yaml%get_var_zbounds())) then + dim_name = axis_ptr%subaxis_name + return + endif + endif + end select + enddo + call mpp_error(FATAL, "Unable to determine the z subaxis name for field "//& + trim(field_yaml%get_var_varname())//" in file: "//& + trim(field_yaml%get_var_fname())) + end subroutine #endif end module fms_diag_axis_object_mod !> @} diff --git a/diag_manager/fms_diag_field_object.F90 b/diag_manager/fms_diag_field_object.F90 index 69b5fc626..210ff5b15 100644 --- a/diag_manager/fms_diag_field_object.F90 +++ b/diag_manager/fms_diag_field_object.F90 @@ -36,7 +36,7 @@ module fms_diag_field_object_mod use fms_diag_yaml_mod, only: diagYamlFilesVar_type, get_diag_fields_entries, get_diag_files_id, & & find_diag_field, get_num_unique_fields, diag_yaml use fms_diag_axis_object_mod, only: diagDomain_t, get_domain_and_domain_type, fmsDiagAxis_type, & - & fmsDiagAxisContainer_type, fmsDiagFullAxis_Type + & fmsDiagAxisContainer_type, fmsDiagFullAxis_Type, find_z_sub_axis_name use time_manager_mod, ONLY: time_type, get_date use fms2_io_mod, only: FmsNetcdfFile_t, FmsNetcdfDomainFile_t, FmsNetcdfUnstructuredDomainFile_t, register_field, & register_variable_attribute @@ -1162,7 +1162,8 @@ pure function get_longname_to_write(this, field_yaml) & end function get_longname_to_write !> @brief Determine the dimension names to use when registering the field to fms2_io -subroutine get_dimnames(this, diag_axis, field_yaml, unlim_dimname, dimnames, is_regional) +subroutine get_dimnames(this, diag_axis, field_yaml, unlim_dimname, dimnames, is_regional, & + file_axis_ids) class (fmsDiagField_type), target, intent(inout) :: this !< diag field class(fmsDiagAxisContainer_type), target, intent(in) :: diag_axis(:) !< Diag_axis object type(diagYamlFilesVar_type), intent(in) :: field_yaml !< Field info from diag_table yaml @@ -1170,6 +1171,7 @@ subroutine get_dimnames(this, diag_axis, field_yaml, unlim_dimname, dimnames, is character(len=120), allocatable, intent(out) :: dimnames(:) !< Array of the dimension names !! for the field logical, intent(in) :: is_regional !< Flag indicating if the field is regional + integer, intent(in) :: file_axis_ids(:) !< Ids of the file axis integer :: i !< For do loops integer :: naxis !< Number of axis for the field @@ -1193,7 +1195,7 @@ subroutine get_dimnames(this, diag_axis, field_yaml, unlim_dimname, dimnames, is do i = 1, size(this%axis_ids) axis_ptr => diag_axis(this%axis_ids(i)) if (axis_ptr%axis%is_z_axis()) then - dimnames(i) = axis_ptr%axis%get_axis_name(is_regional)//"_sub01" + call find_z_sub_axis_name(dimnames(i), this%axis_ids(i), file_axis_ids, field_yaml, diag_axis) else dimnames(i) = axis_ptr%axis%get_axis_name(is_regional) endif @@ -1238,7 +1240,7 @@ end subroutine register_field_wrap !> @brief Write the field's metadata to the file subroutine write_field_metadata(this, fms2io_fileobj, file_id, yaml_id, diag_axis, unlim_dimname, is_regional, & - cell_measures, use_collective_writes) + cell_measures, use_collective_writes, file_axis_ids) class (fmsDiagField_type), target, intent(inout) :: this !< diag field class(FmsNetcdfFile_t), INTENT(INOUT) :: fms2io_fileobj!< Fms2_io fileobj to write to integer, intent(in) :: file_id !< File id of the file to write to @@ -1249,6 +1251,7 @@ subroutine write_field_metadata(this, fms2io_fileobj, file_id, yaml_id, diag_axi character(len=*), intent(in) :: cell_measures !< The cell measures attribute to write logical, intent(in) :: use_collective_writes !< True if using collective writes !! for this variable + integer, intent(in) :: file_axis_ids(:) !< Ids of all of the axis in thje file type(diagYamlFilesVar_type), pointer :: field_yaml !< pointer to the yaml entry character(len=:), allocatable :: var_name !< Variable name @@ -1267,7 +1270,7 @@ subroutine write_field_metadata(this, fms2io_fileobj, file_id, yaml_id, diag_axi var_name = field_yaml%get_var_outname() if (allocated(this%axis_ids)) then - call this%get_dimnames(diag_axis, field_yaml, unlim_dimname, dimnames, is_regional) + call this%get_dimnames(diag_axis, field_yaml, unlim_dimname, dimnames, is_regional, file_axis_ids) !! Collective writes are only used for 2D+ variables if ((use_collective_writes .and. size(this%axis_ids) >= 2) .or. field_yaml%has_chunksizes()) then diff --git a/diag_manager/fms_diag_file_object.F90 b/diag_manager/fms_diag_file_object.F90 index 3f55ac0e4..2600ab9bd 100644 --- a/diag_manager/fms_diag_file_object.F90 +++ b/diag_manager/fms_diag_file_object.F90 @@ -841,6 +841,8 @@ subroutine add_axes(this, axis_ids, diag_axis, naxis, yaml_id, buffer_id, output integer :: subregion_gridtype !< The type of the subregion (latlon or index) logical :: write_on_this_pe !< Flag indicating if the current pe is in the subregion + character(len=MAX_STR_LEN) :: error_mseg !< Message to append in case there is a FATAL error + is_cube_sphere = .false. subregion_gridtype = this%get_file_sub_region_grid_type() @@ -852,9 +854,12 @@ subroutine add_axes(this, axis_ids, diag_axis, naxis, yaml_id, buffer_id, output !! which is why the copy was needed) var_axis_ids = axis_ids + error_mseg = "Field: "//trim(field_yaml%get_var_varname())//" in file: "//& + trim(field_yaml%get_var_fname()) + if (field_yaml%has_var_zbounds()) then call create_new_z_subaxis(field_yaml%get_var_zbounds(), var_axis_ids, diag_axis, naxis, & - this%axis_ids, this%number_of_axis, this%nz_subaxis) + this%axis_ids, this%number_of_axis, this%nz_subaxis, error_mseg) endif select type(this) @@ -1851,7 +1856,7 @@ subroutine write_field_metadata(this, diag_field, diag_axis) call field_ptr%write_field_metadata(fms2io_fileobj, diag_file%id, diag_file%yaml_ids(i), diag_axis, & this%FMS_diag_file%get_file_unlimdim(), is_regional, cell_measures, & - diag_file%is_using_collective_writes()) + diag_file%is_using_collective_writes(), diag_file%axis_ids(1:diag_file%number_of_axis)) enddo if (need_associated_files) & diff --git a/test_fms/diag_manager/Makefile.am b/test_fms/diag_manager/Makefile.am index 80a8b7a98..4fa923fb3 100644 --- a/test_fms/diag_manager/Makefile.am +++ b/test_fms/diag_manager/Makefile.am @@ -35,7 +35,7 @@ check_PROGRAMS = test_diag_manager test_diag_manager_time \ check_time_pow check_time_rms check_subregional test_cell_measures test_var_masks \ check_var_masks test_multiple_send_data test_diag_out_yaml test_output_every_freq \ test_dm_weights test_prepend_date test_ens_runs test_diag_multi_file test_diag_attribute_add \ - check_new_file_freq test_zbounds_limits + check_new_file_freq test_zbounds_limits test_multiple_zbounds # This is the source code for the test. test_output_every_freq_SOURCES = test_output_every_freq.F90 @@ -71,6 +71,7 @@ test_ens_runs_SOURCES = test_ens_runs.F90 test_diag_attribute_add_SOURCES = test_diag_attribute_add.F90 check_new_file_freq_SOURCES = check_new_file_freq.F90 test_zbounds_limits_SOURCES = test_zbounds_limits.F90 +test_multiple_zbounds_SOURCES = test_multiple_zbounds.F90 TEST_EXTENSIONS = .sh SH_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ @@ -81,7 +82,7 @@ TESTS = test_diag_manager2.sh test_time_none.sh test_time_min.sh test_time_max.s test_time_avg.sh test_time_pow.sh test_time_rms.sh test_time_diurnal.sh test_cell_measures.sh \ test_subregional.sh test_var_masks.sh test_multiple_send_data.sh test_output_every_freq.sh \ test_dm_weights.sh test_flush_nc_file.sh test_prepend_date.sh test_ens_runs.sh test_diag_multi_file.sh \ - test_diag_attribute_add.sh test_time_none_netcdf4.sh test_zbounds_limits.sh + test_diag_attribute_add.sh test_time_none_netcdf4.sh test_zbounds_limits.sh test_multiple_zbounds.sh testing_utils.mod: testing_utils.$(OBJEXT) @@ -91,7 +92,7 @@ EXTRA_DIST = test_diag_manager2.sh check_crashes.sh test_time_none.sh test_time_ test_cell_measures.sh test_subregional.sh test_var_masks.sh test_multiple_send_data.sh \ test_flush_nc_file.sh test_dm_weights.sh test_output_every_freq.sh test_prepend_date.sh \ test_ens_runs.sh test_diag_multi_file.sh test_diag_attribute_add.sh test_time_none_netcdf4.sh \ - test_zbounds_limits.sh + test_zbounds_limits.sh test_multiple_zbounds.sh if USING_YAML parser_skip="" diff --git a/test_fms/diag_manager/test_multiple_zbounds.F90 b/test_fms/diag_manager/test_multiple_zbounds.F90 new file mode 100644 index 000000000..1ccb6eaca --- /dev/null +++ b/test_fms/diag_manager/test_multiple_zbounds.F90 @@ -0,0 +1,130 @@ +!*********************************************************************** +!* Apache License 2.0 +!* +!* This file is part of the GFDL Flexible Modeling System (FMS). +!* +!* Licensed under the Apache License, Version 2.0 (the "License"); +!* you may not use this file except in compliance with the License. +!* You may obtain a copy of the License at +!* +!* http://www.apache.org/licenses/LICENSE-2.0 +!* +!* FMS is distributed in the hope that it will be useful, but WITHOUT +!* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied; +!* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +!* PARTICULAR PURPOSE. See the License for the specific language +!* governing permissions and limitations under the License. +!*********************************************************************** + +program test_multiple_zbounds + use fms_mod, only: fms_init, fms_end + use fms2_io_mod + use mpp_mod + use time_manager_mod, only: time_type, set_calendar_type, set_date, JULIAN, set_time, OPERATOR(+) + use diag_manager_mod + + implicit none + + type(time_type) :: Time !< Time of the simulation + type(time_type) :: Time_step !< Time_step of the simulation + integer :: id_z1 !< Axis id for the z dimension + integer :: id_z2 !< Axis id for the z dimension + integer :: id_var1 !< var id for the first variable + integer :: id_var2 !< var_id for the second variable + real, allocatable :: z(:) !< z axis data + integer :: nz !< Size of the z dimension + integer :: i + logical :: used !< Dummy argument to send_data + + call fms_init + call set_calendar_type(JULIAN) + call diag_manager_init + + nz = 10 + allocate(z(nz)) + do i=1, nz + z(i) = i + enddo + + Time = set_date(2,1,1,0,0,0) + Time_step = set_time (3600,0) + + id_z1 = diag_axis_init('zaxis1', z, 'z', 'z', long_name='Z1') + id_z2 = diag_axis_init('zaxis2', z, 'z', 'z', long_name='Z2') + id_var1 = register_diag_field ('atmos', 'ua_1', (/id_z1/), Time) + id_var2 = register_diag_field ('atmos', 'ua_2', (/id_z2/), Time) + + call diag_manager_set_time_end(set_date(2,1,2,0,0,0)) + do i = 1, 24 + Time = Time + Time_step + z = real(i) + used = send_data(id_var1, z, Time) + used = send_data(id_var2, z, Time) + + call diag_send_complete(Time_step) + end do + + call diag_manager_end(Time) + + call check_output() + call fms_end + + contains + + subroutine check_output() + type(FmsNetcdfFile_t) :: fileobj + integer :: EXPECTED_NTIMES = 24 + integer :: SUB1_SIZE = 3 + integer :: SUB2_SIZE = 1 + character(len=20) :: EXPECTED_DIM_NAMES(2) + + EXPECTED_DIM_NAMES(2) = "time" + if (.not. open_file(fileobj, "test_multiple_zbounds.nc", "read")) then + call mpp_error(FATAL, "Unable to open the expected output file: test_var_masks.nc") + endif + + call check_dimension(fileobj, "time", EXPECTED_NTIMES) + call check_dimension(fileobj, "zaxis1_sub01", SUB1_SIZE) + call check_dimension(fileobj, "zaxis2_sub02", SUB2_SIZE) + + EXPECTED_DIM_NAMES(1) = "zaxis1_sub01" + call check_variable(fileobj, "ua_1", EXPECTED_DIM_NAMES) + + EXPECTED_DIM_NAMES(1) = "zaxis2_sub02" + call check_variable(fileobj, "ua_2", EXPECTED_DIM_NAMES) + call close_file(fileobj) + + end subroutine check_output + + subroutine check_variable(fileobj, variable_name, expected_dimnames) + type(FmsNetcdfFile_t), intent(in) :: fileobj + character(len=*), intent(in) :: variable_name + character(len=*), intent(in) :: expected_dimnames(:) + + character(len=20) :: dim_names(2) + integer :: i + + call get_variable_dimension_names(fileobj, variable_name, dim_names) + do i = 1, size(dim_names) + if (trim(dim_names(i)) .ne. trim(expected_dimnames(i))) then + print *, trim(dim_names(i)), " vs ", trim(expected_dimnames(i)) + call mpp_error(FATAL, "The dimension names are correct for "//trim(variable_name)) + endif + enddo + + end subroutine check_variable + + subroutine check_dimension(fileobj, dimension_name, expected_size) + type(FmsNetcdfFile_t), intent(in) :: fileobj + character(len=*), intent(in) :: dimension_name + integer, intent(in) :: expected_size + + integer :: dim_size + + call get_dimension_size(fileobj, dimension_name, dim_size) + if (dim_size .ne. expected_size) then + call mpp_error(FATAL, trim(dimension_name)//" is not the expected size!") + endif + + end subroutine +end program test_multiple_zbounds \ No newline at end of file diff --git a/test_fms/diag_manager/test_multiple_zbounds.sh b/test_fms/diag_manager/test_multiple_zbounds.sh new file mode 100755 index 000000000..44db78c03 --- /dev/null +++ b/test_fms/diag_manager/test_multiple_zbounds.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +#*********************************************************************** +#* Apache License 2.0 +#* +#* This file is part of the GFDL Flexible Modeling System (FMS). +#* +#* Licensed under the Apache License, Version 2.0 (the "License"); +#* you may not use this file except in compliance with the License. +#* You may obtain a copy of the License at +#* +#* http://www.apache.org/licenses/LICENSE-2.0 +#* +#* FMS is distributed in the hope that it will be useful, but WITHOUT +#* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied; +#* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +#* PARTICULAR PURPOSE. See the License for the specific language +#* governing permissions and limitations under the License. +#*********************************************************************** + +# Set common test settings. +. ../test-lib.sh + +output_dir + +if [ -z "${parser_skip}" ] +then + cat <<_EOF > input.nml +&diag_manager_nml + use_modern_diag = .true. +/ +_EOF + + cat <<_EOF > diag_table.yaml +title: test_multiple_zbounds +base_date: 2 1 1 0 0 0 +diag_files: +- file_name: test_multiple_zbounds + freq: 1 hours + time_units: hours + unlimdim: time + module: atmos + reduction: average + kind: r4 + varlist: + - var_name: ua_1 + zbounds: 3 5 + - var_name: ua_2 + zbounds: 1 1 +_EOF + + test_expect_success "Test with multiple zbounds limits (modern diag manager)" ' + mpirun -n 1 ../test_multiple_zbounds + ' +fi + +test_done