Skip to content
Snippets Groups Projects
Select Git revision
  • 6a34bebbcdc1c534c233a4cd8dee3d4d415cb94a
  • master default protected
  • enxhi_issue460_remove_TOAR-I_access
  • michael_issue459_preprocess_german_stations
  • sh_pollutants
  • develop protected
  • release_v2.4.0
  • michael_issue450_feat_load-ifs-data
  • lukas_issue457_feat_set-config-paths-as-parameter
  • lukas_issue454_feat_use-toar-statistics-api-v2
  • lukas_issue453_refac_advanced-retry-strategy
  • lukas_issue452_bug_update-proj-version
  • lukas_issue449_refac_load-era5-data-from-toar-db
  • lukas_issue451_feat_robust-apriori-estimate-for-short-timeseries
  • lukas_issue448_feat_load-model-from-path
  • lukas_issue447_feat_store-and-load-local-clim-apriori-data
  • lukas_issue445_feat_data-insight-plot-monthly-distribution
  • lukas_issue442_feat_bias-free-evaluation
  • lukas_issue444_feat_choose-interp-method-cams
  • 414-include-crps-analysis-and-other-ens-verif-methods-or-plots
  • lukas_issue384_feat_aqw-data-handler
  • v2.4.0 protected
  • v2.3.0 protected
  • v2.2.0 protected
  • v2.1.0 protected
  • Kleinert_etal_2022_initial_submission
  • v2.0.0 protected
  • v1.5.0 protected
  • v1.4.0 protected
  • v1.3.0 protected
  • v1.2.1 protected
  • v1.2.0 protected
  • v1.1.0 protected
  • IntelliO3-ts-v1.0_R1-submit
  • v1.0.0 protected
  • v0.12.2 protected
  • v0.12.1 protected
  • v0.12.0 protected
  • v0.11.0 protected
  • v0.10.0 protected
  • IntelliO3-ts-v1.0_initial-submit
41 results

data_preparation.py

Blame
  • vtk_export.f90 1.65 KiB
    module vtk_export
      implicit none
    
      ! VTK export
      !
      ! This module stores the volumes Q first variable 
      ! as VTK polydata
      !
      
    contains
      subroutine save_vtk(Q, x, y, l, m, n, fname, title)
        implicit none
        integer, intent(in) :: l, m, n
        double precision, intent(in), dimension(l, m, n) :: Q
        double precision, intent(in), dimension(n) :: x
        double precision, intent(in), dimension(m) :: y
        character, intent(in) :: fname*(*)
        character, optional :: title*(*)
        integer i,j
    
        open(1, file=fname)
    
        !
        ! Write vtk Datafile header
        !
        write(1,fmt='(A)') '# vtk DataFile Version 2.0'
         if(present(title)) then
           write(1,fmt='(A)') title
        else
           write(1,fmt='(A)') 'VTK'
        end if  
        write(1,fmt='(A)') 'ASCII'
        write(1,fmt='(A)') 'DATASET POLYDATA'
        write(1,*)
        
        !
        ! Store water height as polydata
        !
         write(1,fmt='(A,I8,A)') 'POINTS', m*n,' double'
         do j=1,n
            do i=1,m
               write(1,fmt='(F7.5,F15.6,F17.12)') x(i), y(j), Q(1,i,j)
            end do
         end do
         write(1,*)
         
         write(1,fmt='(A,I12,I12,I12)') 'VERTICES',n,n*(m+1)
         do j=1,n
            write(1,fmt='(I12)', advance='no') m
            do i=0,m-1
               write(1,fmt='(I12)', advance='no') i+(j-1)*(m)
            end do
            write(1,*)
         end do
    
         !
         ! Store lookup table
         !
         write(1,fmt='(A,I12)') 'POINT_DATA',m*n
         write(1,fmt='(A)') 'SCALARS height double 1'
         write(1,fmt='(A)') 'LOOKUP_TABLE default'
         do j=1,n
            do i=1,m
               write(1,fmt='(F15.12)') Q(1,i,j)
            end do
         end do
         write(1,*)
         close(1)
         
       end subroutine save_vtk
    end module vtk_export