diff --git a/src/ecom/encoders/grib2/grib_encoder_grib2_gg_s_mod.F90 b/src/ecom/encoders/grib2/grib_encoder_grib2_gg_s_mod.F90 index 1954f035..4b207557 100644 --- a/src/ecom/encoders/grib2/grib_encoder_grib2_gg_s_mod.F90 +++ b/src/ecom/encoders/grib2/grib_encoder_grib2_gg_s_mod.F90 @@ -403,7 +403,7 @@ FUNCTION ENCODER_GRIB2_GG_S_ENCODE_ATM( THIS, MODEL_PARAMS, GRIB_INFO, & ILPARAM = COMPUTE_PARAM_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, THIS%CLTYPE_, METADATA ) - ! TOWIL Hacks until we use multi-level soil parameters etc +#if defined(NEW_SOL_ENCODING) SELECT CASE (ILPARAM) CASE( NGRBMX2T3, NGRBMN2T3, NGRB10FG3, & & NGRB10FG6, & @@ -415,6 +415,22 @@ FUNCTION ENCODER_GRIB2_GG_S_ENCODE_ATM( THIS, MODEL_PARAMS, GRIB_INFO, & PP_METADATA_SET( METADATA, 'paramId',ILPARAM) ENDIF END SELECT +#else + SELECT CASE (ILPARAM) + CASE( NGRBMX2T3, NGRBMN2T3, NGRB10FG3, & +& NGRB10FG6, & +& 35,36,37,38, & +& 39,40,41,42, & +& 139,170,183,236, & +& 200001:200999, & ! Class 4i & me, see above +& 80) ! See sekf_write.F90 + PP_METADATA_SET( METADATA, 'paramIdECMF',ILPARAM) + CASE DEFAULT + IF(ILPARAM .NE. 128) THEN + PP_METADATA_SET( METADATA, 'paramId',ILPARAM) + ENDIF + END SELECT +#endif ! Trace end of procedure (on success) PP_METADATA_EXIT_PROCEDURE( METADATA ) diff --git a/src/ecom/encoders/utils/runtime/levels_runtime_utils_mod.F90 b/src/ecom/encoders/utils/runtime/levels_runtime_utils_mod.F90 index 9ac04cc7..0d7e538a 100644 --- a/src/ecom/encoders/utils/runtime/levels_runtime_utils_mod.F90 +++ b/src/ecom/encoders/utils/runtime/levels_runtime_utils_mod.F90 @@ -611,6 +611,7 @@ SUBROUTINE SET_SOL_ICE_LEVEL_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, METADATA ) PP_TRACE_ENTER_PROCEDURE() PP_METADATA_ENTER_PROCEDURE( METADATA ) +#if defined(NEW_SOL_ENCODING) ! Mapping levels SELECT CASE ( MSG%PARAM_ID_ ) CASE (35) @@ -633,6 +634,17 @@ SUBROUTINE SET_SOL_ICE_LEVEL_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, METADATA ) PP_METADATA_SET( METADATA, 'scaledValueOfSecondFixedSurface', LEVEL ) PP_METADATA_SET( METADATA, 'level', LEVEL ) ! level must be defined at the end +#else + ! Set type of level + PP_METADATA_SET( METADATA, 'typeOfFirstFixedSurface', INT(1,JPIB_K) ) + PP_METADATA_SET_MISSING( METADATA, 'scaleFactorOfFirstFixedSurface' ) + PP_METADATA_SET_MISSING( METADATA, 'scaledValueOfFirstFixedSurface' ) + PP_METADATA_SET( METADATA, 'typeOfSecondFixedSurface', INT(255,JPIB_K) ) + PP_METADATA_SET_MISSING( METADATA, 'scaleFactorOfSecondFixedSurface' ) + PP_METADATA_SET_MISSING( METADATA, 'scaledValueOfSecondFixedSurface' ) + ! Set level + PP_METADATA_SET( METADATA, 'level', INT(0,JPIB_K) ) +#endif ! Trace end of procedure (on success) PP_METADATA_EXIT_PROCEDURE( METADATA ) @@ -713,6 +725,7 @@ SUBROUTINE SET_SOL_SOIL_LEVEL_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, METADATA PP_TRACE_ENTER_PROCEDURE() PP_METADATA_ENTER_PROCEDURE( METADATA ) +#if defined(NEW_SOL_ENCODING) ! Mapping levels SELECT CASE ( MSG%PARAM_ID_ ) CASE (39,139) @@ -735,8 +748,19 @@ SUBROUTINE SET_SOL_SOIL_LEVEL_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, METADATA PP_METADATA_SET( METADATA, 'scaledValueOfSecondFixedSurface', LEVEL ) PP_METADATA_SET( METADATA, 'level', LEVEL ) ! level must be defined at the end +#else + ! Set type of level + PP_METADATA_SET( METADATA, 'typeOfFirstFixedSurface', INT(1,JPIB_K) ) + PP_METADATA_SET_MISSING( METADATA, 'scaleFactorOfFirstFixedSurface' ) + PP_METADATA_SET_MISSING( METADATA, 'scaledValueOfFirstFixedSurface' ) + PP_METADATA_SET( METADATA, 'typeOfSecondFixedSurface', INT(255,JPIB_K) ) + PP_METADATA_SET_MISSING( METADATA, 'scaleFactorOfSecondFixedSurface' ) + PP_METADATA_SET_MISSING( METADATA, 'scaledValueOfSecondFixedSurface' ) + ! Set level + PP_METADATA_SET( METADATA, 'level', INT(0,JPIB_K) ) +#endif + -! ENDIF ! Trace end of procedure (on success) PP_METADATA_EXIT_PROCEDURE( METADATA ) diff --git a/src/ecom/encoders/utils/runtime/parameters_runtime_utils_mod.F90 b/src/ecom/encoders/utils/runtime/parameters_runtime_utils_mod.F90 index 095cb089..948458c8 100644 --- a/src/ecom/encoders/utils/runtime/parameters_runtime_utils_mod.F90 +++ b/src/ecom/encoders/utils/runtime/parameters_runtime_utils_mod.F90 @@ -250,9 +250,9 @@ FUNCTION COMPUTE_PARAM_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, CDTYPE, METADAT CASE( 'sg', 'sf' ) IF( ITABLE .EQ. 128 ) IPARAM = 129000 + IPARAM - CASE DEFAULT IF( ITABLE .NE. 128 ) IPARAM = ITABLE*1000 + IPARAM +#if defined(NEW_SOL_ENCODING) SELECT CASE (IPARAM) CASE (35,36,37,38) IPARAM = 262024 @@ -261,9 +261,9 @@ FUNCTION COMPUTE_PARAM_GRIBX_ATM( MODEL_PARAMS, GRIB_INFO, MSG, CDTYPE, METADAT CASE (139,170,183,236) IPARAM = 260360 END SELECT +#endif END SELECT - ! Trace end of procedure (on success) PP_METADATA_EXIT_PROCEDURE( METADATA ) PP_TRACE_EXIT_PROCEDURE_ON_SUCCESS()