
IF FSTEADY#0 THEN
	 ( FOR compv:1 THRU NK DO
           ( utzz[compv]:0,
             FOR iv:1 THRU 3 DO dutdxzz[compv,iv]:0));

IF FMINIMIZE=0 THEN

 (  FOR compv:1 THRU NK DO
      ( vzz[compv]:0,
        FOR iv:1 THRU 3 DO dvdxzz[compv,iv]:0),

    FOR class:0 THRU 3 DO
      ( FOR compv:1 THRU NK DO
         ( vzz[compv]:1,
           HF0[compv,class]:EV(IM[class]),
           vzz[compv]:0,
           FOR iv:1 THRU class DO
             ( dvdxzz[compv,iv]:1,
               HF1[compv,class,iv]:EV(IM[class]),
               dvdxzz[compv,iv]:0)        )))
ELSE  
    
  ( FOR class:0 THRU 3 DO
    ( FOR compv:1 THRU NK DO
        HF0[compv,class]:DIFF(IM[class],uzz[compv],1),
        FOR iv:1 THRU class DO
	    HF1[compv,class,iv]:DIFF(IM[class],dudxzz[compv,iv],1) ));

FOR class:0 THRU 3 DO
  ( FOR compv:1 THRU NK DO
    ( FOR compu:1 THRU NK DO
       ( HF0U[compv,compu,class]:DIFF(HF0[compv,class],uzz[compu],1),
         IF FSTEADY#0 THEN
           HF0UT[compv,compu,class]:0
         ELSE 
           HF0UT[compv,compu,class]:DIFF(HF0[compv,class],utzz[compu],1),

         FOR iu:1 THRU class DO
	   ( HF0UX[compv,compu,class,iu]:DIFF(HF0[compv,class],dudxzz[compu,iu],1),
             IF (FSTEADY#0) THEN
               HF0UTX[compv,compu,class,iu]:0
	     ELSE
               HF0UTX[compv,compu,class,iu]:DIFF(HF0[compv,class],dutdxzz[compu,iu],1)),

             FOR iv:1 THRU class DO
               ( HF1U[compv,compu,class,iv]:DIFF(HF1[compv,class,iv],uzz[compu],1),
                 IF FSTEADY#0 THEN
                   HF1UT[compv,compu,class,iv]:0
                 ELSE 
                   HF1UT[compv,compu,class,iv]:DIFF(HF1[compv,class,iv],utzz[compu],1)),

             FOR iv:1 THRU class DO
               ( FOR iu:1 THRU class DO
	           ( HF1UX[compv,compu,class,iv,iu]:DIFF(HF1[compv,class,iv],dudxzz[compu,iu],1),
                     IF  FSTEADY#0 THEN
	               HF1UTX[compv,compu,class,iv,iu]:0
                     ELSE
	               HF1UTX[compv,compu,class,iv,iu]:DIFF(HF1[compv,class,iv],dutdxzz[compu,iu],1)))
											      )));

SYM:1;
FOR class:0 THRU 3 DO
  ( FOR compv:1 THRU NK DO
      ( FOR compu:1 THRU NK DO
          ( IF EV(HF0U[compu,compv,class]-HF0U[compv,compu,class])#0 THEN SYM:0 ,
            IF EV(HF0UT[compu,compv,class]-HF0UT[compv,compu,class])#0 THEN SYM:0,
            FOR i:1 THRU class DO
	      ( IF EV(HF0UX[compv,compu,class,i]-HF1U[compu,compv,class,i])#0 THEN SYM:0 ,
                IF EV(HF0UTX[compv,compu,class,i]-HF1UT[compu,compv,class,i])#0 THEN SYM:0 ),

	    FOR iv:1 THRU class DO
              ( FOR iu:1 THRU class DO
	          ( IF EV(HF1UX[compu,compv,class,iu,iv]- HF1UX[compv,compu,class,iv,iu])#0 THEN SYM:0 ,
	            IF EV(HF1UTX[compu,compv,class,iu,iv]- HF1UTX[compv,compu,class,iv,iu])#0 THEN  SYM:0 ))
	   )));

FORTRANFILE("/tmp/vemuserb.%EXT_",TRUE);
FOR k:1 THRU NK DO
  IF DB[k]#0 THEN FORTRAN(B[k]=DB[k]);
FORTRANFILE("/tmp/vemuserb.%EXT_",FALSE);

FORTRANFILE("/tmp/vemuseru0.%EXT_",TRUE);
FOR k:1 THRU NK DO
  IF U0[k]#0 THEN FORTRAN(U0ZZ[k]=U0[k]);
FORTRANFILE("/tmp/vemuseru0.%EXT_",FALSE);

FORTRANFILE("/tmp/vemuserf.%EXT_",TRUE);
FOR class:0 THRU 3 DO
  ( FOR compv:1 THRU NK DO
      ( IF HF0[compv,class]#0 THEN FORTRAN(F0[compv,class]=HF0[compv,class]),
        FOR iv:1 THRU class DO
              IF HF1[compv,class,iv]#0 THEN FORTRAN(F1[compv,class,iv]=HF1[compv,class,iv])));
FORTRANFILE("/tmp/vemuserf.%EXT_",FALSE);

FORTRANFILE("/tmp/vemusrfu.%EXT_",TRUE);
FOR class:0 THRU 3 DO
  ( FOR compv:1 THRU NK DO
    ( FOR compu:1 THRU NK DO
       ( IF HF0U[compv,compu,class]#0 THEN FORTRAN(F0U[compv,compu,class]=HF0U[compv,compu,class]),
         FOR iu:1 THRU class DO
           IF HF0UX[compv,compu,class,iu]#0 THEN FORTRAN(F0UX[compv,compu,class,iu]=HF0UX[compv,compu,class,iu]),
           FOR iv:1 THRU class DO
             IF HF1U[compv,compu,class,iv]#0 THEN FORTRAN(F1U[compv,compu,class,iv]=HF1U[compv,compu,class,iv]),
           FOR iu:1 THRU class DO
             ( FOR iv:1 THRU class DO
               IF HF1UX[compv,compu,class,iv,iu]#0 THEN FORTRAN(F1UX[compv,compu,class,iv,iu]= HF1UX[compv,compu,class,iv,iu])))));
FORTRANFILE("/tmp/vemusrfu.%EXT_",FALSE);

FORTRANFILE("/tmp/vemusrfut.%EXT_",TRUE);
FOR class:0 THRU 3 DO
  ( FOR compv:1 THRU NK DO
    ( FOR compu:1 THRU NK DO
       ( IF HF0UT[compv,compu,class]#0 THEN FORTRAN(F0UT[compv,compu,class]=HF0UT[compv,compu,class]),
         FOR iu:1 THRU class DO
           IF HF0UTX[compv,compu,class,iu]#0 THEN FORTRAN(F0UTX[compv,compu,class,iu]=HF0UTX[compv,compu,class,iu]),
         FOR iv:1 THRU class DO
           IF HF1UT[compv,compu,class,iv]#0 THEN FORTRAN(F1UT[compv,compu,class,iv]=HF1UT[compv,compu,class,iv]),
         FOR iu:1 THRU class DO
           ( FOR iv:1 THRU class DO
               IF HF1UTX[compv,compu,class,iv,iu]#0 THEN FORTRAN(F1UTX[compv,compu,class,iv,iu]= HF1UTX[compv,compu,class,iv,iu])))));
FORTRANFILE("/tmp/vemusrfut.%EXT_",FALSE);

FORTRANFILE("/tmp/vemusermasks.%EXT_",TRUE);
FORTRAN(LSYM=SYM);
FORTRANFILE("/tmp/vemusermasks.%EXT_",FALSE);
QUIT();
