-
Notifications
You must be signed in to change notification settings - Fork 2
/
rundiv.linux.debug
929 lines (815 loc) · 22.7 KB
/
rundiv.linux.debug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
#!/bin/ksh
echo rundiv V 6.27 : DIV Input = $1 : OUT Input = $2 : Grid = $3 : BG Data = $4 : CFD Data = $5 : DIV Data = $6
if [ $# -lt 3 ]
then
echo "usage: $0 <DIV input file> <OUT input file> <geometry file name> <fluid plasma filename extention - optional> <CFD solution - optional> <DIVIMP solution - optional>"
echo "Use the word none as the argument for uneeded options"
exit 1
fi
#
# Set Run-time environment variables
#
# These should be all that require changing for most installations
#
#-------------------------------------
#
export CASENAME=$1
export XLFRTEOPTS=namelist=old
export ADASCENT=$HOME/adas
#
VER=pgi
#
#
# If this script is run from the root of the code directory then
# the line assigning PROGDIR will pick up the correct local path - otherwise
# PROGDIR should be set to the local installation directory. The
# default is divimp since the alternate is only really useful when
# working with multiple versions of the code
#
#PROGDIR=`basename \`pwd\``
#
# Note: progdir should point to where ever the local installation is without
# $HOME ...
#
# e.g. divimp = /home/<user>/divimp
# merge/garching-merge = /home/<user>/merge/garching-merge
# ...
#
#
PROGDIR=divimp
#
RUNROOT=$HOME/$PROGDIR
EXEROOT=$HOME/$PROGDIR
DATAROOT=$HOME/$PROGDIR
#
# Loctions of the various DIVIMP files
#
# DIVRUNDIR - Directory where DIVIMP will run - must have read/write access
# DIVDATDIR - Directory containing the input data files
# DIVRESDIR - Directory where the results from the case will be stored
#
# DIVMAINDIR- Main DIVIMP directory containing the source code tree
# DIVEXEDIR - Directory containing the DIVIMP executable
# DIVOUTDIR - Directory containing the OUT excutable
# PINEXEDIR - Directory containing the PIN executable
# EIREXEDIR - Directory containing the EIRENE executable
#
# EQUDIR - Directory containg the equilibrium, background plasma and pump files
#
# DIVEXE - DIVIMP executable
# OUTEXE - OUT executable
# PINEXE - PIN executable
# EIREXE - EIRENE executable
#
export DIVRUNDIR=$RUNROOT/cases
export DIVDATDIR=$RUNROOT/data
export DIVRESDIR=$RUNROOT/results
#
export DIVMAINDIR=$EXEROOT
export DIVEXEDIR=$EXEROOT/div6
export OUTEXEDIR=$EXEROOT/out6
export PINEXEDIR=$EXEROOT/pin6
export PIN5EXEDIR=$EXEROOT/pin5
export EIREXEDIR=$EXEROOT/eirene
export EIREXE99DIR=$EXEROOT/eirene99
export EQUDIR=$DATAROOT/shots
#
export DIVEXE=$DIVEXEDIR/div6dbg$VER
export OUTEXE=$OUTEXEDIR/out6O$VER
export PINEXE=$PINEXEDIR/pin6O
export PIN5EXE=$PIN5EXEDIR/pin5O
export EIREXE=$EIREXEDIR/Sources/eirene
export EIREXE99=$EIREXE99DIR/eirene
#
# jdemod - the following variables are relevant to some of the
# EIRENE07 run scripts
#
# add eirene07 directory
export EIRDIR=$EXEROOT/eirene07
#
#
# Setup DIVHOME for the Eirene07 run script
# - this is also needed for data loading code in DIVIMP so it can
# find the data directories
# - NOTE: when Steve's run scripts are updated to allow different
# users to access common code then the code in hc_lddta.f90 will
# need to be changed to access the EXEROOT and not RUNROOT ... however
# at the present time DIVHOME is the only environment variable with
# a common meaning between these scripts and Steve's versions
# - code has been modified to use DIVMAINDIR if available then DIVHOME
#
export DIVHOME=$RUNROOT
# Location of graphics library used by EIRENE:
export GLI_HOME=$DIVHOME/libsrc
# Set local directories:
export RUNDIR=$RUNROOT
export BATDIR=$EXEROOT/scripts
export EXEDIR=$DIVRUNDIR/$CASENAME
export DATDIR=$DIVDATDIR
export OUTDIR=$OUTEXEDIR
#
#-------------------------------------
#
#
# Change to execution directory
#
cd $DIVRUNDIR
#
# Remove specific directory for the case if it already exists
#
if [[ -e $CASENAME ]] then
echo "Deleting old case directory:" $DIVRUNDIR/$CASENAME
rm -rf $CASENAME
fi
#
# Create case directory and change to it
#
mkdir $CASENAME
cd $CASENAME
#
# Additional setup for EIRENE07 and supplemental programs
#
#
# Copy in triangle meshing program ... this is compiled separately and
# the executable is expected in the divimp bin directory
#
cp $DIVMAINDIR/bin/triangle triangle
#
# Set the name of the Eirene07 input file template
#
EIRFILE=eirene07.dat
#
# Copy in the Eirene07 template and the executable file
# - this will be used by the runeire07 script
#
cp $EIRDIR/$EIRFILE eirene.template
cp $EIRDIR/eirene $EXEDIR/eirene07
#
# Copy scripts to the execution directory from the scripts directory.
# CPC is a copy script with a couple of checks added - found in the scripts
# directory
#
# jdemod - I moved the runeire99 and runpin scripts into the scripts directory to
# be consistent. Note: many of these scripts do not actually exist - the
# cpc script only copies them if they exist ... only runpin, runeire99,
# runeire06 and runeire07 are in the repository.
#
cpc $GLI_HOME/gksfont.dat .
cpc $BATDIR/runeire99 reire99
cpc $BATDIR/runeire02 reire02
cpc $BATDIR/runeire04 reire04
cpc $BATDIR/runeire06 reire06
cpc $BATDIR/runeire06.64 reire06.64
cpc $BATDIR/runeire07 reire07
#
# Old Nimbus script support
#
cpc $BATDIR/runpin rpindiv
#
# jdemod - old script copy code - deprecated
#
# These are the scripts that will run the apprpriate hydrogenic
# neutral code depending on the type of grid. PIN/NIMBUS or EIRENE.
#
#
#cp $DIVMAINDIR/runpin rpindiv
#cp $DIVMAINDIR/runpin5 rpindiv5
#cp $DIVMAINDIR/runeire reirediv
#cp $DIVMAINDIR/runeire99 reire99
#cp $DIVMAINDIR/scripts/runeire07 reire07
#
#
# Original AMJUEL Links for eirene99 - replaced by below
#
# Link to EIRENE AMJUEL data files (SL)
#
# ln -s "$EIREXE99DIR/a+m/HYDHEL" .
# ln -s "$EIREXE99DIR/a+m/SPUTER" .
# ln -s "$EIREXE99DIR/a+m/AMJUEL.TEX" AMJUEL
# ln -s "$EIREXE99DIR/a+m/H2VIBR.TEX" H2VIBR
# ln -s "$EIREXE99DIR/a+m/METHANE" .
#
#
# Eirene07 uses the data files from the Eirene04 tree. However, all versions of Eirene except 07 are not supported. At some point we
# should clean this up.
#
# Try this for now - may need to flag this file for differetiating 99 from 07 - or move the linkage to the EIRENE run scripts assuming divimp doesn't use them
#
ln -sf $EIRDIR/Eirene_04/Database/Surfacedata/SPUTER SPUTER
ln -sf $EIRDIR/Eirene_04/Database/AMdata/amjuel.tex AMJUEL
ln -sf $EIRDIR/Eirene_04/Database/AMdata/hydhel.tex HYDHEL
ln -sf $EIRDIR/Eirene_04/Database/AMdata/h2vibr.tex H2VIBR
ln -sf $EIRDIR/Eirene_04/Database/AMdata/methane.tex METHANE
ln -sf $EIRDIR/Eirene_04/Database/Surfacedata/TRIM
#
# Unit 4 is the equilibrium input file
# Unit 13 is the xy grid file (if available)
# Unit 14 is the DIVIMP input file - assigned to unit 14 for NIMBUS purposes
# - now connected in the runpin script
#
if [[ -f $EQUDIR/$3 ]] then
ln -s $EQUDIR/$3 $DIVRUNDIR/$CASENAME/fort.4
else
echo "Grid file " $EQUDIR/$3 " does not exist."
echo "Abnormal Script Termination - Script Exiting"
# remove case execution directory
cd $DIVRUNDIR
rm -rf $CASENAME
exit 1
fi
#
# copy grid.dat file if it exists
#
if [[ -f $EQUDIR/$3.dat ]] then
cp -a $EQUDIR/$3.dat $DIVRUNDIR/$CASENAME/grid.dat
fi
#
# Info file for Eirene option related print outs
#
if [[ -f $EQUDIR/info.dat ]] then
ln -s $EQUDIR/info.dat $DIVRUNDIR/$CASENAME/info.dat
fi
#
# JET hybrid wall data file
#
if [[ -f $EQUDIR/hybrid.dat ]] then
ln -s $EQUDIR/hybrid.dat $DIVRUNDIR/$CASENAME/fort.28
#else
# echo "JET hybrid wall data file not found."
fi
#
# CFD OSM files
#
if [[ -f $DIVRESDIR/$5.cfd.gz ]] then
gunzip $DIVRESDIR/$5.cfd.gz
fi
#
if [[ -f $DIVRESDIR/$5.cfd ]] then
echo "Linking ..." $DIVRESDIR/$5.cfd
ln -s $DIVRESDIR/$5.cfd $DIVRUNDIR/$CASENAME/fort.74
fi
#
# Other files that are not usually used.
#
# cp $EQUDIR/$3.grd $DIVRUNDIR/$CASENAME/fort.13
# cp $EQUDIR/$3.dat $DIVRUNDIR/$CASENAME/fort.12
# cp $EQUDIR/$3.prn $DIVRUNDIR/$CASENAME/fort.10
#
# divimp_plasma.dat is a background plasma solution - if required.
#
if [[ -f $DIVRESDIR/$6.bgp ]] then
echo "Linking ..." $DIVRESDIR/$6.bgp
ln -s $DIVRESDIR/$6.bgp $DIVRUNDIR/$CASENAME/divimp_plasma.dat
fi
#
# divimp_aux_data.dat contains various data from a previous DIVIMP run
#
if [[ -f $DIVRESDIR/$6.auxdata ]] then
echo "Linking ..." $DIVRESDIR/$6.auxdata
ln -s $DIVRESDIR/$6.auxdata $DIVRUNDIR/$CASENAME/divimp_aux_data.dat
fi
#
# A fluid plasma solution is linked to fort.11 - if one is available.
#
if [[ -n $4 ]] then
if [[ -f $EQUDIR/$4 ]] then
ln -s $EQUDIR/$4 $DIVRUNDIR/$CASENAME/fort.11
else
if [[ -f $EQUDIR/$3.$4 ]] then
ln -s $EQUDIR/$3.$4 $DIVRUNDIR/$CASENAME/fort.11
else
if [[ -f $EQUDIR/$3.g80 ]] then
ln -s $EQUDIR/$3.g80 $DIVRUNDIR/$CASENAME/fort.11
fi
fi
fi
else
if [[ -f $EQUDIR/$3.g80 ]] then
ln -s $EQUDIR/$3.g80 $DIVRUNDIR/$CASENAME/fort.11
fi
fi
#
# Unit 12 is an auxiliary file for the background plasma solution - if required.
#
if [[ -n $4 ]] then
if [[ -f $EQUDIR/$4.aux ]] then
ln -s $EQUDIR/$4.aux $DIVRUNDIR/$CASENAME/fort.12
else
if [[ -f $EQUDIR/$3.$4.aux ]] then
ln -s $EQUDIR/$3.$4.aux $DIVRUNDIR/$CASENAME/fort.12
else
if [[ -f $EQUDIR/$3.aux ]] then
ln -s $EQUDIR/$3.aux $DIVRUNDIR/$CASENAME/fort.12
fi
fi
fi
else
if [[ -f $EQUDIR/$3.aux ]] then
ln -s $EQUDIR/$3.aux $DIVRUNDIR/$CASENAME/fort.12
fi
fi
#
# Unit 13 contains experimental data for the case - if available.
#
if [[ -n $4 ]] then
if [[ -f $EQUDIR/$4.experiment ]] then
ln -s $EQUDIR/$4.experiment $DIVRUNDIR/$CASENAME/fort.13
else
if [[ -f $EQUDIR/$3.$4.experiment ]] then
ln -s $EQUDIR/$3.$4.experiment $DIVRUNDIR/$CASENAME/fort.13
else
if [[ -f $EQUDIR/$3.experiment ]] then
ln -s $EQUDIR/$3.experiment $DIVRUNDIR/$CASENAME/fort.13
fi
fi
fi
else
if [[ -f $EQUDIR/$3.experiment ]] then
ln -s $EQUDIR/$3.experiment $DIVRUNDIR/$CASENAME/fort.13
fi
fi
#
# If an external flux file is available for the shot it will
# be linked to the "ext_flux.dat" file.
#
#
if [[ -n $4 ]] then
if [[ -f $EQUDIR/$4.extflx ]] then
ln -s $EQUDIR/$4.extflx $DIVRUNDIR/$CASENAME/ext_flux.dat
else
if [[ -f $EQUDIR/$3.$4.extflx ]] then
ln -s $EQUDIR/$3.$4.extflx $DIVRUNDIR/$CASENAME/ext_flux.dat
else
if [[ -f $EQUDIR/$3.extflx ]] then
ln -s $EQUDIR/$3.extflx $DIVRUNDIR/$CASENAME/ext_flux.dat
fi
fi
fi
else
if [[ -f $EQUDIR/$3.extflx ]] then
ln -s $EQUDIR/$3.extflx $DIVRUNDIR/$CASENAME/ext_flux.dat
fi
fi
#
# Link to the toroidal camera inversion data (SL)
#
if [[ -f $EQUDIR/$3.camera ]] then
ln -s $EQUDIR/$3.camera $DIVRUNDIR/$CASENAME/camera.dat
fi
#
#
# Execute DIVIMP
#
# Unit 7 is the text output from DIVIMP
# Unit 9 is an echo of the DIVIMP input
# Unit 17 is the passing file from DIVIMP to PIN
# Unit 19 is the temporary file used to record PIN iteration information
# Unit 21 is the print file from the CALCSOL option
# Unit 22 is the HTML version of the .dat file
# Unit 23 is a temporary file used to store HTML as the code runs
# Unit 25 is a diagnostic print file of grid information
# Unit 26 is used by OUT to print the numerics for plots
# Unit 27 is another grid print file
# Unit 41 is the TRAN file output for JET post-processors
# Unit 50 is a diagnostic file from the Theta routines and Steve's code
# Unit 88 is a SOL22 (and other stuff) diagnostic file
#
# Link DIVIMP input data file - so name can be extracted.
#
if [[ -f $DIVDATDIR/$CASENAME.d6i ]] then
ln -s $DIVDATDIR/$CASENAME.d6i fort.5
else
echo "DIVIMP Input file " $DIVDATDIR/$CASENAME.d6i " does not exist."
echo "Abnormal Script Termination - Script Exiting"
cd ..
rm -rf $CASENAME
exit 1
fi
#
# Copy EIRENE input file template:
#
#if [[ -f $EIREXEDIR/$CASENAME.dat ]] then
# ln -s $EIREXEDIR/$CASENAME.dat $DIVRUNDIR/$CASENAME/fort.80
#else
# ln -s $EIREXEDIR/eirene98.dat $DIVRUNDIR/$CASENAME/fort.80
#fi
#
if [[ -f $EIREXE99DIR/$CASENAME.dat ]] then
ln -s $EIREXE99DIR/$CASENAME.dat $DIVRUNDIR/$CASENAME/fort.80
else
ln -s $EIREXE99DIR/eirene99.dat $DIVRUNDIR/$CASENAME/fort.80
fi
#
# Copy in DIVEXE
#
cp $DIVEXE .
#
#
# Copy in the source code
#
cp $RUNROOT/div6/src/*.f .
cp $RUNROOT/div6/src/f90/*.f90 .
cp $RUNROOT/comsrc/*.f .
cp $RUNROOT/comsrc/f90/*.f90 .
cp $RUNROOT/commons/* .
cp $RUNROOT/comsrc/*.c .
#
# Run DIVIMP - Use optimized version.
#
echo Starting DIVIMP ...Debug
#
#
# Run the local copy of the executable from the debugger
#
# Inside the debugger issue the command run < fort.5 to execute
#
pgdbg div6dbg$VER
#
#$DIVEXE < fort.5 > divout1
#
echo DIVIMP Finished.
#
if [[ -n $PINCASE ]] then
echo "PIN/NIMBUS case: " $PINCASE
fi
# Save SOL22 plot file
mvc POSTSCPT.LIS $CASENAME.sol22.ps
# .lim Debugging file
mvc divout1 $CASENAME.lim
# .dat case output file
mvc fort.7 $CASENAME.dat
# .html case output file
mvc fort.22 $CASENAME.html
# .inp input echo file + other information
mvc fort.9 $CASENAME.inp
# PIN input plasma file
mvc fort.17 $CASENAME.pin
# Additional information from SOL option 22.
mvc fort.21 $CASENAME.sol22
# Print-out from PIN
mvc fort.24 $CASENAME.pinprn
# TRAN file for JET postprocessors
mvc fort.41 $CASENAME.tran
# Diagnostic information from THETA module (among others)
mvc fort.50 $CASENAME.theta
# Print out for Kevin Erents
mvc fort.56 $CASENAME.probe
# Additional information from SOL option 23.
mvc fort.71 $CASENAME.sol23
# Excel print information from sol23
mvc fort.73 $CASENAME.exl23
# CFD solution file
mvc fort.75 $CASENAME.cfd
# DIVIMP format background plasma file - if writing one has been requested.
mvc divimp_plasma.out $CASENAME.bgp
# Additional DIVIMP data file - output in a standardized tagged format.
mvc divimp_aux_data.out $CASENAME.auxdata
# Core file in case DIVIMP crashed
mvc core $CASENAME.core
#
# mv fort.25 $DIVRESDIR/$CASENAME.lst.grd
# mv fort.27 $DIVRESDIR/$CASENAME.cell.grd
#
# Convert the DIVIMP output data file to postscript.
#
a2ps $CASENAME.dat --output=$CASENAME.ps
#
# a2ps -nn $DIVRESDIR/$CASENAME.sol > $DIVRESDIR/$CASENAME.sol.ps
# mv POSTSCPT.LIS $DIVRESDIR/$CASENAME.sol.psg
#
#------------------------------------------------------------
#
# Execute OUT
#
echo Starting OUTput processing ...
#
if [[ -f fort.8 ]] then
$OUTEXE < $DIVDATDIR/$2.d6o > outout1
else
echo "RAW Data file was not created by DIVIMP. OUT will not be run."
fi
#
echo OUTput processing complete.
#
# Copy or move results of OUT run.
#
# .out - OUT debugging file
mvc outout1 $CASENAME.out
# .raw complete results file
mvc fort.8 $CASENAME.raw
# Erosion/Deposition print out
mvc fort.57 $CASENAME.deposition
# AUG file
mvc fort.59 $CASENAME.augdiv
# .dag OUT output file
mvc fort.7 $CASENAME.dag
# .psg - Postscript plots - create pdf too
if [[ -f POSTSCPT.LIS ]] then
ps2pdf POSTSCPT.LIS $CASENAME.pdf
mvc POSTSCPT.LIS $CASENAME.psg
fi
# .ing - Echo of input to graphing routines
mvc fort.9 $CASENAME.ing
# Special printed listing of some plot information.
mvc fort.26 $CASENAME.grp
# Special printed listing of some plot information.
mvc fort.49 $CASENAME.plt
#
# Save HC output files
#
# HC alerts
mvc hc_alert.txt $CASENAME.hc_alert
# HC particle tracking stats
mvc hc_cpos_stat.txt $CASENAME.hc_cpos_stat
# HC general output
mvc hc_output.txt $CASENAME.hc_output
# HC scratch
mvc hc_scratch.txt $CASENAME.hc_scratch
# HC temp file
mvc temphc.txt $CASENAME.temphc
#
# EIRENE related output:
#
# Eirene dat file
mvc fort.81 $CASENAME.eirdat
# Eirene particle tracks (?)
mvc eirtrac $CASENAME.eirtrc
# Out debug file (?) ... a fort.50 from divimp has already been moved - this one could be out
mvc fort.50 $CASENAME.out.debug
#
# Move image files if any ...
#
if [[ -f $CASENAME_image01.jpg ]] then
mv *image*.jpg $DIVRESDIR
fi
#
# jdemod - these are the old copy commands - saved until script is verified in use
#
#
# Supplementary .raw files (SL)
#
#if [[ -f plasma.dat ]] then
# mv plasma.dat $DIVRESDIR/$CASENAME.raw.pla
#fi
#if [[ -f source.dat ]] then
# mv source.dat $DIVRESDIR/$CASENAME.raw.src
#fi
#if [[ -f geomty.dat ]] then
# mv geomty.dat $DIVRESDIR/$CASENAME.raw.geo
#fi
#
# Some additional files from the relax subroutine (?)
#
#if [[ -f geomty.dat ]] then
# mv geomty.dat $DIVRESDIR/$CASENAME.geomty.dat
#fi
#if [[ -f plasma.dat ]] then
# mv plasma.dat $DIVRESDIR/$CASENAME.plasma.dat
#fi
#if [[ -f source.dat ]] then
# mv source.dat $DIVRESDIR/$CASENAME.source.dat
#fi
#
#if [[ -f addsur.dat ]] then
# mv addsur.dat $DIVRESDIR/$CASENAME.eirsur
#fi
#
#if [[ -f fort.85 ]] then
# mv fort.85 $DIVRESDIR/$CASENAME.g1
#fi
#
# Diagnostic files (SL)
#
#if [[ -f fort.88 ]] then
# mv fort.88 $DIVRESDIR/$CASENAME.src
#fi
#
#if [[ -f fort.87 ]] then
# mv fort.87 $DIVRESDIR/$CASENAME.g3
#fi
#if [[ -f fort.80 ]] then
# mv fort.80 $DIVRESDIR/$CASENAME.eirtmp
#fi
#if [[ -f fort.52 ]] then
# mv fort.52 $DIVRESDIR/$CASENAME.eirgeo
#fi
#
# Additional files that may be generated by the newer code version and EIRENE07
# The mvc scripts checks to see if the file exists before moving it - this eliminates
# some executione error messages if the case did not produce those file.
#
mvc plasma.dat $CASENAME.raw.pla
mvc source.dat $CASENAME.raw.src
mvc geomty.dat $CASENAME.raw.geo
mvc triangles.raw $CASENAME.raw.tri
mvc fort.79 $CASENAME.raw.rel
mvc vac-grid.dat $CASENAME.raw.vac
mvc jummap.dat $CASENAME.raw.jum
mvc osm.raw $CASENAME.raw.osm
mvc osm_geometry.raw $CASENAME.raw.ogd
mvc osm_legacy.raw $CASENAME.raw.old
# Process tetrahedron files:
#rename ".raw" ".raw.tet" -- tetrahedrons*.raw
#rename ".raw" ".raw.fil" -- filaments*.raw
#rename "tetrahedrons" "$CASENAME" -- tetrahedrons*.raw.tet
#rename "filaments" "$CASENAME" -- filaments*.raw.fil
#
# Move some additional files
# Note: some of these were already done (e.g. g1) but have been centralized here
# Note: moved these into numerical order to make it easier to see what is copied
#
# fort.25 - grid file echo (?)
mvc fort.25 $CASENAME.sonnet
# fort.52 - eirene geometry file
mvc fort.52 $CASENAME.eig
# (?) Eirene debug files (?)
mvc fort.65 $CASENAME.e1
mvc fort.66 $CASENAME.e2
mvc fort.67 $CASENAME.e3
# (?) Eirene debug files (?) Diagnostic files (?)
mvc fort.85 $CASENAME.g1
mvc fort.86 $CASENAME.g2
mvc fort.87 $CASENAME.g3
mvc fort.88 $CASENAME.src
# fort.90 - OSM log file
mvc fort.90 $CASENAME.osm.log
mvc dump.dat $CASENAME.dump
mvc line.dat $CASENAME.dat.line
mvc strata.dat $CASENAME.dat.strata
mvc bgk.dat $CASENAME.dat.bgk
# mvc acd.dat $CASENAME.dat.acd
mvc rec.dat $CASENAME.dat.rec
mvc addsur.dat $CASENAME.addsur
mvc triangles.dat $CASENAME.triangles
mvc triangles.npco_char $CASENAME.triangles.npco_char
mvc triangles.elemente $CASENAME.triangles.elemente
mvc triangles.neighbors $CASENAME.triangles.neighbor
mvc triangles.plasma $CASENAME.triangles.plasma
mvc triangles.efield $CASENAME.triangles.efield
mvc quadrangles.geometry $CASENAME.quadrangles.geometry
mvc quadrangles.plasma $CASENAME.quadrangles.plasma
mvc quadrangles.efield $CASENAME.quadrangles.efield
mvc objects.dat $CASENAME.triangles
mvc objects.npco_char $CASENAME.objects.npco_char
mvc objects.elemente $CASENAME.objects.elemente
mvc objects.neighbors $CASENAME.objects.neighbor
mvc objects.plasma $CASENAME.objects.plasma
mvc objects.centre $CASENAME.objects.centre
mvc objects.efield $CASENAME.objects.efield
mvc osm.idl $CASENAME.osm
mvc plasma-transfer.dat $CASENAME.rzplasma
mvc celldata.dat $CASENAME.celldata
# jdemod - comment out renames for now since the files don't seem to exist (at least in all cases)
#rename ".transfer" ".eir" -- eirene*.transfer
#rename ".input" ".eirdat" -- eirene*.input
#rename ".output" ".eirprn" -- eirene*.output
#rename "eirene" "$CASENAME" -- eirene*.eir*
mvc eirene.transfer $CASENAME.eir2
mvc eirene.input $CASENAME.eirdat2
# apparently an eirene output file
mvc eirene04.txt $CASENAME.eir04txt
# not sure what this file is ...
mvc idl.divimp_launch $CASENAME.idl_launch
# grid clipping output?
mvc output.clipping $CASENAME.clipping
# copy "core analysis" file
cpc core_analysis.dat $CASENAME.midplane.dat
#
# mvc core_analysis.dat ~/idl/lc/$CASENAME.dat
#
#
# ----------------------------------------------------------------------
# Move files for upload to the web:
#
# mvc $CASENAME.html $RESDIR/transfer
# mvc $CASENAME.pdf $RESDIR/transfer
#
# ----------------------------------------------------------------------
#
# Move all files to results directory, over-writing any previous results:
# jdemod - not sure what *.A and *.map files might be
#rm *.A
# zipc *.A
#rm *.map
# echo "Case:" $CASENAME $DIVRESDIR
#
# Move results files
# Note: jdemod - this is a critical step since all files have simply be renamed to $CASENAME so far
#
mv -f $CASENAME.* $DIVRESDIR
#
# cp fort.13 $EQUDIR/$3.grd
# a2ps -nn -p $DIVRESDIR/$CASENAME.plt > $DIVRESDIR/$CASENAME.plt.ps
#
#
# Clean-up
#
rm *.dat
rm fort.*
rm -f rpindiv
rm -f rpindiv5
rm -f reirediv
rm -f reire99
rm -f reire02
rm -f reire04
rm -f reire06
rm -f reire07
# remove eirene related files that we don't want saved
rm -f eirene07
rm -f eirene.template
# the following appears to be a binary file
rm -f eirene.13
# remove the triangle program and any remaining output
rm -f triangle*
rm -f tmp
#
rm -f HYDHEL
rm -f SPUTER
rm -f AMJUEL
rm -f H2VIBR
rm -f METHANE
rm -f TRIM
#
# Remove camera file if linked
#
if [[ -f camera.dat ]] then
rm -f camera.dat
fi
#
# Remove info.dat file if linked
#
if [[ -f info.dat ]] then
rm -f info.dat
fi
#
cd $DIVRUNDIR
rmdir $CASENAME
#-------------------------------
#
# Changing to results directory to clean up and compress
#
cd $DIVRESDIR
#
# Compress the larger output files - check for file existence
# before gziping.
#
if [[ -f $CASENAME.raw ]] then
gzip -f -v $CASENAME.raw
fi
# (SL)
if [[ -f $CASENAME.raw.src ]] then
gzip -f -v $CASENAME.raw.src
fi
if [[ -f $CASENAME.raw.pla ]] then
gzip -f -v $CASENAME.raw.pla
fi
if [[ -f $CASENAME.raw.geo ]] then
gzip -f -v $CASENAME.raw.geo
fi
if [[ -f $CASENAME.raw.rel ]] then
gzip -f -v $CASENAME.raw.rel
fi
#
if [[ -f $CASENAME.lim ]] then
gzip -f -v $CASENAME.lim
fi
#
if [[ -f $CASENAME.sol22 ]] then
gzip -f -v $CASENAME.sol22
fi
#
if [[ -f $CASENAME.sol23 ]] then
gzip -f -v $CASENAME.sol23
fi
#
if [[ -f $CASENAME.out ]] then
gzip -f -v $CASENAME.out
fi
#
if [[ -f $CASENAME.pinout ]] then
gzip -f -v $CASENAME.pinout
fi
#
if [[ -f $CASENAME.pinraw ]] then
gzip -f -v $CASENAME.pinraw
fi
#
if [[ -f $CASENAME.pinnim ]] then
gzip -f -v $CASENAME.pinnim
fi
#
if [[ -f $CASENAME.pinmc ]] then
gzip -f -v $CASENAME.pinmc
fi
#
# Print
#
# lp $CASENAME.ps
# lp $CASENAME.sol.ps
# lp $CASENAME.plt.ps
# lp $CASENAME.psg
# lp $CASENAME.sol.ps
#
# Return to base directory.
#
cd $DIVRUNDIR