source:
issm/oecreview/Archive/14312-15392/ISSM-15015-15016.diff@
15393
Last change on this file since 15393 was 15393, checked in by , 12 years ago | |
---|---|
File size: 5.7 KB |
-
../trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp
11 11 #include "../../toolkits/toolkits.h" 12 12 #include "../InputUpdateFromConstantx/InputUpdateFromConstantx.h" 13 13 14 #define Ntime 5 // number of times with load history15 #define Ntimm 4 // Ntime-1 : for slope/y-cept of load segments16 #define Ntimp 6 // Ntime+1 : for evaluation time17 14 18 15 /*External blocks: {{{*/ 19 16 struct blockp{ 20 17 double pset[7]; 21 18 }; 22 23 struct blockt{ 24 double time[Ntimp]; 25 double bi[Ntimm]; 26 double dmi[Ntimm]; 27 }; 28 19 29 20 struct blocko{ 30 21 double rhoi; 31 double hload[Ntime];32 22 }; 33 23 34 struct blocky{35 double zhload[Ntime];36 };37 24 38 25 struct blockn{ 39 26 int irate; … … 50 37 }; 51 38 52 39 extern "C" { 53 int distme_( int* pidisk,int* piedge); 40 int distme_( int* pidisk,int* piedge, int* pNtime, int* pNtimp, int* pNtimm, int* pNafter,double* time,double* bi,double* dmi,double* zhload,double* hload); 41 54 42 int what0_( int* pidisk,int* piedge); 55 43 extern struct blockp blockp_; 56 extern struct blockt blockt_;57 44 extern struct blocko blocko_; 58 extern struct blocky blocky_;59 45 extern struct blockn blockn_; 60 46 extern struct blockrad blockrad_; 61 47 extern struct blocks blocks_; … … 65 51 66 52 void GiaDeflectionCorex( IssmDouble* pwi, IssmDouble* pdwidt, GiaDeflectionCoreArgs* arguments){ 67 53 54 /*intermediary: */ 55 int i; 56 68 57 /*output: */ 69 58 IssmDouble wi=0; 70 59 IssmDouble dwidt=0; … … 86 75 IssmDouble* times; //loading history times 87 76 int numtimes; //loading history length 88 77 IssmDouble currenttime; 78 int Ntime=5; // number of times with load history 79 int Ntimm; // Ntime-1 : for slope/y-cept of load segments 80 int Ntimp; // Ntime+1 : for evaluation time 81 int Nafter; 82 IssmDouble* blockt_time=NULL; 83 IssmDouble* blockt_bi=NULL; 84 IssmDouble* blockt_dmi=NULL; 85 IssmDouble* blocky_zhload=NULL; 86 IssmDouble* blocko_hload=NULL; 89 87 90 88 /*gia material parameters: */ 91 89 IssmDouble lithosphere_shear_modulus; … … 127 125 /*Modify inputs to match naruse code: */ 128 126 //from our model, irate comes in with values in [1,2], which maps into [0,1] in naruse: 129 127 irate=irate-1; 128 Nafter=1; 129 Ntime=numtimes; 130 Ntimm=Ntime-1; 131 Ntimp=Ntime+Nafter; 130 132 131 133 /*Prepare block inputs for fortran distme and what0 routines of the naruse code: {{{*/ 132 134 /*Now, let's set pset from the data that we got in input to GiaDeflectionCorex: */ … … 140 142 blocko_.rhoi=rho_ice; 141 143 142 144 /*loading history: */ 143 blocky_.zhload[0]=hes[0]; 144 blocky_.zhload[1]=hes[1]; 145 blocky_.zhload[2]=hes[2]; 146 blocky_.zhload[3]=hes[3]; 147 blocky_.zhload[4]=hes[numtimes-1]; 145 blocky_zhload=xNew<IssmDouble>(numtimes); 146 for(i=0;i<numtimes;i++){ 147 blocky_zhload[i]=hes[i]; 148 } 148 149 149 150 /*times: */ 150 blockt_.time[0]=times[0]/1000.0/yts; // in kyr 151 blockt_.time[1]=times[1]/1000.0/yts; // in kyr 152 blockt_.time[2]=times[2]/1000.0/yts; // in kyr 153 blockt_.time[3]=times[3]/1000.0/yts; // in kyr 154 blockt_.time[4]=2500.0; // in kyr 155 blockt_.time[5]=times[numtimes-1]/1000.0/yts; // evaluation time, in kyr 151 blockt_time=xNew<IssmDouble>(numtimes+1); 152 for (i=0;i<numtimes;i++){ 153 blockt_time[i]=times[i]/1000.0/yts; //in kyr 154 if(i==numtimes-2)blockt_time[i]=2500.0; // in kyr 155 } 156 157 /*bi: */ 158 blockt_bi=xNew<IssmDouble>(numtimes-1); 156 159 160 /*dmi: */ 161 blockt_dmi=xNew<IssmDouble>(numtimes-1); 162 163 /*hload:*/ 164 blocko_hload=xNew<IssmDouble>(numtimes); 165 157 166 /*irate: */ 158 167 blockn_.irate=irate; 159 168 … … 162 171 /*}}}*/ 163 172 164 173 /*Call distme driver: */ 165 distme_(&idisk,&iedge );174 distme_(&idisk,&iedge,&Ntime,&Ntimp,&Ntimm,&Nafter,blockt_time,blockt_bi,blockt_dmi,blocky_zhload,blocko_hload); 166 175 176 167 177 /*Call what0 driver: */ 168 178 what0_(&idisk,&iedge); 169 179 … … 179 189 *pdwidt=dwidt; 180 190 } 181 191 192 /*Free ressources: */ 193 xDelete<IssmDouble>(blockt_time); 194 xDelete<IssmDouble>(blockt_bi); 195 xDelete<IssmDouble>(blockt_dmi); 196 xDelete<IssmDouble>(blocky_zhload); 197 xDelete<IssmDouble>(blocko_hload); 198 182 199 } 200 -
../trunk-jpl/src/c/modules/GiaDeflectionCorex/distme.f
1 subroutine distme(idisk,iedge) 1 subroutine distme(idisk,iedge,Ntime,Ntimp,Ntimm,Nafter,time,bi, 2 &dmi,zhload,hload) 2 3 implicit double precision (a-h,o-y) 4 integer idisk,iedge,Ntime,Ntimp,Ntimm,Nafter 3 5 parameter (N3G = 1) 4 parameter (Ntime = 5)5 parameter (Ntimm = Ntime-1)6 parameter (Nafter = 1)7 parameter (Ntimp = Ntime + Nafter)8 6 double precision pset(7) 9 7 double precision time(Ntimp),dmi(Ntimm),bi(Ntimm),dumbt(Ntimp) 10 8 double precision hload(Ntime),qpat(Ntime),qt(Ntime) … … 12 10 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 11 common /blockp/ pset 14 12 common /blockrad/ distrad 15 common /blockt/ time,bi,dmi 16 common /blocky/ zhload 17 common /blocko/ rhoi,hload 13 common /blocko/ rhoi 18 14 data g /9.832186d0/, yearco /3.15576d7/, eradm/6.371d6/ 19 15 data dpi /3.1415926535897932d0/, dzero/0.0d0/ 20 16 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: … … 26 22 dumbt(k) = time(k) 27 23 776 continue 28 24 c write(6,*) time(1), time(2), time(3) 29 c write(6,*) zhload(1), zhload(2), distrad, rhoi30 25 c write(6,*) pset(1), pset(2), pset(3), pset(4), pset(5), pset(6) 31 26 c write(6,*) pset(7) 32 27 c call dvecpr(time,Ntime,'::::: time @ distme.f :::::',79,0,0)
Note:
See TracBrowser
for help on using the repository browser.