@@ -330,6 +330,7 @@ program create_movie_shakemap
330330
331331 iframe = iframe + 1
332332
333+ ! user output
333334 print *
334335 if (plot_shaking_map) then
335336 print * ,' reading shaking map snapshot'
@@ -344,20 +345,20 @@ program create_movie_shakemap
344345 else
345346 write (outputname," ('/moviedata',i6.6)" ) it
346347 endif
347- open (unit= IOUT ,file= trim (OUTPUT_FILES)// trim (outputname),status= ' old' , &
348+ open (unit= IIN ,file= trim (OUTPUT_FILES)// trim (outputname),status= ' old' , &
348349 action= ' read' ,form= ' unformatted' ,iostat= ier)
349350 if (ier /= 0 ) then
350- print * ,' error: ' ,trim (OUTPUT_FILES)// trim (outputname)
351- stop ' error opening moviedata file'
351+ print * ,' Error: failed opening ' ,trim (OUTPUT_FILES)// trim (outputname)
352+ stop ' Error opening moviedata file'
352353 endif
353354
354- read (IOUT ) store_val_x
355- read (IOUT ) store_val_y
356- read (IOUT ) store_val_z
357- read (IOUT ) store_val_ux
358- read (IOUT ) store_val_uy
359- read (IOUT ) store_val_uz
360- close (IOUT )
355+ read (IIN ) store_val_x
356+ read (IIN ) store_val_y
357+ read (IIN ) store_val_z
358+ read (IIN ) store_val_ux
359+ read (IIN ) store_val_uy
360+ read (IIN ) store_val_uz
361+ close (IIN )
361362
362363 ! clear number of elements kept
363364 ispec = 0
@@ -546,14 +547,14 @@ program create_movie_shakemap
546547 zp_save(:) = zp(:)
547548
548549 ! sort the list based upon coordinates to get rid of multiples
549- print * ,' sorting list of points'
550+ print * ,' sorting list of points'
550551 call get_global(npointot,xp,yp,zp,iglob,locval,ifseg,nglob, &
551552 dble (minval (store_val_x(:))),dble (maxval (store_val_x(:))))
552553
553554 ! print total number of points found
554555 print *
555- print * ,' found a total of ' ,nglob,' points'
556- print * ,' initial number of points (with multiples) was ' ,npointot
556+ print * ,' found a total of ' ,nglob,' points'
557+ print * ,' initial number of points (with multiples) was ' ,npointot
557558
558559
559560 ! normalize and scale vector field
@@ -565,14 +566,14 @@ program create_movie_shakemap
565566 if (plot_shaking_map) then
566567 ! print minimum and maximum amplitude in current snapshot
567568 print *
568- print * ,' minimum amplitude in current snapshot after removal = ' ,min_field_current
569- print * ,' maximum amplitude in current snapshot after removal = ' ,max_field_current
569+ print * ,' minimum amplitude in current snapshot after removal = ' ,min_field_current
570+ print * ,' maximum amplitude in current snapshot after removal = ' ,max_field_current
570571 print *
571572 else
572573 ! print minimum and maximum amplitude in current snapshot
573574 print *
574- print * ,' minimum amplitude in current snapshot = ' ,min_field_current
575- print * ,' maximum amplitude in current snapshot = ' ,max_field_current
575+ print * ,' minimum amplitude in current snapshot = ' ,min_field_current
576+ print * ,' maximum amplitude in current snapshot = ' ,max_field_current
576577 print *
577578 endif
578579
@@ -586,11 +587,11 @@ program create_movie_shakemap
586587 ! Earthquake Spectra, Volume 15, 1999
587588 !
588589 ! see: https://www.dtsc-ssfl.com/files/lib_ceqa/ref_draft_peir/Chap4_5-Geology/68331_Wald_et_al_1999.pdf
589- print * ,' converting to tabulated Modified Mercalli Intensity (MMI)'
590+ print * ,' converting to tabulated Modified Mercalli Intensity (MMI)'
590591
591592 if (inorm == 2 ) then
592593 ! tabulated PGV
593- print * ,' using PGV table from Wald et al. (1999)'
594+ print * ,' using PGV table from Wald et al. (1999)'
594595 ! loop over all points
595596 do ipoin = 1 ,npointot
596597 val = field_display(ipoin)
@@ -627,7 +628,7 @@ program create_movie_shakemap
627628 enddo
628629 else if (inorm == 3 ) then
629630 ! tabulated PGA
630- print * ,' using PGA table from Wald et al. (1999)'
631+ print * ,' using PGA table from Wald et al. (1999)'
631632 ! loop over all points
632633 do ipoin = 1 ,npointot
633634 val = field_display(ipoin)
@@ -671,8 +672,8 @@ program create_movie_shakemap
671672
672673 ! print minimum and maximum MMI in current snapshot
673674 print *
674- print * ,' minimum intensity (MMI) in current snapshot = ' ,min_field_current
675- print * ,' maximum intensity (MMI) in current snapshot = ' ,max_field_current
675+ print * ,' minimum intensity (MMI) in current snapshot = ' ,min_field_current
676+ print * ,' maximum intensity (MMI) in current snapshot = ' ,max_field_current
676677 print *
677678 endif
678679 endif
@@ -750,15 +751,15 @@ program create_movie_shakemap
750751
751752 if (USE_OPENDX) then
752753 write (outputname," ('/DX_shaking_map.dx')" )
753- open (unit= 11 ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
754- write (11 ,* ) ' object 1 class array type float rank 1 shape 3 items ' ,nglob,' data follows'
754+ open (unit= IOUT ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
755+ write (IOUT ,* ) ' object 1 class array type float rank 1 shape 3 items ' ,nglob,' data follows'
755756 else if (USE_AVS) then
756757 write (outputname," ('/AVS_shaking_map.inp')" )
757- open (unit= 11 ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
758- write (11 ,* ) nglob,' ' ,nspectot_AVS_max,' 1 0 0'
758+ open (unit= IOUT ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
759+ write (IOUT ,* ) nglob,' ' ,nspectot_AVS_max,' 1 0 0'
759760 else if (USE_GMT) then
760761 write (outputname," ('/gmt_shaking_map.xyz')" )
761- open (unit= 11 ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
762+ open (unit= IOUT ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
762763 else
763764 stop ' wrong output format selected'
764765 endif
@@ -767,15 +768,15 @@ program create_movie_shakemap
767768
768769 if (USE_OPENDX) then
769770 write (outputname," ('/DX_movie_',i6.6,'.dx')" ) ivalue
770- open (unit= 11 ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
771- write (11 ,* ) ' object 1 class array type float rank 1 shape 3 items ' ,nglob,' data follows'
771+ open (unit= IOUT ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
772+ write (IOUT ,* ) ' object 1 class array type float rank 1 shape 3 items ' ,nglob,' data follows'
772773 else if (USE_AVS) then
773774 write (outputname," ('/AVS_movie_',i6.6,'.inp')" ) ivalue
774- open (unit= 11 ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
775- write (11 ,* ) nglob,' ' ,nspectot_AVS_max,' 1 0 0'
775+ open (unit= IOUT ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
776+ write (IOUT ,* ) nglob,' ' ,nspectot_AVS_max,' 1 0 0'
776777 else if (USE_GMT) then
777778 write (outputname," ('/gmt_movie_',i6.6,'.xyz')" ) ivalue
778- open (unit= 11 ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
779+ open (unit= IOUT ,file= trim (OUTPUT_FILES)// outputname,status= ' unknown' )
779780 else
780781 stop ' wrong output format selected'
781782 endif
@@ -793,7 +794,7 @@ program create_movie_shakemap
793794 ibool_number = iglob(ilocnum+ ieoff)
794795 if (.not. mask_point(ibool_number)) then
795796 call utm_geo(long,lat,xp_save(ilocnum+ ieoff),yp_save(ilocnum+ ieoff),IUTM2LONGLAT)
796- write (11 ,* ) sngl(long),sngl(lat),sngl(field_display(ilocnum+ ieoff))
797+ write (IOUT ,* ) sngl(long),sngl(lat),sngl(field_display(ilocnum+ ieoff))
797798 endif
798799 mask_point(ibool_number) = .true.
799800 enddo
@@ -811,18 +812,18 @@ program create_movie_shakemap
811812 ipoin = ipoin + 1
812813 ireorder(ibool_number) = ipoin
813814 if (USE_OPENDX) then
814- write (11 ,* ) sngl(xp_save(ilocnum+ ieoff)),sngl(yp_save(ilocnum+ ieoff)),sngl(zp_save(ilocnum+ ieoff))
815+ write (IOUT ,* ) sngl(xp_save(ilocnum+ ieoff)),sngl(yp_save(ilocnum+ ieoff)),sngl(zp_save(ilocnum+ ieoff))
815816 else if (USE_AVS) then
816- write (11 ,* ) ireorder(ibool_number),sngl(xp_save(ilocnum+ ieoff)), &
817- sngl(yp_save(ilocnum+ ieoff)),sngl(zp_save(ilocnum+ ieoff))
817+ write (IOUT ,* ) ireorder(ibool_number),sngl(xp_save(ilocnum+ ieoff)), &
818+ sngl(yp_save(ilocnum+ ieoff)),sngl(zp_save(ilocnum+ ieoff))
818819 endif
819820 endif
820821 mask_point(ibool_number) = .true.
821822 enddo
822823 enddo
823824
824825 if (USE_OPENDX) &
825- write (11 ,* ) ' object 2 class array type int rank 1 shape 4 items ' ,nspectot_AVS_max,' data follows'
826+ write (IOUT ,* ) ' object 2 class array type int rank 1 shape 4 items ' ,nspectot_AVS_max,' data follows'
826827
827828 ! output list of elements
828829 do ispec = 1 ,nspectot_AVS_max
@@ -834,24 +835,24 @@ program create_movie_shakemap
834835 ibool_number4 = iglob(ieoff + 4 )
835836 if (USE_OPENDX) then
836837 ! point order in OpenDX is 1,4,2,3 *not* 1,2,3,4 as in AVS
837- write (11 ," (i10,1x,i10,1x,i10,1x,i10)" ) ireorder(ibool_number1)- 1 , &
838+ write (IOUT ," (i10,1x,i10,1x,i10,1x,i10)" ) ireorder(ibool_number1)- 1 , &
838839 ireorder(ibool_number4 )- 1 ,ireorder(ibool_number2)- 1 ,ireorder(ibool_number3)- 1
839840 else
840841 ! AVS UCD format
841- write (11 ," (i10,' 1 quad ',i10,1x,i10,1x,i10,1x,i10)" ) ispec,ireorder(ibool_number1), &
842+ write (IOUT ," (i10,' 1 quad ',i10,1x,i10,1x,i10,1x,i10)" ) ispec,ireorder(ibool_number1), &
842843 ireorder(ibool_number4 ),ireorder(ibool_number2),ireorder(ibool_number3)
843844 endif
844845 enddo
845846
846847 if (USE_OPENDX) then
847- write (11 ,* ) ' attribute "element type" string "quads"'
848- write (11 ,* ) ' attribute "ref" string "positions"'
849- write (11 ,* ) ' object 3 class array type float rank 0 items ' ,nglob,' data follows'
848+ write (IOUT ,* ) ' attribute "element type" string "quads"'
849+ write (IOUT ,* ) ' attribute "ref" string "positions"'
850+ write (IOUT ,* ) ' object 3 class array type float rank 0 items ' ,nglob,' data follows'
850851 else
851852 ! AVS UCD format
852853 ! dummy text for labels
853- write (11 ,* ) ' 1 1'
854- write (11 ,* ) ' a, b'
854+ write (IOUT ,* ) ' 1 1'
855+ write (IOUT ,* ) ' a, b'
855856 endif
856857
857858 ! output data values
@@ -864,16 +865,16 @@ program create_movie_shakemap
864865 if (.not. mask_point(ibool_number)) then
865866 if (USE_OPENDX) then
866867 if (plot_shaking_map) then
867- write (11 ,* ) sngl(field_display(ilocnum+ ieoff))
868+ write (IOUT ,* ) sngl(field_display(ilocnum+ ieoff))
868869 else
869- write (11 ,* ) sngl(field_display(ilocnum+ ieoff))
870+ write (IOUT ,* ) sngl(field_display(ilocnum+ ieoff))
870871 endif
871872 else
872873 ! AVS UCD format
873874 if (plot_shaking_map) then
874- write (11 ,* ) ireorder(ibool_number),sngl(field_display(ilocnum+ ieoff))
875+ write (IOUT ,* ) ireorder(ibool_number),sngl(field_display(ilocnum+ ieoff))
875876 else
876- write (11 ,* ) ireorder(ibool_number),sngl(field_display(ilocnum+ ieoff))
877+ write (IOUT ,* ) ireorder(ibool_number),sngl(field_display(ilocnum+ ieoff))
877878 endif
878879 endif
879880 endif
@@ -883,23 +884,25 @@ program create_movie_shakemap
883884
884885 ! define OpenDX field
885886 if (USE_OPENDX) then
886- write (11 ,* ) ' attribute "dep" string "positions"'
887- write (11 ,* ) ' object "irregular positions irregular connections" class field'
888- write (11 ,* ) ' component "positions" value 1'
889- write (11 ,* ) ' component "connections" value 2'
890- write (11 ,* ) ' component "data" value 3'
891- write (11 ,* ) ' end'
887+ write (IOUT ,* ) ' attribute "dep" string "positions"'
888+ write (IOUT ,* ) ' object "irregular positions irregular connections" class field'
889+ write (IOUT ,* ) ' component "positions" value 1'
890+ write (IOUT ,* ) ' component "connections" value 2'
891+ write (IOUT ,* ) ' component "data" value 3'
892+ write (IOUT ,* ) ' end'
892893 endif
893894
894895 ! end of test for GMT format
895896 endif
896897
897- close (11 )
898+ close (IOUT)
899+ print * ,' file written: ' ,trim (OUTPUT_FILES)// outputname
898900
899901 ! end of loop and test on all the time steps for all the movie images
900902 endif
901903 enddo ! it
902904
905+ ! final user output
903906 print *
904907 print * ,' done creating movie or shaking map'
905908 print *
0 commit comments