122 |
C-- here we swap P and PR in order to get in-situ temperature |
C-- here we swap P and PR in order to get in-situ temperature |
123 |
C del_P = PR - P ! to get potential from in-situ temperature |
C del_P = PR - P ! to get potential from in-situ temperature |
124 |
del_P = P - PR ! to get in-situ from potential temperature |
del_P = P - PR ! to get in-situ from potential temperature |
125 |
del_th = del_P*sw_adtg(S,T,PR) |
del_th = del_P*sw_adtg(S,T,P) |
126 |
th = T + onehalf*del_th |
th = T + onehalf*del_th |
127 |
q = del_th |
q = del_th |
128 |
C theta2 |
C theta2 |
129 |
del_th = del_P*sw_adtg(S,th,PR+onehalf*del_P) |
del_th = del_P*sw_adtg(S,th,P+onehalf*del_P) |
130 |
|
|
131 |
th = th + (1 - 1/sqrt(two))*(del_th - q) |
th = th + (1 - 1/sqrt(two))*(del_th - q) |
132 |
q = (two-sqrt(two))*del_th + (-two+three/sqrt(two))*q |
q = (two-sqrt(two))*del_th + (-two+three/sqrt(two))*q |
133 |
|
|
134 |
C theta3 |
C theta3 |
135 |
del_th = del_P*sw_adtg(S,th,PR+onehalf*del_P) |
del_th = del_P*sw_adtg(S,th,P+onehalf*del_P) |
136 |
th = th + (1 + 1/sqrt(two))*(del_th - q) |
th = th + (1 + 1/sqrt(two))*(del_th - q) |
137 |
q = (two + sqrt(two))*del_th + (-two-three/sqrt(two))*q |
q = (two + sqrt(two))*del_th + (-two-three/sqrt(two))*q |
138 |
|
|
139 |
C theta4 |
C theta4 |
140 |
del_th = del_P*sw_adtg(S,th,PR+del_P) |
del_th = del_P*sw_adtg(S,th,P+del_P) |
141 |
SW_temp= th + (del_th - two*q)/(two*three) |
SW_temp= th + (del_th - two*q)/(two*three) |
142 |
|
|
143 |
RETURN |
RETURN |