Changeset 14746


Ignore:
Timestamp:
04/24/13 16:04:43 (12 years ago)
Author:
Eric.Larour
Message:

CHG: finished integration of statically allocated blocks distme into GiaDeflectionCorex.

Location:
issm/trunk-jpl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/GiaDeflectionCoreArgs.h

    r14734 r14746  
    1111        IssmDouble ri; //radial distance from center of disk to vertex  i
    1212        IssmDouble re; //radius of disk
     13        IssmDouble current_he; //thickness of ice at current time
    1314        IssmDouble* hes; //loading history (in ice thickness)
    1415        IssmDouble* times; //loading history times
     
    2728        IssmDouble rho_ice;
    2829
     30        /*debug info: */
     31        int        idisk; //id of the element we are running the gia code in.
     32
    2933};
    3034
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r14735 r14746  
    30573057
    30583058        /*thickness averages: */
     3059        IssmDouble current_he=NULL;
    30593060        IssmDouble* hes=NULL;
    30603061        IssmDouble* times=NULL;
     
    30993100        if (!thickness_input)_error_("thickness input needed to compute gia deflection!");
    31003101        thickness_input->GetInputAllTimeAverages(&hes,&times,&numtimes);
     3102        thickness_input->GetInputAverage(&current_he);
    31013103
    31023104        /*recover lithosphere thickness: */
     
    31183120        /*start loading GiaDeflectionCore arguments: */
    31193121        arguments.re=re;
     3122        arguments.current_he=current_he;
    31203123        arguments.hes=hes;
    31213124        arguments.times=times;
     
    31293132        arguments.lithosphere_thickness=lithosphere_thickness;
    31303133        arguments.rho_ice=rho_ice;
     3134        arguments.idisk=this->id;
    31313135
    31323136        for(i=0;i<gsize;i++){
  • issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp

    r14741 r14746  
    1414#include "../InputUpdateFromConstantx/InputUpdateFromConstantx.h"
    1515
     16#define Nrsl 1
     17#define N3G 1
     18#define Nafter 1
     19#define Ntime 2
     20#define Ntimp 3
     21
     22/*External blocks: {{{*/
     23struct blockp{
     24        double pset[7];
     25};
     26     
     27struct blockt{
     28        double time[Ntimp];
     29        double* time;
     30        double bi[Ntime];
     31        double dmi[Ntime];
     32};
     33
     34struct blocko{
     35        double rhoi;
     36        double hload[Ntime];
     37};
     38
     39struct blocky{
     40        double zhload[Ntime][N3G];
     41};
     42     
     43
     44extern "C" {
     45        int distme_( int* pidisk,int* piedge,int* pisolt);
     46        extern struct blockp blockp_;
     47        extern struct blockt blockt_;
     48        extern struct blocko blocko_;
     49        extern struct blocky blocky_;
     50}
     51/*}}}*/
     52     
    1653void GiaDeflectionCorex( IssmDouble* pwi, GiaDeflectionCoreArgs* arguments){
    1754
    1855        /*output: */
    1956        IssmDouble wi=1;
     57       
     58        /*inputs: */
     59        int iedge=1; //c iedge ......... = 1 square-edged, = 2 elliptical disc x-section  (see naruse.f)
     60        int idisk=1; // disk #
     61        int isolt=1002;
     62
     63        /*intermediary: */
    2064
    2165        /*inputs: {{{*/
    2266        IssmDouble ri; //radial distance from center of disk to vertex  i
    2367        IssmDouble re; //radius of disk
     68        IssmDouble current_he; //thickness at current time
    2469        IssmDouble* hes; //loading history (in ice thickness)
    2570        IssmDouble* times; //loading history times
     
    3782        /*ice properties: */
    3883        IssmDouble rho_ice;
     84
     85        /*some debug info: */
     86        int disk_id;
    3987        /*}}}*/
    4088
    41        
    4289        /*Recover material parameters and loading history: see GiaDeflectionCoreArgs for more details {{{*/
    4390        ri=arguments->ri;
    4491        re=arguments->re;
     92        current_he=arguments->current_he;
    4593        hes=arguments->hes;
    4694        times=arguments->times;
     
    54102        lithosphere_thickness=arguments->lithosphere_thickness;
    55103        rho_ice=arguments->rho_ice;
     104        disk_id=arguments->idisk;
    56105        /*}}}*/
     106
     107        /*Documentation for pset coming from naruse.f:
     108        c pset(1) ....... h (thickness of elastic lithosphere in km)
     109        c pset(2) ....... viscosity of sub-layer in Pa*s
     110        c pset(3) ....... elastic rigidity of lithosphere in dynes/cm^2
     111        c pset(4) ....... elastic rigidity of sub-lithosphere in dynes/cm^2
     112        c pset(5) ....... density of lithosphere in gm/cc
     113        c pset(6) ....... density of sub-lithosphere in gm/cc
     114        c pset(7) ....... =dset(1)
     115        c dset(1) ....... disk radius in km
     116
     117        Now, let's set pset from the data that we got in input to GiaDeflectionCorex:
     118        */
     119        blockp_.pset[0]=lithosphere_thickness;
     120        blockp_.pset[1]=mantle_viscosity;
     121        blockp_.pset[2]=lithosphere_shear_modulus;
     122        blockp_.pset[3]=mantle_shear_modulus;
     123        blockp_.pset[4]=lithosphere_density;
     124        blockp_.pset[5]=mantle_density;
     125        blockp_.pset[6]=re;
     126        blocko_.rhoi=rho_ice;
     127     
     128        /*loading history: */
     129        blocky_.zhload[0][0]=current_he;
     130        blocky_.zhload[1][0]=current_he;
     131
     132        /*times: */
     133        blockt_.time[0]=0.1;
     134        blockt_.time[1]=2000;
     135        blockt_.time[2]=1000;
     136
     137
     138        /*Call distme driver: */
     139        distme_(&idisk,&iedge,&isolt);
     140
     141        //printf("disk id: %i bi: [%g,%g] dmi: [%g,%g] \n",disk_id,blockt_.bi[0], blockt_.bi[1],blockt_.dmi[0],blockt_.dmi[1]);
    57142
    58143        /*allocate output pointer: */
  • issm/trunk-jpl/test/NightlyRun/test2001.m

    r14740 r14746  
    11%GIA test, inspired on test101
    2 md=triangle(model(),'../Exp/Square.exp',50000.);
     2md=triangle(model(),'../Exp/Square.exp',100000.);
    33md=setmask(md,'','');
    44md=parameterize(md,'../Par/SquareSheetConstrained.par');
Note: See TracChangeset for help on using the changeset viewer.