82 parameter(testout = .false.)
83 CHARACTER :: filename*80, paramfile*32
84 REAL :: dirknob, perknob, hsknob, wetpts, seedlat, &
85 seedlon, dirtimeknob, tptimeknob, tint
86 REAL :: lonout(100), latout(100)
87 INTEGER :: maxgroup, ntint, noutp
88 INTEGER :: clkdt0(8),clkdt1(8)
90 TYPE(
dat2d),
POINTER :: wsdat(:)
91 TYPE(
timsys),
POINTER :: sysa(:)
92 INTEGER,
POINTER :: maxsys(:)
101 LOGICAL :: file_exists
102 CHARACTER :: inpstr*72
103 INTEGER :: intype, tmax, tcur, maxi, maxj
104 INTEGER :: it, igrp, sysmatch, ind, ip
105 INTEGER :: i, j, leng, ulimgroup
106 REAL,
ALLOCATABLE :: dum(:,:)
108 REAL,
ALLOCATABLE :: dum2nc(:,:,:,:)
109 REAL,
ALLOCATABLE :: hsprt_nc(:,:,:)
110 REAL,
ALLOCATABLE :: tpprt_nc(:,:,:)
111 REAL,
ALLOCATABLE :: dirprt_nc(:,:,:)
112 REAL,
ALLOCATABLE :: longitude_nc(:),latitude_nc(:)
113 REAL,
ALLOCATABLE :: lonprt_nc(:),latprt_nc(:)
116 INTEGER :: outputtype
117 LOGICAL :: outputcheck1
118 DOUBLE PRECISION :: date1, date2, tstart, tend
119 REAL :: dlon, dlat, lonprt, latprt
121 REAL :: minlon, maxlon, minlat, maxlat
122 INTEGER :: mxcwt, mycwt
124 INTEGER :: rank, nproc, ierr
125 CHARACTER :: rankstr*4
129 REAL :: hsprt(10),tpprt(10),dirprt(10)
130 REAL :: bl_hsprt(10),br_hsprt(10),tr_hsprt(10),tl_hsprt(10), &
131 bl_tpprt(10),br_tpprt(10),tr_tpprt(10),tl_tpprt(10), &
132 bl_dirprt(10),br_dirprt(10),tr_dirprt(10),tl_dirprt(10)
133 REAL :: bl_dirx,br_dirx,tr_dirx,tl_dirx, &
134 bl_diry,br_diry,tr_diry,tl_diry
135 REAL :: bl_lonprt,br_lonprt,tr_lonprt,tl_lonprt, &
136 bl_latprt,br_latprt,tr_latprt,tl_latprt
137 REAL :: t, u, bl_w, br_w, tr_w, tl_w
139 parameter(
pi = 3.1416)
171 CALL mpi_comm_rank(mpi_comm_world, rank, ierr)
172 CALL mpi_comm_size(mpi_comm_world, nproc, ierr)
177 WRITE(rankstr,
'(i4.4)') rank
178 OPEN(unit=20,
file=
'sys_log'//rankstr//
'.ww3',status=
'unknown')
181 OPEN(unit=20,
file=
'sys_log.ww3',status=
'unknown')
193 900
FORMAT (/15x,
' *** WAVEWATCH III Wave system tracking *** '/ &
194 15x,
'==============================================='/)
200 IF (intype.EQ.1)
WRITE(6,*) &
201 '*** WARNING: partRes format input used!'
209 INQUIRE(
file=
'ww3_systrk.inp', exist=file_exists)
210 IF (.NOT.file_exists)
THEN
215 OPEN(unit=10,
file=
'ww3_systrk.inp',status=
'old')
217 READ(10,
'(A72)') inpstr
218 DO WHILE (inpstr(1:1).EQ.
'$')
219 READ(10,
'(A72)') inpstr
224 READ(10,
'(A72)') inpstr
225 DO WHILE (inpstr(1:1).EQ.
'$')
226 READ(10,
'(A72)') inpstr
229 READ(10,*) date1, date2, dt, ntint
230 tstart = date1 + date2/1000000
232 READ(10,
'(A72)') inpstr
233 DO WHILE (inpstr(1:1).EQ.
'$')
234 READ(10,
'(A72)') inpstr
237 READ(10,*) outputtype
240 IF (outputtype.EQ.1)
THEN
242 ELSEIF (outputtype.EQ.3)
THEN
244 outputcheck1 = .true.
246 outputcheck1 = .false.
248 IF(outputcheck1)
THEN
252 ELSEIF (outputtype.EQ.4)
THEN
254 outputcheck1 = .true.
256 outputcheck1 = .false.
258 IF(outputcheck1)
THEN
264 WRITE(6,995) outputtype
268 READ(10,
'(A72)') inpstr
269 DO WHILE (inpstr(1:1).EQ.
'$')
270 READ(10,
'(A72)') inpstr
273 READ(10,*) minlon, maxlon, mxcwt
275 READ(10,
'(A72)') inpstr
276 DO WHILE (inpstr(1:1).EQ.
'$')
277 READ(10,
'(A72)') inpstr
280 READ(10,*) minlat, maxlat, mycwt
282 READ(10,
'(A72)') inpstr
283 DO WHILE (inpstr(1:1).EQ.
'$')
284 READ(10,
'(A72)') inpstr
287 READ(10,*) dirknob, perknob, hsknob, wetpts, &
288 dirtimeknob, tptimeknob
290 READ(10,
'(A72)') inpstr
291 DO WHILE (inpstr(1:1).EQ.
'$')
292 READ(10,
'(A72)') inpstr
295 READ(10,*) seedlat, seedlon
297 READ(10,
'(A72)') inpstr
298 DO WHILE (inpstr(1:1).EQ.
'$')
299 READ(10,
'(A72)') inpstr
306 READ(10,*) lonout(noutp),latout(noutp)
307 IF ((lonout(noutp).EQ.0.).AND.(latout(noutp).EQ.0.))
EXIT
314 WRITE(20,*)
'Raw partition file = ',filename
315 WRITE(20,
'(A,F15.6)')
'Start time = ',tstart
316 WRITE(20,*)
'dt = ',dt
317 WRITE(20,*)
'No. time levels = ',ntint
318 WRITE(20,
'(A,2F7.2)')
'Domain limits: Longitude =',minlon, maxlon
319 WRITE(20,
'(A,2F7.2)')
' Latitude =',minlat, maxlat
320 WRITE(20,*)
'No. increments: Long, Lat =',mxcwt, mycwt
321 WRITE(20,*)
'dirKnob, perKnob, hsKnob, wetPts, &
322 dirTimeKnob, tpTimeKnob, seedLat, seedLon ='
323 WRITE(20,
'(8F6.2)') dirknob, perknob, hsknob, wetpts, &
324 dirtimeknob, tptimeknob, seedlat, seedlon
325 WRITE(20,*)
'No. output points =',noutp
327 WRITE(20,*) lonout(i), latout(i)
330 INQUIRE(
file=filename, exist=file_exists)
331 IF (.NOT.file_exists)
THEN
332 WRITE(20,2200) filename
333 WRITE(6,2200) filename
338 CALL date_and_time ( values=clkdt0 )
346 CALL mpi_bcast(filename,80,mpi_character,0,mpi_comm_world,ierr)
347 CALL mpi_bcast(tstart,1,mpi_double_precision,0, &
349 CALL mpi_bcast(tend,1,mpi_double_precision,0, &
351 CALL mpi_bcast(dt,1,mpi_real,0,mpi_comm_world,ierr)
352 CALL mpi_bcast(ntint,1,mpi_integer,0,mpi_comm_world,ierr)
353 CALL mpi_bcast(minlon,1,mpi_real,0,mpi_comm_world,ierr)
354 CALL mpi_bcast(maxlon,1,mpi_real,0,mpi_comm_world,ierr)
355 CALL mpi_bcast(minlat,1,mpi_real,0,mpi_comm_world,ierr)
356 CALL mpi_bcast(maxlat,1,mpi_real,0,mpi_comm_world,ierr)
357 CALL mpi_bcast(mxcwt,1,mpi_integer,0,mpi_comm_world,ierr)
358 CALL mpi_bcast(mycwt,1,mpi_integer,0,mpi_comm_world,ierr)
359 CALL mpi_bcast(dirknob,1,mpi_real,0,mpi_comm_world,ierr)
360 CALL mpi_bcast(perknob,1,mpi_real,0,mpi_comm_world,ierr)
361 CALL mpi_bcast(hsknob,1,mpi_real,0,mpi_comm_world,ierr)
362 CALL mpi_bcast(wetpts,1,mpi_real,0,mpi_comm_world,ierr)
363 CALL mpi_bcast(dirtimeknob,1,mpi_real,0,mpi_comm_world,ierr)
364 CALL mpi_bcast(tptimeknob,1,mpi_real,0,mpi_comm_world,ierr)
365 CALL mpi_bcast(seedlon,1,mpi_real,0,mpi_comm_world,ierr)
366 CALL mpi_bcast(seedlat,1,mpi_real,0,mpi_comm_world,ierr)
367 CALL mpi_bcast(noutp,1,mpi_integer,0,mpi_comm_world,ierr)
368 CALL mpi_bcast(lonout,100,mpi_real,0,mpi_comm_world,ierr)
369 CALL mpi_bcast(latout,100,mpi_real,0,mpi_comm_world,ierr)
373 CALL mpi_barrier(mpi_comm_world,ierr)
386 seedlon ,dirtimeknob, &
387 tptimeknob ,paramfile , &
395 CALL date_and_time ( values=clkdt1 )
396 clkfel =
tdiff( clkdt0,clkdt1 )
398 WRITE (6,*)
'Final system output...'
405 maxi =
SIZE(wsdat(1)%lon,1)
406 maxj =
SIZE(wsdat(1)%lon,2)
407 dlon = wsdat(1)%lon(2,2)-wsdat(1)%lon(1,1)
408 dlat = wsdat(1)%lat(2,2)-wsdat(1)%lat(1,1)
409 WRITE(20,*)
'dlon, dlat =',dlon,dlat
412 OPEN(unit=21,
file=
'sys_coord.ww3', status=
'unknown')
414 WRITE(21,
'(I6,69X,A)') maxj,
'Number of rows'
415 WRITE(21,
'(I6,69X,A)') maxi,
'Number of cols'
417 ALLOCATE( longitude_nc(maxi) )
418 ALLOCATE( latitude_nc(maxj) )
421 WRITE(21,*)
'Longitude ='
424 WRITE(21,
'(F7.2)',advance=
'NO') wsdat(1)%lon(i,j)
426 longitude_nc(i)=wsdat(1)%lon(i,1)
429 WRITE(21,
'(A)',advance=
'YES')
''
432 WRITE(21,*)
'Latitude = '
435 WRITE(21,
'(F7.2)',advance=
'NO') wsdat(1)%lat(i,j)
437 latitude_nc(j)=wsdat(1)%lat(1,j)
440 WRITE(21,
'(A)',advance=
'YES')
''
446 IF(outputtype == 1)
THEN
447 OPEN(unit=22,
file=
'sys_hs.ww3', status=
'unknown')
449 WRITE(22,
'(I6,69X,A)') maxj,
'Number of rows'
450 WRITE(22,
'(I6,69X,A)') maxi,
'Number of cols'
454 ALLOCATE( dum(maxi,maxj) )
456 IF(outputtype == 3 .OR. outputtype == 4)
THEN
457 ALLOCATE( dum2nc(maxi,maxj,maxgroup,ntime_nc) )
463 IF(outputtype == 1)
THEN
464 WRITE(22,
'(F15.6,60x,A)') wsdat(it)%date,
'Time'
465 WRITE(22,
'(I6,69x,A)') min(ulimgroup,maxgroup), &
466 'Tot number of systems'
468 DO igrp = 1,min(ulimgroup,maxgroup)
469 dum(1:maxi,1:maxj) = 9999.00
472 DO WHILE (sysmatch.LE.maxsys(it))
473 IF (sysa(it)%sys(sysmatch)%grp.EQ.igrp)
EXIT
474 sysmatch = sysmatch+1
476 IF (sysmatch.LE.maxsys(it))
THEN
478 leng = sysa(it)%sys(sysmatch)%nPoints
480 dum(sysa(it)%sys(sysmatch)%i(ind), &
481 sysa(it)%sys(sysmatch)%j(ind)) = &
482 sysa(it)%sys(sysmatch)%hs(ind)
488 IF(outputtype == 1)
THEN
489 WRITE(22,
'(I6,69x,A)') igrp,
'System number'
490 WRITE(22,
'(I6,69x,A)') leng,
'Number of points in system'
494 WRITE(22,
'(F8.2)',advance=
'NO') dum(i,j)
496 WRITE(22,
'(A)',advance=
'YES')
''
502 dum2nc(i,j,igrp,it)=dum(i,j)
512 IF(outputtype == 3 .OR. outputtype == 4 )
THEN
513 call t2netcdf(longitude_nc,latitude_nc,dum2nc,maxi,maxj,&
514 maxgroup,date1,date2,dt,ntime_nc,1,outputtype)
518 IF(outputtype.EQ.1)
CLOSE(22)
521 IF(outputtype == 1)
THEN
522 OPEN(unit=23,
file=
'sys_tp.ww3',status=
'unknown')
524 WRITE(23,
'(I6,69X,A)') maxj,
'Number of rows'
525 WRITE(23,
'(I6,69X,A)') maxi,
'Number of cols'
530 IF(outputtype == 1)
THEN
531 WRITE(23,
'(F15.6,60x,A)') wsdat(it)%date,
'Time'
532 WRITE(23,
'(I6,69X,A)') min(ulimgroup,maxgroup), &
533 'Tot number of systems'
535 DO igrp = 1,min(ulimgroup,maxgroup)
536 dum(1:maxi,1:maxj) = 9999.00
539 DO WHILE (sysmatch.LE.maxsys(it))
540 IF (sysa(it)%sys(sysmatch)%grp.EQ.igrp)
EXIT
541 sysmatch = sysmatch+1
543 IF (sysmatch.LE.maxsys(it))
THEN
545 leng = sysa(it)%sys(sysmatch)%nPoints
547 dum(sysa(it)%sys(sysmatch)%i(ind), &
548 sysa(it)%sys(sysmatch)%j(ind)) = &
549 sysa(it)%sys(sysmatch)%tp(ind)
555 IF(outputtype == 1)
THEN
556 WRITE(23,
'(I6,69X,A)') igrp,
'System number'
557 WRITE(23,
'(I6,69X,A)') leng,
'Number of points in system'
560 WRITE(23,
'(F8.2)',advance=
'NO') dum(i,j)
562 WRITE(23,
'(A)',advance=
'YES')
''
569 dum2nc(i,j,igrp,it)=dum(i,j)
579 IF(outputtype.EQ.3 .OR. outputtype.EQ. 4 )
THEN
580 call t2netcdf(longitude_nc,latitude_nc,dum2nc,maxi,maxj,&
581 maxgroup,date1,date2,dt,ntime_nc,2,outputtype)
585 IF(outputtype.EQ.1)
CLOSE(23)
588 IF(outputtype == 1)
THEN
589 OPEN(unit=24,
file=
'sys_dir.ww3',status=
'unknown')
591 WRITE(24,
'(I6,69X,A)') maxj,
'Number of rows'
592 WRITE(24,
'(I6,69X,A)') maxi,
'Number of cols'
598 IF(outputtype == 1)
THEN
599 WRITE(24,
'(F15.6,60x,A)') wsdat(it)%date,
'Time'
600 WRITE(24,
'(I6,69X,A)') min(ulimgroup,maxgroup), &
601 'Tot number of systems'
603 DO igrp = 1,min(ulimgroup,maxgroup)
604 dum(1:maxi,1:maxj) = 9999.00
607 DO WHILE (sysmatch.LE.maxsys(it))
608 IF (sysa(it)%sys(sysmatch)%grp.EQ.igrp)
EXIT
609 sysmatch = sysmatch+1
611 IF (sysmatch.LE.maxsys(it))
THEN
613 leng = sysa(it)%sys(sysmatch)%nPoints
615 dum(sysa(it)%sys(sysmatch)%i(ind), &
616 sysa(it)%sys(sysmatch)%j(ind)) = &
617 sysa(it)%sys(sysmatch)%dir(ind)
623 IF(outputtype == 1)
THEN
624 WRITE(24,
'(I6,69X,A)') igrp,
'System number'
625 WRITE(24,
'(I6,69X,A)') leng,
'Number of points in system'
628 WRITE(24,
'(F8.2)',advance=
'NO') dum(i,j)
630 WRITE(24,
'(A)',advance=
'YES')
''
636 dum2nc(i,j,igrp,it)=dum(i,j)
646 IF(outputtype.EQ.3 .OR. outputtype.EQ.4 )
THEN
647 call t2netcdf(longitude_nc,latitude_nc,dum2nc,maxi,maxj,&
648 maxgroup,date1,date2,dt,ntime_nc,3,outputtype)
651 IF(outputtype.EQ.1)
CLOSE(24)
654 IF(outputtype == 1)
THEN
655 OPEN(unit=25,
file=
'sys_dspr.ww3',status=
'unknown')
657 WRITE(25,
'(I6,69X,A)') maxj,
'Number of rows'
658 WRITE(25,
'(I6,69X,A)') maxi,
'Number of cols'
663 IF(outputtype == 1)
THEN
664 WRITE(25,
'(F15.6,60x,A)') wsdat(it)%date,
'Time'
665 WRITE(25,
'(I6,69X,A)') min(ulimgroup,maxgroup), &
666 'Tot number of systems'
668 DO igrp = 1,min(ulimgroup,maxgroup)
669 dum(1:maxi,1:maxj) = 9999.00
672 DO WHILE (sysmatch.LE.maxsys(it))
673 IF (sysa(it)%sys(sysmatch)%grp.EQ.igrp)
EXIT
674 sysmatch = sysmatch+1
676 IF (sysmatch.LE.maxsys(it))
THEN
678 leng = sysa(it)%sys(sysmatch)%nPoints
680 dum(sysa(it)%sys(sysmatch)%i(ind), &
681 sysa(it)%sys(sysmatch)%j(ind)) = &
682 sysa(it)%sys(sysmatch)%dspr(ind)
688 IF(outputtype == 1)
THEN
689 WRITE(25,
'(I6,69X,A)') igrp,
'System number'
690 WRITE(25,
'(I6,69X,A)') leng,
'Number of points in system'
693 WRITE(25,
'(F8.2)',advance=
'NO') dum(i,j)
695 WRITE(25,
'(A)',advance=
'YES')
''
701 dum2nc(i,j,igrp,it)=dum(i,j)
711 IF(outputtype.EQ.3 .OR. outputtype.EQ.4 )
THEN
712 call t2netcdf(longitude_nc,latitude_nc,dum2nc,maxi,maxj,&
713 maxgroup,date1,date2,dt,ntime_nc,4,outputtype)
716 IF(outputtype.EQ.1)
CLOSE(25)
718 IF (
ALLOCATED(dum))
DEALLOCATE(dum)
720 IF (
ALLOCATED(dum2nc))
DEALLOCATE(dum2nc)
724 IF(outputtype.EQ.3.OR.outputtype.EQ.4)
THEN
725 ALLOCATE( hsprt_nc(10,noutp,ntime_nc) )
726 ALLOCATE( tpprt_nc(10,noutp,ntime_nc) )
727 ALLOCATE( dirprt_nc(10,noutp,ntime_nc) )
728 ALLOCATE( lonprt_nc(noutp) )
729 ALLOCATE( latprt_nc(noutp) )
734 IF(outputtype == 1)
THEN
735 OPEN(unit=26,
file=
'sys_pnt.ww3',status=
'unknown')
738 WRITE(26,
'(A)')
'% WW3 Wave tracking point output'
740 WRITE(26,
'(10A)')
'% Xp Yp ', &
741 'HsSY01 HsSY02 HsSY03 HsSY04 ', &
742 'HsSY05 HsSY06 HsSY07 HsSY08 ', &
744 'TpSY01 TpSY02 TpSY03 TpSY04 ', &
745 'TpSY05 TpSY06 TpSY07 TpSY08 ', &
747 'DrSY01 DrSY02 DrSY03 DrSY04 ', &
748 'DrSY05 DrSY06 DrSY07 DrSY08 ', &
750 WRITE(26,
'(10A)')
'% [degr] [degr] ', &
751 '[m] [m] [m] [m] ', &
752 '[m] [m] [m] [m] ', &
754 '[sec] [sec] [sec] [sec] ', &
755 '[sec] [sec] [sec] [sec] ', &
757 '[degr] [degr] [degr] [degr] ', &
758 '[degr] [degr] [degr] [degr] ', &
764 IF(outputtype == 1)
THEN
765 WRITE(26,
'(A,F15.6)')
'Time : ',wsdat(it)%date
769 hsprt(1:10) = 999.9999
770 tpprt(1:10) = 999.9999
771 dirprt(1:10) = 999.9999
774 bl_hsprt(1:10) = 999.9999
775 bl_tpprt(1:10) = 999.9999
776 bl_dirprt(1:10) = 999.9999
777 br_hsprt(1:10) = 999.9999
778 br_tpprt(1:10) = 999.9999
779 br_dirprt(1:10) = 999.9999
780 tl_hsprt(1:10) = 999.9999
781 tl_tpprt(1:10) = 999.9999
782 tl_dirprt(1:10) = 999.9999
783 tr_hsprt(1:10) = 999.9999
784 tr_tpprt(1:10) = 999.9999
785 tr_dirprt(1:10) = 999.9999
801 IF ( ( ((lonout(ip).GE. &
802 wsdat(1)%lon(i,j)).AND. &
804 wsdat(1)%lon(i+1,j))).OR. &
806 wsdat(1)%lon(i,j)).AND. &
808 wsdat(1)%lon(i+1,j))) ).AND. &
810 wsdat(1)%lat(i,j)).AND. &
812 wsdat(1)%lat(i,j+1))).OR. &
814 wsdat(1)%lat(i,j)).AND. &
816 wsdat(1)%lat(i,j+1))) ) ) &
818 bl_lonprt = wsdat(1)%lon(i,j)
819 bl_latprt = wsdat(1)%lat(i,j)
820 br_lonprt = wsdat(1)%lon(i+1,j)
821 br_latprt = wsdat(1)%lat(i+1,j)
822 tl_lonprt = wsdat(1)%lon(i,j+1)
823 tl_latprt = wsdat(1)%lat(i,j+1)
824 tr_lonprt = wsdat(1)%lon(i+1,j+1)
825 tr_latprt = wsdat(1)%lat(i+1,j+1)
827 t = (lonout(ip)-bl_lonprt)/(br_lonprt-bl_lonprt)
828 u = (latout(ip)-bl_latprt)/(tl_latprt-bl_latprt)
834 lonprt = bl_w*bl_lonprt + br_w*br_lonprt + &
835 tl_w*tl_lonprt + tr_w*tr_lonprt
836 latprt = bl_w*bl_latprt + br_w*br_latprt + &
837 tl_w*tl_latprt + tr_w*tr_latprt
842 DO igrp = 1,min(10,maxgroup)
845 DO WHILE (sysmatch.LE.maxsys(it))
846 IF (sysa(it)%sys(sysmatch)%grp.EQ.igrp)
EXIT
847 sysmatch = sysmatch+1
849 IF (sysmatch.LE.maxsys(it))
THEN
851 leng = sysa(it)%sys(sysmatch)%nPoints
854 IF ( (sysa(it)%sys(sysmatch)%lon(ind).EQ.&
856 (sysa(it)%sys(sysmatch)%lat(ind).EQ.&
858 bl_hsprt(igrp) = sysa(it)%sys(sysmatch)%hs(ind)
859 bl_tpprt(igrp) = sysa(it)%sys(sysmatch)%tp(ind)
860 bl_dirprt(igrp) = sysa(it)%sys(sysmatch)%dir(ind)
861 ELSE IF ( (sysa(it)%sys(sysmatch)%lon(ind).EQ.&
863 (sysa(it)%sys(sysmatch)%lat(ind).EQ.&
865 br_hsprt(igrp) = sysa(it)%sys(sysmatch)%hs(ind)
866 br_tpprt(igrp) = sysa(it)%sys(sysmatch)%tp(ind)
867 br_dirprt(igrp) = sysa(it)%sys(sysmatch)%dir(ind)
868 ELSE IF ( (sysa(it)%sys(sysmatch)%lon(ind).EQ.&
870 (sysa(it)%sys(sysmatch)%lat(ind).EQ.&
872 tl_hsprt(igrp) = sysa(it)%sys(sysmatch)%hs(ind)
873 tl_tpprt(igrp) = sysa(it)%sys(sysmatch)%tp(ind)
874 tl_dirprt(igrp) = sysa(it)%sys(sysmatch)%dir(ind)
875 ELSE IF ( (sysa(it)%sys(sysmatch)%lon(ind).EQ.&
877 (sysa(it)%sys(sysmatch)%lat(ind).EQ.&
879 tr_hsprt(igrp) = sysa(it)%sys(sysmatch)%hs(ind)
880 tr_tpprt(igrp) = sysa(it)%sys(sysmatch)%tp(ind)
881 tr_dirprt(igrp) = sysa(it)%sys(sysmatch)%dir(ind)
886 IF ( (bl_hsprt(igrp).NE.999.9999).AND. &
887 (br_hsprt(igrp).NE.999.9999).AND. &
888 (tl_hsprt(igrp).NE.999.9999).AND. &
889 (tr_hsprt(igrp).NE.999.9999) )
THEN
890 hsprt(igrp) = bl_w * bl_hsprt(igrp) + &
891 br_w * br_hsprt(igrp) + &
892 tl_w * tl_hsprt(igrp) + &
893 tr_w * tr_hsprt(igrp)
894 tpprt(igrp) = bl_w * bl_tpprt(igrp) + &
895 br_w * br_tpprt(igrp) + &
896 tl_w * tl_tpprt(igrp) + &
897 tr_w * tr_tpprt(igrp)
898 bl_dirx = cos((270-bl_dirprt(igrp))*
pi/180.)
899 br_dirx = cos((270-br_dirprt(igrp))*
pi/180.)
900 tr_dirx = cos((270-tr_dirprt(igrp))*
pi/180.)
901 tl_dirx = cos((270-tl_dirprt(igrp))*
pi/180.)
902 bl_diry = sin((270-bl_dirprt(igrp))*
pi/180.)
903 br_diry = sin((270-br_dirprt(igrp))*
pi/180.)
904 tr_diry = sin((270-tr_dirprt(igrp))*
pi/180.)
905 tl_diry = sin((270-tl_dirprt(igrp))*
pi/180.)
906 dirprt(igrp)=270 - 180./
pi* &
907 atan2(bl_w*bl_diry+br_w*br_diry+ &
908 tl_w*tl_diry+tr_w*tr_diry, &
909 bl_w*bl_dirx+br_w*br_dirx+ &
910 tl_w*tl_dirx+tr_w*tr_dirx)
911 IF (dirprt(igrp).GT.360.)
THEN
912 dirprt(igrp) = dirprt(igrp) - 360.
915 hsprt(igrp) = 999.9999
916 tpprt(igrp) = 999.9999
917 dirprt(igrp) = 999.9999
921 IF(outputtype == 1)
THEN
922 WRITE(26,
'(32F14.4)') lonprt,latprt, &
923 hsprt(1:10),tpprt(1:10),dirprt(1:10)
926 IF(outputtype.EQ.3.OR.outputtype.EQ.4)
THEN
930 hsprt_nc(igrp,ip,it)=hsprt(igrp)
931 tpprt_nc(igrp,ip,it)=tpprt(igrp)
932 dirprt_nc(igrp,ip,it)=dirprt(igrp)
940 IF(outputtype.EQ.3.OR.outputtype.EQ.4)
THEN
941 call pt2netcdf(lonprt_nc,latprt_nc,hsprt_nc,tpprt_nc, &
942 dirprt_nc,noutp,date1,date2,dt,ntime_nc,outputtype)
946 IF(outputtype.EQ.1)
CLOSE(26)
950 OPEN(unit=28,
file=
'sys_pnt_nn.ww3',status=
'unknown')
953 WRITE(28,
'(A)')
'% WW3 Wave tracking point output'
955 WRITE(28,
'(10A)')
'% Xp Yp ', &
956 'HsSY01 HsSY02 HsSY03 HsSY04 ', &
957 'HsSY05 HsSY06 HsSY07 HsSY08 ', &
959 'TpSY01 TpSY02 TpSY03 TpSY04 ', &
960 'TpSY05 TpSY06 TpSY07 TpSY08 ', &
962 'DrSY01 DrSY02 DrSY03 DrSY04 ', &
963 'DrSY05 DrSY06 DrSY07 DrSY08 ', &
965 WRITE(28,
'(10A)')
'% [degr] [degr] ', &
966 '[m] [m] [m] [m] ', &
967 '[m] [m] [m] [m] ', &
969 '[sec] [sec] [sec] [sec] ', &
970 '[sec] [sec] [sec] [sec] ', &
972 '[degr] [degr] [degr] [degr] ', &
973 '[degr] [degr] [degr] [degr] ', &
978 WRITE(28,
'(A,F15.6)')
'Time : ',wsdat(it)%date
981 hsprt(1:10) = 999.9999
982 tpprt(1:10) = 999.9999
983 dirprt(1:10) = 999.9999
990 IF ( (lonout(ip).GE. &
991 (wsdat(1)%lon(i,j)-dlon/2)).AND. &
993 (wsdat(1)%lon(i,j)+dlon/2)).AND. &
995 (wsdat(1)%lat(i,j)-dlat/2)).AND. &
997 (wsdat(1)%lat(i,j)+dlat/2)) ) &
999 lonprt = wsdat(1)%lon(i,j)
1000 latprt = wsdat(1)%lat(i,j)
1005 DO igrp = 1,min(10,maxgroup)
1008 DO WHILE (sysmatch.LE.maxsys(it))
1009 IF (sysa(it)%sys(sysmatch)%grp.EQ.igrp)
EXIT
1010 sysmatch = sysmatch+1
1012 IF (sysmatch.LE.maxsys(it))
THEN
1014 leng = sysa(it)%sys(sysmatch)%nPoints
1017 IF ( (lonout(ip).GE. &
1018 (sysa(it)%sys(sysmatch)%lon(ind)-dlon/2)).AND. &
1020 (sysa(it)%sys(sysmatch)%lon(ind)+dlon/2)).AND. &
1022 (sysa(it)%sys(sysmatch)%lat(ind)-dlat/2)).AND. &
1024 (sysa(it)%sys(sysmatch)%lat(ind)+dlat/2)) ) &
1026 hsprt(igrp) = sysa(it)%sys(sysmatch)%hs(ind)
1027 tpprt(igrp) = sysa(it)%sys(sysmatch)%tp(ind)
1028 dirprt(igrp) = sysa(it)%sys(sysmatch)%dir(ind)
1033 WRITE(28,
'(32F14.4)') lonprt,latprt, &
1034 hsprt(1:10),tpprt(1:10),dirprt(1:10)
1043 WRITE(20,*)
'In ww3_systrk: Deallocating wsdat ...'
1045 IF (
ASSOCIATED(wsdat(it)%lat))
DEALLOCATE(wsdat(it)%lat)
1046 IF (
ASSOCIATED(wsdat(it)%lon))
DEALLOCATE(wsdat(it)%lon)
1047 IF (
ASSOCIATED(wsdat(it)%par))
DEALLOCATE(wsdat(it)%par)
1048 IF (
ASSOCIATED(wsdat(it)%wnd))
DEALLOCATE(wsdat(it)%wnd)
1050 IF (
ASSOCIATED(wsdat))
DEALLOCATE(wsdat)
1051 WRITE(20,*)
' Deallocating sysA ...'
1053 DO j=1,
size(sysa(i)%sys)
1054 IF (
ASSOCIATED(sysa(i)%sys(j)%i))
DEALLOCATE(sysa(i)%sys(j)%i)
1055 IF (
ASSOCIATED(sysa(i)%sys(j)%j))
DEALLOCATE(sysa(i)%sys(j)%j)
1056 IF (
ASSOCIATED(sysa(i)%sys(j)%lon)) &
1057 DEALLOCATE(sysa(i)%sys(j)%lon)
1058 IF (
ASSOCIATED(sysa(i)%sys(j)%lat)) &
1059 DEALLOCATE(sysa(i)%sys(j)%lat)
1060 IF (
ASSOCIATED(sysa(i)%sys(j)%hs)) &
1061 DEALLOCATE(sysa(i)%sys(j)%hs)
1062 IF (
ASSOCIATED(sysa(i)%sys(j)%tp)) &
1063 DEALLOCATE(sysa(i)%sys(j)%tp)
1064 IF (
ASSOCIATED(sysa(i)%sys(j)%dir)) &
1065 DEALLOCATE(sysa(i)%sys(j)%dir)
1066 IF (
ASSOCIATED(sysa(i)%sys(j)%dspr)) &
1067 DEALLOCATE(sysa(i)%sys(j)%dspr)
1070 IF (
ASSOCIATED(sysa))
DEALLOCATE(sysa)
1071 WRITE(20,*)
' Deallocating maxSys ...'
1072 IF (
ASSOCIATED(maxsys))
DEALLOCATE(maxsys)
1075 WRITE(6,*)
'... ww3_systrk completed successfully.'
1084 CALL mpi_finalize(ierr)
1088 998
FORMAT (
' ... finished. Elapsed time : ',f10.2,
' s')
1089 993
FORMAT (/
' *** WAVEWATCH III ERROR IN WW3_SYSTRK : '/ &
1090 ' OutputType=3 needs TRKNC switch ')
1091 994
FORMAT (/
' *** WAVEWATCH III ERROR IN WW3_SYSTRK : '/ &
1092 ' OutputType=4 needs TRKNC switch ')
1093 995
FORMAT (/
' *** WAVEWATCH III ERROR IN WW3_SYSTRK : '/ &
1094 ' OutputType,',i3,
'not valid. Options: 1,3,4')
1096 999
FORMAT (/15x,
'End of program '/ &
1097 15x,
'==============================================='/ &
1098 15x,
' *** WAVEWATCH III Wave system tracking *** ')
1100 2000
FORMAT (/
' *** WAVEWATCH III ERROR IN W3SYSTRK : '/ &
1101 ' ERROR IN OPENING INPUT FILE')
1102 2200
FORMAT (/
' *** WAVEWATCH III ERROR IN W3SYSTRK : '/ &
1103 ' ERROR IN OPENING PARTITION FILE : ',a)
1127 subroutine t2netcdf(lons,lats,data_in,nlons,nlats,nsys,date1,date2,&
1128 dt,ntime,ivar, outputType)
1132 character (len = 15) :: file_name
1133 integer,
parameter :: ndims = 4
1134 integer,
parameter :: deflate = 1
1135 integer :: outputType, ncid, oldMode
1136 integer :: nlons,nlats,nsys,rec,ntime,ivar
1137 double precision :: date1,date2,timenc
1138 real :: data_in(nlons, nlats, nsys,ntime)
1139 real :: lats(nlats), lons(nlons),dt
1140 double precision :: times(ntime)
1141 integer :: iyc,imc,idc,ihc,iminc,isc,Jday,Jday0
1146 integer :: lon_varid, lat_varid, rec_varid
1147 character (len = *),
parameter :: lsys_name =
"system_index"
1148 character (len = *),
parameter :: lat_name =
"latitude"
1149 character (len = *),
parameter :: lon_name =
"longitude"
1150 character (len = *),
parameter :: time_name =
"time"
1151 integer :: sys_dimid, lon_dimid, lat_dimid, rec_dimid
1152 integer :: start(ndims), count(ndims)
1156 character (len = *),
parameter :: var1_name=
"hs"
1157 character (len = *),
parameter :: var2_name=
"tp"
1158 character (len = *),
parameter :: var3_name=
"dir"
1159 character (len = *),
parameter :: var4_name=
"dspr"
1160 integer :: var1_varid, var2_varid, var3_varid,var4_varid
1161 integer :: dimids(ndims)
1165 character (len = *),
parameter :: units =
"units"
1166 character (len = *),
parameter :: var1_units =
"m"
1167 character (len = *),
parameter :: var2_units =
"s"
1168 character (len = *),
parameter :: var3_units =
"degrees"
1169 character (len = *),
parameter :: var4_units =
"degrees"
1170 character (len = *),
parameter :: lat_units =
"degrees_north"
1171 character (len = *),
parameter :: lon_units =
"degrees_east"
1173 imc=(date1-iyc*10000)/100
1174 idc=int(date1-dble(iyc*10000)-dble(imc*100))
1176 iminc=(date2-ihc*10000)/100
1177 isc=date2-ihc*10000-100*iminc
1178 timenc=dble(
julday(idc,imc,iyc))+(dble(ihc)+(dble(iminc)+ &
1179 (dble(isc)/60.0d0))/60.0d0)/24.0d0
1183 times(rec)=timenc+dble( (rec-1)*dt)/3600.0d0/24.0d0
1186 file_name =
"sys_hs.ww3.nc"
1187 else if( ivar == 2)
then
1188 file_name =
"sys_tp.ww3.nc"
1189 else if( ivar == 3)
then
1190 file_name =
"sys_dir.ww3.nc"
1192 file_name =
"sys_dspr.ww3.nc"
1198 if (outputtype.EQ.3)
then
1199 call check( nf90_create(file_name, nf90_clobber, ncid) )
1201 if(outputtype.EQ.4)
call check( nf90_create(file_name,nf90_netcdf4,ncid))
1202 call check ( nf90_set_fill(ncid,nf90_nofill,oldmode) )
1203 call check( nf90_def_dim(ncid, lsys_name, nsys, sys_dimid) )
1204 call check( nf90_def_dim(ncid, lat_name, nlats, lat_dimid) )
1205 call check( nf90_def_dim(ncid, lon_name, nlons, lon_dimid) )
1206 call check( nf90_def_dim(ncid, time_name, ntime, rec_dimid) )
1207 call check( nf90_def_var(ncid, lat_name, nf90_real, lat_dimid,lat_varid))
1208 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,lat_varid,1,1,deflate) )
1209 call check( nf90_def_var(ncid, lon_name, nf90_real, lon_dimid,lon_varid))
1210 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,lon_varid,1,1,deflate) )
1211 call check( nf90_def_var(ncid,time_name,nf90_double,rec_dimid,rec_varid))
1212 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,rec_varid,1,1,deflate) )
1216 call check( nf90_put_att(ncid, lat_varid, units, lat_units) )
1217 call check( nf90_put_att(ncid, lat_varid,
'long_name',
'latitude') )
1218 call check( nf90_put_att(ncid, lat_varid,
'standard_name',
'latitude') )
1219 call check( nf90_put_att(ncid, lat_varid,
'axis',
'Y'))
1220 call check( nf90_put_att(ncid, lon_varid, units, lon_units) )
1221 call check( nf90_put_att(ncid, lon_varid,
'long_name',
'longitude') )
1222 call check( nf90_put_att(ncid, lon_varid,
'standard_name',
'longitude') )
1223 call check( nf90_put_att(ncid, lon_varid,
'axis',
'X'))
1224 call check(nf90_put_att(ncid,rec_varid,units,&
1225 'days since 1990-01-01 00:00:00'))
1226 call check(nf90_put_att(ncid,rec_varid,
'long_name',
'julian day (UT)'))
1227 call check( nf90_put_att(ncid, rec_varid,
'standard_name',
'time') )
1228 call check( nf90_put_att(ncid, rec_varid,
'conventions',&
1229 'relative julian day with decimal part (as part of the day)' ) )
1230 call check( nf90_put_att(ncid, rec_varid,
'axis',
'T'))
1234 dimids = (/ lon_dimid, lat_dimid, sys_dimid, rec_dimid /)
1236 call check( nf90_def_var(ncid, var1_name, nf90_real, dimids,var1_varid) )
1237 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,var1_varid,1,1,deflate) )
1238 call check( nf90_put_att(ncid, var1_varid, units, var1_units) )
1239 call check( nf90_put_att(ncid, var1_varid,
'long_name',
'significant_wave_height') )
1240 call check( nf90_put_att(ncid, var1_varid,
'missing_value',
'9999.00'))
1241 else if( ivar == 2)
then
1242 call check( nf90_def_var(ncid, var2_name, nf90_real, dimids, var2_varid) )
1243 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,var2_varid,1,1,deflate) )
1244 call check( nf90_put_att(ncid, var2_varid, units, var2_units) )
1245 call check( nf90_put_att(ncid, var2_varid,
'long_name',
'peak_period') )
1246 call check( nf90_put_att(ncid, var2_varid,
'missing_value',
'9999.00') )
1247 else if ( ivar ==3 )
then
1248 call check( nf90_def_var(ncid, var3_name, nf90_real, dimids, var3_varid) )
1249 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,var3_varid,1,1,deflate) )
1250 call check( nf90_put_att(ncid, var3_varid, units, var3_units) )
1251 call check( nf90_put_att(ncid, var3_varid,
'long_name',
'peak_direction') )
1252 call check( nf90_put_att(ncid, var3_varid,
'missing_value',
'9999.00') )
1254 call check( nf90_def_var(ncid, var4_name, nf90_real, dimids, var4_varid) )
1255 if(outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,var4_varid,1,1,deflate) )
1256 call check( nf90_put_att(ncid, var4_varid, units, var4_units) )
1257 call check( nf90_put_att(ncid,var4_varid,
'long_name',
'directional_spread') )
1258 call check( nf90_put_att(ncid, var4_varid,
'missing_value',
'9999.00') )
1260 call check( nf90_enddef(ncid) )
1264 call check( nf90_put_var(ncid, lat_varid, lats) )
1265 call check( nf90_put_var(ncid, lon_varid, lons) )
1266 call check( nf90_put_var(ncid, rec_varid, times) )
1270 count = (/ nlons, nlats, nsys, ntime /)
1271 start = (/ 1, 1, 1, 1 /)
1273 call check( nf90_put_var(ncid, var1_varid, data_in, start = start, &
1275 else if( ivar == 2)
then
1276 call check( nf90_put_var(ncid, var2_varid, data_in, start = start, &
1278 else if( ivar == 3)
then
1279 call check( nf90_put_var(ncid, var3_varid, data_in, start = start, &
1282 call check( nf90_put_var(ncid, var4_varid, data_in, start = start, &
1285 call check( nf90_close(ncid) )
1298 subroutine check(status)
1300 integer,
intent ( in) :: status
1301 if(status /= nf90_noerr)
then
1303 996
FORMAT (/
' *** WAVEWATCH III ERROR IN WW3_SYSTRK:'/ &
1305 print *, trim(nf90_strerror(status))
1306 stop
"Stopped in netcdf output part"
1308 end subroutine check
1330 subroutine pt2netcdf(longitude,latitude,hs,tp,&
1331 dir,npoints,date1,date2,dt,ntime,outputType)
1335 integer :: ntime,npoints,outputType
1336 integer,
parameter :: deflate = 1
1337 integer :: iret, oldMode
1339 integer :: system_index_dim
1340 integer :: point_dim,rec_dim
1342 integer :: start(3), count(3)
1343 parameter(nsys = 10)
1344 integer :: latitude_id
1345 integer :: longitude_id
1350 integer :: time_rank
1354 parameter(time_rank = 1)
1355 parameter(hs_rank = 3)
1356 parameter(tp_rank = 3)
1357 parameter(dir_rank = 3)
1361 integer :: hs_dims(hs_rank)
1362 integer :: tp_dims(tp_rank)
1363 integer :: dir_dims(dir_rank)
1364 real :: latitude(npoints),dt
1365 real :: longitude(npoints)
1366 real :: hs(nsys, npoints, ntime)
1367 real :: tp(nsys, npoints, ntime)
1368 real :: dir(nsys, npoints, ntime)
1369 integer :: iyc,imc,idc,ihc,iminc,isc,Jday,Jday0,rec
1370 double precision date1,date2,timenc
1371 double precision times(ntime)
1376 imc=(date1-iyc*10000)/100
1377 idc=int(date1-dble(iyc*10000)-dble(imc*100))
1379 iminc=(date2-ihc*10000)/100
1380 isc=date2-ihc*10000-100*iminc
1381 timenc=dble(
julday(idc,imc,iyc))+(dble(ihc)+(dble(iminc)+ &
1382 (dble(isc)/60.0d0))/60.0d0)/24.0d0
1386 times(rec)=timenc+dble( (rec-1)*dt)/3600.0d0/24.0d0
1391 if(outputtype.EQ.3)
then
1392 iret = nf90_create(
'sys_pnt.ww3.nc', nf90_clobber, ncid)
1394 if (outputtype.EQ.4) iret = nf90_create(
'sys_pnt.ww3.nc',nf90_netcdf4, ncid)
1396 iret = nf90_set_fill(ncid,nf90_nofill,oldmode)
1399 iret = nf90_def_dim(ncid,
'system_index', nsys, system_index_dim)
1401 iret = nf90_def_dim(ncid,
'point', npoints, point_dim)
1403 iret = nf90_def_dim(ncid,
'time', ntime, rec_dim)
1406 iret = nf90_def_var(ncid,
'latitude', nf90_real, point_dim, &
1409 if (outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,latitude_id,1,1,deflate))
1410 iret = nf90_def_var(ncid,
'longitude', nf90_real, point_dim, &
1413 if (outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,longitude_id,1,1,deflate))
1414 iret = nf90_def_var(ncid,
'time', nf90_double, rec_dim, &
1417 if (outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,time_id,1,1,deflate) )
1418 hs_dims(3) = rec_dim
1419 hs_dims(2) = point_dim
1420 hs_dims(1) = system_index_dim
1421 iret = nf90_def_var(ncid,
'hs', nf90_real, &
1424 if (outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,hs_id,1,1,deflate))
1425 tp_dims(3) = rec_dim
1426 tp_dims(2) = point_dim
1427 tp_dims(1) = system_index_dim
1428 iret = nf90_def_var(ncid,
'tp', nf90_real, &
1431 if (outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,tp_id,1,1,deflate))
1432 dir_dims(3) = rec_dim
1433 dir_dims(2) = point_dim
1434 dir_dims(1) = system_index_dim
1435 iret = nf90_def_var(ncid,
'dir', nf90_real, &
1438 if (outputtype.EQ.4)
call check( nf90_def_var_deflate(ncid,dir_id,1,1,deflate))
1440 iret = nf90_put_att(ncid, latitude_id,
'units',
'degrees_north')
1442 iret = nf90_put_att(ncid, latitude_id,
'long_name',
'latitude')
1444 iret = nf90_put_att(ncid, latitude_id,
'standard_name',
'latitude')
1446 iret = nf90_put_att(ncid, latitude_id,
'axis',
'Y')
1448 iret = nf90_put_att(ncid, longitude_id,
'units',
'degrees_east')
1450 iret = nf90_put_att(ncid, longitude_id,
'long_name',
'longitude')
1452 iret = nf90_put_att(ncid, longitude_id,
'standard_name',
'longitude')
1454 iret = nf90_put_att(ncid, longitude_id,
'axis',
'X')
1456 iret = nf90_put_att(ncid, time_id,
'units', &
1457 'days since 1990-01-01 00:00:00')
1459 iret = nf90_put_att(ncid, time_id,
'long_name',
'julian day(UT)')
1461 iret = nf90_put_att(ncid, time_id,
'standard_name',
'time')
1463 iret = nf90_put_att(ncid, time_id,
'conventions', &
1464 'relative julian day with decimal part (as part of the day)')
1466 iret = nf90_put_att(ncid, time_id,
'axis',
'T')
1468 iret = nf90_put_att(ncid, hs_id,
'units',
'm')
1470 iret = nf90_put_att(ncid, hs_id,
'long_name',
'significant_wave_height')
1472 iret = nf90_put_att(ncid, hs_id,
'missing_value', &
1475 iret = nf90_put_att(ncid, tp_id,
'units',
's')
1477 iret = nf90_put_att(ncid, tp_id,
'long_name',
'peak_period')
1479 iret = nf90_put_att(ncid, tp_id,
'missing_value', &
1482 iret = nf90_put_att(ncid, dir_id,
'units',
'degrees')
1484 iret = nf90_put_att(ncid, dir_id,
'long_name',
'peak_direction')
1486 iret = nf90_put_att(ncid, dir_id,
'missing_value',&
1490 iret = nf90_enddef(ncid)
1492 iret = nf90_put_var(ncid, latitude_id, latitude)
1497 iret = nf90_put_var(ncid, longitude_id, longitude)
1502 iret = nf90_put_var(ncid, time_id, times)
1507 start = (/ 1, 1, 1 /)
1508 count = (/ nsys,npoints,ntime /)
1512 iret = nf90_put_var(ncid, hs_id, hs,&
1513 start = start, count = count )
1515 iret = nf90_put_var(ncid, tp_id, tp, &
1516 start = start, count = count )
1518 iret = nf90_put_var(ncid, dir_id, dir,&
1519 start = start, count = count )
1521 iret = nf90_close(ncid)