27 real(kind=kind_real),
allocatable :: xyz(:,:)
28 integer,
allocatable :: indx(:)
31 #define LISTED_TYPE qg_locs 34 #include "oops/util/linkedList_i.f" 43 #include "oops/util/linkedList_c.f" 50 integer(c_int),
intent(inout) :: c_key_locs
86 subroutine c_qg_loc_test(c_key_locs,config,klocs,klats,klons,kz) bind(c,name='qg_loc_test_f90')
88 use fckit_log_module,
only : fckit_log
91 integer(c_int),
intent(in) :: c_key_locs
92 type(c_ptr) ,
intent(in) :: config
93 integer(c_int),
intent(in) :: klocs
94 real(c_double),
intent(in) :: klats(klocs)
95 real(c_double),
intent(in) :: klons(klocs)
96 real(c_double),
intent(in) :: kz(klocs)
98 type(qg_locs),
pointer ::locs
99 real(kind_real),
allocatable :: xx(:), yy(:), rnum(:)
100 integer :: nrand, nloc, i, jo, nseed
102 integer*4,
allocatable :: rseed(:)
104 call fckit_log%warning(
"qg_locs_mod:qg_loc_test generating test locations")
106 if (config_element_exists(config,
"Nrandom"))
then 107 nrand = config_get_int(config,
"Nrandom")
124 allocate(xx(nloc),yy(nloc))
132 xx(1:klocs) = klons(:)
133 yy(1:klocs) = klats(:)
136 if (config_element_exists(config,
"random_seed"))
then 139 rseed0 = config_get_real(config,
"random_seed")
142 call system_clock(count=rseed0)
146 call random_seed(
size=nseed)
147 allocate(rseed(nseed))
149 rseed(i) = rseed0 + i**2
151 call random_seed(put=rseed)
153 allocate(rnum(3*nrand))
154 call random_number(rnum)
157 xx(klocs+1:nloc) = rnum(1:nrand)
158 yy(klocs+1:nloc) = rnum(nrand+1:2*nrand)
169 allocate(locs%indx(nloc))
172 allocate(locs%xyz(3,nloc))
174 locs%xyz(1,jo)=xx(jo)
175 locs%xyz(2,jo)=yy(jo)
183 if (kz(jo) <= 0.5_kind_real)
then 184 locs%xyz(3,jo) = 1.0_kind_real
186 locs%xyz(3,jo) = 2.0_kind_real
192 locs%xyz(3,jo) = int(rnum(i)*2.0_kind_real)+1
195 deallocate(xx,yy,rnum)
203 type(
qg_locs),
intent(inout) :: self
205 integer,
intent(in) :: kobs(:)
209 allocate(self%indx(self%nloc))
210 self%indx(:) = kobs(:)
211 allocate(self%xyz(3,self%nloc))
214 self%xyz(jc,jo)=lvec%values(jc,jo)
225 integer(c_int),
intent(inout) :: key
226 type(qg_locs),
pointer :: self
229 if (
allocated(self%xyz))
deallocate(self%xyz)
236 subroutine c_qg_loc_nobs(key, kobs) bind(c,name='qg_loc_nobs_f90')
239 integer(c_int),
intent(in) :: key
240 integer(c_int),
intent(inout) :: kobs
241 type(qg_locs),
pointer :: self
252 integer(c_int),
intent(in) :: key
253 integer(c_int),
intent(in) :: iloc
254 real(c_double),
intent(inout) :: xyz(3)
255 type(qg_locs),
pointer :: self
259 xyz(1) = self%xyz(2,iloc+1)
260 xyz(2) = self%xyz(1,iloc+1)
261 xyz(3) = self%xyz(3,iloc+1)
subroutine c_qg_loc_create(c_key_locs)
Linked list implementation.
type(registry_t), public qg_locs_registry
Linked list interface - defines registry_t type.
subroutine c_qg_loc_delete(key)
Fortran derived type to hold observation locations.
subroutine c_qg_loc_nobs(key, kobs)
subroutine c_qg_loc_element(key, iloc, xyz)
subroutine c_qg_loc_test(c_key_locs, config, klocs, klats, klons, kz)
Generate locations for interpolation test.
Fortran module handling observation locations.
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************subroutine READ_RECORD_CORE_(unit, field, nwords, data, start, axsiz) integer, intent(in) ::unit type(fieldtype), intent(in) ::field integer, intent(in) ::nwords MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in) ::start(:), axsiz(:) integer(SHORT_KIND) ::i2vals(nwords)!rab used in conjunction with transfer intrinsic to determine size of a variable integer(KIND=1) ::one_byte(8) integer ::word_sz!#ifdef __sgi integer(INT_KIND) ::ivals(nwords) real(FLOAT_KIND) ::rvals(nwords)!#else! integer ::ivals(nwords)! real ::rvals(nwords)!#endif real(DOUBLE_KIND) ::r8vals(nwords) pointer(ptr1, i2vals) pointer(ptr2, ivals) pointer(ptr3, rvals) pointer(ptr4, r8vals) if(mpp_io_stack_size< nwords) call mpp_io_set_stack_size(nwords) call mpp_error(FATAL, 'MPP_READ currently requires use_netCDF option') end subroutine READ_RECORD_CORE_ subroutine READ_RECORD_(unit, field, nwords, data, time_level, domain, position, tile_count, start_in, axsiz_in)!routine that is finally called by all mpp_read routines to perform the read!a non-netCDF record contains:! field ID! a set of 4 coordinates(is:ie, js:je) giving the data subdomain! a timelevel and a timestamp(=NULLTIME if field is static)! 3D real data(stored as 1D)!if you are using direct access I/O, the RECL argument to OPEN must be large enough for the above!in a global direct access file, record position on PE is given by %record.!Treatment of timestamp:! We assume that static fields have been passed without a timestamp.! Here that is converted into a timestamp of NULLTIME.! For non-netCDF fields, field is treated no differently, but is written! with a timestamp of NULLTIME. There is no check in the code to prevent! the user from repeatedly writing a static field. integer, intent(in) ::unit, nwords type(fieldtype), intent(in) ::field MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in), optional ::time_level type(domain2D), intent(in), optional ::domain integer, intent(in), optional ::position, tile_count integer, intent(in), optional ::start_in(:), axsiz_in(:) integer, dimension(size(field%axes(:))) ::start, axsiz integer ::tlevel !, subdomain(4) integer ::i, error, is, ie, js, je, isg, ieg, jsg, jeg type(domain2d), pointer ::io_domain=> tlevel if(PRESENT(start_in) .AND. PRESENT(axsiz_in)) then if(size(start(! the data domain and compute domain must refer to the subdomain being passed ! In this ! since that attempts to gather all data on PE size(field%axes(:)) axsiz(i)
subroutine, public qg_loc_setup(self, lvec, kobs)
Fortran module handling observation vectors.
Fortran derived type to represent an observation vector.