@@ -614,7 +614,7 @@ SUBROUTINE ReadRunType( RunType, PlotType, myThid )
614
614
CALL PRINT_MESSAGE( msgbuf, PRTFile, SQUEEZE_RIGHT, myThid )
615
615
#endif /* IHOP_WRITE_OUT */
616
616
617
- SELECT CASE ( RunType( 1 : 1 ) )
617
+ SELECT CASE ( RunType( 1 : 1 ) )
618
618
CASE ( ' R' )
619
619
#ifdef IHOP_WRITE_OUT
620
620
WRITE (msgBuf,' (A)' ) ' Ray trace run'
@@ -649,6 +649,11 @@ SUBROUTINE ReadRunType( RunType, PlotType, myThid )
649
649
#ifdef IHOP_WRITE_OUT
650
650
WRITE (msgBuf,' (A)' ) ' Arrivals calculation, binary file output'
651
651
CALL PRINT_MESSAGE( msgbuf, PRTFile, SQUEEZE_RIGHT, myThid )
652
+ #endif /* IHOP_WRITE_OUT */
653
+ CASE ( ' e' )
654
+ #ifdef IHOP_WRITE_OUT
655
+ WRITE (msgBuf,' (A)' ) ' Eigenrays + Arrivals run, ASCII file output'
656
+ CALL PRINT_MESSAGE( msgbuf, PRTFile, SQUEEZE_RIGHT, myThid )
652
657
#endif /* IHOP_WRITE_OUT */
653
658
CASE DEFAULT
654
659
#ifdef IHOP_WRITE_OUT
@@ -960,7 +965,7 @@ SUBROUTINE OpenOutputFiles( fName, myTime, myIter, myThid )
960
965
fullName = fName
961
966
ENDIF
962
967
963
- SELECT CASE ( Beam% RunType( 1 : 1 ) )
968
+ SELECT CASE ( Beam% RunType( 1 : 1 ) )
964
969
CASE ( ' R' , ' E' ) ! Ray trace or Eigenrays
965
970
#ifdef IHOP_WRITE_OUT
966
971
OPEN ( FILE = TRIM ( fullName ) // ' .ray' , UNIT = RAYFile, &
@@ -977,9 +982,9 @@ SUBROUTINE OpenOutputFiles( fName, myTime, myIter, myThid )
977
982
#else /* IHOP_THREED */
978
983
WRITE ( RAYFile, * ) ' '' rz'' '
979
984
#endif /* IHOP_THREED */
985
+ FLUSH( RAYFile )
980
986
#endif /* IHOP_WRITE_OUT */
981
-
982
- CASE ( ' A' ) ! arrival file in ascii format
987
+ CASE ( ' e' ) ! eigenrays + arrival file in ascii format
983
988
#ifdef IHOP_WRITE_OUT
984
989
OPEN ( FILE = TRIM ( fullName ) // ' .arr' , UNIT = ARRFile, &
985
990
FORM = ' FORMATTED' )
@@ -1008,7 +1013,7 @@ SUBROUTINE OpenOutputFiles( fName, myTime, myIter, myThid )
1008
1013
WRITE ( ARRFile, * ) Pos% Ntheta, Pos% theta( 1 : Pos% Ntheta )
1009
1014
# endif /* IHOP_THREED */
1010
1015
1011
- ! IEsco22: add to arrivals output
1016
+ ! IEsco22: add erays to arrivals output
1012
1017
OPEN ( FILE = TRIM ( fullName ) // ' .ray' , UNIT = RAYFile, &
1013
1018
FORM = ' FORMATTED' )
1014
1019
WRITE ( RAYFile, * ) ' '' ' , Title( 1 : 50 ), ' '' '
@@ -1040,6 +1045,38 @@ SUBROUTINE OpenOutputFiles( fName, myTime, myIter, myThid )
1040
1045
WRITE ( DELFile, * ) ' '' rz'' '
1041
1046
# endif /* IHOP_THREED */
1042
1047
ENDIF
1048
+
1049
+ FLUSH( RAYFile )
1050
+ IF (writeDelay) FLUSH( DELFile )
1051
+ FLUSH( ARRFile )
1052
+ #endif /* IHOP_WRITE_OUT */
1053
+ CASE ( ' A' ) ! arrival file in ascii format
1054
+ #ifdef IHOP_WRITE_OUT
1055
+ OPEN ( FILE = TRIM ( fullName ) // ' .arr' , UNIT = ARRFile, &
1056
+ FORM = ' FORMATTED' )
1057
+
1058
+ # ifdef IHOP_THREED
1059
+ WRITE ( ARRFile, * ) ' '' 3D'' '
1060
+ # else /* IHOP_THREED */
1061
+ WRITE ( ARRFile, * ) ' '' 2D'' '
1062
+ # endif /* IHOP_THREED */
1063
+
1064
+ WRITE ( ARRFile, * ) IHOP_freq
1065
+
1066
+ ! write source locations
1067
+ # ifdef IHOP_THREED
1068
+ WRITE ( ARRFile, * ) Pos% NSx, Pos% Sx( 1 : Pos% NSx )
1069
+ WRITE ( ARRFile, * ) Pos% NSy, Pos% Sy( 1 : Pos% NSy )
1070
+ # endif /* IHOP_THREED */
1071
+ WRITE ( ARRFile, * ) Pos% NSz, Pos% Sz( 1 : Pos% NSz )
1072
+
1073
+ ! write receiver locations
1074
+ WRITE ( ARRFile, * ) Pos% NRz, Pos% Rz( 1 : Pos% NRz )
1075
+ WRITE ( ARRFile, * ) Pos% NRr, Pos% Rr( 1 : Pos% NRr )
1076
+ # ifdef IHOP_THREED
1077
+ WRITE ( ARRFile, * ) Pos% Ntheta, Pos% theta( 1 : Pos% Ntheta )
1078
+ # endif /* IHOP_THREED */
1079
+ FLUSH( ARRFile )
1043
1080
#endif /* IHOP_WRITE_OUT */
1044
1081
CASE ( ' a' ) ! arrival file in binary format
1045
1082
#ifdef IHOP_WRITE_OUT
@@ -1069,8 +1106,8 @@ SUBROUTINE OpenOutputFiles( fName, myTime, myIter, myThid )
1069
1106
# ifdef IHOP_THREED
1070
1107
WRITE ( ARRFile ) Pos% Ntheta, Pos% theta( 1 : Pos% Ntheta )
1071
1108
# endif /* IHOP_THREED */
1109
+ FLUSH( ARRFile )
1072
1110
#endif /* IHOP_WRITE_OUT */
1073
-
1074
1111
CASE DEFAULT
1075
1112
atten = 0.0
1076
1113
@@ -1263,7 +1300,7 @@ SUBROUTINE openPRTFile ( myTime, myIter, myThid )
1263
1300
CALL PRINT_MESSAGE( msgbuf, PRTFile, SQUEEZE_RIGHT, myThid )
1264
1301
WRITE (msgbuf,' (A)' )
1265
1302
CALL PRINT_MESSAGE( msgbuf, PRTFile, SQUEEZE_RIGHT, myThid )
1266
- WRITE ( msgBuf, ' (A,I ,A,F20.2,A)' ) ' GCM iter ' , myIter,' at time = ' , &
1303
+ WRITE ( msgBuf, ' (A,I10 ,A,F20.2,A)' ) ' GCM iter ' , myIter,' at time = ' , &
1267
1304
myTime,' [sec]'
1268
1305
CALL PRINT_MESSAGE( msgbuf, PRTFile, SQUEEZE_RIGHT, myThid )
1269
1306
# ifdef ALLOW_CAL
@@ -1294,6 +1331,7 @@ SUBROUTINE resetMemory()
1294
1331
USE bdry_mod, only: Top,Bot
1295
1332
USE angle_mod, only: Angles
1296
1333
USE arr_mod, only: Narr, Arr
1334
+ USE ihop_mod, only: ray2D, MaxN, iStep
1297
1335
1298
1336
! From angle_mod
1299
1337
IF (ALLOCATED (Angles% alpha))DEALLOCATE (Angles% alpha)
@@ -1322,6 +1360,17 @@ SUBROUTINE resetMemory()
1322
1360
IF (ALLOCATED (SSP% cMat3)) DEALLOCATE (SSP% cMat3)
1323
1361
IF (ALLOCATED (SSP% czMat3)) DEALLOCATE (SSP% czMat3)
1324
1362
IF (ALLOCATED (SSP% Seg% r)) DEALLOCATE (SSP% Seg% r)
1363
+ ! From ihop_mod
1364
+ DO iStep = 1 ,MaxN
1365
+ ray2D(iStep)% x = [zeroRL, zeroRL]
1366
+ ray2D(iStep)% t = [zeroRL, zeroRL]
1367
+ ray2D(iStep)% p = [zeroRL, zeroRL]
1368
+ ray2D(iStep)% q = [zeroRL, zeroRL]
1369
+ ray2D(iStep)% c = zeroRL
1370
+ ray2D(iStep)% Amp = zeroRL
1371
+ ray2D(iStep)% Phase = zeroRL
1372
+ ray2D(iStep)% tau = (zeroRL, zeroRL)
1373
+ END DO
1325
1374
1326
1375
END ! SUBROUTINE resetMemory
1327
1376
0 commit comments