Changeset 12708


Ignore:
Timestamp:
07/24/12 10:38:45 (13 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 12707

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src/c/objects/Inputs/TransientInput.h

    r12706 r12708  
    5151                void GetInputValue(IssmDouble* pvalue){_error2_("not implemented yet");};
    5252                void GetInputValue(IssmDouble* pvalue,GaussTria* gauss);
    53                 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss){_error2_("not implemented yet");};
     53                void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss);
    5454                void GetInputValue(IssmDouble* pvalue,GaussTria* gauss,IssmDouble time);
    55                 void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time){_error2_("not implemented yet");};
     55                void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss,IssmDouble time);
    5656                void GetInputValue(IssmDouble* pvalue,GaussTria* gauss ,int index){_error2_("not implemented yet");};
    5757                void GetInputValue(IssmDouble* pvalue,GaussPenta* gauss ,int index){_error2_("not implemented yet");};
  • issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp

    r12641 r12708  
    55#include "./elements.h"
    66
    7 double PddSurfaceMassBlance(double* monthlytemperatures, double* monthlyprec, double* pdds, double* pds, double signorm, double yts, double h, double s, double rho_ice, double rho_water){
     7IssmDouble PddSurfaceMassBlance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec, IssmDouble* pdds, IssmDouble* pds, IssmDouble signorm, IssmDouble yts, IssmDouble h, IssmDouble s, IssmDouble rho_ice, IssmDouble rho_water){
    88
    99  // output:
    10   double B;    // surface mass balance, melt+accumulation
     10  IssmDouble B;    // surface mass balance, melt+accumulation
    1111
    1212  int    iqj,imonth, j;
    1313 
    14   double saccu;     // yearly surface accumulation
    15   double smelt;     // yearly melt
    16   double precrunoff;      // yearly runoff
    17   double prect; // total precipitation during 1 year taking into account des. ef.
    18   double water; //water=rain + snowmelt
    19   double runoff; //meltwater only, does not include rain
    20   double sconv; //rhow_rain/rhoi / 12 months
    21  
    22   double density;
    23   double lapser=6.5/1000., sealev=0.;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
    24   double desfac = 0.5;                 // desert elevation factor
    25   double s0p=0.;         // should be set to elevation from precip source
    26   double s0t=0.;         // should be set to elevation from temperature source
    27   double st;             // elevation between altitude of the temp record and current altitude
    28   double sp;             // elevation between altitude of the prec record and current altitude
     14  IssmDouble saccu;     // yearly surface accumulation
     15  IssmDouble smelt;     // yearly melt
     16  IssmDouble precrunoff;      // yearly runoff
     17  IssmDouble prect; // total precipitation during 1 year taking into account des. ef.
     18  IssmDouble water; //water=rain + snowmelt
     19  IssmDouble runoff; //meltwater only, does not include rain
     20  IssmDouble sconv; //rhow_rain/rhoi / 12 months
     21 
     22  IssmDouble density;
     23  IssmDouble lapser=6.5/1000., sealev=0.;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
     24  IssmDouble desfac = 0.5;                 // desert elevation factor
     25  IssmDouble s0p=0.;         // should be set to elevation from precip source
     26  IssmDouble s0t=0.;         // should be set to elevation from temperature source
     27  IssmDouble st;             // elevation between altitude of the temp record and current altitude
     28  IssmDouble sp;             // elevation between altitude of the prec record and current altitude
    2929 
    3030  // PDD and PD constants and variables
    31   double siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
    32   double signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
    33   double siglimc, siglim0, siglim0c;
    34   double PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
    35   double DT = 0.02;
    36   double pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
    37  
    38   double q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
    39   double qm = 0.;        // snow part of the precipitation
    40   double qmt = 0.;       // precipitation without desertification effect adjustment
    41   double qmp = 0.;       // desertification taken into account
    42   double pdd = 0.;     
    43   double frzndd = 0.; 
    44  
    45   double tstar;                        // monthly mean surface temp
    46   double Tsum= 0.;       // average summer (JJA) temperature
    47   double Tsurf = 0.;     // average annual temperature   
    48  
    49 
    50   double deltm=1./12.;
     31  IssmDouble siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
     32  IssmDouble signormc = signorm - 0.5;     // sigma of the temperature distribution for cloudy day
     33  IssmDouble siglimc, siglim0, siglim0c;
     34  IssmDouble PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C)
     35  IssmDouble DT = 0.02;
     36  IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
     37 
     38  IssmDouble q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
     39  IssmDouble qm = 0.;        // snow part of the precipitation
     40  IssmDouble qmt = 0.;       // precipitation without desertification effect adjustment
     41  IssmDouble qmp = 0.;       // desertification taken into account
     42  IssmDouble pdd = 0.;     
     43  IssmDouble frzndd = 0.; 
     44 
     45  IssmDouble tstar;                        // monthly mean surface temp
     46  IssmDouble Tsum= 0.;       // average summer (JJA) temperature
     47  IssmDouble Tsurf = 0.;     // average annual temperature   
     48 
     49
     50  IssmDouble deltm=1./12.;
    5151  int    ismon[12]={11,0,1,2,3,4,5,6,7,8,9,10};
    5252 
    53   double snwm;  // snow that could have been melted in a year.
    54   double snwmf; //  ablation factor for snow per positive degree day.
    55   double smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
    56  
    57   double dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
    58   double supice,supcap,diffndd;
    59   double fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
    60   double pddtj, hmx2;
     53  IssmDouble snwm;  // snow that could have been melted in a year.
     54  IssmDouble snwmf; //  ablation factor for snow per positive degree day.
     55  IssmDouble smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
     56 
     57  IssmDouble dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
     58  IssmDouble supice,supcap,diffndd;
     59  IssmDouble fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
     60  IssmDouble pddtj, hmx2;
    6161 
    6262  sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
Note: See TracChangeset for help on using the changeset viewer.