libsim Versione 7.1.11

◆ gridinfo_init()

subroutine 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 
)

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 696 del file gridinfo_class.F90.

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

Generated with Doxygen.