Error running PEST protocol with model generated by Fortran executable

Hey everyone,

I'm trying to use the iTOUGH2 PEST protocol to calculate coefficients of a constitutive model relating the viscosity of a sodium nitrate brine with mass fraction and temperature.  Using the samplePEST setup as a template, I put together an executable using Fortran source code (viscosity.f) and set up the input files to estimate the coefficients of this model with iTOUGH2.  When I run the model directly using the >>> FORWARD command, it seems to work fine.  But as soon as I attempt to calculate the Jacobian for a single regression iteration, the program terminates and generates the following message in the main output file:

***** WARNING ***** System call "./viscosity < viscosity.in > viscosity.out" returned with error code 2.

Could I get Stefan Finsterle or someone else to help me figure out what's causing my problem?  I've attached all of the files I generated in a .zip file.  Once you download them onto your machine, you can run iTOUGH using the command "itough2 -pest viscosityi &".  Depending on your OS, you may need to regenerate the executable and name it accordingly in the iTOUGH2 input file.  The version I've attached was set up for a Unix environment.


- Mikey

2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Mikey,

    It seems it does not like the name "viscosity" as the executable name (because it is the same name as the directory?). It copies it, but has no executable permission.

    Two ways to solve it:

    (1) Rename the executable "viscosity.exe" (of course you need to change the file name after the command COPY: and in EXECUTABLE: accordingly).

    (2) Change the executable to:

             >>>> EXECUTABLE: 'chmod a+x viscosity; ./viscosity < viscosity.in > viscosity.out'


    Hope this works for you as well.



  • Thanks Stefan!  It turns out the issue I had, in addition to what you pointed out, was with the OS and iTOUGH2 executable I had built in our cluster.  I tried building it in a common directory for multiple folks to access it, rather than in my home directory.  I tried it again with a Linux partition on my computer running Ubuntu 18.04 LTS, where I had installed itough2 on my home directory, and it worked perfectly fine.  For good measure, I also employed your fix (1). 

Like Follow
  • 2 yrs agoLast active
  • 2Replies
  • 26Views
  • 2 Following