| 1 |
jscott |
1.1 |
|
| 2 |
|
|
#include "ctrparam.h" |
| 3 |
|
|
|
| 4 |
|
|
! ========================================================== |
| 5 |
|
|
! |
| 6 |
|
|
! NEWCON.F: A subroutine for convert predicted concentrations |
| 7 |
|
|
! of chemical species to GISS radiation |
| 8 |
|
|
! scales. |
| 9 |
|
|
! |
| 10 |
|
|
! ---------------------------------------------------------- |
| 11 |
|
|
! |
| 12 |
|
|
! Revision History: |
| 13 |
|
|
! |
| 14 |
|
|
! When Who What |
| 15 |
|
|
! ---- ---------- ------- |
| 16 |
|
|
! 080100 Chien Wang repack based on CliChem3 & M24x11, |
| 17 |
|
|
! and add cpp. |
| 18 |
|
|
! |
| 19 |
|
|
! ========================================================== |
| 20 |
|
|
|
| 21 |
|
|
subroutine newcon(xn,yn,xo,yo,x0,y0) |
| 22 |
|
|
|
| 23 |
|
|
FFN3(X,Y)=3.1515*X/(1.0+0.21448*X**0.87) - 0.056*X*Y 9131.5 |
| 24 |
|
|
+ +0.3234*Y/(1.0+0.052*Y**0.84) |
| 25 |
|
|
FFN1(X,Y)=1.556*LOG(1.0+1.098*X**0.77*(1.0+0.032*X) 9113.3 |
| 26 |
|
|
+ /(1.0+0.0014*X*X)) 9113.4 |
| 27 |
|
|
+ +(0.394*Y**0.66+0.16*Y*EXP(-1.6*Y)) 9113.5 |
| 28 |
|
|
+ /(1.0+0.169*Y**0.62) 9113.6 |
| 29 |
|
|
+ -0.14*LOG(1.0+0.636*(X*Y)**0.75+0.007*Y*(X*Y)**1.52) 9113.7 |
| 30 |
|
|
data ifirst /1/ |
| 31 |
|
|
if(ifirst.eq.1)then |
| 32 |
|
|
c print *,x0,y0,xo,yo |
| 33 |
|
|
fr1=ffn1(x0,y0) |
| 34 |
|
|
fr3=ffn3(x0,y0) |
| 35 |
|
|
ifirst=0 |
| 36 |
|
|
inprnt=0 |
| 37 |
|
|
endif |
| 38 |
|
|
fx1=ffn1(xo,y0)-fr1 |
| 39 |
|
|
fy1=ffn1(x0,yo)-fr1 |
| 40 |
|
|
x=xo |
| 41 |
|
|
iter=0 |
| 42 |
|
|
100 continue |
| 43 |
|
|
fx3=ffn3(x,y0)-fr3 |
| 44 |
|
|
dfdx=fx3/(x-x0) |
| 45 |
|
|
df=fx1-fx3 |
| 46 |
|
|
x=x+df/dfdx |
| 47 |
|
|
iter=iter+1 |
| 48 |
|
|
if(iter.lt.15.and.abs(df).gt.1.e-5) go to 100 |
| 49 |
|
|
xn=x |
| 50 |
|
|
c if(inprnt.lt.25) then |
| 51 |
|
|
c print *,' iter=',iter |
| 52 |
|
|
c print *,' xo=',xo,' fx1=',fx1,' x=',x,' fx3=',fx3 |
| 53 |
|
|
c endif |
| 54 |
|
|
iter=0 |
| 55 |
|
|
y=yo |
| 56 |
|
|
200 continue |
| 57 |
|
|
fy3=ffn3(x0,y)-fr3 |
| 58 |
|
|
dfdy=fy3/(y-y0) |
| 59 |
|
|
df=fy1-fy3 |
| 60 |
|
|
y=y+df/dfdy |
| 61 |
|
|
iter=iter+1 |
| 62 |
|
|
if(iter.lt.15.and.abs(df).gt.1.e-5) go to 200 |
| 63 |
|
|
yn=y |
| 64 |
|
|
c if(inprnt.lt.25)then |
| 65 |
|
|
c print *,' iter=',iter |
| 66 |
|
|
c print *,' yo=',yo,' fy1=',fy1,' y=',y,' fy3=',fy3 |
| 67 |
|
|
c endif |
| 68 |
|
|
c inprnt=inprnt+1 |
| 69 |
|
|
return |
| 70 |
|
|
end |