#NEWLINE# def copy_files( ml , nproc ) : #NEWLINE# #INDENT# cf_base = os . path . join ( 'data' , 'uspb' ) #NEWLINE# exclude = [ 'hds' , 'cbc' , 'list' , 'ddn' ] #NEWLINE# cf_pths = [ ] #NEWLINE# for idx in range ( nproc ) : #NEWLINE# #INDENT# cf_pths . append ( os . path . join ( cf_base , 'cf{:02d}' . format ( idx ) ) ) #NEWLINE# if ( idx == 0 ) : #NEWLINE# #INDENT# ml . model_ws = cf_pths [ idx ] #NEWLINE# ml . remove_package ( 'OC' ) #NEWLINE# stress_period_data = { #NEWLINE# #INDENT# ( 1 , 9 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 10 ) : [ ] , #NEWLINE# ( 1 , 19 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 20 ) : [ ] , #NEWLINE# ( 1 , 29 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 30 ) : [ ] , #NEWLINE# ( 1 , 39 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 40 ) : [ ] , #NEWLINE# ( 1 , 49 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 50 ) : [ ] , #NEWLINE# ( 1 , 59 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 60 ) : [ ] , #NEWLINE# ( 1 , 69 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 70 ) : [ ] , #NEWLINE# ( 1 , 79 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 80 ) : [ ] , #NEWLINE# ( 1 , 89 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 90 ) : [ ] , #NEWLINE# ( 1 , 99 ) : [ 'save head' , 'save budget' , 'print budget' ] , #NEWLINE# ( 1 , 100 ) : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# oc = flopy . modflow . ModflowOc ( ml , stress_period_data = stress_period_data ) #NEWLINE# ml . write_input ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not os . path . exists ( cf_pths [ idx ] ) ) : #NEWLINE# #INDENT# os . makedirs ( cf_pths [ idx ] ) #NEWLINE# #UNINDENT# filelist = [ f for f in os . listdir ( cf_pths [ 0 ] ) ] #NEWLINE# sys . stdout . write ( 'copying files from {} to {}\n' . format ( cf_pths [ 0 ] , cf_pths [ idx ] ) ) #NEWLINE# for f in filelist : #NEWLINE# #INDENT# if ( os . path . splitext ( f ) [ 1 ] . lower ( ) in exclude ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# src = os . path . join ( cf_pths [ 0 ] , f ) #NEWLINE# dst = os . path . join ( cf_pths [ idx ] , f ) #NEWLINE# shutil . copyfile ( src , dst ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( ml , cf_pths )