erdc / RAPIDpy

RAPIDpy is a python interface for RAPID that assists to prepare inputs, runs the RAPID program, and provides post-processing utilities.
BSD 3-Clause "New" or "Revised" License
23 stars 26 forks source link

Set generate_initialization_file=True in run_lsm_rapid_process method but nothing generates #14

Closed jlgutenson closed 7 years ago

jlgutenson commented 7 years ago

I was running a set of FLDAS land surface model outputs for several HydroSHEDS drainage basins using the run_lsm_rapid_process method.

After completing several RAPID runs, one of the initializations file was not generated by the code. This leads to the namelist pointing to the previously processed watershed and an error interrupting processing.

snowman2 commented 7 years ago

@jlgutenson, can you share the function you were running so I can check the inputs?

jlgutenson commented 7 years ago

@snowman2 Sure, here you go. See below for GLDAS data example.

run rapid for each HydroSHED

run_lsm_rapid_process(
    rapid_executable_location='/var/lib/rapid/src/rapid',
    rapid_io_files_location='/home/user/rapid-io',
    lsm_data_location='/home/user/GLDAS_NOAH10_3H.2.0',
    simulation_start_datetime=datetime(2001, 1, 2),
    simulation_end_datetime=datetime(2001, 1, 31),
    generate_initialization_file=True,
    file_datetime_re_pattern = r'\d{8}\.\d{2}',
    file_datetime_pattern = "%Y%m%d.%H",
    convert_one_hour_to_three=False
)  
snowman2 commented 7 years ago

Did you look in the input or output folder?

It should be in the input folder. https://github.com/erdc-cm/RAPIDpy/blob/a4764eb81659074efe7399d136538f1df6d30098/RAPIDpy/inflow/lsm_rapid_process.py#L836-L840

jlgutenson commented 7 years ago

Yes, it seems to work for a segment of the watersheds I am providing RAPID but fails at other instances. See the output regarding the error.

nohup.txt

snowman2 commented 7 years ago

I noticed that the model is attempting to run from an initial flow file. Very odd... Not sure how that is happening unless the rapid_namelist file is not being removed. Can you try running the model after deleting the rapid_namelist file and any qinit files?

snowman2 commented 7 years ago

@jlgutenson, you are correct. I will try to work in a fix for this before the next release.

snowman2 commented 7 years ago

@jlgutenson, try the latest. It should be fixed, but if not, let me know. Thanks!