SOCA
|
A collection of soca_field types representing a collective state or increment. More...
Public Member Functions | |
constructors / destructors | |
procedure | create => soca_fields_create |
Create a new set of fields, allocate space for them, and initialize to zero. More... | |
procedure | copy => soca_fields_copy |
Copy the contents of rhs to self . More... | |
procedure | delete => soca_fields_delete |
delete all the fields More... | |
field getters/checkers | |
procedure | get => soca_fields_get |
Get a pointer to the soca_field with the given name. More... | |
procedure | has => soca_fields_has |
Returns whether a field with the given name exists. More... | |
procedure | check_congruent => soca_fields_check_congruent |
Make sure two sets of fields are the same shape (same variables, same resolution) More... | |
procedure | check_subset => soca_fields_check_subset |
make sure two sets of fields are the same shape for fields they have in common More... | |
math operators | |
procedure | add => soca_fields_add |
Add two sets of fields together. More... | |
procedure | axpy => soca_fields_axpy |
Add two fields (multiplying the rhs first) More... | |
procedure | dot_prod => soca_fields_dotprod |
Calculate the global dot product of two sets of fields. More... | |
procedure | gpnorm => soca_fields_gpnorm |
calculate global statistics for each field (min, max, average) More... | |
procedure | mul => soca_fields_mul |
Multiply a set of fields by a constant. More... | |
procedure | sub => soca_fields_sub |
subtract two sets of fields More... | |
procedure | ones => soca_fields_ones |
Set the value of all fields to one. More... | |
procedure | zeros => soca_fields_zeros |
Reset the value of all fields to zero. More... | |
I/O | |
procedure | read => soca_fields_read |
read a set of fields from a file More... | |
procedure | write_file => soca_fields_write_file |
Save soca fields to file using fms write_data. More... | |
procedure | write_rst => soca_fields_write_rst |
Save soca fields in a restart format. More... | |
misc | |
procedure | update_halos => soca_fields_update_halos |
Update the halo region of all fields. More... | |
procedure | colocate => soca_fields_colocate |
Colocate by interpolating from one c-grid location to another. More... | |
serialization | |
procedure | serial_size => soca_fields_serial_size |
Number of elements to return in the serialized array. More... | |
procedure | serialize => soca_fields_serialize |
Return the fields as a serialized array. More... | |
procedure | deserialize => soca_fields_deserialize |
Deserialize, creating fields from a single serialized array. More... | |
Public Attributes | |
type(soca_geom), pointer | geom => null() |
Pointer to the relevant soca_geom_mod::soca_geom. More... | |
type(soca_field), dimension(:), pointer | fields => null() |
The soca_field instances that make up the fields. More... | |
Related Functions | |
(Note that these are not member functions.) | |
subroutine | soca_fields_init_vars (self, vars) |
For a given list of field names, initialize the properties of those fields. More... | |
subroutine | soca_fields_create (self, geom, vars) |
Create a new set of fields, allocate space for them, and initialize to zero. More... | |
subroutine | soca_fields_delete (self) |
delete all the fields More... | |
subroutine | soca_fields_copy (self, rhs) |
Copy the contents of rhs to self . More... | |
subroutine | soca_fields_get (self, name, field) |
Get a pointer to the soca_field with the given name. More... | |
logical function | soca_fields_has (self, name) |
Returns whether a field with the given name exists. More... | |
subroutine | soca_fields_update_halos (self) |
Update the halo region of all fields. More... | |
subroutine | soca_fields_ones (self) |
Set the value of all fields to one. More... | |
subroutine | soca_fields_zeros (self) |
Reset the value of all fields to zero. More... | |
subroutine | soca_fields_add (self, rhs) |
Add two sets of fields together. More... | |
subroutine | soca_fields_sub (self, rhs) |
subtract two sets of fields More... | |
subroutine | soca_fields_mul (self, zz) |
Multiply a set of fields by a constant. More... | |
subroutine | soca_fields_axpy (self, zz, rhs) |
Add two fields (multiplying the rhs first) More... | |
subroutine | soca_fields_dotprod (self, rhs, zprod) |
Calculate the global dot product of two sets of fields. More... | |
subroutine | soca_fields_read (self, f_conf, vdate) |
read a set of fields from a file More... | |
subroutine | soca_fields_gpnorm (self, nf, pstat) |
calculate global statistics for each field (min, max, average) More... | |
subroutine | soca_fields_check_congruent (self, rhs) |
Make sure two sets of fields are the same shape (same variables, same resolution) More... | |
subroutine | soca_fields_check_subset (self, rhs) |
make sure two sets of fields are the same shape for fields they have in common More... | |
subroutine | soca_fields_write_file (self, filename) |
Save soca fields to file using fms write_data. More... | |
subroutine | soca_fields_write_rst (self, f_conf, vdate) |
Save soca fields in a restart format. More... | |
subroutine | soca_fields_colocate (self, cgridlocout) |
Colocate by interpolating from one c-grid location to another. More... | |
subroutine | soca_fields_serial_size (self, geom, vec_size) |
Number of elements to return in the serialized array. More... | |
subroutine | soca_fields_serialize (self, geom, vec_size, vec) |
Return the fields as a serialized array. More... | |
subroutine | soca_fields_deserialize (self, geom, vec_size, vec, index) |
Deserialize, creating fields from a single serialized array. More... | |
A collection of soca_field types representing a collective state or increment.
The base class for soca_increment_mod::soca_increment and soca_state_mod::soca_state
Definition at line 109 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::add |
Add two sets of fields together.
Definition at line 155 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::axpy |
Add two fields (multiplying the rhs first)
Definition at line 158 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::check_congruent |
Make sure two sets of fields are the same shape (same variables, same resolution)
Definition at line 144 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::check_subset |
make sure two sets of fields are the same shape for fields they have in common
Definition at line 147 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::colocate |
Colocate by interpolating from one c-grid location to another.
Definition at line 201 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::copy |
Copy the contents of rhs
to self
.
Definition at line 127 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::create |
Create a new set of fields, allocate space for them, and initialize to zero.
Definition at line 124 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::delete |
delete all the fields
Definition at line 130 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::deserialize |
Deserialize, creating fields from a single serialized array.
Definition at line 214 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::dot_prod |
Calculate the global dot product of two sets of fields.
Definition at line 161 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::get |
Get a pointer to the soca_field with the given name.
Definition at line 138 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::gpnorm |
calculate global statistics for each field (min, max, average)
Definition at line 164 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::has |
Returns whether a field with the given name exists.
Definition at line 141 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::mul |
Multiply a set of fields by a constant.
Definition at line 167 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::ones |
Set the value of all fields to one.
Definition at line 173 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::read |
read a set of fields from a file
Definition at line 184 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::serial_size |
Number of elements to return in the serialized array.
Definition at line 208 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::serialize |
Return the fields as a serialized array.
Definition at line 211 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::sub |
subtract two sets of fields
Definition at line 170 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::update_halos |
Update the halo region of all fields.
Definition at line 198 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::write_file |
Save soca fields to file using fms write_data.
Definition at line 187 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::write_rst |
Save soca fields in a restart format.
Definition at line 190 of file soca_fields_mod.F90.
procedure soca_fields_mod::soca_fields::zeros |
Reset the value of all fields to zero.
Definition at line 176 of file soca_fields_mod.F90.
|
related |
Add two sets of fields together.
\( self = self + rhs \)
abor1_ftn | aborts if two fields are not congruent |
[in] | rhs | other field to add |
Definition at line 585 of file soca_fields_mod.F90.
|
related |
Add two fields (multiplying the rhs first)
\(self = self + zz * rhs\)
abor1_ftn | aborts if is not a subset of \rhs |
[in] | zz | constant by which to multiply other rhs |
[in] | rhs | other field to add |
Definition at line 645 of file soca_fields_mod.F90.
|
related |
Make sure two sets of fields are the same shape (same variables, same resolution)
abor1_ftn | aborts if two fields are not congruent. |
[in] | rhs | other fields to check for congruency |
Definition at line 1016 of file soca_fields_mod.F90.
|
related |
make sure two sets of fields are the same shape for fields they have in common
abor1_ftn | aborts if self is not a subset of rhs |
[in] | rhs | other field that self should be subset of |
Definition at line 1044 of file soca_fields_mod.F90.
|
related |
Colocate by interpolating from one c-grid location to another.
[in] | cgridlocout | colocate to cgridloc (u, v or h) |
Definition at line 1181 of file soca_fields_mod.F90.
|
related |
Copy the contents of rhs
to self
.
self
will be initialized with the variable names in rhs
if not already initialized.
[in] | rhs | fields to copy from |
Definition at line 459 of file soca_fields_mod.F90.
|
related |
Create a new set of fields, allocate space for them, and initialize to zero.
[in,out] | geom | geometry to associate with the fields |
[in,out] | vars | list of field names to create |
Definition at line 405 of file soca_fields_mod.F90.
|
related |
delete all the fields
Definition at line 436 of file soca_fields_mod.F90.
|
related |
Deserialize, creating fields from a single serialized array.
[in] | geom | todo remove this, not needed? |
[in] | vec_size | size of vec |
[in] | vec | vector to deserialize |
[in,out] | index | index in vec at which to start deserializing |
Definition at line 1302 of file soca_fields_mod.F90.
|
related |
Calculate the global dot product of two sets of fields.
abor1_ftn | aborts if two fields are not congruent |
[in] | rhs | field 2 of dot product |
[out] | zprod | The resulting dot product |
Definition at line 670 of file soca_fields_mod.F90.
|
related |
Get a pointer to the soca_field with the given name.
abor1_ftn | If no field exists with that name, the prorgam aborts |
[in] | name | name of field to find |
[out] | field | a pointer to the resulting field |
Definition at line 493 of file soca_fields_mod.F90.
|
related |
calculate global statistics for each field (min, max, average)
[in] | nf | The number of fields, should be equal to the size of soca_fields::fields |
[out] | pstat | a 2D array with shape (i,j). For each field index i is set as 0 = min, 1 = max, 2 = average, for j number of fields. |
Definition at line 973 of file soca_fields_mod.F90.
|
related |
Returns whether a field with the given name exists.
[in] | name | name of field to find |
Definition at line 517 of file soca_fields_mod.F90.
|
related |
For a given list of field names, initialize the properties of those fields.
[in] | vars | List of variables to initialize. They must be present in the configuration file used to create soca_fields_metadata_mod::soca_fields_metadata |
abor1_ftn | aborts if illegal grid or levels specified |
Definition at line 338 of file soca_fields_mod.F90.
|
related |
Multiply a set of fields by a constant.
\( self = zz * self \)
[in] | zz | the constant by which to multipy the field |
Definition at line 627 of file soca_fields_mod.F90.
|
related |
Set the value of all fields to one.
Definition at line 552 of file soca_fields_mod.F90.
|
related |
read a set of fields from a file
[in] | f_conf | : Configuration with the following parameters
|
[in,out] | vdate | : If fields are being invented (read_from_file == 0), the vdate is used as the valid date of the fields. If the fields are being read in as a state (read_from_file == 1), vdate is set the the date from the files |
Definition at line 732 of file soca_fields_mod.F90.
|
related |
Number of elements to return in the serialized array.
[in] | geom | todo remove, not needed? |
[out] | vec_size | resulting size of vector |
Definition at line 1258 of file soca_fields_mod.F90.
|
related |
Return the fields as a serialized array.
[in] | geom | todo remove this, not needed? |
[in] | vec_size | size of vector to return |
[out] | vec | fields as a serialized vector |
Definition at line 1279 of file soca_fields_mod.F90.
|
related |
subtract two sets of fields
\( self = self - rhs \)
abor1_ftn | aborts if two fields are not congruent |
[in] | rhs | other field to subtract |
Definition at line 607 of file soca_fields_mod.F90.
|
related |
Update the halo region of all fields.
Definition at line 538 of file soca_fields_mod.F90.
|
related |
Save soca fields to file using fms write_data.
[in] | filename | : The name of the file to save to |
Definition at line 1071 of file soca_fields_mod.F90.
|
related |
Save soca fields in a restart format.
TODO this can be generalized even more
[in,out] | self | Fields |
[in] | f_conf | Configuration |
[in,out] | vdate | DateTime |
Definition at line 1097 of file soca_fields_mod.F90.
|
related |
Reset the value of all fields to zero.
Definition at line 567 of file soca_fields_mod.F90.
type(soca_field), dimension(:), pointer soca_fields_mod::soca_fields::fields => null() |
The soca_field instances that make up the fields.
Definition at line 117 of file soca_fields_mod.F90.
type(soca_geom), pointer soca_fields_mod::soca_fields::geom => null() |
Pointer to the relevant soca_geom_mod::soca_geom.
null()
after initialization of the class. Definition at line 114 of file soca_fields_mod.F90.