Next: allocate Up: Allocation of the fields Previous: openfile Contents

### readinput

This subroutine reads the input and stores it in field inpc. Before storing, the following actions are performed:

- the blanks are deleted
- all characters are changed to uppercase except file names
- the comment lines are not stored
- the include statements are expanded

Furthermore, the number of sets are counted and stored in nset_, the number of lines in inpc are stored in nline. The variable nset_ is used for subsequent allocation purposes. Finally, the order in which inpc is to be read is stored in the fields ipoinp and inp. Indeed, some keyword cards cannot be interpreted before others were read, e.g. a material reference in a *SOLID SECTION card cannot be interpreted before the material definition in the *MATERIAl card was read. The order in which keyword cards must be read is defined in field nameref in subroutine keystart.f. Right now, it reads:

1. *RESTART,READ
2. *NODE
3. *ELEMENT
4. *NSET
5. *ELSET
6. *TRANSFORM
7. *MATERIAL
8. *ORIENTATION
9. *SURFACE
10. *TIE
11. *SURFACE INTERACTION
12. *INITIAL CONDITIONS
13. *AMPLITUDE
14. *CONTACTPAIR
15. everything else

This means that *RESTART,READ has to be read before all other cards, then comes *NODE etc. The way inpc is to be read is stored in the fields ipoinp, inp and ipoinpc. The two-dimensional field ipoinp consists of 2 columns and nentries rows, where nentries is the number of keyword cards listed in the list above, i.e. right now nentries=15. The first column of row i in field ipoinp contains a row number of field inp, for instance j1. Then, the first column of row j1 in field inp contains the line number where reading for keyword i should start, the second column contains the line number where reading should end and the third column contains the line number in field inp where the reading information for keyword i continues, else it is zero. If it is zero the corresponding row number in inp is stored in the second column of row i in field ipoinp. Lines are stored consecutively in field inpc (without blanks and without comment lines). Line l1 starts at ipoinpc(l1-1)+1 (first character) and ends at ipoinpc(l1) (last character). Notice that ipoinpc(0)=0. This structure uniquely specifies in what order field inpc must be read. This is also illustrated in Figure 134

Figure 134: Reading the lines for keyword entry i

If you want to add keywords in the above list you have to

- update nentries in the parameter statement in the FORTRAN subroutines allocation.f, calinput.f, keystart.f, getnewline.f and writeinput.f
- update the initialization of nentries in the C-routines ccx_2.8p2.c and readinput.c.
- update the data statement for the field nameref in the FORTRAN subroutines keystart.f and writeinput.f
- update the data statement for the field namelen in the FORTRAN subroutine keystart.f. It contains the number of characters in each keyword.
- look for the block running

            else if(strcmp1(&buff[0],"*AMPLITUDE")==0){
              FORTRAN(keystart,(&ifreeinp,ipoinp,inp,"AMPLITUDE",
                                nline,&ikey));
      			  }

  in file readinput.c, copy the block and replace AMPLITUDE by the new keyword.

Next: allocate Up: Allocation of the fields Previous: openfile Contents