23 module data_override_r4
24 #include "data_override_r4.fh"
25 end module data_override_r4
27 module data_override_r8
28 #include "data_override_r8.fh"
29 end module data_override_r8
51 module data_override_mod
54 use platform_mod,
only: r4_kind, r8_kind
68 module procedure data_override_0d_r4
69 module procedure data_override_0d_r8
70 module procedure data_override_2d_r4
71 module procedure data_override_2d_r8
72 module procedure data_override_3d_r4
73 module procedure data_override_3d_r8
79 module procedure data_override_ug_1d_r4
80 module procedure data_override_ug_1d_r8
81 module procedure data_override_ug_2d_r4
82 module procedure data_override_ug_2d_r8
85 integer,
parameter :: mode_r4 = 1
86 integer,
parameter :: mode_r8 = 2
88 integer :: atm_mode = 0
90 integer :: ocn_mode = 0
92 integer :: lnd_mode = 0
94 integer :: ice_mode = 0
120 subroutine data_override_init(Atm_domain_in, Ocean_domain_in, Ice_domain_in, Land_domain_in, Land_domainUG_in, mode)
121 type (
domain2d),
intent(in),
optional :: atm_domain_in
122 type (
domain2d),
intent(in),
optional :: ocean_domain_in
123 type (
domain2d),
intent(in),
optional :: ice_domain_in
124 type (
domain2d),
intent(in),
optional :: land_domain_in
125 type(
domainug) ,
intent(in),
optional :: land_domainug_in
126 integer,
intent(in),
optional :: mode
128 integer :: mode_flags
130 if (
present(mode))
then
137 call mpp_error(fatal,
"data_override_init: Unsupported mode argument")
140 mode_flags = ior(mode_r4, mode_r8)
143 if (iand(mode_flags, mode_r4).ne.0)
then
144 call data_override_init_r4(atm_domain_in, ocean_domain_in, ice_domain_in, land_domain_in, land_domainug_in)
147 if (iand(mode_flags, mode_r8).ne.0)
then
148 call data_override_init_r8(atm_domain_in, ocean_domain_in, ice_domain_in, land_domain_in, land_domainug_in)
151 if (
present(atm_domain_in)) atm_mode = ior(atm_mode, mode_flags)
152 if (
present(ocean_domain_in)) ocn_mode = ior(ocn_mode, mode_flags)
153 if (
present(ice_domain_in)) ice_mode = ior(ice_mode, mode_flags)
154 if (
present(land_domain_in)) lnd_mode = ior(lnd_mode, mode_flags)
161 unset_Ice, unset_Land, must_be_set)
162 logical,
intent(in),
optional :: unset_atm, unset_ocean, unset_ice, unset_land
164 logical,
intent(in),
optional :: must_be_set
166 logical :: fail_if_not_set
168 fail_if_not_set = .true. ;
if (
present(must_be_set)) fail_if_not_set = must_be_set
170 if (
present(unset_atm))
then ;
if (unset_atm)
then
171 if (atm_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
172 "data_override_unset_domains: attempted to unset an Atm_domain that has not been set.")
174 if (iand(atm_mode, mode_r4).ne.0)
call data_override_unset_atm_r4
175 if (iand(atm_mode, mode_r8).ne.0)
call data_override_unset_atm_r8
179 if (
present(unset_ocean))
then ;
if (unset_ocean)
then
180 if (ocn_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
181 "data_override_unset_domains: attempted to unset an Ocn_domain that has not been set.")
183 if (iand(ocn_mode, mode_r4).ne.0)
call data_override_unset_ocn_r4
184 if (iand(ocn_mode, mode_r8).ne.0)
call data_override_unset_ocn_r8
188 if (
present(unset_land))
then ;
if (unset_land)
then
189 if (lnd_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
190 "data_override_unset_domains: attempted to unset an Land_domain that has not been set.")
192 if (iand(lnd_mode, mode_r4).ne.0)
call data_override_unset_lnd_r4
193 if (iand(lnd_mode, mode_r8).ne.0)
call data_override_unset_lnd_r8
197 if (
present(unset_ice))
then ;
if (unset_ice)
then
198 if (ice_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
199 "data_override_unset_domains: attempted to unset an Ice_domain that has not been set.")
201 if (iand(ice_mode, mode_r4).ne.0)
call data_override_unset_ice_r4
202 if (iand(ice_mode, mode_r8).ne.0)
call data_override_unset_ice_r8
208 end module data_override_mod
subroutine, public data_override_init(Atm_domain_in, Ocean_domain_in, Ice_domain_in, Land_domain_in, Land_domainUG_in, mode)
Initialize data_override. Users should call data_override_init before calling data_override.
subroutine, public data_override_unset_domains(unset_Atm, unset_Ocean, unset_Ice, unset_Land, must_be_set)
Unset domains that had previously been set for use by data_override.
Interface for inserting and interpolating data into a file for a model's grid and time....
Version of Data Override for unstructured grids.
The domain2D type contains all the necessary information to define the global, compute and data domai...
Domain information for managing data on unstructured grids.
Type to represent amounts of time. Implemented as seconds and days to allow for larger intervals.