21 #include "fms_switches.h" 22 #define _FLATTEN(A) reshape((A), (/size((A))/) ) 25 #include <fms_platform.h> 94 #define _TYPE_DOMAIN2D integer 99 use mpp_mod ,
only : mpp_pe, mpp_npes
101 #define _MPP_PE mpp_pe() 102 #define _MPP_ROOT mpp_root_pe() 103 #define _MPP_NPES mpp_npes() 104 #define _TYPE_DOMAIN2D type(domain2d) 119 use cloud_interpolator_mod,
only: cld_ntrp_linear_cell_interp, cld_ntrp_locate_cell, cld_ntrp_get_cell_values
131 #include<file_version.h> 144 real, _allocatable :: fields(:,:) _null
146 real, _allocatable :: xu(:) _null
147 real, _allocatable :: yu(:) _null
148 real, _allocatable :: zu(:) _null
149 real, _allocatable :: xv(:) _null
150 real, _allocatable :: yv(:) _null
151 real, _allocatable :: zv(:) _null
152 real, _allocatable :: xw(:) _null
153 real, _allocatable :: yw(:) _null
154 real, _allocatable :: zw(:) _null
156 real, _allocatable :: temp_pos(:,:) _null
157 real, _allocatable :: rk4_k1(:,:) _null
158 real, _allocatable :: rk4_k2(:,:) _null
159 real, _allocatable :: rk4_k3(:,:) _null
160 real, _allocatable :: rk4_k4(:,:) _null
162 character(len=MAX_STR_LEN) :: input_file, output_file
165 logical :: rk4_completed
167 logical, _allocatable :: remove(:) _null
170 interface assignment(=)
175 module procedure drifters_push_2
176 module procedure drifters_push_3
180 module procedure drifters_computek2d
181 module procedure drifters_computek3d
185 module procedure drifters_set_field_2d
186 module procedure drifters_set_field_3d
221 subroutine drifters_new(self, input_file, output_file, ermesg)
224 character(len=*),
intent(in) :: input_file
225 character(len=*),
intent(in) :: output_file
226 character(len=*),
intent(out) :: ermesg
228 integer nd, nf, npdim, i
229 character(len=6) :: pe_str
233 self%input_file = input_file
234 self%output_file = output_file
237 if(ermesg/=
'')
return 240 nd =
size(self%input%velocity_names)
242 npdim = int(1.3*
size(self%input%positions, 2))
244 if(ermesg/=
'')
return 247 nf =
size(self%input%field_names)
251 write(pe_str,
'(i6)') _mpp_pe
252 pe_str = adjustr(pe_str)
254 if(pe_str(i:i)==
' ') pe_str(i:i)=
'0' 256 call drifters_io_new(self%io, output_file//
'.'//pe_str, nd, nf, ermesg)
257 if(ermesg/=
'')
return 260 if(ermesg/=
'')
return 268 if(ermesg/=
'')
return 271 if(ermesg/=
'')
return 275 if(ermesg/=
'')
return 278 if(ermesg/=
'')
return 285 self%rk4_completed = .false.
287 allocate(self%rk4_k1(self%core%nd, self%core%npdim))
288 self%rk4_k1 = -huge(1.)
289 allocate(self%rk4_k2(self%core%nd, self%core%npdim))
290 self%rk4_k2 = -huge(1.)
291 allocate(self%rk4_k3(self%core%nd, self%core%npdim))
292 self%rk4_k3 = -huge(1.)
293 allocate(self%rk4_k4(self%core%nd, self%core%npdim))
294 self%rk4_k4 = -huge(1.)
295 allocate(self%remove(self%core%npdim))
296 self%remove = .false.
297 allocate(self%temp_pos(nd, self%core%npdim))
298 self%temp_pos = -huge(1.)
300 allocate(self%fields(nf, self%core%npdim))
301 self%fields = -huge(1.)
327 character(len=*),
intent(out) :: ermesg
331 deallocate(self%fields, stat=flag)
332 deallocate(self%xu, stat=flag)
333 deallocate(self%yu, stat=flag)
334 deallocate(self%zu, stat=flag)
335 deallocate(self%xv, stat=flag)
336 deallocate(self%yv, stat=flag)
337 deallocate(self%zv, stat=flag)
338 deallocate(self%xw, stat=flag)
339 deallocate(self%yw, stat=flag)
340 deallocate(self%zw, stat=flag)
341 deallocate(self%temp_pos, stat=flag)
342 deallocate(self%rk4_k1, stat=flag)
343 deallocate(self%rk4_k2, stat=flag)
344 deallocate(self%rk4_k3, stat=flag)
345 deallocate(self%rk4_k4, stat=flag)
346 deallocate(self%remove, stat=flag)
349 if(ermesg/=
'')
return 351 if(ermesg/=
'')
return 353 if(ermesg/=
'')
return 355 if(ermesg/=
'')
return 383 type(drifters_type),
intent(in) :: old_instance
384 type(drifters_type),
intent(inout) :: new_instance
386 character(len=MAX_STR_LEN) :: ermesg
392 if(ermesg/=
'')
return 394 new_instance%core = old_instance%core
395 new_instance%input = old_instance%input
396 new_instance%io = old_instance%io
397 new_instance%comm = old_instance%comm
399 new_instance%dt = old_instance%dt
400 new_instance%time = old_instance%time
402 allocate(new_instance%fields(
size(old_instance%fields, 1), &
403 &
size(old_instance%fields, 2) ))
404 new_instance%fields = old_instance%fields
406 allocate(new_instance%xu(
size(old_instance%xu) ))
407 allocate(new_instance%yu(
size(old_instance%yu) ))
408 allocate(new_instance%zu(
size(old_instance%zu) ))
409 new_instance%xu = old_instance%xu
410 new_instance%yu = old_instance%yu
411 new_instance%zu = old_instance%zu
412 allocate(new_instance%xv(
size(old_instance%xv) ))
413 allocate(new_instance%yv(
size(old_instance%yv) ))
414 allocate(new_instance%zv(
size(old_instance%zv) ))
415 new_instance%xv = old_instance%xv
416 new_instance%yv = old_instance%yv
417 new_instance%zv = old_instance%zv
418 allocate(new_instance%xw(
size(old_instance%xw) ))
419 allocate(new_instance%yw(
size(old_instance%yw) ))
420 allocate(new_instance%zw(
size(old_instance%zw) ))
421 new_instance%xw = old_instance%xw
422 new_instance%yw = old_instance%yw
423 new_instance%zw = old_instance%zw
425 allocate(new_instance%temp_pos(
size(old_instance%temp_pos,1), &
426 &
size(old_instance%temp_pos,2) ))
427 new_instance%temp_pos = old_instance%temp_pos
428 allocate(new_instance%rk4_k1(
size(old_instance%rk4_k1,1), &
429 &
size(old_instance%rk4_k1,2) ))
430 allocate(new_instance%rk4_k2(
size(old_instance%rk4_k2,1), &
431 &
size(old_instance%rk4_k2,2) ))
432 allocate(new_instance%rk4_k3(
size(old_instance%rk4_k3,1), &
433 &
size(old_instance%rk4_k3,2) ))
434 allocate(new_instance%rk4_k4(
size(old_instance%rk4_k4,1), &
435 &
size(old_instance%rk4_k4,2) ))
436 new_instance%rk4_k1 = old_instance%rk4_k1
437 new_instance%rk4_k2 = old_instance%rk4_k2
438 new_instance%rk4_k3 = old_instance%rk4_k3
439 new_instance%rk4_k4 = old_instance%rk4_k4
441 new_instance%rk4_step = old_instance%rk4_step
442 new_instance%rk4_completed = old_instance%rk4_completed
443 new_instance%nx = old_instance%nx
444 new_instance%ny = old_instance%ny
446 allocate(new_instance%remove(
size(old_instance%remove)))
447 new_instance%remove = old_instance%remove
516 & xmin_comp, xmax_comp, ymin_comp, ymax_comp, &
517 & xmin_data, xmax_data, ymin_data, ymax_data, &
518 & xmin_glob, xmax_glob, ymin_glob, ymax_glob, &
522 real,
optional,
intent(in) :: xmin_comp, xmax_comp, ymin_comp, ymax_comp
524 real,
optional,
intent(in) :: xmin_data, xmax_data, ymin_data, ymax_data
526 real,
optional,
intent(in) :: xmin_glob, xmax_glob, ymin_glob, ymax_glob
527 character(len=*),
intent(out) :: ermesg
530 if(
present(xmin_comp)) self%comm%xcmin = xmin_comp
531 if(
present(xmax_comp)) self%comm%xcmax = xmax_comp
532 if(
present(ymin_comp)) self%comm%ycmin = ymin_comp
533 if(
present(ymax_comp)) self%comm%ycmax = ymax_comp
535 if(
present(xmin_data)) self%comm%xdmin = xmin_data
536 if(
present(xmax_data)) self%comm%xdmax = xmax_data
537 if(
present(ymin_data)) self%comm%ydmin = ymin_data
538 if(
present(ymax_data)) self%comm%ydmax = ymax_data
540 if(
present(xmin_glob)) self%comm%xgmin = xmin_glob
541 if(
present(xmax_glob)) self%comm%xgmax = xmax_glob
542 if(
present(ymin_glob)) self%comm%ygmin = ymin_glob
543 if(
present(ymax_glob)) self%comm%ygmax = ymax_glob
547 if(
present(xmin_glob) .and.
present(xmax_glob)) self%comm%xperiodic = .true.
548 if(
present(ymin_glob) .and.
present(ymax_glob)) self%comm%yperiodic = .true.
580 _type_domain2d :: domain
581 character(len=*),
intent(out) :: ermesg
591 #define drifters_push_XXX drifters_push_2 592 #include "drifters_push.h" 594 #undef drifters_push_XXX 598 #define drifters_push_XXX drifters_push_3 599 #include "drifters_push.h" 601 #undef drifters_push_XXX 605 type(drifters_type) :: self
606 real,
intent(inout) :: positions(:,:)
607 character(len=*),
intent(out) :: ermesg
615 if(self%comm%xperiodic)
then 618 positions(1, ip) = self%comm%xgmin + &
619 & modulo(x - self%comm%xgmin, self%comm%xgmax-self%comm%xgmin)
623 if(self%comm%yperiodic)
then 626 positions(2, ip) = self%comm%ygmin + &
627 & modulo(y - self%comm%ygmin, self%comm%ygmax-self%comm%ygmin)
635 #define drifters_set_field_XXX drifters_set_field_2d 636 #include "drifters_set_field.h" 638 #undef drifters_set_field_XXX 642 #define drifters_set_field_XXX drifters_set_field_3d 643 #include "drifters_set_field.h" 645 #undef drifters_set_field_XXX 669 character(len=*),
intent(out) :: ermesg
674 nf =
size(self%input%field_names)
679 & self%core%ids, self%core%positions, &
680 & fields=self%fields(:,1:np), ermesg=ermesg)
707 character(len=*),
intent(out) :: ermesg
715 ermesg =
'drifters_distribute: dimension must be >=2' 719 nptot =
size(self%input%positions, 2)
721 x = self%input%positions(1,i)
722 y = self%input%positions(2,i)
723 if(x >= self%comm%xdmin .and. x <= self%comm%xdmax .and. &
724 & y >= self%comm%ydmin .and. y <= self%comm%ydmax)
then 726 self%core%np = self%core%np + 1
727 self%core%positions(1:nd, self%core%np) = self%input%positions(1:nd, i)
728 self%core%ids(self%core%np) = i
789 & root, mycomm, ermesg)
794 character(len=*),
intent(in) :: filename
798 real,
intent(in),
optional :: x1(:), y1(:), geolon1(:,:)
799 real,
intent(in),
optional :: x2(:), y2(:), geolat2(:,:)
801 integer,
intent(in),
optional :: root
802 integer,
intent(in),
optional :: mycomm
803 character(len=*),
intent(out) :: ermesg
806 logical :: do_save_lonlat
807 real,
allocatable :: lons(:), lats(:)
813 allocate(lons(np), lats(np))
818 if(
present(x1) .and.
present(y1) .and.
present(geolon1) .and. &
819 &
present(x2) .and.
present(y2) .and.
present(geolat2))
then 820 do_save_lonlat = .true.
822 do_save_lonlat = .false.
825 if(do_save_lonlat)
then 829 & positions=self%core%positions(:,1:np), &
830 & x1=x1, y1=y1, geolon1=geolon1, &
831 & x2=x2, y2=y2, geolat2=geolat2, &
832 & lons=lons, lats=lats, ermesg=ermesg)
833 if(ermesg/=
'')
return 838 & lons, lats, do_save_lonlat, &
846 #define drifters_compute_k_XXX drifters_computek2d 847 #include "drifters_compute_k.h" 849 #undef drifters_compute_k_XXX 853 #define drifters_compute_k_XXX drifters_computek3d 854 #include "drifters_compute_k.h" 856 #undef drifters_compute_k_XXX 896 character(len=*),
intent(in) :: component
897 real,
intent(in) :: x(:), y(:), z(:)
898 character(len=*),
intent(out) :: ermesg
900 integer ier, nx, ny, nz
906 select case (component(1:1))
909 deallocate(self%xu, stat=ier)
910 allocate(self%xu(nx))
912 self%nx =
max(self%nx,
size(x))
915 deallocate(self%yu, stat=ier)
916 allocate(self%yu(ny))
918 self%ny =
max(self%ny,
size(y))
921 deallocate(self%zu, stat=ier)
922 allocate(self%zu(nz))
927 deallocate(self%xv, stat=ier)
928 allocate(self%xv(nx))
930 self%nx =
max(self%nx,
size(x))
933 deallocate(self%yv, stat=ier)
934 allocate(self%yv(ny))
936 self%ny =
max(self%ny,
size(y))
939 deallocate(self%zv, stat=ier)
940 allocate(self%zv(nz))
945 deallocate(self%xw, stat=ier)
946 allocate(self%xw(nx))
948 self%nx =
max(self%nx,
size(x))
951 deallocate(self%yw, stat=ier)
952 allocate(self%yw(ny))
954 self%ny =
max(self%ny,
size(y))
957 deallocate(self%zw, stat=ier)
958 allocate(self%zw(nz))
962 ermesg =
'drifters_set_v_axes: ERROR component must be "u", "v" or "w"' 997 _type_domain2d :: domain
998 integer,
intent(in) :: backoff_x
999 integer,
intent(in) :: backoff_y
1000 character(len=*),
intent(out) :: ermesg
1004 if(.not._allocated(self%xu) .or. .not._allocated(self%yu))
then 1005 ermesg =
'drifters_set_domain_bounds: ERROR "u"-component axes not set' 1009 if(.not._allocated(self%xv) .or. .not._allocated(self%yv))
then 1010 ermesg =
'drifters_set_domain_bounds: ERROR "v"-component axes not set' 1013 if(_allocated(self%xw) .and. _allocated(self%yw))
then 1073 & x1, y1, geolon1, &
1074 & x2, y2, geolat2, &
1080 real,
intent(in) :: positions(:,:)
1082 real,
intent(in) :: x1(:), y1(:), geolon1(:,:)
1083 real,
intent(in) :: x2(:), y2(:), geolat2(:,:)
1085 real,
intent(out) :: lons(:), lats(:)
1086 character(len=*),
intent(out) :: ermesg
1088 real fvals(2**self%core%nd), ts(self%core%nd)
1089 integer np, ij(2), ip, ier, n1s(2), n2s(2), i, j, iertot
1090 character(len=10) :: n1_str, n2_str, np_str, iertot_str
1097 n1s = (/
size(x1),
size(y1)/)
1098 n2s = (/
size(x2),
size(y2)/)
1099 if(n1s(1) /=
size(geolon1, 1) .or. n1s(2) /=
size(geolon1, 2))
then 1100 ermesg =
'drifters_positions2geolonlat: ERROR incompatibles dims between (x1, y1, geolon1)' 1103 if(n2s(1) /=
size(geolat2, 1) .or. n2s(2) /=
size(geolat2, 2))
then 1104 ermesg =
'drifters_positions2geolonlat: ERROR incompatibles dims between (x2, y2, geolat2)' 1108 np =
size(positions, 2)
1109 if(
size(lons) < np .or.
size(lats) < np)
then 1110 write(np_str,
'(i10)') np
1111 write(n1_str,
'(i10)')
size(lons)
1112 write(n2_str,
'(i10)')
size(lats)
1113 ermesg =
'drifters_positions2geolonlat: ERROR size of "lons" ('//trim(n1_str)// &
1114 &
') or "lats" ('//trim(n2_str)//
') < '//trim(np_str)
1123 call cld_ntrp_locate_cell(x1, positions(1,ip), i, ier)
1124 iertot = iertot + ier
1125 call cld_ntrp_locate_cell(y1, positions(2,ip), j, ier)
1126 iertot = iertot + ier
1127 ij(1) = i; ij(2) = j;
1128 call cld_ntrp_get_cell_values(n1s, _flatten(geolon1), ij, fvals, ier)
1129 iertot = iertot + ier
1130 ts(1) = (positions(1,ip) - x1(i))/(x1(i+1) - x1(i))
1131 ts(2) = (positions(2,ip) - y1(j))/(y1(j+1) - y1(j))
1132 call cld_ntrp_linear_cell_interp(fvals, ts, lons(ip), ier)
1133 iertot = iertot + ier
1136 call cld_ntrp_locate_cell(x2, positions(1,ip), i, ier)
1137 iertot = iertot + ier
1138 call cld_ntrp_locate_cell(y2, positions(2,ip), j, ier)
1139 iertot = iertot + ier
1140 ij(1) = i; ij(2) = j;
1141 call cld_ntrp_get_cell_values(n2s, _flatten(geolat2), ij, fvals, ier)
1142 iertot = iertot + ier
1143 ts(1) = (positions(1,ip) - x2(i))/(x2(i+1) - x2(i))
1144 ts(2) = (positions(2,ip) - y2(j))/(y2(j+1) - y2(j))
1145 call cld_ntrp_linear_cell_interp(fvals, ts, lats(ip), ier)
1146 iertot = iertot + ier
1150 if(iertot /= 0)
then 1151 write(iertot_str,
'(i10)') iertot
1152 ermesg =
'drifters_positions2geolonlat: ERROR '//trim(iertot_str)// &
1153 &
' interpolation errors (domain out of bounds?)' 1184 integer,
intent(in),
optional :: pe
1185 character(len=*),
intent(out) :: ermesg
1187 integer,
parameter :: i8 = selected_int_kind(13)
1188 integer(i8) :: mold, chksum_pos, chksum_k1, chksum_k2, chksum_k3, chksum_k4
1189 integer(i8) :: chksum_tot
1194 if(.not.
present(pe))
then 1200 if(me == _mpp_pe)
then 1204 chksum_pos = transfer(sum(sum(self%core%positions(1:nd,1:np),1)), mold)
1205 chksum_k1 = transfer(sum(sum(self%rk4_k1(1:nd,1:np),1)), mold)
1206 chksum_k2 = transfer(sum(sum(self%rk4_k2(1:nd,1:np),1)), mold)
1207 chksum_k3 = transfer(sum(sum(self%rk4_k3(1:nd,1:np),1)), mold)
1208 chksum_k4 = transfer(sum(sum(self%rk4_k4(1:nd,1:np),1)), mold)
1209 chksum_tot = chksum_pos + chksum_k1 + chksum_k2 + chksum_k3 +chksum_k4
1211 print *,
'==============drifters checksums==========================' 1212 print
'(a,i25,a,i6,a,e15.7)',
'==positions: ', chksum_pos,
' PE=', me,
' time = ', self%time
1213 print
'(a,i25,a,i6,a,e15.7)',
'==k1 : ', chksum_k1,
' PE=', me,
' time = ', self%time
1214 print
'(a,i25,a,i6,a,e15.7)',
'==k2 : ', chksum_k2,
' PE=', me,
' time = ', self%time
1215 print
'(a,i25,a,i6,a,e15.7)',
'==k3 : ', chksum_k3,
' PE=', me,
' time = ', self%time
1216 print
'(a,i25,a,i6,a,e15.7)',
'==k4 : ', chksum_k4,
' PE=', me,
' time = ', self%time
1217 print
'(a,i25,a,i6,a,e15.7)',
'==total : ', chksum_tot,
' PE=', me,
' time = ', self%time
1224 type(drifters_type) :: self
1225 character(len=*),
intent(out) :: ermesg
1231 if(
size(self%rk4_k1, 2) < self%core%np)
then 1232 deallocate(self%rk4_k1, stat=ier)
1233 allocate(self%rk4_k1(self%core%nd, self%core%npdim))
1236 if(
size(self%rk4_k2, 2) < self%core%np)
then 1237 deallocate(self%rk4_k2, stat=ier)
1238 allocate(self%rk4_k2(self%core%nd, self%core%npdim))
1241 if(
size(self%rk4_k3, 2) < self%core%np)
then 1242 deallocate(self%rk4_k3, stat=ier)
1243 allocate(self%rk4_k3(self%core%nd, self%core%npdim))
1246 if(
size(self%rk4_k4, 2) < self%core%np)
then 1247 deallocate(self%rk4_k4, stat=ier)
1248 allocate(self%rk4_k4(self%core%nd, self%core%npdim))
1252 if(
size(self%remove) < self%core%np)
then 1253 deallocate(self%remove, stat=ier)
1254 allocate(self%remove(self%core%npdim))
1255 self%remove = .false.
1258 if(
size(self%temp_pos, 2) < self%core%np)
then 1259 deallocate(self%temp_pos, stat=ier)
1260 nd =
size(self%input%velocity_names)
1261 allocate(self%temp_pos(nd, self%core%npdim))
1262 self%temp_pos = -huge(1.)
1357 #ifdef _TEST_DRIFTERS 1367 character(len=*),
intent(in) :: mesg
1390 character(len=128) :: ermesg
1392 real :: t0, dt, t, tend, rho
1393 real :: xmin, xmax, ymin, ymax, zmin, zmax, theta
1394 real,
parameter :: pi = 3.1415926535897931159980
1395 real,
allocatable :: x(:), y(:)
1397 real,
allocatable :: u(:,:), v(:,:), w(:,:), temp(:,:)
1400 real,
allocatable :: z(:), u(:,:,:), v(:,:,:), w(:,:,:), temp(:,:,:)
1402 integer :: layout(2), nx, ny, nz, halox, haloy, i, j, k,
npes, pe, root
1403 integer :: isd, ied, jsd, jed, isc, iec, jsc, jec
1404 integer :: pe_beg, pe_end
1407 _type_domain2d :: domain
1424 xmin = -1. ; xmax = 1.
1425 ymin = -1. ; ymax = 1.
1426 zmin = -1. ; zmax = 1.
1427 nx = 41; ny = 41; nz = 21;
1428 halox = 2; haloy = 2;
1430 allocate( x(1-halox:nx+halox), y(1-haloy:ny+haloy))
1431 x = xmin + (xmax-xmin)*(/ (
real(i-1)/
real(nx-1), i = 1-halox, nx+halox) /)
1432 y = ymin + (ymax-ymin)*(/ (
real(j-1)/
real(ny-1), j = 1-haloy, ny+haloy) /)
1435 allocate( u(1-halox:nx+halox, 1-haloy:ny+haloy), &
1436 & v(1-halox:nx+halox, 1-haloy:ny+haloy), &
1437 & w(1-halox:nx+halox, 1-haloy:ny+haloy), &
1438 & temp(1-halox:nx+halox, 1-haloy:ny+haloy))
1442 z = zmin + (zmax-zmin)*(/ (
real(k-1)/
real(nz-1), k = 1, nz) /)
1443 allocate( u(1-halox:nx+halox, 1-haloy:ny+haloy, nz), &
1444 & v(1-halox:nx+halox, 1-haloy:ny+haloy, nz), &
1445 & w(1-halox:nx+halox, 1-haloy:ny+haloy, nz), &
1446 & temp(1-halox:nx+halox, 1-haloy:ny+haloy, nz))
1452 call mpp_domains_init
1455 call mpp_declare_pelist( (/ (i, i=pe_beg, pe_end) /),
'_drifters')
1459 if(pe >= pe_beg .and. pe <= pe_end)
then 1462 call mpp_set_current_pelist( (/ (i, i=pe_beg, pe_end) /) )
1465 if(pe==root) print *,
'LAYOUT: ', layout
1467 & xhalo=halox, yhalo=haloy)
1474 & input_file =
'drifters_inp_test_2d.nc' , &
1475 & output_file=
'drifters_out_test_2d.nc', &
1480 & input_file =
'drifters_inp_test_3d.nc' , &
1481 & output_file=
'drifters_out_test_3d.nc', &
1487 drfts%comm%pe_beg = pe_beg
1488 drfts%comm%pe_end = pe_end
1498 ibnds = lbound(x); isd = ibnds(1)
1499 ibnds = ubound(x); ied = ibnds(1)
1500 ibnds = lbound(y); jsd = ibnds(1)
1501 ibnds = ubound(y); jed = ibnds(1)
1502 isc = isd; iec = ied - 1
1503 jsc = jsd; jec = jed - 1
1518 & xmin_comp=x(isc ), xmax_comp=x(iec+1), &
1519 & ymin_comp=y(jsc ), ymax_comp=y(jec+1), &
1520 & xmin_data=x(isd ), xmax_data=x(ied ), &
1521 & ymin_data=y(jsd ), ymax_data=y(jed ), &
1575 do while (t <= tend+epsilon(1.))
1583 do j = 1-haloy, ny+haloy
1584 do i = 1-halox, nx+halox
1585 theta = atan2(y(j), x(i))
1586 rho = sqrt(x(i)**2 + y(j)**2)
1587 u(i,j) = - rho * sin(theta)
1588 v(i,j) = + rho * cos(theta)
1589 temp(i,j) = (x(i)**2 + y(j)**2)
1598 do j = 1-haloy, ny+haloy
1599 do i = 1-halox, nx+halox
1600 theta = atan2(y(j), x(i))
1601 rho = sqrt(x(i)**2 + y(j)**2)
1602 u(i,j,k) = - rho * sin(theta)
1603 v(i,j,k) = + rho * cos(theta)
1604 w(i,j,k) = + 0.01 * cos(t)
1605 temp(i,j,k) = (x(i)**2 + y(j)**2) * (1.0 - z(k)**2)
1617 if(drfts%rk4_completed)
then 1625 & data=temp, ermesg=ermesg)
1652 deallocate(u, v, temp)
subroutine, public drifters_write_restart(self, filename, x1, y1, geolon1, x2, y2, geolat2, root, mycomm, ermesg)
subroutine, public drifters_comm_update(self, drfts, new_positions, comm, remove, max_add_remove)
subroutine, public drifters_io_del(self, ermesg)
subroutine, public drifters_save(self, ermesg)
subroutine, public drifters_core_new(self, nd, npdim, ermesg)
subroutine, public drifters_io_new(self, filename, nd, nf, ermesg)
subroutine, public drifters_new(self, input_file, output_file, ermesg)
subroutine, public drifters_set_domain(self, xmin_comp, xmax_comp, ymin_comp, ymax_comp, xmin_data, xmax_data, ymin_data, ymax_data, xmin_glob, xmax_glob, ymin_glob, ymax_glob, ermesg)
subroutine, public drifters_distribute(self, ermesg)
subroutine, public drifters_comm_new(self)
subroutine, public drifters_io_set_field_units(self, names, ermesg)
subroutine, public drifters_io_set_field_names(self, names, ermesg)
integer, parameter, private max_str_len
subroutine, public drifters_set_v_axes(self, component, x, y, z, ermesg)
subroutine, public drifters_set_pe_neighbors(self, domain, ermesg)
subroutine, public drifters_print_checksums(self, pe, ermesg)
subroutine, public drifters_comm_set_pe_neighbors(self, domain)
subroutine my_error_handler(mesg)
real, dimension(0) drft_empty_array
subroutine, public drifters_io_set_time_units(self, name, ermesg)
subroutine drifters_modulo(self, positions, ermesg)
subroutine drifters_copy_new(new_instance, old_instance)
subroutine, public drifters_comm_set_domain(self, domain, x, y, backoff_x, backoff_y)
subroutine, public drifters_del(self, ermesg)
subroutine, public drifters_io_set_position_units(self, names, ermesg)
subroutine drifters_reset_rk4(self, ermesg)
subroutine, public drifters_comm_del(self)
subroutine, public drifters_io_write(self, time, np, nd, nf, ids, positions, fields, ermesg)
subroutine, public drifters_set_domain_bounds(self, domain, backoff_x, backoff_y, ermesg)
subroutine, public drifters_positions2lonlat(self, positions, x1, y1, geolon1, x2, y2, geolat2, lons, lats, ermesg)
subroutine, public drifters_comm_gather(self, drfts, dinp, lons, lats, do_save_lonlat, filename, root, mycomm)
subroutine, public drifters_io_set_position_names(self, names, ermesg)
subroutine, public drifters_core_del(self, ermesg)