[esp-r] Re: launching ESP-r in Perl or Python

David Garcia david.garcias at gmail.com
Mon Aug 2 09:22:05 BST 2010


In my case I only use perl to change the geometry attributions file (*.geo)
and the main configurations file (*.cfg)

you can do something like

code_change_geo.pl and invoke it like:

perl code_change_geo.pl $VAR1 $VAR 2 .... (the code must produce a .geo
file)

where VAR1 and VAR2 are the variables you want to change.

if you put this in a for you can generate a X quantity of .geo files, then
you can do the same for a cfg file (the main configuration file to assign
the geometry you want to esp-r)

like
perl code_change_cfg.pl $VAR1 $VAR

and in the same for you can run esp-r.

I have a bash file who do almost the same (since a lot time I didn't do that
kind of procedure) this is the for statement:

------

for  ((i=1 ;  i<=$Nnumber ;  i++))
do
printf "$i moving prueba$i.cfg... \n" ;
./change_cfg.pl prueba$i.cfg perltest$i.geo
mv prueba$i.cfg ./cfg/prueba$i.cfg
printf "$i analyzing the file prueba$i.cfg ... \n";
cd cfg/el archivo
./CHANGEGEO.wc prueba$i.cfg $VERSION $i
./ANALYSEGEO prueba$i.cfg.wc_res $VERSION $i
cd ..
done
-------

you can see that ./ANALYSEGEO I take it from esp-r cookbook example  (I just
rename it and take out the results that interest me)

Hope it helps you

regards
DGS



On Mon, Aug 2, 2010 at 6:09 AM, victor bunster <victorbunster at gmail.com>wrote:

> Hi All,
> After some tryouts, your help and lots of cookbook, the terminal is getting
> very rewarding.
> For example to generate a zone from scratch:
>
> ############## start
> #!/bin/csh -fb
> prj -mode text << key1
> e
> MODEL
> a
> description
> modelname.log
> N
> N
> 41
> -4
> 2010
> m
> c
> a
> a
> zonedescription
> whatrepresents
> a
> 0,0,0
> 5,5,5
> 0
> 0
> 0
> connectionsname.cnn
> key1
> ############ end
>
> But when trying to do the same type of procedures in Perl or Python (I need
> to write some objects) I have a couple of basic problems, for example, how
> do you start the prj -mode text by a .py or a .pl? or how do you pass the
> keyboard keys?
> My idea is to write several separated files and run them from one "parent",
> like the TEST sample.
>
> Thanks in advance,
>
> Victor Bunster
>
>
> _______________________________________________
> esp-r mailing list
> esp-r at lists.strath.ac.uk
> http://lists.strath.ac.uk/mailman/listinfo/esp-r
>



-- 
David GARCIA SANCHEZ
------------------------------------------------------------
Département Systèmes Énergétiques Environnement
Ecole des Mines de Nantes
4, Rue Alfred Kastler
44300 Nantes
France
------------------------------------------------------------
Email: david.garcia-sanchez at emn.fr
Tel: +33 (0) 2 51 85 82 14
Mobile: +33 (0) 6 78 15 08 09
Fax: +33 (0) 2 51 85 82 99
------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.strath.ac.uk/archives/esp-r/attachments/20100802/a034032b/attachment.html 


More information about the esp-r mailing list