libsim  Versione7.2.3

◆ gridinfo_init()

subroutine gridinfo_class::gridinfo_init ( type(gridinfo_def), intent(out)  this,
type(grid_id), intent(in), optional  gaid,
type(griddim_def), intent(in), optional  griddim,
type(datetime), intent(in), optional  time,
type(vol7d_timerange), intent(in), optional  timerange,
type(vol7d_level), intent(in), optional  level,
type(volgrid6d_var), intent(in), optional  var,
logical, intent(in), optional  clone,
character(len=*), intent(in), optional  categoryappend 
)
private

Constructor, it creates a new instance of the object.

All the additional parameters are optional and they will be initialised to the corresponding missing value if not provided.

Parametri
[out]thisobject to be initialized
[in]gaididentificator of the grid to be described
[in]griddimgrid descriptor
[in]timetime dimension descriptor
[in]timerangetimerange (forecast, analysis, statistically processed) dimension descriptor
[in]levelvertical level dimension descriptor
[in]varphysical variable dimension descriptor
[in]cloneif provided and .TRUE., the gaid will be cloned and not simply copied into the gridinfo object
[in]categoryappendappend this suffix to log4fortran namespace category

Definizione alla linea 702 del file gridinfo_class.F90.

702  ELSE ! cosmo or old simc convention
703  CALL code_referencetime(this-timedelta_new(sec=timerange%p2))
704  ENDIF
705  ELSE ! bad timerange
706  CALL l4f_log( l4f_error, 'Timerange with 0>p1>p2 cannot be exported in grib2')
707  CALL raise_error()
708  ENDIF
709 
710 ELSE
711 
712  CALL l4f_log(l4f_error,'GribEditionNumber '//t2c(editionnumber)//' not supported')
713  CALL raise_error()
714 
715 ENDIF
716 
717 CONTAINS
718 
719 SUBROUTINE code_referencetime(reftime)
720 TYPE(datetime),INTENT(in) :: reftime
721 
722 INTEGER :: date,time
723 CHARACTER(len=17) :: date_time
724 
725 ! datetime is AAAAMMGGhhmmssmsc
726 CALL getval(reftime, simpledate=date_time)
727 READ(date_time(:8),'(I8)')date
728 READ(date_time(9:12),'(I4)')time
729 CALL grib_set(gaid,'dataDate',date)
730 CALL grib_set(gaid,'dataTime',time)
731 
732 END SUBROUTINE code_referencetime
733 
734 END SUBROUTINE time_export_gribapi
735 
736 
737 SUBROUTINE level_import_gribapi(this, gaid)
738 TYPE(vol7d_level),INTENT(out) :: this ! vol7d_level object
739 INTEGER,INTENT(in) :: gaid ! grib_api id of the grib loaded in memory to import
740 
741 INTEGER :: EditionNumber,level1,l1,level2,l2
742 INTEGER :: ltype,ltype1,scalef1,scalev1,ltype2,scalef2,scalev2
743 
744 call grib_get(gaid,'GRIBEditionNumber',editionnumber)
745 
746 if (editionnumber == 1)then
747 
748  call grib_get(gaid,'indicatorOfTypeOfLevel',ltype)
749  call grib_get(gaid,'topLevel',l1)
750  call grib_get(gaid,'bottomLevel',l2)
751 
752  call level_g1_to_g2(ltype,l1,l2,ltype1,scalef1,scalev1,ltype2,scalef2,scalev2)
753 
754 else if (editionnumber == 2)then
755 
756  call grib_get(gaid,'typeOfFirstFixedSurface',ltype1)
757  call grib_get(gaid,'scaleFactorOfFirstFixedSurface',scalef1)
758  call grib_get(gaid,'scaledValueOfFirstFixedSurface',scalev1)
759  IF (scalef1 == -1 .OR. scalev1 == -1) THEN
760  scalef1 = imiss; scalev1 = imiss
761  ENDIF
762 
763  call grib_get(gaid,'typeOfSecondFixedSurface',ltype2)
764  call grib_get(gaid,'scaleFactorOfSecondFixedSurface',scalef2)
765  call grib_get(gaid,'scaledValueOfSecondFixedSurface',scalev2)
766  IF (scalef2 == -1 .OR. scalev2 == -1) THEN
767  scalef2 = imiss; scalev2 = imiss
768  ENDIF
769 

Generated with Doxygen.