|
◆ volgrid6d_write_on_file()
subroutine volgrid6d_class::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 |
|
) |
| |
|
private |
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] | this | volume volgrid6d da scrivere |
[in,out] | unit | unità su cui scrivere; se passata =0 ritorna il valore rielaborato (default =rielaborato internamente con getlun ) |
[in] | filename | nome del file su cui scrivere |
[out] | filename_auto | nome del file generato se "filename" è omesso |
[in] | description | descrizione del volume |
Definizione alla linea 816 del file volgrid6d_class.F90.
821 SUBROUTINE import_from_gridinfo(this, gridinfo, force, dup_mode, clone, &
823 TYPE(volgrid6d), INTENT(inout) :: this
824 TYPE(gridinfo_def), INTENT(in) :: gridinfo
825 LOGICAL, INTENT(in), OPTIONAL :: force
826 INTEGER, INTENT(in), OPTIONAL :: dup_mode
827 LOGICAL , INTENT(in), OPTIONAL :: clone
828 LOGICAL, INTENT(IN), OPTIONAL :: isanavar
830 CHARACTER(len=255) :: type
831 INTEGER :: itime0, itimerange0, itime1, itimerange1, itime, itimerange, &
832 ilevel, ivar, ldup_mode
834 TYPE(datetime) :: correctedtime
835 TYPE(vol7d_timerange) :: correctedtimerange
836 REAL, ALLOCATABLE :: tmpgrid(:,:)
838 IF ( PRESENT(dup_mode)) THEN
844 call get_val(this%griddim,proj_type=type)
847 call l4f_category_log(this%category,l4f_debug, "import_from_gridinfo: "//trim(type))
850 if (.not. c_e(type)) then
851 call copy(gridinfo%griddim, this%griddim)
855 CALL volgrid6d_alloc_vol(this, ini=.true.)
857 else if (.not. (this%griddim == gridinfo%griddim )) then
859 CALL l4f_category_log(this%category,l4f_error, &
860 "volgrid and gridinfo grid type or size are different, gridinfo rejected")
867 ilevel = index(this%level, gridinfo%level)
868 IF (ilevel == 0 .AND. optio_log(force)) THEN
869 ilevel = index(this%level, vol7d_level_miss)
870 IF (ilevel /= 0) this%level(ilevel) = gridinfo%level
873 IF (ilevel == 0) THEN
874 CALL l4f_category_log(this%category,l4f_error, &
875 "volgrid6d: level not valid for volume, gridinfo rejected")
880 IF (optio_log(isanavar)) THEN
882 itime1 = SIZE(this%time)
884 itimerange1 = SIZE(this%timerange)
886 correctedtime = gridinfo%time
887 IF (this%time_definition == 1 .OR. this%time_definition == 2) correctedtime = correctedtime + &
888 timedelta_new(sec=gridinfo%timerange%p1)
889 itime0 = index(this%time, correctedtime)
890 IF (itime0 == 0 .AND. optio_log(force)) THEN
891 itime0 = index(this%time, datetime_miss)
892 IF (itime0 /= 0) this%time(itime0) = correctedtime
894 IF (itime0 == 0) THEN
895 CALL l4f_category_log(this%category,l4f_error, &
896 "volgrid6d: time not valid for volume, gridinfo rejected")
902 correctedtimerange = gridinfo%timerange
903 IF (this%time_definition == 2) correctedtimerange%p1 = 0
904 itimerange0 = index(this%timerange, correctedtimerange)
|