Skip to content

Commit

Permalink
MUL-146 MULTIOM - dictionary API setting MARS Keys
Browse files Browse the repository at this point in the history
  • Loading branch information
geier1993 committed Jan 14, 2025
1 parent a3e88b9 commit c580215
Show file tree
Hide file tree
Showing 4 changed files with 850 additions and 6 deletions.
104 changes: 99 additions & 5 deletions src/multiom/api/api_dictionary_wrapper_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,16 @@ PP_THREAD_SAFE FUNCTION MULTIO_GRIB2_DICT_SET( DICT, KEY, KLEN, VALUE, VLEN ) &
USE :: FORTRAN_MESSAGE_MOD, ONLY: FORTRAN_MESSAGE_T
USE :: PARAMETRIZATION_MOD, ONLY: PARAMETRIZATION_T
USE :: GENERAL_UTILS_MOD, ONLY: TOLOWER
USE :: ENUMERATORS_MOD, ONLY: CSTREAM2ISTREAM, CTYPE2ITYPE, CCLASS2ICLASS, CLEVTYPE2ILEVTYPE
USE :: ENUMERATORS_MOD, ONLY: CSTREAM2ISTREAM
USE :: ENUMERATORS_MOD, ONLY: CTYPE2ITYPE
USE :: ENUMERATORS_MOD, ONLY: CCLASS2ICLASS
USE :: ENUMERATORS_MOD, ONLY: CLEVTYPE2ILEVTYPE
USE :: ENUMERATORS_MOD, ONLY: CORIGIN2IORIGIN
USE :: ENUMERATORS_MOD, ONLY: CINT2IINT
USE :: ENUMERATORS_MOD, ONLY: CREPRES2IREPRES
USE :: ENUMERATORS_MOD, ONLY: CPACKING2IPACKING
USE :: ENUMERATORS_MOD, ONLY: CMODEL2IMODEL
USE :: ENUMERATORS_MOD, ONLY: CPARAMTYPE2IPARAMTYPE


! Symbols imported by the preprocessor for debugging purposes
Expand Down Expand Up @@ -750,12 +759,97 @@ PP_THREAD_SAFE FUNCTION MULTIO_GRIB2_DICT_SET( DICT, KEY, KLEN, VALUE, VLEN ) &
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CCLASS2ICLASS(F_VAL, ITEMP, HOOKS)
MARS_DICT%CLASS=ITEMP

CASE ( 'origin' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CORIGIN2IORIGIN(F_VAL, ITEMP, HOOKS)
MARS_DICT%ORIGIN=ITEMP

CASE ( 'anoffset' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%ANOFFSET=ITEMP

CASE ( 'packing' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CPACKING2IPACKING(F_VAL, ITEMP, HOOKS)
MARS_DICT%NUMBER=ITEMP

CASE ( 'number' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%NUMBER=ITEMP

CASE ( 'ident' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%IDENT=ITEMP

CASE ( 'instrument' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%INSTRUMENT=ITEMP

CASE ( 'channel' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%CHANNEL=ITEMP

CASE ( 'paramtype' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CPARAMTYPE2IPARAMTYPE(F_VAL, ITEMP, HOOKS)
MARS_DICT%PARAM_TYPE=ITEMP

CASE ( 'chem' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%CHEM=ITEMP

CASE ( 'param' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%PARAM=ITEMP

CASE ( 'model' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CMODEL2IMODEL(F_VAL, ITEMP, HOOKS)
MARS_DICT%MODEL=ITEMP

CASE ( 'levtype' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CLEVTYPE2ILEVTYPE(F_VAL, ITEMP, HOOKS)
MARS_DICT%LEVTYPE=ITEMP

CASE ( 'levelist' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%LEVELIST=ITEMP

CASE ( 'direction' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%DIRECTION=ITEMP

CASE ( 'frequency' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%FREQUENCY=ITEMP

CASE ( 'date' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%DATE=ITEMP

CASE ( 'time' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%time=ITEMP

CASE ( 'step' )
! TODO handle step range?
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%step=ITEMP

CASE ( 'repres' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CREPRES2IREPRES(F_VAL, ITEMP, HOOKS)
MARS_DICT%repres=ITEMP

CASE ( 'truncation' )
! TODO
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CINT2IINT(F_VAL, ITEMP, HOOKS)
MARS_DICT%TRUNCATION=ITEMP

CASE ( 'timeproc' )
MARS_DICT%TIMEPROC=F_VAL

CASE ( 'expver' )
MARS_DICT%CLASS=F_VAL
MARS_DICT%EXPVER=F_VAL

CASE ( 'grid' )
MARS_DICT%GRID=F_VAL

CASE ( 'origin' )
PP_TRYCALL(ERRFLAG_CONVERT_MARS_TO_ENUM) CCENT(F_VAL, ITEMP, HOOKS)
MARS_DICT%CLASS=ITEMP

CASE DEFAULT

Expand Down
Loading

0 comments on commit c580215

Please sign in to comment.