22"""
33BSD 3-Clause License
44
5- Copyright (c) 2023 , University of Southern California
5+ Copyright (c) 2024 , University of Southern California
66All rights reserved.
77
88Redistribution and use in source and binary forms, with or without
@@ -78,9 +78,18 @@ def run(self):
7878 a_statfile = os .path .join (install .A_IN_DATA_DIR ,
7979 str (sim_id ),
8080 self .r_stations )
81- a_srffile = os .path .join (install .A_IN_DATA_DIR ,
82- str (sim_id ),
83- self .r_srffile )
81+ a_rupture_file = os .path .join (install .A_IN_DATA_DIR ,
82+ str (sim_id ),
83+ self .r_srffile )
84+ # RWG 20241025: jbsim-v3.0.0 is backward compatible with jbsim-v2.0.0
85+ # it can use rupture files in both SRF and MRF formats
86+ if os .path .splitext (a_rupture_file )[- 1 ].lower () == ".srf" :
87+ rupmod_type = "SRF"
88+ elif os .path .splitext (a_rupture_file )[- 1 ].lower () == ".mrf" :
89+ rupmod_type = "MRF"
90+ else :
91+ print ("[ERROR]: Unknown rupture format in file %s" % (a_rupture_file ))
92+ sys .exit (- 1 )
8493
8594 # Set directories, and make sure they exist
8695 a_indir = os .path .join (install .A_IN_DATA_DIR , str (sim_id ))
@@ -106,9 +115,11 @@ def run(self):
106115 #
107116 progstring = ("%s latloncoords=1 slon=%f slat=%f " %
108117 (os .path .join (install .A_GP_BIN_DIR ,
109- "jbsim-v2 .0.0" ), slon , slat ) +
118+ "jbsim-v3 .0.0" ), slon , slat ) +
110119 "tshift_timedomain=1 use_closest_gf=1 " +
111- "rupmodtype=SRF rupmodfile=%s " % a_srffile +
120+ "cgf_flag=%d " % (config .GF_CGFFLAG ) +
121+ "rupmodtype=%s " % (rupmod_type ) +
122+ "rupmodfile=%s " % (a_rupture_file ) +
112123 "moment=-1 outdir=%s stat=%s " % (a_veldir , site ) +
113124 "min_taper_range=0.0 max_taper_range=0.0 " +
114125 "gftype=fk gflocs=%s gftimes=%s gf_swap_bytes=%d " %
0 commit comments