Skip to content
Snippets Groups Projects
main.f90 515 B
Newer Older
program main
    use netcdf_io_module
    implicit none
    type(io_struct) :: ios
    real, dimension(10) :: time_data = (/1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0/)
    real, dimension(10) :: series_data = (/10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0/)

    call open_netcdf('series_data.nc', ios, 10)
    if (ios%is_open) then
        call write_series(ios, time_data, series_data)
        call close_netcdf(ios)
    else
        print *, 'Failed to open NetCDF file.'
    endif
end program main