- Timestamp:
- Jul 19, 2024, 4:15:44 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90
r2428 r5081 38 38 39 39 ! ----- INPUTS ----- 40 real *8, intent(in) :: freq,tk40 real(kind=8), intent(in) :: freq,tk 41 41 42 42 ! ----- OUTPUTS ----- 43 real *8, intent(out) :: n_r, n_i43 real(kind=8), intent(out) :: n_r, n_i 44 44 45 45 ! ----- INTERNAL ----- 46 real *8ld,es,ei,a,ls,sg,tm1,cos1,sin147 real *8e_r,e_i48 real *8pi49 real *8tc50 complex *16e_comp, sq46 real(kind=8) ld,es,ei,a,ls,sg,tm1,cos1,sin1 47 real(kind=8) e_r,e_i 48 real(kind=8) pi 49 real(kind=8) tc 50 complex(kind=8) e_comp, sq 51 51 52 52 tc = tk - 273.15 … … 102 102 103 103 ! ----- INPUTS ----- 104 real *8, intent(in) :: freq, t104 real(kind=8), intent(in) :: freq, t 105 105 106 106 ! ----- OUTPUTS ----- 107 real *8, intent(out) :: n_r,n_i107 real(kind=8), intent(out) :: n_r,n_i 108 108 109 109 ! Parameters: 110 integer *2:: i,lt1,lt2,nwl,nwlt110 integer(kind=2) :: i,lt1,lt2,nwl,nwlt 111 111 parameter(nwl=468,nwlt=62) 112 112 113 real *8:: alam,cutice,pi,t1,t2,wlmax,wlmin, &113 real(kind=8) :: alam,cutice,pi,t1,t2,wlmax,wlmin, & 114 114 x,x1,x2,y,y1,y2,ylo,yhi,tk 115 115 116 real *8:: &116 real(kind=8) :: & 117 117 tabim(nwl),tabimt(nwlt,4),tabre(nwl),tabret(nwlt,4),temref(4), & 118 118 wl(nwl),wlt(nwlt) … … 540 540 if(tk < temref(4)) tk=temref(4) 541 541 do 11 i=2,4 542 if(tk .ge.temref(i)) go to 12542 if(tk>=temref(i)) go to 12 543 543 11 continue 544 544 12 lt1=i 545 545 lt2=i-1 546 546 do 13 i=2,nwlt 547 if(alam .le.wlt(i)) go to 14547 if(alam<=wlt(i)) go to 14 548 548 13 continue 549 549 14 x1=log(wlt(i-1)) … … 586 586 Subroutine MieInt(Dx, SCm, Inp, Dqv, Dqxt, Dqsc, Dbsc, Dg, Xs1, Xs2, DPh, Error) 587 587 588 Integer * 2Imaxx588 Integer (kind=2) Imaxx 589 589 Parameter (Imaxx = 12000) 590 Real * 4RIMax ! largest real part of refractive index590 Real (kind=4) RIMax ! largest real part of refractive index 591 591 Parameter (RIMax = 2.5) 592 Real * 4IRIMax ! largest imaginary part of refractive index592 Real (kind=4) IRIMax ! largest imaginary part of refractive index 593 593 Parameter (IRIMax = -2) 594 Integer * 2Itermax594 Integer (kind=2) Itermax 595 595 Parameter (Itermax = 12000 * 2.5) 596 596 ! must be large enough to cope with the 597 597 ! largest possible nmx = x * abs(scm) + 15 598 598 ! or nmx = Dx + 4.05*Dx**(1./3.) + 2.0 599 Integer * 2Imaxnp599 Integer (kind=2) Imaxnp 600 600 Parameter (Imaxnp = 10000) ! Change this as required 601 601 ! INPUT 602 Real * 8Dx603 Complex * 16SCm604 Integer * 4Inp605 Real * 8Dqv(Inp)602 Real (kind=8) Dx 603 Complex (kind=8) SCm 604 Integer (kind=4) Inp 605 Real (kind=8) Dqv(Inp) 606 606 ! OUTPUT 607 Complex * 16Xs1(InP)608 Complex * 16Xs2(InP)609 Real * 8Dqxt610 Real * 8Dqsc611 Real * 8Dg612 Real * 8Dbsc613 Real * 8DPh(InP)614 Integer * 4Error607 Complex (kind=8) Xs1(InP) 608 Complex (kind=8) Xs2(InP) 609 Real (kind=8) Dqxt 610 Real (kind=8) Dqsc 611 Real (kind=8) Dg 612 Real (kind=8) Dbsc 613 Real (kind=8) DPh(InP) 614 Integer (kind=4) Error 615 615 ! LOCAL 616 Integer * 2I617 Integer * 2NStop618 Integer * 2NmX619 Integer * 4N ! N*N > 32767 ie N > 181620 Integer * 4Inp2621 Real * 8Chi,Chi0,Chi1622 Real * 8APsi,APsi0,APsi1623 Real * 8Pi0(Imaxnp)624 Real * 8Pi1(Imaxnp)625 Real * 8Taun(Imaxnp)626 Real * 8Psi,Psi0,Psi1627 Complex * 8Ir628 Complex * 16Cm629 Complex * 16A,ANM1,APB630 Complex * 16B,BNM1,AMB631 Complex * 16D(Itermax)632 Complex * 16Sp(Imaxnp)633 Complex * 16Sm(Imaxnp)634 Complex * 16Xi,Xi0,Xi1635 Complex * 16Y616 Integer (kind=2) I 617 Integer (kind=2) NStop 618 Integer (kind=2) NmX 619 Integer (kind=4) N ! N*N > 32767 ie N > 181 620 Integer (kind=4) Inp2 621 Real (kind=8) Chi,Chi0,Chi1 622 Real (kind=8) APsi,APsi0,APsi1 623 Real (kind=8) Pi0(Imaxnp) 624 Real (kind=8) Pi1(Imaxnp) 625 Real (kind=8) Taun(Imaxnp) 626 Real (kind=8) Psi,Psi0,Psi1 627 Complex (kind=4) Ir 628 Complex (kind=8) Cm 629 Complex (kind=8) A,ANM1,APB 630 Complex (kind=8) B,BNM1,AMB 631 Complex (kind=8) D(Itermax) 632 Complex (kind=8) Sp(Imaxnp) 633 Complex (kind=8) Sm(Imaxnp) 634 Complex (kind=8) Xi,Xi0,Xi1 635 Complex (kind=8) Y 636 636 ! ACCELERATOR VARIABLES 637 Integer * 2Tnp1638 Integer * 2Tnm1639 Real * 8Dn640 Real * 8Rnx641 Real * 8S(Imaxnp)642 Real * 8T(Imaxnp)643 Real * 8Turbo644 Real * 8A2645 Complex * 16A1637 Integer (kind=2) Tnp1 638 Integer (kind=2) Tnm1 639 Real (kind=8) Dn 640 Real (kind=8) Rnx 641 Real (kind=8) S(Imaxnp) 642 Real (kind=8) T(Imaxnp) 643 Real (kind=8) Turbo 644 Real (kind=8) A2 645 Complex (kind=8) A1 646 646 647 If ((Dx .Gt.Imaxx) .Or. (InP.Gt.ImaxNP)) Then647 If ((Dx>Imaxx) .Or. (InP>ImaxNP)) Then 648 648 Error = 1 649 649 Return … … 652 652 Ir = 1 / Cm 653 653 Y = Dx * Cm 654 If (Dx .Lt.0.02) Then654 If (Dx<0.02) Then 655 655 NStop = 2 656 656 Else 657 If (Dx .Le.8.0) Then657 If (Dx<=8.0) Then 658 658 NStop = Dx + 4.00*Dx**(1./3.) + 2.0 659 659 Else 660 If (Dx .Lt.4200.0) Then660 If (Dx< 4200.0) Then 661 661 NStop = Dx + 4.05*Dx**(1./3.) + 2.0 662 662 Else … … 666 666 End If 667 667 NmX = Max(Real(NStop),Real(Abs(Y))) + 15. 668 If (Nmx .gt.Itermax) then668 If (Nmx > Itermax) then 669 669 Error = 1 670 670 Return … … 709 709 Dqxt = Tnp1 * Dble(A + B) + Dqxt 710 710 Dqsc = Tnp1 * (A*Conjg(A) + B*Conjg(B)) + Dqsc 711 If (N .Gt.1) then711 If (N>1) then 712 712 Dg = Dg + (dN*dN - 1) * Dble(ANM1*Conjg(A) + BNM1 * Conjg(B)) / dN + TNM1 * Dble(ANM1*Conjg(BNM1)) / (dN*dN - dN) 713 713 End If … … 717 717 AMB = A2 * (A - B) 718 718 Do I = 1,Inp2 719 If (I .GT.Inp) Then719 If (I>Inp) Then 720 720 S(I) = -Pi1(I) 721 721 Else … … 736 736 Xi1 = Dcmplx(APsi1,Chi1) 737 737 End Do 738 If (Dg .GT.0) Dg = 2 * Dg / Dqsc738 If (Dg >0) Dg = 2 * Dg / Dqsc 739 739 Dqsc = 2 * Dqsc / Dx**2 740 740 Dqxt = 2 * Dqxt / Dx**2
Note: See TracChangeset
for help on using the changeset viewer.