libsim Versione 7.2.1

◆ volgrid6d_write_on_file()

subroutine volgrid6d_write_on_file ( type(volgrid6d), intent(in)  this,
integer, intent(inout), optional  unit,
character(len=*), intent(in), optional  description,
character(len=*), intent(in), optional  filename,
character(len=*), intent(out), optional  filename_auto 
)

Scrittura su file di un volume Volgrid6d.

Scrittura su file unformatted di un intero volume Volgrid6d. Il volume viene serializzato e scritto su file. Il file puo' essere aperto opzionalmente dall'utente. Si possono passare opzionalmente unità e nome del file altrimenti assegnati internamente a dei default; se assegnati internamente tali parametri saranno in output. Se non viene fornito il nome file viene utilizzato un file di default con nome pari al nome del programma in esecuzione con postfisso ".vg6d". Come parametro opzionale c'è la description che insieme alla data corrente viene inserita nell'header del file.

Parametri
[in]thisvolume volgrid6d da scrivere
[in,out]unitunità su cui scrivere; se passata =0 ritorna il valore rielaborato (default =rielaborato internamente con getlun )
[in]filenamenome del file su cui scrivere
[out]filename_autonome del file generato se "filename" è omesso
[in]descriptiondescrizione del volume

Definizione alla linea 794 del file volgrid6d_class.F90.

795!! volgrid6d_alloc(). If the \a force argument is missing or \a
796!! .FALSE. , the volgrid6d object dimension descriptors (time,
797!! timerange, vertical level, physical variable) must already have
798!! space for the corresponding values coming from gridinfo, otherwise
799!! the object will be rejected; this means that all the volgrid6d
800!! dimension descriptors should be correctly assigned. If \a force is
801!! \a .TRUE. , the gridinfo dimension descriptors that do not fit into
802!! available descriptors in the \a volgrid6d structure, will be
803!! accomodated in a empty (i.e. equal to missing value) descriptor, if
804!! available, otherwise the gridinfo will be rejected. The
805!! descriptor of the grid in the \a volgrid object is assigned to the
806!! descriptor contained in \a gridinfo if it is missing in \a volgrid,
807!! otherwise it is checked and the object is rejected if grids do not
808!! match.
809SUBROUTINE import_from_gridinfo(this, gridinfo, force, dup_mode, clone, &
810 isanavar)
811TYPE(volgrid6d),INTENT(inout) :: this
812TYPE(gridinfo_def),INTENT(in) :: gridinfo
813LOGICAL,INTENT(in),OPTIONAL :: force
814INTEGER,INTENT(in),OPTIONAL :: dup_mode
815LOGICAL , INTENT(in),OPTIONAL :: clone
816LOGICAL,INTENT(IN),OPTIONAL :: isanavar
817
818CHARACTER(len=255) :: type
819INTEGER :: itime0, itimerange0, itime1, itimerange1, itime, itimerange, &
820 ilevel, ivar, ldup_mode
821LOGICAL :: dup
822TYPE(datetime) :: correctedtime
823REAL,ALLOCATABLE :: tmpgrid(:,:)
824
825IF (PRESENT(dup_mode)) THEN
826 ldup_mode = dup_mode
827ELSE
828 ldup_mode = 0
829ENDIF
830
831call get_val(this%griddim,proj_type=type)
832
833#ifdef DEBUG
834call l4f_category_log(this%category,l4f_debug,"import_from_gridinfo: "//trim(type))
835#endif
836
837if (.not. c_e(type))then
838 call copy(gridinfo%griddim, this%griddim)
839! ho gia` fatto init, altrimenti non potrei fare la get_val(this%griddim)
840! per cui meglio non ripetere
841! call init(this,gridinfo%griddim,categoryappend)
842 CALL volgrid6d_alloc_vol(this, ini=.true.) ! decode?
843
844else if (.not. (this%griddim == gridinfo%griddim ))then
845
846 CALL l4f_category_log(this%category,l4f_error, &
847 "volgrid and gridinfo grid type or size are different, gridinfo rejected")
848 CALL raise_error()
849 RETURN
850
851end if
852
853! Cerco gli indici del campo da inserire, se non trovo metto nel primo missing
854ilevel = index(this%level, gridinfo%level)
855IF (ilevel == 0 .AND. optio_log(force)) THEN
856 ilevel = index(this%level, vol7d_level_miss)
857 IF (ilevel /= 0) this%level(ilevel) = gridinfo%level
858ENDIF
859
860IF (ilevel == 0) THEN
861 CALL l4f_category_log(this%category,l4f_error, &
862 "volgrid6d: level not valid for volume, gridinfo rejected")
863 CALL raise_error()
864 RETURN
865ENDIF
866
867IF (optio_log(isanavar)) THEN ! assign to all times and timeranges
868 itime0 = 1
869 itime1 = SIZE(this%time)
870 itimerange0 = 1
871 itimerange1 = SIZE(this%timerange)
872ELSE ! usual case
873 correctedtime = gridinfo%time
874 IF (this%time_definition == 1) correctedtime = correctedtime + &
875 timedelta_new(sec=gridinfo%timerange%p1)
876 itime0 = index(this%time, correctedtime)
877 IF (itime0 == 0 .AND. optio_log(force)) THEN
878 itime0 = index(this%time, datetime_miss)
879 IF (itime0 /= 0) this%time(itime0) = correctedtime
880 ENDIF
881 IF (itime0 == 0) THEN
882 CALL l4f_category_log(this%category,l4f_error, &
Index method.

Generated with Doxygen.