Several of us at LANL feel like it's important that the vertical mixing module does not require data to be copied into new data structures in order to use it. Mainly because doing this requires that on each model time step the model now has to first copy all required data (which already exists in a manner that should be consistent with the requirements of this vmix module) into a data structure, and second copy all computed data from a data structure into the model data structures. Not only does this seem to waste storage space (having two copies of identical data) it also wastes computational time (for the two copies in/out).

A proposed alternative allows more flexibility on the model side, and doesn't change how the vmix module can handle incoming data. This change is to use pointers instead of arrays. As described in https://wiki.ucar.edu/display/vmix/Project+Overview+%28initial+email+from+July+10%29 the current implementation has vmix_input_type and vmix_output_type containing allocatable arrays, which is the reason data has to be copied. If these are changed to 1D pointers instead models can choose how to use them instead of having the module dictate how the models can use them.

I have attached a tar file containing several source files, which can be found here (https://wiki.ucar.edu/download/attachments/91161165/vmix_examples.tgz).

I created these files with the intent of illustrating the versatility of pointers, as opposed to arrays. These files were all created by checking out the vmix project from the ucar repository, and modifying the required files. I have subnames on some of the files, where they either contain a _parrays or a _pointers. _parrays means that file illustrates how POP would use the required data structures using pointers but creating new arrays (which is identical to having the data types be defined as "dimension(:), allocatable"). _pointers means that file illustrates how POP would use the required data structures using pointers, but referencing the already created data structures.

These were created on 7/26, so they are probably a bit older than the current implementation. I used revision number 38964 to create them, in case anyone wants to check it out and diff the files to find out what I changed. Most of the changes are minimal and don't relate to the actual vmix module at all.

  • No labels