1 |
C $Header: /u/gcmpack/MITgcm/pkg/streamice/eta_gl_streamice_prime.F,v 1.2 2013/06/21 18:38:45 dgoldberg Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
_RL FUNCTION ETA_GL_STREAMICE_PRIME (X, M1, M2, Y0, W) |
7 |
|
8 |
! This function returns the derivative of ETA_GL_STREAMICE |
9 |
! w.r.t. its first argument |
10 |
|
11 |
|
12 |
! X: input variable |
13 |
! M1: slope of y where x<0 |
14 |
! M2: slope of y where x>0 |
15 |
! Y0: value of y at 0 |
16 |
! W: width of smoothing |
17 |
|
18 |
_RL X, M1, M2, Y0, W |
19 |
_RL TMP1, PI |
20 |
|
21 |
|
22 |
IF (X.le.-0.5*W) THEN |
23 |
ETA_GL_STREAMICE_PRIME = M1 |
24 |
ELSEIF(X.gt.0.5*W) THEN |
25 |
ETA_GL_STREAMICE_PRIME = M2 |
26 |
ELSE |
27 |
PI = 3.14159265358979323844D0 |
28 |
TMP1 = SIN (PI*X/W) |
29 |
ETA_GL_STREAMICE_PRIME = |
30 |
& 0.5*M1 * (1-TMP1) + |
31 |
& 0.5*M2 * (1+TMP1) |
32 |
ENDIF |
33 |
|
34 |
RETURN |
35 |
END |