Skip to content

Run a simulation? #1

@matthiasdemuzere

Description

@matthiasdemuzere

I have been going through the Docs, and I am now at point 2. Run a simulation.

In there, a run-case is defined as follows, after initialization:

from pyclmuapp import usp_clmu

# initialize
usp = usp_clmu() # will create a temporary working directory workdir
# can use pwd to specify the working directory
#, e.g. usp_clmu(pwd="/path/to/working/directory"), default is the current working directory


usp_res = usp.run(
            case_name = "usp_spinup",
            SURF="surfdata.nc",
            FORCING="forcing.nc",
            RUN_STARTDATE = "2002-01-01", # the start date of the simulation, must include in the forcing file time range
            STOP_OPTION = "nyears", # can be 'ndays', 'nmonths', 'nyears', 'nsteps'; nsteps means 1800s
            STOP_N = "10", # run for 10 years
            #RUN_TYPE= "coldstart", # coldstart is the default option
        )

Some observations:

  • upon initialization, surfdata.nc is automatically copied into /workdir/inputfolder/usp. That works. But, would it not be interesting to do the same for forcing.nc, from the example data?
  • Now, I provided absolute paths to where these files live on my system. When I run this, I get an error:

Traceback (most recent call last):
File "/snap/pycharm-community/510/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "", line 1, in
File "/home/matthias/pyvens/pyclmuapp/lib/python3.12/site-packages/pyclmuapp/usp.py", line 549, in run
for filename in os.listdir(op_path):
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/SSD2TB/scripts/b-kode/pyclmuapp/workdir/outputfolder/lnd/hist'

from op_path here, output_path exists, but not subfolders 'lnd', 'hist'? So probably this should be fixed?

After creating those manually, I can execute the usp_res = usp.run(...) block.

But then

>>> usp_res
[]

results in an empty list?

FYI, I also tried the Optional run way, but also there usp_res just results in an ampty list?

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions