File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ def copy_merra2(self):
256256def ask_catch_questions ():
257257 catch_input_shared_rst_dir = ''
258258 def has_rs_rc_out (path ):
259+ path = os .path .abspath (os .path .expanduser (path ))
259260 if os .path .exists (path ):
260261 dirs = os .listdir (path )
261262 if 'rs' in dirs and 'rc_out' in dirs :
@@ -391,6 +392,7 @@ def has_catch_rst(text):
391392 dd = answers ['input:shared:yyyymmddhh' ][6 :8 ]
392393 hh = answers ['input:shared:yyyymmddhh' ][8 :10 ]
393394
395+ answers ['input:shared:rst_dir' ] = os .path .abspath (os .path .expanduser (answers ['input:shared:rst_dir' ]))
394396 rst_dir = answers ['input:shared:rst_dir' ]+ '/rs/ens0000/Y' + yyyy + '/M' + mm + '/'
395397 rst_file = glob .glob (rst_dir + '*catch*_internal_rst.' + yyyy + mm + dd + '_' + hh + '00' )[0 ]
396398 idx1 = rst_file .find ('catch' )
@@ -411,7 +413,7 @@ def has_catch_rst(text):
411413 answers ['output:surface:remap_catch' ] = True
412414 bc_base = answers ['output:shared:bc_base' ].split (": " )[- 1 ]
413415 answers ['output:shared:bc_base' ] = bc_base
414- answers ['output:shared:out_dir' ] = os .path .abspath (answers ['output:shared:out_dir' ])
416+ answers ['output:shared:out_dir' ] = os .path .abspath (os . path . expanduser ( answers ['output:shared:out_dir' ]) )
415417
416418 if answers ['output:surface:EASE_grid' ] == 'Cubed-Sphere' :
417419 remove_ogrid_comment (answers , 'OUT' )
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ def get_answers_from_command_line(cml):
9494 answers ["input:shared:MERRA-2" ] = cml .merra2
9595 answers ["input:shared:GEOS-IT" ] = cml .geosit
9696 answers ["input:shared:yyyymmddhh" ] = cml .ymdh
97- answers ["output:shared:out_dir" ] = os .path .abspath (cml .out_dir + '/' )
97+ answers ["output:shared:out_dir" ] = os .path .abspath (os . path . expanduser ( cml .out_dir ) )
9898 if cml .merra2 :
9999 init_merra2 (answers )
100100 elif cml .geosit :
@@ -105,7 +105,7 @@ def get_answers_from_command_line(cml):
105105 answers ["input:shared:bc_version" ] = cml .bcvin
106106 answers ["input:surface:catch_model" ]= cml .catch_model
107107 answers ["input:shared:stretch" ] = cml .in_stretch
108- answers ["input:shared:rst_dir" ] = os .path .abspath (cml .rst_dir + '/' )
108+ answers ["input:shared:rst_dir" ] = os .path .abspath (os . path . expanduser ( cml .rst_dir ) )
109109 fvcore_info (answers )
110110 ogrid = cml .oceanin
111111 if ogrid == "CS" :
Original file line number Diff line number Diff line change @@ -456,8 +456,8 @@ def ask_questions():
456456 },
457457 ]
458458 answers = questionary .prompt (questions )
459- answers ['input:shared:rst_dir' ] = os .path .abspath (answers ['input:shared:rst_dir' ])
460- answers ['output:shared:out_dir' ] = os .path .abspath (answers ['output:shared:out_dir' ])
459+ answers ['input:shared:rst_dir' ] = os .path .abspath (os . path . expanduser ( answers ['input:shared:rst_dir' ]) )
460+ answers ['output:shared:out_dir' ] = os .path .abspath (os . path . expanduser ( answers ['output:shared:out_dir' ]) )
461461
462462 if answers .get ('input:air:nlevel' ) : del answers ['input:air:nlevel' ]
463463 if answers ["output:surface:remap" ] and not answers ["input:shared:MERRA-2" ] and not answers ["input:shared:GEOS-IT" ]:
You can’t perform that action at this time.
0 commit comments