Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I want to write the data of a 3D variable calculated by Fortran routines into a NetCDF file.
I have written the code to write the variable data but it is creating an empty NetCDF file after the execution.
stat = NF90_CREATE( '/home/sachin/output.nc', NF90_CLOBBER, ncid_user)
stat = NF90_DEF_DIM( ncid_user, i, NF90_UNLIMITED, i_id )
stat = NF90_DEF_DIM( ncid_user, j, NF90_UNLIMITED, j_id )
stat = NF90_DEF_DIM( ncid_user, k, NF90_UNLIMITED, k_id )
e_id=(/i_id,j_id,k_id/)
stat = NF90_DEF_VAR( ncid_user, ene, NF90_INT, e_id, ev_id )
stat1 = NF90_OPEN('/home/sachin/output.nc', NF90_WRITE, ncid_user)
stat1 = NF90_PUT_VAR(ncid_user, ev_id, start = (/ 1,1,1 /), count = (/ 10,10,0 /), stride = (/ 10,10,0 /) )
When I am printing stat1 variable, it is printing -51 as the return value of the NF90_PUT_VAR function.
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.