Simple netcdf writer xarray compatible A developer released fortxarray, a small Fortran library for writing NETCDF files compatible with Python's xarray library, designed for simplicity and ease of use. The library, which leverages Google Gemini for development, allows users to write NETCDF files with minimal code, such as three calls to create, add a variable, and close. It includes routines for reading data back and supports both explicit dimension definitions and automatic dimension creation. I wrote a small library for writing NETCDF files compatible with python xarray library. It started a few year ago when I decided to write the output of code to NETCDF in a format compatible with xarray so it can be easily read. I decided in the last few days to make a full library that is not going to use all the NETCDF possibilities but that would have been as easy to use as possible. I extensively used Google gemini to achieve that. The ide is that you can write a netcdf as easily as: program test simple use fortxarray, only: xarray type use iso fortran env, only: dp = real64 implicit none integer, parameter :: NP = 5, NX = 3 type xarray type :: xr real dp :: z NP, NX integer :: j, k do concurrent j=1:NP, k=1:NX z j,k = j 10 + k end do call xr%create netcdf 'temporary' call xr%add dimension 't', NP call xr%add dimension 'x', real dp :: 10, 20, 30 call xr%add variable 'z', z, 't','x' call xr%add variable 'zz', z, 'tt', 'xx' , add dimension=.true. call xr%close netcdf end program test simple The really bare minimum is: call xr%create netcdf 'temporary' call xr%add variable 'zz', z, 'tt', 'xx' , add dimension=.true. call xr%close netcdf If you don’t care about the dimension being an array of something. There are routines similar to those to read back the data.