diff --git a/lib/python/wrf4g/utils/namelist.py b/lib/python/wrf4g/utils/namelist.py index 9c8ffe7a..0914c22c 100644 --- a/lib/python/wrf4g/utils/namelist.py +++ b/lib/python/wrf4g/utils/namelist.py @@ -58,9 +58,11 @@ def get_latlon_dx(start_date, dom): file_name = "met_em.%s.%s.nc" % ( dom, datetime2datewrf( start_date ) ) if exists( file_name ) : dxfile = file_name - file_name = "wrfinput_%s" % dom - if exists( file_name ) : + logging.info("Reading dx from %s" % file_name) + else: + file_name = "wrfinput_%s" % dom dxfile = file_name + logging.info("Reading dx from %s" % file_name) if dxfile: shcmd = "ncdump -h %s | grep 'DX =' | sed -e 's/^\t//' | tr '=;' ' ' | awk '{printf \"%%f\", $2}'" % dxfile rval = round(float(os.popen(shcmd).read().strip()), 4) diff --git a/lib/python/wrf4g/wrapper.py b/lib/python/wrf4g/wrapper.py index 73850913..c245295d 100644 --- a/lib/python/wrf4g/wrapper.py +++ b/lib/python/wrf4g/wrapper.py @@ -690,7 +690,7 @@ def launch_wrapper( params ): except : raise JobError( "'namelist.wps' has not copied", Job.CodeError.COPY_FILE ) job_db.set_job_status( Job.Status.DOWN_WPS ) - pattern = "wrf[lbif]*_d\d\d_" + datetime2dateiso( sdate ) + "*" + pattern = "wrf[lbif]*_d\d\d_" + datetime2dateiso( params.chunk_sdate ) + "*" for file_name in VCPURL( params.real_rea_output_path ).ls( pattern ): orig = join( params.real_rea_output_path, file_name ) # From wrflowinp_d08_ we remove the _ at the end @@ -700,6 +700,8 @@ def launch_wrapper( params ): copy_file( orig, dest ) except : raise JobError( "'%s' has not copied" % file_name, Job.CodeError.COPY_REAL_FILE ) + # Change the directory to wrf run path + os.chdir( params.wrf_run_path ) wps2wrf( params.namelist_wps, params.namelist_input, params.chunk_rdate, params.chunk_edate, params.max_dom, chunk_rerun, params.timestep_dxfactor) except :