Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Using a batch file to create NAMELIST input file for FORTRAN

  1. Nov 29, 2009 #1

    I'm trying to get a batch file put together to create a namelist input file for a fortran prog. Pretty much all I need to do is create this [short] input file and call the fortran prog several times, each time with a variable in the input file changed. I also tell the fortran prog where to dump the output. Here's what I got so far, but because i am new to batch files, I'm not sure what I'm doing wrong. Can anybody see why this wouldn't work?


    @echo off

    FOR %%tcloud IN (0 1 5) DO (
    echo ^&INPUT > INPUT
    echo tcloud=%%tcloud >> INPUT
    echo zcloud=8 >> INPUT
    echo nre=10 >> INPUT
    echo idatm=4 >> INPUT
    echo sza=95 >> INPUT
    echo wlinf=4 >> INPUT
    echo wlsup=20 >> INPUT
    echo wlinc=-.01 >> INPUT
    echo iout=1 >> INPUT
    echo / >> INPUT

    echo Data for tcloud=%%tcloud >> output.dat
    sbdart >> output.dat

  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted