Skip to content

Commit

Permalink
Add more keys to parametrization
Browse files Browse the repository at this point in the history
  • Loading branch information
geier1993 committed Aug 23, 2024
1 parent ed61522 commit 4328b2a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
30 changes: 20 additions & 10 deletions src/ecom/common/om_multio_utils_v3_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ SUBROUTINE MULTIO_WRITE_PARAMETRIZATION( MIO_HANDLE, MODEL_PARAMS )
! Symbols imported from other modules within the project.
USE :: OM_CORE_MOD, ONLY: JPIB_K
USE :: OM_CORE_MOD, ONLY: JPIM_K
USE :: OM_API_MOD, ONLY: MODEL_PAR_T
USE :: OM_CORE_MOD, ONLY: MODEL_PAR_T

! Symbols imported from other libraries
USE :: GRIB_API, ONLY: GRIB_SUCCESS
Expand Down Expand Up @@ -329,24 +329,27 @@ SUBROUTINE MULTIO_WRITE_PARAMETRIZATION( MIO_HANDLE, MODEL_PARAMS )
ERR = MIOMD%SET('generatingProcessIdentifier', MODEL_PARAMS%SIM_%NCYCLE )
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )

ERR = MIOMD%SET('iterationNumber', MODEL_PARAMS%SIM_%NJITER)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('sensitiveAreaDomain', MODEL_PARAMS%SIM_%NJDOMAI)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('diagnosticNumber', MODEL_PARAMS%SIM_%NJDIAG)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
! TODO look at mars_preset_utils_mod.F90 to see how this is used for ccccIdentifiers and consensusCount
! ERR = MIOMD%SET('', MODEL_PARAMS%SIM_%NDWD)
! ERR = MIOMD%SET('', MODEL_PARAMS%SIM_%NMFR)
! ERR = MIOMD%SET('', MODEL_PARAMS%SIM_%NNCEP)
! ERR = MIOMD%SET('', MODEL_PARAMS%SIM_%NUKM)
ERR = MIOMD%SET('perturbationNumber', MODEL_PARAMS%SIM_%NENSFNB)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
! TODO set all the following fields only if numberOfForecastsInEnsemble is positive ???
ERR = MIOMD%SET('numberOfForecastsInEnsemble', MODEL_PARAMS%SIM_%NTOTENS)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('perturbationNumber', MODEL_PARAMS%SIM_%NENSFNB)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('systemNumber', MODEL_PARAMS%SIM_%NSYSTEM)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('methodNumber', MODEL_PARAMS%SIM_%NMETHOD)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('iterationNumber', MODEL_PARAMS%SIM_%NJITER)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('diagnosticNumber', MODEL_PARAMS%SIM_%NJDIAG)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )

PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('referenceDate', MODEL_PARAMS%SIM_%NREFERENCE)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
Expand All @@ -360,6 +363,13 @@ SUBROUTINE MULTIO_WRITE_PARAMETRIZATION( MIO_HANDLE, MODEL_PARAMS )
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('stream', MODEL_PARAMS%SIM_%NSTREAM)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )

ERR = MIOMD%SET('date', MODEL_PARAMS%SIM_%NINDAT)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('timeInSeconds', MODEL_PARAMS%SIM_%NSSSSS)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('timeIncrementInSeconds', MODEL_PARAMS%SIM_%TSTEP)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )

! TODO WRITE as array
ERR = MIO_HANDLE%WRITE_PARAMETRIZATION('pv', MODEL_PARAMS%GEO_%ZVERT(1:2*(MODEL_PARAMS%GEO_%IFLEV+1)))
Expand Down Expand Up @@ -439,7 +449,7 @@ SUBROUTINE MULTIO_WRITE_PARAMETRIZATION( MIO_HANDLE, MODEL_PARAMS )
LON_STRET_DEG = 180._JPRD_K/(2.0_JPRD_K*ASIN(1.0_JPRD_K))*REAL(YPI%RLOCEN,JPRD_K)

IF( YPI%NSTTYP .GE. 2 ) THEN
ERR = MIOMD%SET('gridType','stretched_rotated_sh')
ERR = MIOMD%SET('sphericalHarmonicsType','stretched_rotated_sh')
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('latitudeOfStretchingPoleInDegrees', LAT_STRET_DEG )
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
Expand All @@ -448,13 +458,13 @@ SUBROUTINE MULTIO_WRITE_PARAMETRIZATION( MIO_HANDLE, MODEL_PARAMS )
ERR = MIOMD%SET('stretchingFactor',YPI%RSTRET)
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ELSEIF( ABS(YPI%RSTRET-1.0_JPRD_K) .GE. 1.E-14_JPRD_K ) THEN
ERR = MIOMD%SET('gridType', 'stretched_sh' )
ERR = MIOMD%SET('sphericalHarmonicsType', 'stretched_sh' )
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ERR = MIOMD%SET('stretchingFactor', YPI%RSTRET )
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )
ELSE

ERR = MIOMD%SET('gridType','sh')
ERR = MIOMD%SET('sphericalHarmonicsType','sh')
PP_DEBUG_CRITICAL_COND_THROW( ERR.NE.MULTIO_SUCCESS, 1 )

ENDIF
Expand Down
2 changes: 1 addition & 1 deletion src/ecom/core/om_data_types_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ MODULE OM_DATA_TYPES_MOD


! yomrip0.F90 - time related quantities
! NINDAT : run initial date in the form AAAAMMDD
! NINDAT : run initial date in the form YYYYMMDD
INTEGER(KIND=JPIB_K) :: NINDAT

! NSSSSS : initial time in seconds (e.g. for 12h, 43200)
Expand Down
2 changes: 1 addition & 1 deletion src/ecom/encoders/utils/preset/time_preset_utils_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@ END SUBROUTINE TIME_PRESET_GRIBX_ATM
END MODULE TIME_PRESET_UTILS_MOD
#undef PP_SECTION_NAME
#undef PP_SECTION_TYPE
#undef PP_FILE_NAME
#undef PP_FILE_NAME

0 comments on commit 4328b2a

Please sign in to comment.