From 8fba6e82387f68f6dc4e23f8f140061647ecabd6 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 7 Dec 2023 15:37:59 +0000 Subject: [PATCH] Update chgres_cube to read either form of the surface climo fixed files - i.e., C96 or C96.mx050. Fixes #867. --- sorc/chgres_cube.fd/program_setup.F90 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sorc/chgres_cube.fd/program_setup.F90 b/sorc/chgres_cube.fd/program_setup.F90 index 4be7940a6..68c6c0308 100644 --- a/sorc/chgres_cube.fd/program_setup.F90 +++ b/sorc/chgres_cube.fd/program_setup.F90 @@ -38,7 +38,7 @@ module program_setup character(len=500), public :: sfc_files_input_grid(6) = "NULL" !< File names containing input surface data. Not used for 'grib2' input type. character(len=500), public :: vcoord_file_target_grid = "NULL" !< Vertical coordinate definition file. character(len=500), public :: thomp_mp_climo_file= "NULL" !< Path/name to the Thompson MP climatology file. - character(len=6), public :: cres_target_grid = "NULL" !< Target grid resolution, i.e., C768. + character(len=15), public :: cres_target_grid = "NULL" !< Target grid resolution, i.e., C768. character(len=500), public :: atm_weight_file="NULL" !< File containing pre-computed weights to horizontally interpolate atmospheric fields. character(len=25), public :: input_type="restart" !< Input data type: !! - "restart" for fv3 tiled warm restart @@ -215,17 +215,17 @@ subroutine read_setup_namelist(filename) orog_dir_input_grid = trim(orog_dir_input_grid) // '/' !------------------------------------------------------------------------- -! Determine CRES of target grid from the name of the mosaic file. +! Determine CRES of target grid from the name of the orography file. !------------------------------------------------------------------------- - is = index(mosaic_file_target_grid, "/", .true.) - ie = index(mosaic_file_target_grid, "mosaic") - 1 + is = 1 + ie = index(orog_files_target_grid(1), "_oro_") - 1 - if (is == 0 .or. ie == 0) then - call error_handler("CANT DETERMINE CRES FROM MOSAIC FILE.", 1) + if (ie == 0) then + call error_handler("CANT DETERMINE CRES FROM OROG FILE.", 1) endif - cres_target_grid = mosaic_file_target_grid(is+1:ie-1) + cres_target_grid = orog_files_target_grid(1)(is:ie) if (.not. convert_sfc .and. .not. convert_atm) then call error_handler("MUST CONVERT EITHER AN ATM OR SFC FILE.", 1)