Add new variable to output files


I calculated a new variable within a new subroutine. And I would like to write this newly calculated variable to a NetCDF file to see the results. I thought that I could write the variable to one of the already existing output files (CONC or DRYDEP) because I was not able to create a new NetCDF file.

I tried to add the variable by changing wr_init.F, wr_conc.F, and STD_CONC.F files like TA, PRES, and RH. But I am not sure that this is the correct way to add new variable to the output files because I cannot see the variable in the output files.

What is the procedure for creating a new NetCDF file or adding a local variable to the existing output files? Could you please help me with this or provide the correct source for this?

I read this part of the guide but it didn’t work.

Kind regards,

Hi Ezgi,

Add a new variable to an existing output file, such as CONC file, is much more difficult for a general user. However, putting a new variable (or a list of variables) in a brand new netCDF output file, is much easier. You can follow the way how CMAQ is creating an output file, e.g. ACONC or DRY_DEP_1. Also please consult with IOAPI user guide regarding the proper usage of some basic routines: OPEN3, WRITE3, and DESC3.