1- /* Conection painting. */
1+ /* Convection painting. */
22/*
3- Copyright (C) 2004 University of Texas at Austin
3+ Copyright (C) 2025 University of Texas at Austin
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
2424int main (int argc , char * argv [])
2525{
2626 int order , n1 , n2 , n12 , i1 , i2 , i0 , nw ;
27- char * label , * unit ;
2827 float * * u , * * * conv , * trace ;
2928 float o1 , d1 , o2 , d2 , eps , * time ;
3029 sf_file cnv , out , seed ;
@@ -43,17 +42,10 @@ int main (int argc, char* argv[])
4342 n12 = n1 * n2 ;
4443
4544 if (!sf_histint (cnv ,"n2" ,& nw )) sf_error ("Need n2= in input" );
46-
47- sf_putint (out ,"n2" ,n2 );
48- sf_putfloat (out ,"d2" ,d2 );
49- sf_putfloat (out ,"o2" ,o2 );
50- if (NULL != (label = sf_histstring (cnv ,"label3" ))) sf_putstring (out ,"label2" ,label );
51- if (NULL != (unit = sf_histstring (cnv ,"unit3" ))) sf_putstring (out ,"unit2" ,unit );
52-
53- sf_putint (out ,"n3" ,1 );
54-
5545 order = nw /2 ;
5646
47+ sf_unshiftdim (cnv ,out ,2 );
48+
5749 if (NULL != sf_getstring ("seed" )) {
5850 seed = sf_input ("seed" );
5951 time = NULL ;
@@ -98,6 +90,7 @@ int main (int argc, char* argv[])
9890 u [i2 ][i1 ] = trace [i1 ];
9991 }
10092 }
93+
10194 for (i1 = 0 ; i1 < n1 ; i1 ++ ) {
10295 trace [i1 ] = u [i0 ][i1 ];
10396 }
@@ -107,6 +100,7 @@ int main (int argc, char* argv[])
107100 u [i2 ][i1 ] = trace [i1 ];
108101 }
109102 }
103+
110104 sf_floatwrite (u [0 ],n1 * n2 ,out );
111105
112106 exit (0 );
0 commit comments