Exemplo n.º 1
0
void grain_growth_initialize(
     struct All_variables *E
)
{
  int i,j,el,level,rheo,material;
  char default_str[40];

  /* Which formulation is to be used .... growth/nucleation or empirical */

  input_int("Grain_size_model",&(E->tracer.grain_size_model),"1");

  for(material=0;material<=E->tracer.NUM_MATERIALS;material++) {

    if(E->tracer.grain_size_model==1) {
      sprintf(default_str,"Material_%d_grsz_epsT",material);
      input_std_precision(default_str,&(E->tracer.grain[material].grsz_epsT),"0.0");
      sprintf(default_str,"Material_%d_grsz_B",material);
      input_std_precision(default_str,&(E->tracer.grain[material].grsz_B),"1.0");
      sprintf(default_str,"Material_%d_grsz_stsexp",material);
      input_std_precision(default_str,&(E->tracer.grain[material].grsz_stsexp),"1.0");

    }

    else if (E->tracer.grain_size_model==2) {

      sprintf(default_str,"Material_%d_reduction_factor_e",material);
      input_std_precision(default_str,&(E->tracer.grain[material].reduction_factor_equil),"1.0");
      sprintf(default_str,"Material_%d_reduction_factor_m",material);
      input_std_precision(default_str,&(E->tracer.grain[material].reduction_factor_metas),"1.0");
      
      sprintf(default_str,"Material_%d_grain_T_dep",material);
      input_int_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].GRAIN_T_dep,1);
      sprintf(default_str,"Material_%d_grain_gr_a",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].ggrw_a,0.0);
      sprintf(default_str,"Material_%d_grain_gr_m",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].ggrw_m,0.0);
      sprintf(default_str,"Material_%d_grain_gr_Q",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].ggrw_Q,0.0);
      sprintf(default_str,"Material_%d_grain_gr_T",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].ggrw_T,0.0);
      sprintf(default_str,"Material_%d_grain_gr_T0",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].ggrw_T0,0.0);
      sprintf(default_str,"Material_%d_grain_nu_a",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].gnuc_a,0.0);
      sprintf(default_str,"Material_%d_grain_nu_m",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].gnuc_m,0.0);
      sprintf(default_str,"Material_%d_grain_nu_meps",material);
      input_std_precision_vector(default_str,E->tracer.Phases[material],E->tracer.grain[material].gnuc_meps,0.0);
    }
  }
  return;
}
Exemplo n.º 2
0
void tic_input(struct All_variables *E)
{

  int m = E->parallel.me;
  int noz = E->lmesh.noz;
  int n;
#ifdef USE_GGRD
  int tmp;
#endif

  input_int("tic_method", &(E->convection.tic_method), "0,0,2", m);

#ifdef USE_GGRD			/* for backward capability */
  input_int("ggrd_tinit", &tmp, "0", m);
  if(tmp){
    E->convection.tic_method = 4; /*  */
    E->control.ggrd.use_temp = 1;
  }
#endif  
  /* When tic_method is 0 (default), the temperature is a linear profile +
     perturbation at some layers.

     When tic_method is -1, the temperature is read in from the
     [datafile_old].velo.[rank].[solution_cycles_init] files.

     When tic_method is 1, the temperature is isothermal (== bottom b.c.) +
     uniformly cold plate (thickness specified by 'half_space_age').

     When tic_method is 2, (tic_method==1) + a hot blob. A user can specify
     the location and radius of the blob, and also the amplitude of temperature
     change in the blob relative to the ambient mantle temperautre
     (E->control.mantle_temp).
        - blob_center: A comma-separated list of three float numbers.
        - blob_radius: A dmensionless length, typically a fraction
                       of the Earth's radius.
        - blob_dT    : Dimensionless temperature.

     When tic_method is 3, the temperature is a linear profile + perturbation
     for whole mantle.

     tic_method is 4: read in initial temperature distribution from a set of netcdf grd
                      files. this required the GGRD extension to be compiled in

  */

    /* This part put a temperature anomaly at depth where the global
       node number is equal to load_depth. The horizontal pattern of
       the anomaly is given by spherical harmonic ll & mm. */

    input_int("num_perturbations", &n, "0,0,PERTURB_MAX_LAYERS", m);

    if (n > 0) {
      E->convection.number_of_perturbations = n;

      if (! input_float_vector("perturbmag", n, E->convection.perturb_mag, m) ) {
	fprintf(stderr,"Missing input parameter: 'perturbmag'\n");
	parallel_process_termination();
      }
      if (! input_int_vector("perturbm", n, E->convection.perturb_mm, m) ) {
	fprintf(stderr,"Missing input parameter: 'perturbm'\n");
	parallel_process_termination();
      }
      if (! input_int_vector("perturbl", n, E->convection.perturb_ll, m) ) {
	fprintf(stderr,"Missing input parameter: 'perturbl'\n");
	parallel_process_termination();
      }
      if (! input_int_vector("perturblayer", n, E->convection.load_depth, m) ) {
	fprintf(stderr,"Missing input parameter: 'perturblayer'\n");
	parallel_process_termination();
      }
    }
    else {
      E->convection.number_of_perturbations = 1;
      E->convection.perturb_mag[0] = 1;
      E->convection.perturb_mm[0] = 2;
      E->convection.perturb_ll[0] = 2;
      E->convection.load_depth[0] = (noz+1)/2;
    }

    input_float("half_space_age", &(E->convection.half_space_age), "40.0,1e-3,nomax", m);
    input_float("mantle_temp",&(E->control.mantle_temp),"1.0",m);

    
    switch(E->convection.tic_method){
    case 2:			/* blob */
      if( ! input_float_vector("blob_center", 3, E->convection.blob_center, m)) {
	assert( E->sphere.caps == 12 || E->sphere.caps == 1 );
	if(E->sphere.caps == 12) { /* Full version: just quit here */
	  fprintf(stderr,"Missing input parameter: 'blob_center'.\n");
	  parallel_process_termination();
	}
	else if(E->sphere.caps == 1) { /* Regional version: put the blob at the center */
	  fprintf(stderr,"Missing input parameter: 'blob_center'. The blob will be placed at the center of the domain.\n");
	  E->convection.blob_center[0] = 0.5*(E->control.theta_min+E->control.theta_max);
	  E->convection.blob_center[1] = 0.5*(E->control.fi_min+E->control.fi_max);
	  E->convection.blob_center[2] = 0.5*(E->sphere.ri+E->sphere.ro);
	}
      }
      input_float("blob_radius", &(E->convection.blob_radius), "0.063,0.0,1.0", m);
      input_float("blob_dT", &(E->convection.blob_dT), "0.18,nomin,nomax", m);
      input_boolean("blob_bc_persist",&(E->convection.blob_bc_persist),"off",m);
      break;
    case 4:
      /*
	case 4: initial temp from grd files
      */
#ifdef USE_GGRD
      /* 
	 read in some more parameters 
	 
      */
      /* scale the anomalies with PREM densities */
      input_boolean("ggrd_tinit_scale_with_prem",
		    &(E->control.ggrd.temp.scale_with_prem),"off",E->parallel.me);
      /* limit T to 0...1 */
      input_boolean("ggrd_tinit_limit_trange",
		    &(E->control.ggrd.temp.limit_trange),"on",E->parallel.me);
      /* scaling factor for the grids */
      input_double("ggrd_tinit_scale",
		   &(E->control.ggrd.temp.scale),"1.0",E->parallel.me); /* scale */
      /* temperature offset factor */
      input_double("ggrd_tinit_offset",
		   &(E->control.ggrd.temp.offset),"0.0",E->parallel.me); /* offset */
      /* 
	 do we want a different scaling for the lower mantle?
      */
      input_float("ggrd_lower_depth_km",&(E->control.ggrd_lower_depth_km),"7000",
		  E->parallel.me); /* depth, in km, below which
				      different scaling applies */
      input_float("ggrd_lower_scale",&(E->control.ggrd_lower_scale),"1.0",E->parallel.me);
      input_float("ggrd_lower_offset",&(E->control.ggrd_lower_offset),"1.0",E->parallel.me);

      /* grid name, without the .i.grd suffix */
      input_string("ggrd_tinit_gfile",
		   E->control.ggrd.temp.gfile,"",E->parallel.me); /* grids */
      input_string("ggrd_tinit_dfile",
		   E->control.ggrd.temp.dfile,"",E->parallel.me); /* depth.dat layers of grids*/
      /* override temperature boundary condition? */
      input_boolean("ggrd_tinit_override_tbc",
		    &(E->control.ggrd.temp.override_tbc),"off",E->parallel.me);
      input_string("ggrd_tinit_prem_file",
		   E->control.ggrd.temp.prem.model_filename,"hc/prem/prem.dat", 
		   E->parallel.me); /* PREM model filename */

      /* non-linear scaling, downweighing negative anomalies? */
      input_boolean("ggrd_tinit_nl_scale",&(E->control.ggrd_tinit_nl_scale),"off",E->parallel.me);
    
#else
      fprintf(stderr,"tic_method 4 only works for USE_GGRD compiled code\n");
      parallel_process_termination();
#endif
      break;
    } /* no default needed */
    return;
}