#NEWLINE# def write_file( self ) : #NEWLINE# #INDENT# '\n        Write the package file\n\n        Returns\n        -------\n        None\n\n        ' #NEWLINE# ( nrow , ncol , nlay , nper ) = self . parent . mf . nrow_ncol_nlay_nper #NEWLINE# f_sim = open ( self . fn_path , 'w' ) #NEWLINE# f_sim . write ( '#{0:s}\n#{1:s}\n' . format ( self . heading1 , self . heading2 ) ) #NEWLINE# f_sim . write ( '{0:s}\n' . format ( self . mp_name_file ) ) #NEWLINE# f_sim . write ( '{0:s}\n' . format ( self . mp_list_file ) ) #NEWLINE# for i in range ( 12 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:4d}' . format ( self . option_flags [ i ] ) ) #NEWLINE# #UNINDENT# f_sim . write ( '\n' ) #NEWLINE# f_sim . write ( '{0:s}\n' . format ( self . endpoint_file ) ) #NEWLINE# if ( self . options_dict [ 'SimulationType' ] == 2 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . pathline_file ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'SimulationType' ] == 3 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . time_ser_file ) ) #NEWLINE# #UNINDENT# if ( ( self . options_dict [ 'AdvectiveObservationsOption' ] == 2 ) and ( self . option_dict [ 'SimulationType' ] == 3 ) ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . advobs_file ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'ReferenceTimeOption' ] == 1 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:f}\n' . format ( self . ref_time ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'ReferenceTimeOption' ] == 2 ) : #NEWLINE# #INDENT# ( Period , Step , TimeFraction ) = self . ref_time_per_stp #NEWLINE# f_sim . write ( '{0:d} {1:d} {2:f}\n' . format ( Period , Step , TimeFraction ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'StopOption' ] == 3 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:f}\n' . format ( self . stop_time ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'ParticleGenerationOption' ] == 1 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:d}\n' . format ( self . group_ct ) ) #NEWLINE# for i in range ( self . group_ct ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . group_name [ i ] ) ) #NEWLINE# ( Grid , GridCellRegionOption , PlacementOption , ReleaseStartTime , ReleaseOption , CHeadOption ) = self . group_placement [ i ] #NEWLINE# f_sim . write ( '{0:d} {1:d} {2:d} {3:f} {4:d} {5:d}\n' . format ( Grid , GridCellRegionOption , PlacementOption , ReleaseStartTime , ReleaseOption , CHeadOption ) ) #NEWLINE# if ( ReleaseOption == 2 ) : #NEWLINE# #INDENT# ( ReleasePeriodLength , ReleaseEventCount ) = self . release_times [ i ] #NEWLINE# f_sim . write ( '{0:f} {1:d}\n' . format ( ReleasePeriodLength , ReleaseEventCount ) ) #NEWLINE# #UNINDENT# if ( GridCellRegionOption == 1 ) : #NEWLINE# #INDENT# ( MinLayer , MinRow , MinColumn , MaxLayer , MaxRow , MaxColumn ) = self . group_region [ i ] #NEWLINE# f_sim . write ( '{0:d} {1:d} {2:d} {3:d} {4:d} {5:d}\n' . format ( ( MinLayer + 1 ) , ( MinRow + 1 ) , ( MinColumn + 1 ) , ( MaxLayer + 1 ) , ( MaxRow + 1 ) , ( MaxColumn + 1 ) ) ) #NEWLINE# #UNINDENT# if ( GridCellRegionOption == 2 ) : #NEWLINE# #INDENT# f_sim . write ( self . mask_nlay [ i ] . get_file_entry ( ) ) #NEWLINE# #UNINDENT# if ( GridCellRegionOption == 3 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . mask_layer [ i ] ) ) #NEWLINE# f_sim . write ( self . mask_1lay [ i ] . get_file_entry ( ) ) #NEWLINE# #UNINDENT# if ( PlacementOption == 1 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:d}\n' . format ( self . face_ct [ i ] ) ) #NEWLINE# for j in range ( self . face_ct [ i ] ) : #NEWLINE# #INDENT# ( IFace , ParticleRowCount , ParticleColumnCount ) = self . ifaces [ i ] [ j ] #NEWLINE# f_sim . write ( '{0:d} {1:d} {2:d} \n' . format ( IFace , ParticleRowCount , ParticleColumnCount ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( PlacementOption == 2 ) : #NEWLINE# #INDENT# ( ParticleLayerCount , ParticleRowCount , ParticleColumnCount ) = self . particle_cell_cnt [ i ] #NEWLINE# f_sim . write ( '{0:d} {1:d} {2:d} \n' . format ( ParticleLayerCount , ParticleRowCount , ParticleColumnCount ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . options_dict [ 'ParticleGenerationOption' ] == 2 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . strt_file ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'TimePointOption' ] != 1 ) : #NEWLINE# #INDENT# if ( ( self . options_dict [ 'TimePointOption' ] == 2 ) or ( self . options_dict [ 'TimePointOption' ] == 3 ) ) : #NEWLINE# #INDENT# f_sim . write ( '{0:d}\n' . format ( self . time_ct ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'TimePointOption' ] == 2 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:f}\n' . format ( self . release_time_incr ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'TimePointOption' ] == 3 ) : #NEWLINE# #INDENT# for r in range ( self . time_ct ) : #NEWLINE# #INDENT# f_sim . write ( '{0:f}\n' . format ( self . time_pts [ r ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( self . options_dict [ 'BudgetOutputOption' ] != 1 ) or ( self . options_dict [ 'BudgetOutputOption' ] != 2 ) ) : #NEWLINE# #INDENT# if ( self . options_dict [ 'BudgetOutputOption' ] == 3 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:d}\n' . format ( self . cell_bd_ct ) ) #NEWLINE# for k in range ( self . cell_bd_ct ) : #NEWLINE# #INDENT# ( Grid , Layer , Row , Column ) = self . bud_loc [ k ] #NEWLINE# f_sim . write ( '{0:d} {1:d} {2:d} {3:d} \n' . format ( Grid , ( Layer + 1 ) , ( Row + 1 ) , ( Column + 1 ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . options_dict [ 'BudgetOutputOption' ] == 4 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . trace_file ) ) #NEWLINE# f_sim . write ( '{0:s}\n' . format ( self . trace_id ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . options_dict [ 'ZoneArrayOption' ] != 1 ) : #NEWLINE# #INDENT# f_sim . write ( '{0:s}\n' . format ( self . stop_zone ) ) #NEWLINE# f_sim . write ( self . stop_zone . get_file_entry ( ) ) #NEWLINE# #UNINDENT# if ( self . options_dict [ 'RetardationOption' ] != 1 ) : #NEWLINE# #INDENT# f_sim . write ( self . retard_fac . get_file_entry ( ) ) #NEWLINE# f_sim . write ( self . retard_fcCB . get_file_entry ( ) ) #NEWLINE# #UNINDENT# f_sim . close ( )