diff --git a/sorc/chgres_cube.fd/atm_input_data.F90 b/sorc/chgres_cube.fd/atm_input_data.F90 index cb9b1e87c..bf5494b72 100644 --- a/sorc/chgres_cube.fd/atm_input_data.F90 +++ b/sorc/chgres_cube.fd/atm_input_data.F90 @@ -2154,13 +2154,19 @@ subroutine read_input_atm_grib2_file(localpet) call quicksort(rlevs,1,lev_input) - do i = 1, lev_input + do i = 1, lev_input if (isnative) then write(slevs(i), '(i6)') nint(rlevs(i)) slevs(i) = trim(slevs(i)) // " hybrid" + if (i>1) then + if (any(slevs(1:i-1)==slevs(i))) call error_handler("Duplicate vertical level entries found.",1) + endif else write(slevs(i), '(f11.2)') rlevs(i) slevs(i) = trim(slevs(i)) // " Pa" + if (i>1) then + if (any(slevs(1:i-1)==slevs(i))) call error_handler("Duplicate vertical level entries found.",1) + endif endif enddo