Commits

Anonymous committed 08dd2c3

Changed temperature as array to scalar in global_auxvar

  • Participants
  • Parent commits 986a31c

Comments (0)

Files changed (21)

File src/pflotran/condition_control.F90

                                             (temp + 273.15d0)* &
                                             surf_th_auxvars(ghosted_id)%Cw
                       surf_global_auxvars(ghosted_id)%den_kg(1) = dw_kg
-                      surf_global_auxvars(ghosted_id)%temp(1) = temp
+                      surf_global_auxvars(ghosted_id)%temp = temp
                   end select
                 enddo
                 xx_p(ibegin:iend) = 0.0d0

File src/pflotran/flash2.F90

     if (associated(global_auxvars)) then
       global_auxvars(ghosted_id)%pres(:)= auxvars(ghosted_id)%auxvar_elem(0)%pres -&
                auxvars(ghosted_id)%auxvar_elem(0)%pc(:)
-      global_auxvars(ghosted_id)%temp(:)=auxvars(ghosted_id)%auxvar_elem(0)%temp
+      global_auxvars(ghosted_id)%temp=auxvars(ghosted_id)%auxvar_elem(0)%temp
       global_auxvars(ghosted_id)%sat(:)=auxvars(ghosted_id)%auxvar_elem(0)%sat(:)
 !     global_auxvars(ghosted_id)%sat_store =
       global_auxvars(ghosted_id)%fugacoeff(1)=xphi
       if (associated(global_auxvars_bc)) then
         global_auxvars_bc(sum_connection)%pres(:)= auxvars_bc(sum_connection)%auxvar_elem(0)%pres -&
                      auxvars(ghosted_id)%auxvar_elem(0)%pc(:)
-        global_auxvars_bc(sum_connection)%temp(:)=auxvars_bc(sum_connection)%auxvar_elem(0)%temp
+        global_auxvars_bc(sum_connection)%temp=auxvars_bc(sum_connection)%auxvar_elem(0)%temp
         global_auxvars_bc(sum_connection)%sat(:)=auxvars_bc(sum_connection)%auxvar_elem(0)%sat(:)
         !    global_auxvars(ghosted_id)%sat_store =
         global_auxvars_bc(sum_connection)%fugacoeff(1)=xphi
       if (associated(global_auxvars_bc)) then
         global_auxvars_bc(sum_connection)%pres(:)= auxvars_bc(sum_connection)%auxvar_elem(0)%pres -&
                      auxvars(ghosted_id)%auxvar_elem(0)%pc(:)
-        global_auxvars_bc(sum_connection)%temp(:)=auxvars_bc(sum_connection)%auxvar_elem(0)%temp
+        global_auxvars_bc(sum_connection)%temp=auxvars_bc(sum_connection)%auxvar_elem(0)%temp
         global_auxvars_bc(sum_connection)%sat(:)=auxvars_bc(sum_connection)%auxvar_elem(0)%sat(:)
       !    global_auxvars(ghosted_id)%sat_store = 
         global_auxvars_bc(sum_connection)%fugacoeff(1)=xphi
     if(associated(global_auxvars)) then
       global_auxvars(ghosted_id)%pres(:)= auxvars(ghosted_id)%auxvar_elem(0)%pres -&
                auxvars(ghosted_id)%auxvar_elem(0)%pc(:)
-      global_auxvars(ghosted_id)%temp(:)=auxvars(ghosted_id)%auxvar_elem(0)%temp
+      global_auxvars(ghosted_id)%temp=auxvars(ghosted_id)%auxvar_elem(0)%temp
       global_auxvars(ghosted_id)%sat(:)=auxvars(ghosted_id)%auxvar_elem(0)%sat(:)
 !      global_auxvars(ghosted_id)%sat_store =
       global_auxvars(ghosted_id)%fugacoeff(1)=xphi

File src/pflotran/global.F90

       select case(isubvar)
         case(TIME_T)
           do ghosted_id=1, grid%ngmax
-            patch%aux%Global%auxvars(ghosted_id)%temp_store(1,TIME_T) = &
+            patch%aux%Global%auxvars(ghosted_id)%temp_store(TIME_T) = &
               vec_loc_p(ghosted_id)
           enddo
         case(TIME_TpDT)
           do ghosted_id=1, grid%ngmax
-            patch%aux%Global%auxvars(ghosted_id)%temp_store(1,TIME_TpDT) = &
+            patch%aux%Global%auxvars(ghosted_id)%temp_store(TIME_TpDT) = &
               vec_loc_p(ghosted_id)
           enddo
         case default
           do ghosted_id=1, grid%ngmax
-            patch%aux%Global%auxvars(ghosted_id)%temp(1) = vec_loc_p(ghosted_id)
+            patch%aux%Global%auxvars(ghosted_id)%temp = vec_loc_p(ghosted_id)
           enddo
       end select
     case(LIQUID_DENSITY)
         auxvars(ghosted_id)%pres(:) = &
           (weight*auxvars(ghosted_id)%pres_store(:,TIME_TpDT)+ &
            (1.d0-weight)*auxvars(ghosted_id)%pres_store(:,TIME_T))
-        auxvars(ghosted_id)%temp(:) = &
-          (weight*auxvars(ghosted_id)%temp_store(:,TIME_TpDT)+ &
-           (1.d0-weight)*auxvars(ghosted_id)%temp_store(:,TIME_T))
+        auxvars(ghosted_id)%temp = &
+          (weight*auxvars(ghosted_id)%temp_store(TIME_TpDT)+ &
+           (1.d0-weight)*auxvars(ghosted_id)%temp_store(TIME_T))
       enddo  
     case(MPH_MODE,FLASH2_MODE)
       ! need future implementation for ims_mode too    
         auxvars(ghosted_id)%pres(:) = &
           (weight*auxvars(ghosted_id)%pres_store(:,TIME_TpDT)+ &
            (1.d0-weight)*auxvars(ghosted_id)%pres_store(:,TIME_T))
-        auxvars(ghosted_id)%temp(:) = &
-          (weight*auxvars(ghosted_id)%temp_store(:,TIME_TpDT)+ &
-           (1.d0-weight)*auxvars(ghosted_id)%temp_store(:,TIME_T))
+        auxvars(ghosted_id)%temp = &
+          (weight*auxvars(ghosted_id)%temp_store(TIME_TpDT)+ &
+           (1.d0-weight)*auxvars(ghosted_id)%temp_store(TIME_T))
         auxvars(ghosted_id)%fugacoeff(:) = &
           (weight*auxvars(ghosted_id)%fugacoeff_store(:,TIME_TpDT)+ &
            (1.d0-weight)*auxvars(ghosted_id)%fugacoeff_store(:,TIME_T))

File src/pflotran/global_aux.F90

 
   type, public :: global_auxvar_type
     PetscInt :: istate
+    PetscReal :: temp
     PetscReal, pointer :: pres(:)
     PetscReal, pointer :: pres_store(:,:)
-    PetscReal, pointer :: temp(:)
-    PetscReal, pointer :: temp_store(:,:)
+    PetscReal, pointer :: temp_store(:)
     PetscReal, pointer :: sat(:)
     PetscReal, pointer :: sat_store(:,:)
     PetscReal, pointer :: den(:)  ! kmol/m^3
   type(option_type) :: option
   
   auxvar%istate = 0
+  auxvar%temp = 0.d0
 
   ! nullify everthing to begin with and allocate later
   nullify(auxvar%pres)
-  nullify(auxvar%temp)
   nullify(auxvar%sat)
   nullify(auxvar%den)
   nullify(auxvar%den_kg)
   endif
   allocate(auxvar%pres(option%nphase))
   auxvar%pres = 0.d0
-  allocate(auxvar%temp(ONE_INTEGER))
-  auxvar%temp = 0.d0
   allocate(auxvar%sat(option%nphase))
   auxvar%sat = 0.d0
   allocate(auxvar%den_kg(option%nphase))
       auxvar%xmass = 1.d0
       allocate(auxvar%pres_store(option%nphase,TWO_INTEGER))
       auxvar%pres_store = option%reference_pressure
-      allocate(auxvar%temp_store(ONE_INTEGER,TWO_INTEGER))
+      allocate(auxvar%temp_store(TWO_INTEGER))
       auxvar%temp_store = 0.d0
       allocate(auxvar%fugacoeff(ONE_INTEGER))
       auxvar%fugacoeff = 1.d0
     ! auxvar%xmass = 1.d0
       allocate(auxvar%pres_store(option%nphase,TWO_INTEGER))
       auxvar%pres_store = 0.d0
-      allocate(auxvar%temp_store(ONE_INTEGER,TWO_INTEGER))
+      allocate(auxvar%temp_store(TWO_INTEGER))
       auxvar%temp_store = 0.d0
     ! allocate(auxvar%fugacoeff(ONE_INTEGER))
     ! auxvar%fugacoeff = 1.d0
       if (option%ntrandof > 0) then
         allocate(auxvar%pres_store(option%nphase,TWO_INTEGER))
         auxvar%pres_store = 0.d0
-        allocate(auxvar%temp_store(option%nphase,TWO_INTEGER))
+        allocate(auxvar%temp_store(TWO_INTEGER))
         auxvar%temp_store = 0.d0
         allocate(auxvar%den_kg_store(option%nphase,TWO_INTEGER))
         auxvar%den_kg_store = 0.d0
   type(global_auxvar_type) :: auxvar
   
   call DeallocateArray(auxvar%pres)
-  call DeallocateArray(auxvar%temp)
   call DeallocateArray(auxvar%sat)
   call DeallocateArray(auxvar%den)
   call DeallocateArray(auxvar%fugacoeff)

File src/pflotran/mfd.F90

   endif
 
 #ifndef DONT_USE_WATEOS
-  call EOSWaterDensity(global_auxvar%temp(1),pw,dw_kg,dw_mol, &
+  call EOSWaterDensity(global_auxvar%temp,pw,dw_kg,dw_mol, &
                        dw_dp,dw_dt,ierr)
 #else
-  call EOSWaterDensity(global_auxvar%temp(1),pw,dw_kg,dw_mol,ierr)
+  call EOSWaterDensity(global_auxvar%temp,pw,dw_kg,dw_mol,ierr)
   pert = tol*pw
   pw_pert = pw + pert
-  call EOSWaterDensity(global_auxvar%temp(1),pw_pert,dw_kg_pert,dw_mol,ierr)
+  call EOSWaterDensity(global_auxvar%temp,pw_pert,dw_kg_pert,dw_mol,ierr)
   dw_dp = (dw_kg_pert-dw_kg)/pert
   ! dw_kg = kg/m^3
   ! dw_mol = kmol/m^3

File src/pflotran/mineral.F90

           if (mineral%kinmnrl_pref_activation_energy(ipref,imnrl) > 0.d0) then
             arrhenius_factor = &
               exp(mineral%kinmnrl_pref_activation_energy(ipref,imnrl)/rgas &
-                  *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp(iphase)+ &
+                  *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp+ &
                                                 273.15d0)))
           endif
           sum_prefactor_rate = sum_prefactor_rate + prefactor(ipref)* &
         arrhenius_factor = 1.d0
         if (mineral%kinmnrl_activation_energy(imnrl) > 0.d0) then
           arrhenius_factor = exp(mineral%kinmnrl_activation_energy(imnrl)/rgas &
-            *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp(iphase)+273.15d0)))
+            *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp+273.15d0)))
         endif
         sum_prefactor_rate = mineral%kinmnrl_rate(imnrl)*arrhenius_factor
       endif
         if (mineral%kinmnrl_pref_activation_energy(ipref,imnrl) > 0.d0) then
           arrhenius_factor = &
             exp(mineral%kinmnrl_pref_activation_energy(ipref,imnrl)/rgas &
-                *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp(iphase)+ &
+                *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp+ &
                                               273.15d0)))
         endif
         ! prefactor() saved in residual calc above
         if (mineral%kinmnrl_pref_activation_energy(ipref,imnrl) > 0.d0) then
           arrhenius_factor = &
             exp(mineral%kinmnrl_pref_activation_energy(ipref,imnrl)/rgas &
-                *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp(iphase)+ &
+                *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp+ &
                                               273.15d0)))
         endif
         sum_prefactor_rate = sum_prefactor_rate + prefactor(ipref)* &
       arrhenius_factor = 1.d0
       if (mineral%kinmnrl_activation_energy(imnrl) > 0.d0) then
         arrhenius_factor = exp(mineral%kinmnrl_activation_energy(imnrl)/rgas &
-          *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp(iphase)+273.15d0)))
+          *(1.d0/(25.d0+273.15d0)-1.d0/(global_auxvar%temp+273.15d0)))
       endif
       sum_prefactor_rate = mineral%kinmnrl_rate(imnrl)*arrhenius_factor
     endif
   mineral => reaction%mineral
 
   if (.not.option%use_isothermal) then
-    call MineralUpdateTempDepCoefs(global_auxvar%temp(iphase), &
+    call MineralUpdateTempDepCoefs(global_auxvar%temp, &
                                    global_auxvar%pres(iphase), &
                                    reaction%mineral, &
                                    reaction%use_geothermal_hpt, &

File src/pflotran/miscible_aux.F90

   
   auxvar%sat(1) = 1.d0
   auxvar%kvr(1) = 1.d0/visw
-  auxvar%h(1) = denw*4.18d-3*global_auxvar%temp(1)
+  auxvar%h(1) = denw*4.18d-3*global_auxvar%temp
   
 ! Glycol-Water mixture diffusivity (yh2o mass fraction water)
   auxvar%diff(2) = ((((-4.021d0*yh2o + 9.1181d0)*yh2o - 5.9703d0)*yh2o &

File src/pflotran/mphase.F90

 !        auxvars(ghosted_id)%auxvar_elem(0)%pc(:),auxvars(ghosted_id)%auxvar_elem(0)%pres, &
 !        global_auxvars(ghosted_id)%pres(:)
 
-      global_auxvars(ghosted_id)%temp(:) = auxvars(ghosted_id)%auxvar_elem(0)%temp
+      global_auxvars(ghosted_id)%temp = auxvars(ghosted_id)%auxvar_elem(0)%temp
       global_auxvars(ghosted_id)%sat(:) = auxvars(ghosted_id)%auxvar_elem(0)%sat(:)
       global_auxvars(ghosted_id)%fugacoeff(1) = xphi
       global_auxvars(ghosted_id)%den(:) = auxvars(ghosted_id)%auxvar_elem(0)%den(:)
       if (associated(global_auxvars_bc)) then
         global_auxvars_bc(sum_connection)%pres(:) = auxvars_bc(sum_connection)%auxvar_elem(0)%pres -&
                      auxvars_bc(sum_connection)%auxvar_elem(0)%pc(:)
-        global_auxvars_bc(sum_connection)%temp(:) = auxvars_bc(sum_connection)%auxvar_elem(0)%temp
+        global_auxvars_bc(sum_connection)%temp = auxvars_bc(sum_connection)%auxvar_elem(0)%temp
         global_auxvars_bc(sum_connection)%sat(:) = auxvars_bc(sum_connection)%auxvar_elem(0)%sat(:)
         !    global_auxvars(ghosted_id)%sat_store = 
         global_auxvars_bc(sum_connection)%fugacoeff(1) = xphi
     if (associated(global_auxvars)) then
        global_auxvars(ghosted_id)%pres(:) = auxvars(ghosted_id)%auxvar_elem(0)%pres - &
                auxvars(ghosted_id)%auxvar_elem(0)%pc(:)
-       global_auxvars(ghosted_id)%temp(:) = auxvars(ghosted_id)%auxvar_elem(0)%temp
+       global_auxvars(ghosted_id)%temp = auxvars(ghosted_id)%auxvar_elem(0)%temp
        global_auxvars(ghosted_id)%sat(:) = auxvars(ghosted_id)%auxvar_elem(0)%sat(:)
        global_auxvars(ghosted_id)%fugacoeff(1) = xphi
        global_auxvars(ghosted_id)%den(:) = auxvars(ghosted_id)%auxvar_elem(0)%den(:)
       if( associated(global_auxvars_bc))then
         global_auxvars_bc(sum_connection)%pres(:) = auxvars_bc(sum_connection)%auxvar_elem(0)%pres -&
                      auxvars(ghosted_id)%auxvar_elem(0)%pc(:)
-        global_auxvars_bc(sum_connection)%temp(:) = auxvars_bc(sum_connection)%auxvar_elem(0)%temp
+        global_auxvars_bc(sum_connection)%temp = auxvars_bc(sum_connection)%auxvar_elem(0)%temp
         global_auxvars_bc(sum_connection)%sat(:) = auxvars_bc(sum_connection)%auxvar_elem(0)%sat(:)
       !    global_auxvars(ghosted_id)%sat_store = 
         global_auxvars_bc(sum_connection)%fugacoeff(1) = xphi
   dm_plus = sec_heat_vars%dm_plus
   dm_minus = sec_heat_vars%dm_minus
   area_fm = sec_heat_vars%interfacial_area
-! temp_primary_node = global_auxvar%temp(1)
+! temp_primary_node = global_auxvar%temp
   temp_primary_node = auxvar%temp
 
   coeff_left = 0.d0

File src/pflotran/patch.F90

         endif
 
 #ifndef DONT_USE_WATEOS
-        call EOSWaterDensity(global_auxvar%temp(1), &
+        call EOSWaterDensity(global_auxvar%temp, &
                              global_auxvar%pres(1), &
                              global_auxvar%den_kg(1), &
                              dum1,ierr)
 #else
-        call EOSWaterdensity(global_auxvar%temp(1),global_auxvar%pres(1), &
+        call EOSWaterdensity(global_auxvar%temp,global_auxvar%pres(1), &
                              global_auxvar%den_kg(1),dum1,ierr)
 #endif                     
       else
         select case(ivar)
           case(TEMPERATURE)
             do local_id=1,grid%nlmax
-              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1)
+              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp
             enddo
           case(LIQUID_PRESSURE)
             do local_id=1,grid%nlmax
         select case(ivar)
           case(TEMPERATURE)
             do local_id=1,grid%nlmax
-              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1)
+              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp
             enddo
           case(LIQUID_PRESSURE)
             do local_id=1,grid%nlmax
         
           case(TEMPERATURE)
             do local_id=1,grid%nlmax
-              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1)
+              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp
             enddo
           case(LIQUID_PRESSURE)
             do local_id=1,grid%nlmax
         
 !         case(TEMPERATURE)
 !           do local_id=1,grid%nlmax
-!             vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1)
+!             vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp
 !           enddo
           case(LIQUID_PRESSURE)
             do local_id=1,grid%nlmax
         select case(ivar)
           case(TEMPERATURE)
             do local_id=1,grid%nlmax
-              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1)
+              vec_ptr(local_id) = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp
             enddo
           case(LIQUID_PRESSURE)
             do local_id=1,grid%nlmax
                       log(patch%aux%RT%auxvars(ghosted_id)%pri_molal(comp_id)* &
                         patch%aux%RT%auxvars(ghosted_id)%pri_act_coef(comp_id))
               enddo
-              tk = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1) + &
+              tk = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp + &
                    273.15d0
               ehfac = IDEAL_GAS_CONST*tk*LOG_TO_LN/faraday
               eh0 = ehfac*(-4.d0*ph0+lnQKgas*LN_TO_LOG+logKeh(tk))/4.d0
                       log(patch%aux%RT%auxvars(ghosted_id)%pri_molal(comp_id)* &
                         patch%aux%RT%auxvars(ghosted_id)%pri_act_coef(comp_id))
               enddo
-              tk = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp(1) + &
+              tk = patch%aux%Global%auxvars(grid%nL2G(local_id))%temp + &
                    273.15d0
               ehfac = IDEAL_GAS_CONST*tk*LOG_TO_LN/faraday
               eh0 = ehfac*(-4.d0*ph0+lnQKgas*LN_TO_LOG+logKeh(tk))/4.d0
      if (associated(patch%aux%TH)) then
         select case(ivar)
           case(TEMPERATURE)
-            value = patch%aux%Global%auxvars(ghosted_id)%temp(1)
+            value = patch%aux%Global%auxvars(ghosted_id)%temp
           case(LIQUID_PRESSURE)
             value = patch%aux%Global%auxvars(ghosted_id)%pres(1)
           case(LIQUID_SATURATION)
       else if (associated(patch%aux%Flash2)) then
         select case(ivar)
           case(TEMPERATURE)
-            value = patch%aux%Global%auxvars(ghosted_id)%temp(1)
+            value = patch%aux%Global%auxvars(ghosted_id)%temp
           case(LIQUID_PRESSURE)
             value = patch%aux%Global%auxvars(ghosted_id)%pres(1)
           case(LIQUID_SATURATION)
       else if (associated(patch%aux%Mphase)) then
         select case(ivar)
           case(TEMPERATURE)
-            value = patch%aux%Global%auxvars(ghosted_id)%temp(1)
+            value = patch%aux%Global%auxvars(ghosted_id)%temp
           case(LIQUID_PRESSURE)
             value = patch%aux%Global%auxvars(ghosted_id)%pres(1)
           case(GAS_PRESSURE)
       else if (associated(patch%aux%Immis)) then
         select case(ivar)
           case(TEMPERATURE)
-            value = patch%aux%Global%auxvars(ghosted_id)%temp(1)
+            value = patch%aux%Global%auxvars(ghosted_id)%temp
           case(LIQUID_PRESSURE)
             value = patch%aux%Global%auxvars(ghosted_id)%pres(1)
           case(GAS_PRESSURE)
       else if (associated(patch%aux%Miscible)) then
         select case(ivar)
 !         case(TEMPERATURE)
-!           value = patch%aux%Global%auxvars(ghosted_id)%temp(1)
+!           value = patch%aux%Global%auxvars(ghosted_id)%temp
           case(LIQUID_PRESSURE)
             value = patch%aux%Global%auxvars(ghosted_id)%pres(1)
 !         case(LIQUID_SATURATION)
                         patch%aux%RT%auxvars(ghosted_id)%pri_act_coef(comp_id))
           enddo
 
-          tk = patch%aux%Global%auxvars(grid%nL2G(ghosted_id))%temp(1)+273.15d0
+          tk = patch%aux%Global%auxvars(grid%nL2G(ghosted_id))%temp+273.15d0
           ehfac = IDEAL_GAS_CONST*tk*LOG_TO_LN/faraday
           eh0 = ehfac*(-4.d0*ph0+lnQKgas*LN_TO_LOG+logKeh(tk))/4.d0
 
                         patch%aux%RT%auxvars(ghosted_id)%pri_act_coef(comp_id))
           enddo
 
-          tk = patch%aux%Global%auxvars(grid%nL2G(ghosted_id))%temp(1)+273.15d0
+          tk = patch%aux%Global%auxvars(grid%nL2G(ghosted_id))%temp+273.15d0
           ehfac = IDEAL_GAS_CONST*tk*LOG_TO_LN/faraday
           eh0 = ehfac*(-4.d0*ph0+lnQKgas*LN_TO_LOG+logKeh(tk))/4.d0
           pe0 = eh0/ehfac
       enddo
     case(SURFACE_LIQUID_TEMPERATURE)
       do local_id=1,grid%nlmax
-        vec_ptr(local_id) = patch%surf_aux%SurfaceGlobal%auxvars(grid%nL2G(local_id))%temp(1)
+        vec_ptr(local_id) = patch%surf_aux%SurfaceGlobal%auxvars(grid%nL2G(local_id))%temp
       enddo
     case(MATERIAL_ID)
       do local_id=1,grid%nlmax

File src/pflotran/pmc_surface.F90

                 surf_temp_p(local_id) = this%option%reference_temperature
               else
                 surf_head_p(local_id) = xx_loc_p(istart)
-                surf_temp_p(local_id) = surf_global_auxvars(ghosted_id)%temp(1)
+                surf_temp_p(local_id) = surf_global_auxvars(ghosted_id)%temp
               endif
             enddo
 

File src/pflotran/reaction.F90

             pres = conc(icomp)*1.D5
             global_auxvar%pres(2) = pres
             
-            tc = global_auxvar%temp(1)
+            tc = global_auxvar%temp
 
             call EOSWaterSaturationPressure(tc, sat_pressure, ierr)
             
     case(FLASH2_MODE,MPH_MODE,IMS_MODE,MIS_MODE)
     case(NULL_MODE)
       global_auxvar%den_kg(iphase) = option%reference_water_density
-      global_auxvar%temp(1) = option%reference_temperature
+      global_auxvar%temp = option%reference_temperature
       global_auxvar%sat(iphase) = option%reference_saturation
     case(RICHARDS_MODE)
-      global_auxvar%temp(1) = option%reference_temperature
+      global_auxvar%temp = option%reference_temperature
   end select
         
 !  global_auxvar%den_kg(iphase) = option%reference_water_density
-!  global_auxvar%temp(1) = option%reference_temperature
+!  global_auxvar%temp = option%reference_temperature
 !  global_auxvar%sat(iphase) = option%reference_saturation
   bulk_vol_to_fluid_vol = option%reference_porosity* &
                           global_auxvar%sat(iphase)*1000.d0
                       log(rt_auxvar%pri_molal(comp_id)*rt_auxvar%pri_act_coef(comp_id))
         enddo
 
-        tk = global_auxvar%temp(1)+273.15d0
+        tk = global_auxvar%temp+273.15d0
         ehfac = IDEAL_GAS_CONST*tk*LOG_TO_LN/faraday
         eh = ehfac*(-4.d0*ph+lnQKgas(ifo2)*LN_TO_LOG+logKeh(tk))/4.d0
         pe = eh/ehfac
     write(option%fid_out,'(a20,1pe12.4,a5)') '        pressure: ', &
       global_auxvar%pres(1),' [Pa]'
     write(option%fid_out,'(a20,f8.2,a4)') '     temperature: ', &
-      global_auxvar%temp(1),' [C]'
+      global_auxvar%temp,' [C]'
     write(option%fid_out,'(a20,f8.2,a9)') '     density H2O: ', &
       global_auxvar%den_kg(1),' [kg/m^3]'
     write(option%fid_out,'(a20,1p2e12.4,a9)') 'ln / activity H2O: ', &
     global_auxvar => constraint_coupler%global_auxvar
 
     iphase = 1
-    global_auxvar%temp(iphase) = option%reference_temperature
-    tempk = tk + global_auxvar%temp(iphase)
+    global_auxvar%temp = option%reference_temperature
+    tempk = tk + global_auxvar%temp
     
     potential = 0.1d0 ! initial guess
     boltzmann = exp(-faraday*potential/(rgas*tempk))
 
 ! print *,'CO2AqActCoeff: ', global_auxvar%pres(:)
 
-  tc = global_auxvar%temp(1)
+  tc = global_auxvar%temp
   pco2 = global_auxvar%pres(2)
   sat_pressure =0D0
 
     do ieqgas = 1, reaction%ngas ! all gas phase species are secondary
 
       pressure = global_auxvar%pres(2)
-      temperature = global_auxvar%temp(1)
+      temperature = global_auxvar%temp
       xphico2 = global_auxvar%fugacoeff(1)
 !     den = global_auxvar%den(2)
  
   PetscInt, parameter :: iphase = 1
   
   if (.not.reaction%use_geothermal_hpt)then
-    temp = global_auxvar%temp(iphase)
+    temp = global_auxvar%temp
     pres = 0.d0
     if (associated(reaction%eqcplx_logKcoef)) then
       call ReactionInterpolateLogK(reaction%eqcplx_logKcoef, &
                                 reaction%surface_complexation%nsrfcplx)      
     endif
   else ! high pressure and temperature
-    temp = global_auxvar%temp(iphase)
+    temp = global_auxvar%temp
     pres = global_auxvar%pres(iphase)
     if (associated(reaction%eqcplx_logKcoef)) then
       call ReactionInterpolateLogK_hpt(reaction%eqcplx_logKcoef, &

File src/pflotran/reaction_sandbox_clm_cn.F90

   
   ! inhibition due to temperature
   ! Equation: F_t = exp(308.56*(1/17.02 - 1/(T - 227.13)))
-  temp_K = global_auxvar%temp(1) + 273.15d0
+  temp_K = global_auxvar%temp + 273.15d0
 
   if(temp_K > 227.15d0) then
     F_t = exp(308.56d0*(one_over_71_02 - 1.d0/(temp_K - 227.13d0)))

File src/pflotran/richards_aux.F90

 
 !  call wateos_noderiv(option%temp,pw,dw_kg,dw_mol,hw,option%scale,ierr)
 #ifndef DONT_USE_WATEOS
-!geh  call EOSWaterDensityEnthalpy(global_auxvar%temp(1),pw,dw_kg,dw_mol,hw, &
+!geh  call EOSWaterDensityEnthalpy(global_auxvar%temp,pw,dw_kg,dw_mol,hw, &
 !                               dw_dp,dw_dt,hw_dp,hw_dt,option%scale,ierr)
-  call EOSWaterDensity(global_auxvar%temp(1),pw,dw_kg,dw_mol, &
+  call EOSWaterDensity(global_auxvar%temp,pw,dw_kg,dw_mol, &
                        dw_dp,dw_dt,ierr)
 #else
-  call EOSWaterDensity(global_auxvar%temp(1),pw,dw_kg,dw_mol,ierr)
+  call EOSWaterDensity(global_auxvar%temp,pw,dw_kg,dw_mol,ierr)
   pert = tol*pw
   pw_pert = pw+pert
-  call EOSWaterdensity(global_auxvar%temp(1),pw_pert,dw_kg_pert,dw_mol,ierr)
+  call EOSWaterdensity(global_auxvar%temp,pw_pert,dw_kg_pert,dw_mol,ierr)
   dw_dp = (dw_kg_pert-dw_kg)/pert
   ! dw_kg = kg/m^3
   ! dw_mol = kmol/m^3
   dw_dp = dw_dp/FMWH2O
 #endif
 ! may need to compute dpsat_dt to pass to VISW
-  call EOSWaterSaturationPressure(global_auxvar%temp(1),sat_pressure,ierr)
+  call EOSWaterSaturationPressure(global_auxvar%temp,sat_pressure,ierr)
   !geh: 0.d0 passed in for derivative of pressure w/respect to temp
-  call EOSWaterViscosity(global_auxvar%temp(1),pw,sat_pressure,0.d0, &
+  call EOSWaterViscosity(global_auxvar%temp,pw,sat_pressure,0.d0, &
                          visl,dvis_dt,dvis_dp,dvis_dpsat,ierr) 
 !geh  dvis_dpsat = -dvis_dp   ! already handled in EOSWaterViscosity
   if (.not.saturated) then !kludge since pw is constant in the unsat zone

File src/pflotran/secondary_continuum.F90

       endif
         
 #ifndef DONT_USE_WATEOS
-      call EOSWaterDensity(global_auxvar%temp(1), &
+      call EOSWaterDensity(global_auxvar%temp, &
                            global_auxvar%pres(1), &
                            global_auxvar%den_kg(1), &
                            dum1,ierr)
 #else
-      call EOSWaterDensity(global_auxvar%temp(1),global_auxvar%pres(1), &
+      call EOSWaterDensity(global_auxvar%temp,global_auxvar%pres(1), &
                            global_auxvar%den_kg(1),dum1,ierr)
 #endif             
     else
   dm_plus = sec_heat_vars%dm_plus
   dm_minus = sec_heat_vars%dm_minus
   area_fm = sec_heat_vars%interfacial_area
-  temp_primary_node = global_auxvar%temp(1)
+  temp_primary_node = global_auxvar%temp
   
   coeff_left = 0.d0
   coeff_diag = 0.d0
   dm_plus = sec_heat_vars%dm_plus
   dm_minus = sec_heat_vars%dm_minus
   area_fm = sec_heat_vars%interfacial_area
-  temp_primary_node = global_auxvar%temp(1)
+  temp_primary_node = global_auxvar%temp
   
   coeff_left = 0.d0
   coeff_diag = 0.d0

File src/pflotran/surface_global.F90

       select case(isubvar)
         case default
           do ghosted_id=1, grid%ngmax
-            patch%surf_aux%SurfaceGlobal%auxvars(ghosted_id)%temp(1) = vec_loc_p(ghosted_id)
+            patch%surf_aux%SurfaceGlobal%auxvars(ghosted_id)%temp = vec_loc_p(ghosted_id)
           enddo
       end select
     case(SURFACE_LIQUID_DENSITY)

File src/pflotran/surface_global_aux.F90

   type, public :: surface_global_auxvar_type
     PetscInt :: istate
     PetscReal, pointer :: head(:)   ! [m]
-    PetscReal, pointer :: temp(:)   ! [C]
+    PetscReal :: temp   ! [C]
     PetscReal, pointer :: den_kg(:) ! [kg/m^3]
   end type surface_global_auxvar_type
   
 
   allocate(auxvar%head(option%nphase))
   auxvar%head = 0.d0
-  allocate(auxvar%temp(ONE_INTEGER))
   auxvar%temp = option%reference_temperature
   allocate(auxvar%den_kg(option%nphase))
   auxvar%den_kg = 0.d0
   type(surface_global_auxvar_type) :: auxvar
   
   call DeallocateArray(auxvar%head)
-  call DeallocateArray(auxvar%temp)
   call DeallocateArray(auxvar%den_kg)
 
 

File src/pflotran/surface_th.F90

       ! is correct here, but I should check.
       ff_p(iend) = ff_p(iend) + esrc + &
                     surf_global_auxvars_ss(sum_connection)%den_kg(1)* &
-                    (surf_global_auxvars_ss(sum_connection)%temp(1) + 273.15d0)* &
+                    (surf_global_auxvars_ss(sum_connection)%temp + 273.15d0)* &
                     surf_auxvars(local_id)%Cwi* &
                     qsrc/area_p(local_id)
     enddo
 
   if (head_up>head_dn) then
     mannings_half = mannings_up
-    temp_half = surf_global_auxvar_up%temp(1) + 273.15d0
+    temp_half = surf_global_auxvar_up%temp + 273.15d0
     unfrozen_fraction_half = surf_auxvar_up%unfrozen_fraction
     if (surf_global_auxvar_up%head(1)>eps) then
       hw_half = surf_global_auxvar_up%head(1)
     endif
   else
     mannings_half = mannings_dn
-    temp_half = surf_global_auxvar_dn%temp(1) + 273.15d0
+    temp_half = surf_global_auxvar_dn%temp + 273.15d0
     unfrozen_fraction_half = surf_auxvar_dn%unfrozen_fraction
     if (surf_global_auxvar_dn%head(1)>eps) then
       hw_half = surf_global_auxvar_dn%head(1)
   den_aveg = (surf_global_auxvar_up%den_kg(1) + &
               surf_global_auxvar_dn%den_kg(1))/2.d0
   ! Temperature difference
-  dtemp = surf_global_auxvar_up%temp(1) - surf_global_auxvar_dn%temp(1)
+  dtemp = surf_global_auxvar_up%temp - surf_global_auxvar_dn%temp
 
   ! Note, Cw and k_therm are same for up and downwind
   Cw = surf_auxvar_up%Cw
   end select
 
   if (vel>0.d0) then
-    temp_half = surf_global_auxvar_up%temp(1) + 273.15d0
+    temp_half = surf_global_auxvar_up%temp + 273.15d0
   else
-    temp_half = surf_global_auxvar_dn%temp(1) + 273.15d0
+    temp_half = surf_global_auxvar_dn%temp + 273.15d0
   endif
 
   if (pressure_bc_type /= ZERO_GRADIENT_BC) then
     select case (ibndtype(TH_TEMPERATURE_DOF))
       case (DIRICHLET_BC)
-        dtemp = surf_global_auxvar_up%temp(1) - surf_global_auxvar_dn%temp(1)
+        dtemp = surf_global_auxvar_up%temp - surf_global_auxvar_dn%temp
       case default
         option%io_buffer = 'Unknown temperature_bc_type for surface flow '
         call printErrMsg(option)
     ! [rho*h*T*Cwi]
     xx_loc_p(istart+1) = surf_global_auxvars(ghosted_id)%den_kg(1)* &
                          xx_loc_p(istart)* &
-                         (surf_global_auxvars(ghosted_id)%temp(1) + 273.15d0)* &
+                         (surf_global_auxvars(ghosted_id)%temp + 273.15d0)* &
                          surf_th_auxvars(ghosted_id)%Cwi
   enddo
    
         end select
       enddo
 
-      surf_global_auxvars_bc(sum_connection)%temp(1) = xxbc(2)
+      surf_global_auxvars_bc(sum_connection)%temp = xxbc(2)
       call SurfaceTHAuxVarCompute(xxbc, &
                                   surf_th_auxvars_bc(sum_connection), &
                                   surf_global_auxvars_bc(sum_connection), &
         endif
       else
         tsrc1 = xx_loc_p((ghosted_id-1)*option%nflowdof+1)
-        tsrc1 = surf_global_auxvars(ghosted_id)%temp(1)
+        tsrc1 = surf_global_auxvars(ghosted_id)%temp
       endif
 
       xxss = xx_loc_p(istart:iend)
       xxss(2) = tsrc1
 
-      surf_global_auxvars_ss(sum_connection)%temp(1) = tsrc1
+      surf_global_auxvars_ss(sum_connection)%temp = tsrc1
       call SurfaceTHAuxVarCompute(xxss, &
                                   surf_th_auxvars_ss(sum_connection), &
                                   surf_global_auxvars_ss(sum_connection), &
           surf_global_auxvars(local_id)%den_kg(1) = den
         enddo
       endif
-      surf_global_auxvars(ghosted_id)%temp(1) = temp
+      surf_global_auxvars(ghosted_id)%temp = temp
     endif
   enddo
 
       local_id = cur_connection_set%id_dn(iconn)
       ghosted_id = grid%nL2G(local_id)
       
-      surf_global_auxvars_bc(sum_connection)%temp(1) = &
-        surf_global_auxvars(ghosted_id)%temp(1)
+      surf_global_auxvars_bc(sum_connection)%temp = &
+        surf_global_auxvars(ghosted_id)%temp
     enddo
     boundary_condition => boundary_condition%next
   enddo
       local_id = cur_connection_set%id_dn(iconn)
       ghosted_id = grid%nL2G(local_id)
 
-      surf_global_auxvars_ss(sum_connection)%temp(1) = &
-        surf_global_auxvars(ghosted_id)%temp(1)
+      surf_global_auxvars_ss(sum_connection)%temp = &
+        surf_global_auxvars(ghosted_id)%temp
 
     enddo
     source_sink => source_sink%next

File src/pflotran/surface_th_aux.F90

   kr = 0.d0
  
   global_auxvar%head(1) = xx(1)
-  !global_auxvar%temp(1) = xx(2)
+  !global_auxvar%temp = xx(2)
     ! RTM: Why is the above commented out?  Is one of these internal 
     ! energy instead of temperature?
  
   ds_dp = 0.d0
   dkr_dp = 0.d0
 
-  call EOSWaterDensityEnthalpy(global_auxvar%temp(1),pw,dw_kg,dw_mol,hw,ierr)
+  call EOSWaterDensityEnthalpy(global_auxvar%temp,pw,dw_kg,dw_mol,hw,ierr)
   ! J/kmol -> whatever units
   hw = hw * option%scale
   
 
   ! Compute unfrozen fraction, and then compute the weighted averages of 
   ! density, specific heat capacity, thermal conductivity
-  unfrozen_fraction = SurfaceTHAuxVarComputeUnfrozen(global_auxvar%temp(1))
+  unfrozen_fraction = SurfaceTHAuxVarComputeUnfrozen(global_auxvar%temp)
   auxvar%unfrozen_fraction = unfrozen_fraction
   global_auxvar%den_kg(1) = unfrozen_fraction * dw_kg + (1.d0 - unfrozen_fraction) * di_kg
   auxvar%Cwi = unfrozen_fraction * auxvar%Cw + (1.d0 - unfrozen_fraction) * auxvar%Ci

File src/pflotran/th.F90

   
   vol = material_auxvar%volume
   pres = global_auxvar%pres(1)
-  temp = global_auxvar%temp(1)
+  temp = global_auxvar%temp
   sat = global_auxvar%sat(1)
   den = global_auxvar%den(1)
   dden_dp = TH_auxvar%dden_dp
      u_i = TH_auxvar%u_ice
      den_i = TH_auxvar%den_ice
      p_g = option%reference_pressure ! set to reference pressure
-     den_g = p_g/(IDEAL_GAS_CONST*(global_auxvar%temp(1) + 273.15d0))*1.d-3
-     call EOSWaterSaturationPressure(global_auxvar%temp(1), p_sat, dpsat_dt, ierr)
+     den_g = p_g/(IDEAL_GAS_CONST*(global_auxvar%temp + 273.15d0))*1.d-3
+     call EOSWaterSaturationPressure(global_auxvar%temp, p_sat, dpsat_dt, ierr)
      mol_g = p_sat/p_g
      C_g = C_wv*mol_g*FMWH2O + C_a*(1.d0 - mol_g)*FMWAIR !in MJ/kmol/K, expression might be different
-     u_g = C_g*(global_auxvar%temp(1) + 273.15d0)
-     ddeng_dt = - p_g/(IDEAL_GAS_CONST*(global_auxvar%temp(1) + 273.15d0)**2)*1.d-3
+     u_g = C_g*(global_auxvar%temp + 273.15d0)
+     ddeng_dt = - p_g/(IDEAL_GAS_CONST*(global_auxvar%temp + 273.15d0)**2)*1.d-3
      dmolg_dt = dpsat_dt/p_g
      dsatg_dp = TH_auxvar%dsat_gas_dp
      dsatg_dt = TH_auxvar%dsat_gas_dt
      dug_dt = C_g + (C_wv*dmolg_dt*FMWH2O - C_a*dmolg_dt*FMWAIR)* &
-          (global_auxvar%temp(1) + 273.15d0)
+          (global_auxvar%temp + 273.15d0)
      dsati_dt = TH_auxvar%dsat_ice_dt
      dsati_dp = TH_auxvar%dsat_ice_dp
      ddeni_dt = TH_auxvar%dden_ice_dt
     call MaterialAuxVarCopy(material_auxvar,material_auxvar_pert,option)
 
     x(1) = global_auxvar%pres(1)
-    x(2) = global_auxvar%temp(1)
+    x(2) = global_auxvar%temp
     
     call THAccumulation(TH_auxvar,global_auxvar,material_auxvar, &
                          rock_dencpr,option, &
   eng = global_auxvar%sat(1) * &
         global_auxvar%den(1) * &
         auxvar%u * porXvol + &
-        (1.d0 - por) * vol * rock_dencpr * global_auxvar%temp(1)
+        (1.d0 - por) * vol * rock_dencpr * global_auxvar%temp
 
   if (option%use_th_freezing) then
      ! SK, 11/17/11
      u_i = auxvar%u_ice
      den_i = auxvar%den_ice
      p_g = option%reference_pressure
-     den_g = p_g/(IDEAL_GAS_CONST*(global_auxvar%temp(1) + 273.15d0))*1.d-3 !in kmol/m3
-     call EOSWaterSaturationPressure(global_auxvar%temp(1), p_sat, ierr)
+     den_g = p_g/(IDEAL_GAS_CONST*(global_auxvar%temp + 273.15d0))*1.d-3 !in kmol/m3
+     call EOSWaterSaturationPressure(global_auxvar%temp, p_sat, ierr)
      mol_g = p_sat/p_g
      C_g = C_wv*mol_g*FMWH2O + C_a*(1.d0 - mol_g)*FMWAIR ! in MJ/kmol/K
-     u_g = C_g*(global_auxvar%temp(1) + 273.15d0)       ! in MJ/kmol
+     u_g = C_g*(global_auxvar%temp + 273.15d0)       ! in MJ/kmol
      mol(1) = mol(1) + (sat_g*den_g*mol_g + sat_i*den_i)*porXvol
      eng = eng + (sat_g*den_g*u_g + sat_i*den_i*u_i)*porXvol
   endif
     satg_dn = auxvar_dn%sat_gas
     if ((satg_up > eps) .and. (satg_dn > eps)) then
       p_g = option%reference_pressure  ! set to reference pressure
-      deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp(1) + 273.15d0))*1.d-3
-      deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp(1) + 273.15d0))*1.d-3
+      deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp + 273.15d0))*1.d-3
+      deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp + 273.15d0))*1.d-3
 
       Diffg_ref = 2.13D-5 ! Reference diffusivity, need to read from input file
       p_ref = 1.01325d5   ! in Pa
       T_ref = 25.d0       ! in deg C
 
-      Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp(1) + 273.15d0)/ &
+      Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp + 273.15d0)/ &
            (T_ref + 273.15d0))**(1.8)  
-      Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp(1) + 273.15d0)/ &
+      Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp + 273.15d0)/ &
            (T_ref + 273.15d0))**(1.8)
 
       Ddiffgas_up = por_up*tor_up*satg_up*deng_up*Diffg_up
       Ddiffgas_dn = por_dn*tor_dn*satg_dn*deng_dn*Diffg_dn
-      call EOSWaterSaturationPressure(global_auxvar_up%temp(1), psat_up, dpsat_dt_up, ierr)
-      call EOSWaterSaturationPressure(global_auxvar_dn%temp(1), psat_dn, dpsat_dt_dn, ierr)
+      call EOSWaterSaturationPressure(global_auxvar_up%temp, psat_up, dpsat_dt_up, ierr)
+      call EOSWaterSaturationPressure(global_auxvar_dn%temp, psat_dn, dpsat_dt_dn, ierr)
 
       ! vapor pressure lowering due to capillary pressure
       fv_up = exp(-auxvar_up%pc/(global_auxvar_up%den(1)* &
-           R_gas_constant*(global_auxvar_up%temp(1) + 273.15d0)))
+           R_gas_constant*(global_auxvar_up%temp + 273.15d0)))
       fv_dn = exp(-auxvar_dn%pc/(global_auxvar_dn%den(1)* &
-           R_gas_constant*(global_auxvar_dn%temp(1) + 273.15d0)))
+           R_gas_constant*(global_auxvar_dn%temp + 273.15d0)))
 
       molg_up = psat_up*fv_up/p_g
       molg_dn = psat_dn*fv_dn/p_g
 
       dfv_dt_up = fv_up*(auxvar_up%pc/R_gas_constant/(global_auxvar_up%den(1)* &
-           (global_auxvar_up%temp(1) + 273.15d0))**2)* &
-           (auxvar_up%dden_dt*(global_auxvar_up%temp(1) + 273.15d0) &
+           (global_auxvar_up%temp + 273.15d0))**2)* &
+           (auxvar_up%dden_dt*(global_auxvar_up%temp + 273.15d0) &
            + global_auxvar_up%den(1))
       dfv_dt_dn = fv_dn*(auxvar_dn%pc/R_gas_constant/(global_auxvar_dn%den(1)* &
-           (global_auxvar_dn%temp(1) + 273.15d0))**2)* &
-           (auxvar_dn%dden_dt*(global_auxvar_dn%temp(1) + 273.15d0) &
+           (global_auxvar_dn%temp + 273.15d0))**2)* &
+           (auxvar_dn%dden_dt*(global_auxvar_dn%temp + 273.15d0) &
            + global_auxvar_dn%den(1))
 
       dfv_dp_up = fv_up*(auxvar_up%pc/R_gas_constant/(global_auxvar_up%den(1))**2/ &
-           (global_auxvar_up%temp(1) + 273.15d0)*auxvar_up%dden_dp &
+           (global_auxvar_up%temp + 273.15d0)*auxvar_up%dden_dp &
            + 1.d0/R_gas_constant/global_auxvar_up%den(1)/ &
-           (global_auxvar_up%temp(1) + 273.15d0))
+           (global_auxvar_up%temp + 273.15d0))
       dfv_dp_dn = fv_dn*(auxvar_dn%pc/R_gas_constant/(global_auxvar_dn%den(1))**2/ &
-           (global_auxvar_dn%temp(1) + 273.15d0)*auxvar_dn%dden_dp &
+           (global_auxvar_dn%temp + 273.15d0)*auxvar_dn%dden_dp &
            + 1.d0/R_gas_constant/global_auxvar_dn%den(1)/ &
-           (global_auxvar_dn%temp(1) + 273.15d0))
+           (global_auxvar_dn%temp + 273.15d0))
 
       dmolg_dt_up = (1/p_g)*dpsat_dt_up*fv_up + psat_up/p_g*dfv_dt_up
       dmolg_dt_dn = (1/p_g)*dpsat_dt_dn*fv_dn + psat_dn/p_g*dfv_dt_dn
       dmolg_dp_up = psat_up/p_g*dfv_dp_up
       dmolg_dp_dn = psat_dn/p_g*dfv_dp_dn
 
-      ddeng_dt_up = - p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp(1) + &
+      ddeng_dt_up = - p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp + &
            273.15d0)**2)*1.d-3
-      ddeng_dt_dn = - p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp(1) + &
+      ddeng_dt_dn = - p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp + &
            273.15d0)**2)*1.d-3
 
-      dDiffg_dt_up = 1.8*Diffg_up/(global_auxvar_up%temp(1) + 273.15d0)
-      dDiffg_dt_dn = 1.8*Diffg_dn/(global_auxvar_dn%temp(1) + 273.15d0)
+      dDiffg_dt_up = 1.8*Diffg_up/(global_auxvar_up%temp + 273.15d0)
+      dDiffg_dt_dn = 1.8*Diffg_dn/(global_auxvar_dn%temp + 273.15d0)
 
       dDiffg_dp_up = 0.d0
       dDiffg_dp_dn = 0.d0
 
   endif
     
-  !  cond = Dk*area*(global_auxvar_up%temp(1)-global_auxvar_dn%temp(1)) 
+  !  cond = Dk*area*(global_auxvar_up%temp-global_auxvar_dn%temp) 
   Jup(option%nflowdof,1) = Jup(option%nflowdof,1) + &
-                           area*(global_auxvar_up%temp(1) - &
-                           global_auxvar_dn%temp(1))*dDk_dp_up
+                           area*(global_auxvar_up%temp - &
+                           global_auxvar_dn%temp)*dDk_dp_up
   Jdn(option%nflowdof,1) = Jdn(option%nflowdof,1) + &
-                           area*(global_auxvar_up%temp(1) - &
-                           global_auxvar_dn%temp(1))*dDk_dp_dn
+                           area*(global_auxvar_up%temp - &
+                           global_auxvar_dn%temp)*dDk_dp_dn
                            
   Jup(option%nflowdof,2) = Jup(option%nflowdof,2) + Dk*area + &
-                           area*(global_auxvar_up%temp(1) - & 
-                           global_auxvar_dn%temp(1))*dDk_dt_up 
+                           area*(global_auxvar_up%temp - & 
+                           global_auxvar_dn%temp)*dDk_dt_up 
   Jdn(option%nflowdof,2) = Jdn(option%nflowdof,2) + Dk*area*(-1.d0) + &
-                           area*(global_auxvar_up%temp(1) - & 
-                           global_auxvar_dn%temp(1))*dDk_dt_dn 
+                           area*(global_auxvar_up%temp - & 
+                           global_auxvar_dn%temp)*dDk_dt_dn 
 
   ! note: Res is the flux contribution, for node up J = J + Jup
   !                                              dn J = J - Jdn  
     call MaterialAuxVarCopy(material_auxvar_dn,material_auxvar_pert_dn,option)
 
     x_up(1) = global_auxvar_up%pres(1)
-    x_up(2) = global_auxvar_up%temp(1)
+    x_up(2) = global_auxvar_up%temp
     x_dn(1) = global_auxvar_dn%pres(1)
-    x_dn(2) = global_auxvar_dn%temp(1)
+    x_dn(2) = global_auxvar_dn%temp
 
     call THFlux( &
       auxvar_up,global_auxvar_up, &
     satg_dn = auxvar_dn%sat_gas
     if ((satg_up > eps) .and. (satg_dn > eps)) then
       p_g = option%reference_pressure ! set to reference pressure
-      deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp(1) + 273.15d0))*1.d-3
-      deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp(1) + 273.15d0))*1.d-3
+      deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp + 273.15d0))*1.d-3
+      deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp + 273.15d0))*1.d-3
 
       Diffg_ref = 2.13D-5 ! Reference diffusivity, need to read from input file
       p_ref = 1.01325d5 ! in Pa
       T_ref = 25.d0 ! in deg C
 
-      Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp(1) + 273.15d0)/ &
+      Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp + 273.15d0)/ &
            (T_ref + 273.15d0))**(1.8)  
-      Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp(1) + 273.15d0)/ &
+      Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp + 273.15d0)/ &
            (T_ref + 273.15d0))**(1.8)
            
       Ddiffgas_up = por_up*tor_up*satg_up*deng_up*Diffg_up
       Ddiffgas_dn = por_dn*tor_dn*satg_dn*deng_dn*Diffg_dn
-      call EOSWaterSaturationPressure(global_auxvar_up%temp(1), psat_up, ierr)
-      call EOSWaterSaturationPressure(global_auxvar_dn%temp(1), psat_dn, ierr)
+      call EOSWaterSaturationPressure(global_auxvar_up%temp, psat_up, ierr)
+      call EOSWaterSaturationPressure(global_auxvar_dn%temp, psat_dn, ierr)
 
       ! vapor pressure lowering due to capillary pressure
       fv_up = exp(-auxvar_up%pc/(global_auxvar_up%den(1)* &
-           R_gas_constant*(global_auxvar_up%temp(1) + 273.15d0)))
+           R_gas_constant*(global_auxvar_up%temp + 273.15d0)))
       fv_dn = exp(-auxvar_dn%pc/(global_auxvar_dn%den(1)* &
-           R_gas_constant*(global_auxvar_dn%temp(1) + 273.15d0)))
+           R_gas_constant*(global_auxvar_dn%temp + 273.15d0)))
 
       molg_up = psat_up*fv_up/p_g
       molg_dn = psat_dn*fv_dn/p_g
   endif
  
   Dk = (Dk_eff_up * Dk_eff_dn) / (dd_dn*Dk_eff_up + dd_up*Dk_eff_dn)
-  cond = Dk*area*(global_auxvar_up%temp(1) - global_auxvar_dn%temp(1))
+  cond = Dk*area*(global_auxvar_up%temp - global_auxvar_dn%temp)
 
   fluxe = fluxe + cond
 
             ! ---------------------------
 
             ! If surface-water is frozen, zero out the darcy velocity
-            if (global_auxvar_up%temp(1) < 0.d0) then
+            if (global_auxvar_up%temp < 0.d0) then
               dphi = 0.d0
               dphi_dp_dn = 0.d0
               dphi_dt_dn = 0.d0
   select case(ibndtype(TH_TEMPERATURE_DOF))
     case(DIRICHLET_BC,HET_DIRICHLET)
       Dk =  Dk_dn / dd_up
-      !cond = Dk*area*(global_auxvar_up%temp(1)-global_auxvar_dn%temp(1))
+      !cond = Dk*area*(global_auxvar_up%temp-global_auxvar_dn%temp)
 
       if (option%nsurfflowdof == 0) then
         ! ---------------------------
          satg_dn = auxvar_dn%sat_gas
          if ((satg_up > eps) .and. (satg_dn > eps)) then
             p_g = option%reference_pressure  ! set to reference pressure
-            deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp(1) + &
+            deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp + &
                  273.15d0))*1.d-3
-            deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp(1) + &
+            deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp + &
                  273.15d0))*1.d-3
         
             Diffg_ref = 2.13D-5 ! Reference diffusivity, need to read from input file
             p_ref = 1.01325d5 ! in Pa
             T_ref = 25.d0 ! in deg C 
 
-            Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp(1) + &
+            Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp + &
                  273.15d0)/(T_ref + 273.15d0))**(1.8)  
-            Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp(1) + &
+            Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp + &
                  273.15d0)/(T_ref + 273.15d0))**(1.8)
             Ddiffgas_up = satg_up*deng_up*Diffg_up
             Ddiffgas_dn = satg_dn*deng_dn*Diffg_dn
-            call EOSWaterSaturationPressure(global_auxvar_up%temp(1), psat_up, ierr)
-            call EOSWaterSaturationPressure(global_auxvar_dn%temp(1), psat_dn, dpsat_dt_dn, ierr)
+            call EOSWaterSaturationPressure(global_auxvar_up%temp, psat_up, ierr)
+            call EOSWaterSaturationPressure(global_auxvar_dn%temp, psat_dn, dpsat_dt_dn, ierr)
             molg_up = psat_up/p_g
             molg_dn = psat_dn/p_g
-            ddeng_dt_dn = - p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp(1) + &
+            ddeng_dt_dn = - p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp + &
                  273.15d0)**2)*1.d-3
             dmolg_dt_dn = (1/p_g)*dpsat_dt_dn
-            dDiffg_dt_dn = 1.8*Diffg_dn/(global_auxvar_dn%temp(1) + 273.15d0)
+            dDiffg_dt_dn = 1.8*Diffg_dn/(global_auxvar_dn%temp + 273.15d0)
             dDiffg_dp_dn = 0.d0
             dsatg_dp_dn = auxvar_dn%dsat_gas_dp
         
                             option)
 
     x_up(1) = global_auxvar_up%pres(1)
-    x_up(2) = global_auxvar_up%temp(1)
+    x_up(2) = global_auxvar_up%temp
     x_dn(1) = global_auxvar_dn%pres(1)
-    x_dn(2) = global_auxvar_dn%temp(1)
+    x_dn(2) = global_auxvar_dn%temp
     do ideriv = 1,3
       if (ibndtype(ideriv) == ZERO_GRADIENT_BC) then
         x_up(ideriv) = x_dn(ideriv)
             ! ---------------------------
 
             ! If surface-water is frozen, zero out the darcy velocity
-            if (global_auxvar_up%temp(1) < 0.d0) then
+            if (global_auxvar_up%temp < 0.d0) then
               dphi = 0.d0
             endif
           endif
   select case(ibndtype(TH_TEMPERATURE_DOF))
     case(DIRICHLET_BC,HET_DIRICHLET)
       Dk = Dk_dn / dd_up
-      cond = Dk*area*(global_auxvar_up%temp(1)-global_auxvar_dn%temp(1))
+      cond = Dk*area*(global_auxvar_up%temp-global_auxvar_dn%temp)
 
       if (option%nsurfflowdof>0) then
 
          satg_dn = auxvar_dn%sat_gas
          if ((satg_up > eps) .and. (satg_dn > eps)) then
             p_g = option%reference_pressure ! set to reference pressure
-            deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp(1) + 273.15d0))*1.d-3
-            deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp(1) + 273.15d0))*1.d-3
+            deng_up = p_g/(IDEAL_GAS_CONST*(global_auxvar_up%temp + 273.15d0))*1.d-3
+            deng_dn = p_g/(IDEAL_GAS_CONST*(global_auxvar_dn%temp + 273.15d0))*1.d-3
   
             Diffg_ref = 2.13D-5 ! Reference diffusivity, need to read from input file
             p_ref = 1.01325d5 ! in Pa
             T_ref = 25.d0 ! in deg C
 
-            Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp(1) + &
+            Diffg_up = Diffg_ref*(p_ref/p_g)*((global_auxvar_up%temp + &
                  273.15d0)/(T_ref + 273.15d0))**(1.8)
-            Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp(1) + &
+            Diffg_dn = Diffg_ref*(p_ref/p_g)*((global_auxvar_dn%temp + &
                  273.15d0)/(T_ref + 273.15d0))**(1.8)
             Ddiffgas_up = satg_up*deng_up*Diffg_up
             Ddiffgas_dn = satg_dn*deng_dn*Diffg_dn
-            call EOSWaterSaturationPressure(global_auxvar_up%temp(1), psat_up, ierr)
-            call EOSWaterSaturationPressure(global_auxvar_dn%temp(1), psat_dn, ierr)
+            call EOSWaterSaturationPressure(global_auxvar_up%temp, psat_up, ierr)
+            call EOSWaterSaturationPressure(global_auxvar_dn%temp, psat_dn, ierr)
         
             ! vapor pressure lowering due to capillary pressure
             fv_up = exp(-auxvar_up%pc/(global_auxvar_up%den(1)* &
-                 R_gas_constant*(global_auxvar_up%temp(1) + 273.15d0)))
+                 R_gas_constant*(global_auxvar_up%temp + 273.15d0)))
             fv_dn = exp(-auxvar_dn%pc/(global_auxvar_dn%den(1)* &
-                 R_gas_constant*(global_auxvar_dn%temp(1) + 273.15d0)))
+                 R_gas_constant*(global_auxvar_dn%temp + 273.15d0)))
 
             molg_up = psat_up*fv_up/p_g
             molg_dn = psat_dn*fv_dn/p_g
     disp_vec(3,1) = grid%z(ghosted_neighbors(i)) - grid%z(ghosted_id)
     disp_mat = disp_mat + matmul(disp_vec,transpose(disp_vec))
     temp_weighted = temp_weighted + disp_vec* &
-                    (global_auxvars(ghosted_neighbors(i))%temp(1) - &
-                     global_auxvars(ghosted_id)%temp(1))
+                    (global_auxvars(ghosted_neighbors(i))%temp - &
+                     global_auxvars(ghosted_id)%temp)
   enddo
 
   call ludcmp(disp_mat,THREE_INTEGER,INDX,D)
   dm_plus = sec_heat_vars%dm_plus
   dm_minus = sec_heat_vars%dm_minus
   area_fm = sec_heat_vars%interfacial_area
-  temp_primary_node = global_auxvar%temp(1)
+  temp_primary_node = global_auxvar%temp
   
   coeff_left = 0.d0
   coeff_diag = 0.d0

File src/pflotran/th_aux.F90

   endif  
 
 !  call wateos_noderiv(option%temp,pw,dw_kg,dw_mol,hw,option%scale,ierr)
-  call EOSWaterDensityEnthalpy(global_auxvar%temp(1),pw,dw_kg,dw_mol,hw, &
+  call EOSWaterDensityEnthalpy(global_auxvar%temp,pw,dw_kg,dw_mol,hw, &
                                dw_dp,dw_dt,hw_dp,hw_dt,ierr)
   ! J/kmol -> whatever units
   hw = hw * option%scale
   hw_dt = hw_dt * option%scale
   
 ! may need to compute dpsat_dt to pass to VISW
-  call EOSWaterSaturationPressure(global_auxvar%temp(1),sat_pressure,dpsat_dt,ierr)
+  call EOSWaterSaturationPressure(global_auxvar%temp,sat_pressure,dpsat_dt,ierr)
   
 !  call VISW_noderiv(option%temp,pw,sat_pressure,visl,ierr)
-  call EOSWaterViscosity(global_auxvar%temp(1),pw,sat_pressure,dpsat_dt,visl, &
+  call EOSWaterViscosity(global_auxvar%temp,pw,sat_pressure,dpsat_dt,visl, &
                          dvis_dt,dvis_dp,dvis_dpsat,ierr)
   if (iphase == 3) then !kludge since pw is constant in the unsat zone
     dvis_dp = 0.d0
     case (PAINTER_EXPLICIT)
       ! Model from Painter, Comp. Geosci. (2011)
       call SatFuncComputeIcePExplicit(global_auxvar%pres(1), & 
-                                      global_auxvar%temp(1), ice_saturation, &
+                                      global_auxvar%temp, ice_saturation, &
                                       global_auxvar%sat(1), gas_saturation, &
                                       kr, ds_dp, dsl_temp, dsg_pl, dsg_temp, &
                                       dsi_pl, dsi_temp, dkr_dp, dkr_dt, &
     case (PAINTER_KARRA_IMPLICIT)
       ! Implicit model from Painter & Karra, VJZ (2013)
       call SatFuncComputeIcePKImplicit(global_auxvar%pres(1), & 
-                                       global_auxvar%temp(1), ice_saturation, &
+                                       global_auxvar%temp, ice_saturation, &
                                        global_auxvar%sat(1), gas_saturation, &
                                        kr, ds_dp, dsl_temp, dsg_pl, dsg_temp, &
                                        dsi_pl, dsi_temp, dkr_dp, dkr_dt, &
     case (PAINTER_KARRA_EXPLICIT)
       ! Explicit model from Painter & Karra, VJZ (2013)
       call SatFuncComputeIcePKExplicit(global_auxvar%pres(1), & 
-                                       global_auxvar%temp(1), ice_saturation, &
+                                       global_auxvar%temp, ice_saturation, &
                                        global_auxvar%sat(1), gas_saturation, &
                                        kr, ds_dp, dsl_temp, dsg_pl, dsg_temp, &
                                        dsi_pl, dsi_temp, dkr_dp, dkr_dt, &
     case (DALL_AMICO)
       ! Model from Dall'Amico (2010) and Dall' Amico et al. (2011)
       call SatFuncComputeIceDallAmico(global_auxvar%pres(1), &
-                                      global_auxvar%temp(1), &
+                                      global_auxvar%temp, &
                                       auxvar%pres_fh2o, &
                                       auxvar%dpres_fh2o_dp, &
                                       auxvar%dpres_fh2o_dt, &
     case (PAINTER_KARRA_EXPLICIT_NOCRYO)
       ! Explicit model from Painter & Karra, VJZ (2013) and removed cryosuction
       call SatFuncComputeIcePKExplicitNoCryo(global_auxvar%pres(1), & 
-                                       global_auxvar%temp(1), ice_saturation, &
+                                       global_auxvar%temp, ice_saturation, &
                                        global_auxvar%sat(1), gas_saturation, &
                                        kr, ds_dp, dsl_temp, dsg_pl, dsg_temp, &
                                        dsi_pl, dsi_temp, dkr_dp, dkr_dt, &
       call printErrMsg(option)
   end select
 
-  call EOSWaterDensityEnthalpy(global_auxvar%temp(1),pw,dw_kg,dw_mol,hw, &
+  call EOSWaterDensityEnthalpy(global_auxvar%temp,pw,dw_kg,dw_mol,hw, &
                                dw_dp,dw_dt,hw_dp,hw_dt,ierr)
   ! J/kmol -> MJ/kmol
   hw = hw * 1.d-6
   hw_dp = hw_dp * 1.d-6
   hw_dt = hw_dt * 1.d-6
                          
-  call EOSWaterSaturationPressure(global_auxvar%temp(1), sat_pressure, &
+  call EOSWaterSaturationPressure(global_auxvar%temp, sat_pressure, &
                                   dpsat_dt, ierr)
-  call EOSWaterViscosity(global_auxvar%temp(1), pw, sat_pressure, dpsat_dt, &
+  call EOSWaterViscosity(global_auxvar%temp, pw, sat_pressure, dpsat_dt, &
                          visl, dvis_dt,dvis_dp, dvis_dpsat, ierr)
 
   if (iphase == 3) then !kludge since pw is constant in the unsat zone
   auxvar%dsat_gas_dt = dsg_temp
   
 ! Calculate the density, internal energy and derivatives for ice
-  call EOSWaterDensityIce(global_auxvar%temp(1), global_auxvar%pres(1), &
+  call EOSWaterDensityIce(global_auxvar%temp, global_auxvar%pres(1), &
                           den_ice, dden_ice_dT, dden_ice_dP, ierr)
 
-  call EOSWaterInternalEnergyIce(global_auxvar%temp(1), u_ice, du_ice_dT)
+  call EOSWaterInternalEnergyIce(global_auxvar%temp, u_ice, du_ice_dT)
 
   auxvar%den_ice = den_ice
   auxvar%dden_ice_dt = dden_ice_dT

File src/pflotran/transport.F90

 
 #if defined(TEMP_DEPENDENT_LOGK) || defined (CHUAN_HPT)
     T_ref_inv = 1.d0/(25.d0 + 273.15d0)
-    temp_up = global_auxvar_up%temp(1)  ! getting data from global to local variables
-    temp_dn = global_auxvar_dn%temp(1)
+    temp_up = global_auxvar_up%temp  ! getting data from global to local variables
+    temp_dn = global_auxvar_dn%temp
     Ddiff_up = rt_parameter%diffusion_coefficient(iphase)* &
                exp(rt_parameter%diffusion_activation_energy(iphase) &
                /R_gas_constant*(T_ref_inv - 1.d0/(temp_up + 273.15d0)))
 ! Add the effect of temperature on diffusivity, Satish Karra, LANL, 11/1/2011
 #if defined(TEMP_DEPENDENT_LOGK) || defined (CHUAN_HPT)
           T_ref_inv = 1.d0/(25.d0 + 273.15d0)
-          temp_up = global_auxvar_up%temp(1)      
-          temp_dn = global_auxvar_dn%temp(1)
+          temp_up = global_auxvar_up%temp      
+          temp_dn = global_auxvar_dn%temp
           Ddiff_up = rt_parameter%diffusion_coefficient(iphase)* &
                     exp(rt_parameter%diffusion_activation_energy(iphase) &
                     /R_gas_constant*(T_ref_inv - 1.d0/(temp_up + 273.15d0)))
                           
 #if defined(TEMP_DEPENDENT_LOGK) || defined (CHUAN_HPT)
       T_ref_inv = 1.d0/(25.d0 + 273.15d0)
-      temp_up = global_auxvar_up%temp(1)      
+      temp_up = global_auxvar_up%temp      
       dispersion(iphase) = dispersion(iphase) + &
         stp_ave_over_dist*rt_parameter%diffusion_coefficient(iphase)* &
         (exp(rt_parameter%diffusion_activation_energy(iphase)/ &
                             
 #if defined(TEMP_DEPENDENT_LOGK) || defined (CHUAN_HPT)  
         T_ref_inv = 1.d0/(25.d0 + 273.15d0)
-        temp_up = global_auxvar_up%temp(1)      
+        temp_up = global_auxvar_up%temp      
         dispersion(iphase) = dispersion(iphase) + &
           stp_ave_over_dist*rt_parameter%diffusion_coefficient(iphase)* &
           (exp(rt_parameter%diffusion_activation_energy(iphase)/ &
                 
 #if defined(TEMP_DEPENDENT_LOGK) || defined (CHUAN_HPT)
             T_ref_inv = 1.d0/(25.d0 + 273.15d0)
-            temp_up = global_auxvar_up%temp(1)      
+            temp_up = global_auxvar_up%temp      
             dispersion(iphase) = dispersion(iphase) + &
               stp_ave_over_dist*rt_parameter%diffusion_coefficient(iphase)* &
               (exp(rt_parameter%diffusion_activation_energy(iphase)/ &
                                   rt_parameter%diffusion_coefficient(iphase)
 #if defined(TEMP_DEPENDENT_LOGK) || defined (CHUAN_HPT)
               T_ref_inv = 1.d0/(25.d0 + 273.15d0)
-              temp_up = global_auxvar_up%temp(1)      
+              temp_up = global_auxvar_up%temp      
               dispersion(iphase) = dispersion(iphase) + &
                 stp_ave_over_dist*rt_parameter%diffusion_coefficient(iphase)* &
                 (exp(rt_parameter%diffusion_activation_energy(iphase)/ &