PUBLIC INTERFACE ~ PUBLIC ROUTINES

Module ocean_blob_util_mod

Contact:  Michael L. Bates Stephen M. Griffies
Reviewers: 
Change History: WebCVS Log


OVERVIEW

This module contains subroutines that are common (or are likely to need be common to future implementations) to some or all of the various modules that run the Lagrangian blob scheme.

This module contains subroutines that are common (or may be common in a future implementation) to some of the modules that make up the blobs framework. Some of the subroutines contained herein perform tasks such as performing checksums, checking a linked lists for very small blobs (and deleting them), inserting blobs into a list, a bunch of routines for writing blob restart and history files, grid cell search algorithms, buffer manipulations, computations etc. The module has no namelist. All potential namelist variables are controlled through the ocean_blob_mod namelist.


OTHER MODULES USED

       constants_mod
fms_mod
mpp_domains_mod
mpp_mod
ocean_parameters_mod
ocean_types_mod
ocean_workspace_mod

PUBLIC INTERFACE

blob_util_init:
blob_chksum:
lagrangian_system_chksum:
E_and_L_totals:
write_blobs:
blob_delete:
unlink_blob:
insert_blob:
count_blob:
put_att:
inq_var:
get_double:
get_int:
put_double:
put_int:
def_var:
give_error_code:
hashfun:
blob_util_end:
check_ijcell:
check_kcell:
kill_blob:
free_blob_memory:
allocate_interaction_memory:
reallocate_interaction_memory:
interp_tcoeff:
interp_ucoeff:
check_cyclic:


PUBLIC ROUTINES

  1. blob_util_init

    DESCRIPTION
    Initialises this module.


  2. blob_chksum

    DESCRIPTION
    Performs global sums and checksums for all blob types (for diagnostic purposes).


  3. lagrangian_system_chksum

    DESCRIPTION
    Performs checksums for the Lagrangian_system derived type. This is the derived type that stores all of the "gridded" blob variables, and is essential for the accounting required to interact with the Eulerian model in a conservative manner. The checksums are for diagnostic purposes.


  4. E_and_L_totals

    DESCRIPTION
    Gives a brief summary of the total mass, volume and tracer content of the E, L and total systems. Usually used for debuggin purposes.


  5. write_blobs

    DESCRIPTION
    Dumps most of the information carried around by blobs, for all blobs in a particular list. Useful for debugging.


  6. blob_delete

    DESCRIPTION
    Deletes all (nearly) zero mass blob objects from the linked list. The size of the blobs that are deleted is controlled by the variable blob_small_mass in the ocean_blob_nml.


  7. unlink_blob

    DESCRIPTION
    Unlinks a blob from a doubly linked list. It returns pointers to the blob, the head of the list, the (formerly) previous blob in the list and the (formerly) next blob in the list.


  8. insert_blob

    DESCRIPTION
    Inserts a blob to the linked list. The relative order of blobs in a linked list determines whether bitwise reproduction is possible. Regardless of bitwise reproducability or not, we must ensure that blobs always appear in the same relative order when we are using dynamic blobs because if we have a situation where dztL>dztT, we start destroying blobs to enforce dztL<dztT. In order that we do not significantly change answers, we must always destroy the same blob, regardless of domain decomposition, restarts, etc. So, we must always sort blobs so they appear in the linked list in the same relative order.


  9. count_blob

    DESCRIPTION
    Allocates a blob its hash and a number. These two numbers can uniquely identify any blob. The hash and number is based on the grid cell of origin. Each grid cell has a unique hash. We have an array which keeps track of the number of blobs formed in a grid cell. These two numbers give the unique identifier. So, we also need to increment the counter array.


  10. put_att

    DESCRIPTION
    Writes an attribute to a netcdf file.


  11. inq_var

    DESCRIPTION
    Gets the variable identifier from a netcdf file.


  12. get_double

    DESCRIPTION
    Gets the value of a "double" variable from a netcdf file


  13. get_int

    DESCRIPTION
    Gets the value of an integer variable from a netcdf file


  14. put_double

    DESCRIPTION
    Writes the value of a "double" variable to a netcdf file


  15. put_int

    DESCRIPTION
    Writes the value of an integer variable to a netcdf file


  16. def_var

    DESCRIPTION
    Defines a netcdf variable


  17. give_error_code

    DESCRIPTION
    Gives error descriptions for netcdf calls.


  18. hashfun

    DESCRIPTION
    Calculates the hash


  19. blob_util_end

    DESCRIPTION
    Does what is necessary to shut down the module.


  20. check_ijcell

    DESCRIPTION
    Checks whether a blob (horizontally) resides in a grid cell or not. If it does not it figures out which direction the blob is in and checks the neighbouring grid cell, until it finds which grid cell the blob resides in. It uses a cross product technique from computational geometry (Cormen et al., 2001).


  21. check_kcell

    DESCRIPTION
    Searches for which (vertical) grid cell a blob resides in).


  22. kill_blob

    DESCRIPTION
    Kills a blob by returning all of its remaining properties to the E system.


  23. free_blob_memory

    DESCRIPTION
    Frees the heap memory taken up by a blob.


  24. allocate_interaction_memory

    DESCRIPTION
    Allocates the history arrays for a blob (only used when bitwise_reproduction=.true. in the ocean_blob_nml).


  25. reallocate_interaction_memory

    DESCRIPTION
    Different blobs can have different history memory requirements. When they change from one type of blob to another, we need to change the memory allocated to a blob to reflect the new requirements. This is only necessary if bitwise_reproduction=.true. in the ocean_blob_nml.


  26. interp_tcoeff

    DESCRIPTION
    Used for the horizontal interpolation of T grid variables. The routine returns coefficients required for inverse distance weighting (Shephard, 1968).


  27. interp_ucoeff

    DESCRIPTION
    Used for the horizontal interpolation of U grid variables. The routine returns coefficients required for inverse distance weighting (Shephard, 1968).


  28. check_cyclic

    DESCRIPTION
    Checks and adjusts blob position and grid cell index for cylclic/periodic domains, as well as the Murray (1996) tripolar grid.



REFERENCES

  1. Cormen, T. H, Leiserson, C. E. Rivest, R. L., Stein, C. (2001) Introduction to Algorithms. The MIT Press.
  2. Shepard, D. (1968) A two-dimensional interpolation function for irregularly-spaced data. In: Proceedings of the 1968 23rd ACM national conference. ACM '68. ACM, New York, NY, USA, pp. 517-524.
  3. Murray, R. J. (1996) Explicit generation of orthogonal grids for ocean models. Journal of Computational Physics 126, 251-273.


top