Changeset 24103


Ignore:
Timestamp:
07/22/19 14:15:42 (6 years ago)
Author:
schlegel
Message:

CHG: update some warnings for the Nye functions

Location:
issm/trunk-jpl/src/c/shared/Elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Elements/NyeCO2.cpp

    r24073 r24103  
    22 * \brief figure out B of CO2 ice for a certain temperature
    33 *              INPUT function B=NyeCO2(temperature)
    4  *      where rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Nye, p -COMPLETE- ).
     4 *      where rigidigty (in s^(1/n)Pa) is the flow law paramter in the flow law sigma=B*e(1/n) (Nye, p2000).
    55 */
    66
    7 #include <math.h>
    8 #include "../Numerics/types.h"
     7#include "../io/io.h" #include <math.h> #include "../Numerics/types.h"
    98
    109IssmDouble NyeCO2(IssmDouble temperature){
    1110
    1211        /*Coefficients*/
    13         const IssmPDouble Rg      = 8.3144598;     /* J mol^-1 K^-1 */
    14         const IssmPDouble A_const = pow(10.,10.8); /*s^-1 MPa       */
    15         const IssmPDouble Q       = 63000.;        /*J mol^-1       */
    16         const IssmPDouble n       = 7.;            /*Glen's exponent*/
     12        const IssmPDouble Rg      = 8.3144598;     /* J mol^-1 K^-1 */ const
     13          IssmPDouble A_const = pow(10.,10.8); /*s^-1 MPa       */ const IssmPDouble
     14          Q       = 63000.;        /*J mol^-1       */ const IssmPDouble n       =
     15          7.;            /*Glen's exponent*/
    1716
    1817        /*Arrhenius Law*/
    19         IssmDouble A = A_const *exp(-Q/(temperature*Rg)); /*s^-1 MPa   */
     18        IssmDouble A = A_const *exp(-Q/(temperature*Rg));  /*s^-1 MPa   */
    2019        IssmDouble B = 1e6*pow(A,-1/n);                    /*s^(1/n) Pa */
    2120
     21        /*Beyond-melting-point cases*/
     22        if((temperature>200.)&&(temperature<220.)) printf("CO2 ICE - POSSIBLE
     23                                MELTING. Some temperature values are between 200K and 220K.\n");
     24        else if(temperature>=220.) _printf0_("CO2 ICE - GUARANTEED MELTING. Some
     25                                temperature values are beyond 220K.\n");
     26
    2227        /*Return output*/
    23         return B;
     28        return B; 
    2429}
  • issm/trunk-jpl/src/c/shared/Elements/NyeH2O.cpp

    r24073 r24103  
    22 * brief figure out B of H2O ice for a certain temperature
    33 *              INPUT function B=NyeH2O(temperature)
    4  *      where rigidigty (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Nye, p -COMPLETE- ).
    5 
    6  VALUES CALCULATED USING THE FOLLOWING MATLAB CODE
    7 
    8  Rg = 8.3144598; % J mol^-1 K^-1
    9  A_const = 9e4; % s^-1 MPa
    10  Q = 60000; % J mol^-1
    11  n = 3; % Glen's exponent
    12  T = -102.5:5:2.5; T = T + 273; % K
    13  A = A_const*exp(-Q./(T*Rg)); % s^-1 MPa
    14  B = A.^(-1/n)*1e6; % s^(1/n) Pa
     4 *      where rigidigty (in s^(1/n)Pa) is the flow law paramter in the flow law sigma=B*e(1/n) (Nye, p2000).
    155 */
    166
     7#include "../io/io.h"
    178#include <math.h>
    189#include "../Numerics/types.h"
     
    2718
    2819        /*Arrhenius Law*/
    29         IssmDouble A = A_const *exp(-Q/(temperature*Rg)); /*s^-1 MPa   */
     20        IssmDouble A = A_const *exp(-Q/(temperature*Rg));  /*s^-1 MPa   */
    3021        IssmDouble B = 1e6*pow(A,-1/n);                    /*s^(1/n) Pa */
     22
     23        /*Beyond-melting-point case*/
     24        if(temperature>=273.15) _printf0_("H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\n");
    3125
    3226        /*Return output*/
Note: See TracChangeset for help on using the changeset viewer.