24 module data_override_r4
25 #include "data_override_r4.fh"
26 end module data_override_r4
28 module data_override_r8
29 #include "data_override_r8.fh"
30 end module data_override_r8
52 module data_override_mod
55 use platform_mod,
only: r4_kind, r8_kind
69 module procedure data_override_0d_r4
70 module procedure data_override_0d_r8
71 module procedure data_override_2d_r4
72 module procedure data_override_2d_r8
73 module procedure data_override_3d_r4
74 module procedure data_override_3d_r8
80 module procedure data_override_ug_1d_r4
81 module procedure data_override_ug_1d_r8
82 module procedure data_override_ug_2d_r4
83 module procedure data_override_ug_2d_r8
86 integer,
parameter :: mode_r4 = 1
87 integer,
parameter :: mode_r8 = 2
89 integer :: atm_mode = 0
91 integer :: ocn_mode = 0
93 integer :: lnd_mode = 0
95 integer :: ice_mode = 0
121 subroutine data_override_init(Atm_domain_in, Ocean_domain_in, Ice_domain_in, Land_domain_in, Land_domainUG_in, mode)
122 type (
domain2d),
intent(in),
optional :: atm_domain_in
123 type (
domain2d),
intent(in),
optional :: ocean_domain_in
124 type (
domain2d),
intent(in),
optional :: ice_domain_in
125 type (
domain2d),
intent(in),
optional :: land_domain_in
126 type(
domainug) ,
intent(in),
optional :: land_domainug_in
127 integer,
intent(in),
optional :: mode
129 integer :: mode_flags
131 if (
present(mode))
then
138 call mpp_error(fatal,
"data_override_init: Unsupported mode argument")
141 mode_flags = ior(mode_r4, mode_r8)
144 if (iand(mode_flags, mode_r4).ne.0)
then
145 call data_override_init_r4(atm_domain_in, ocean_domain_in, ice_domain_in, land_domain_in, land_domainug_in)
148 if (iand(mode_flags, mode_r8).ne.0)
then
149 call data_override_init_r8(atm_domain_in, ocean_domain_in, ice_domain_in, land_domain_in, land_domainug_in)
152 if (
present(atm_domain_in)) atm_mode = ior(atm_mode, mode_flags)
153 if (
present(ocean_domain_in)) ocn_mode = ior(ocn_mode, mode_flags)
154 if (
present(ice_domain_in)) ice_mode = ior(ice_mode, mode_flags)
155 if (
present(land_domain_in)) lnd_mode = ior(lnd_mode, mode_flags)
162 unset_Ice, unset_Land, must_be_set)
163 logical,
intent(in),
optional :: unset_atm, unset_ocean, unset_ice, unset_land
165 logical,
intent(in),
optional :: must_be_set
167 logical :: fail_if_not_set
169 fail_if_not_set = .true. ;
if (
present(must_be_set)) fail_if_not_set = must_be_set
171 if (
present(unset_atm))
then ;
if (unset_atm)
then
172 if (atm_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
173 "data_override_unset_domains: attempted to unset an Atm_domain that has not been set.")
175 if (iand(atm_mode, mode_r4).ne.0)
call data_override_unset_atm_r4
176 if (iand(atm_mode, mode_r8).ne.0)
call data_override_unset_atm_r8
180 if (
present(unset_ocean))
then ;
if (unset_ocean)
then
181 if (ocn_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
182 "data_override_unset_domains: attempted to unset an Ocn_domain that has not been set.")
184 if (iand(ocn_mode, mode_r4).ne.0)
call data_override_unset_ocn_r4
185 if (iand(ocn_mode, mode_r8).ne.0)
call data_override_unset_ocn_r8
189 if (
present(unset_land))
then ;
if (unset_land)
then
190 if (lnd_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
191 "data_override_unset_domains: attempted to unset an Land_domain that has not been set.")
193 if (iand(lnd_mode, mode_r4).ne.0)
call data_override_unset_lnd_r4
194 if (iand(lnd_mode, mode_r8).ne.0)
call data_override_unset_lnd_r8
198 if (
present(unset_ice))
then ;
if (unset_ice)
then
199 if (ice_mode.eq.0 .and. fail_if_not_set)
call mpp_error(fatal, &
200 "data_override_unset_domains: attempted to unset an Ice_domain that has not been set.")
202 if (iand(ice_mode, mode_r4).ne.0)
call data_override_unset_ice_r4
203 if (iand(ice_mode, mode_r8).ne.0)
call data_override_unset_ice_r8
209 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.