FESOM / fesom2

Multi-resolution ocean general circulation model.
http://fesom.de/
GNU General Public License v3.0
51 stars 49 forks source link

a variable store module for probing variable name and its assoiciation for multiple output backends #334

Open suvarchal opened 2 years ago

suvarchal commented 2 years ago

I can imagine in future we would like to support various data backends for storing fesom output, like fdb, zarr etc. In any such output stream we would like to control what variable to write to that backend via namelist like it is currently done for netcdf io. A common theme in all such cases is to associate variable name in namelist to its actual data in module o_arrays and its units etc.

Currently in module io_meandata for netcdf-io it is accomplished using a switch case like:

CASE ('sst       ')
    call def_stream(nod2D, myDim_nod2D, 'sst',      'sea surface temperature',  'C',  tr_arr(1,1:myDim_nod2D,1), io_list(i)%freq, io_list(i)%unit, io_list(i)%precicion ......)

where sst is id in the namelist and is associated to tr_arr(....,1) and has units 'C' and so on

It would be good if we can reuse this part for any new IO backends so that apart from repeting code we may use same name convention in the namelists for other io backends. So I wonder if we can abstract this part and express each variable as type (atleast for io part in may be another module) with any such attributes common for all data output backends.

I will update this thread with my thoughts after experimenting in future but others have an opinion?

JanStreffing commented 2 months ago

Still on the TODO list?