@@ -30,6 +30,9 @@ module mp_radar
30
30
!.. calculations based on 50 individual size bins of the distributions.
31
31
!+---+-----------------------------------------------------------------+
32
32
33
+ integer, parameter, private :: R4KIND = selected_real_kind(6)
34
+ integer, parameter, private :: R8KIND = selected_real_kind(12)
35
+
33
36
integer,parameter,public:: nrbins = 50
34
37
integer,parameter,public:: slen = 20
35
38
character(len=slen), public:: &
@@ -38,7 +41,7 @@ module mp_radar
38
41
mixingrulestring_g, matrixstring_g, inclusionstring_g, &
39
42
hoststring_g, hostmatrixstring_g, hostinclusionstring_g
40
43
41
- complex*16 ,public:: m_w_0, m_i_0
44
+ complex(kind=R8KIND) ,public:: m_w_0, m_i_0
42
45
43
46
double precision,dimension(nrbins+1),public:: xxdx
44
47
double precision,dimension(nrbins),public:: xxds,xdts,xxdg,xdtg
@@ -123,7 +126,7 @@ subroutine radar_init
123
126
xxdx(1) = 100.d-6
124
127
xxdx(nrbins+1) = 0.02d0
125
128
do n = 2, nrbins
126
- xxdx(n) = dexp(dfloat (n-1)/dfloat (nrbins) &
129
+ xxdx(n) = dexp(real (n-1,kind=R8KIND)/real (nrbins,kind=R8KIND ) &
127
130
* dlog(xxdx(nrbins+1)/xxdx(1)) +dlog(xxdx(1)))
128
131
enddo
129
132
do n = 1, nrbins
@@ -135,7 +138,7 @@ subroutine radar_init
135
138
xxdx(1) = 100.d-6
136
139
xxdx(nrbins+1) = 0.05d0
137
140
do n = 2, nrbins
138
- xxdx(n) = dexp(dfloat (n-1)/dfloat (nrbins) &
141
+ xxdx(n) = dexp(real (n-1,kind=R8KIND)/real (nrbins,kind=R8KIND ) &
139
142
* dlog(xxdx(nrbins+1)/xxdx(1)) +dlog(xxdx(1)))
140
143
enddo
141
144
do n = 1, nrbins
@@ -196,7 +199,7 @@ subroutine rayleigh_soak_wetgraupel(x_g,a_geo,b_geo,fmelt,meltratio_outside,m_w,
196
199
character(len=*), intent(in):: mixingrule, matrix, inclusion, &
197
200
host, hostmatrix, hostinclusion
198
201
199
- complex*16 ,intent(in):: m_w, m_i
202
+ complex(kind=R8KIND) ,intent(in):: m_w, m_i
200
203
201
204
double precision, intent(in):: x_g, a_geo, b_geo, fmelt, lambda, meltratio_outside
202
205
@@ -206,7 +209,7 @@ subroutine rayleigh_soak_wetgraupel(x_g,a_geo,b_geo,fmelt,meltratio_outside,m_w,
206
209
!--- local variables:
207
210
integer:: error
208
211
209
- complex*16 :: m_core, m_air
212
+ complex(kind=R8KIND) :: m_core, m_air
210
213
211
214
double precision, parameter:: pix=3.1415926535897932384626434d0
212
215
double precision:: d_large, d_g, rhog, x_w, xw_a, fm, fmgrenz, &
@@ -340,7 +343,7 @@ real(kind=kind_phys) function gammln(xx)
340
343
end function gammln
341
344
342
345
!=================================================================================================================
343
- complex*16 function get_m_mix_nested (m_a, m_i, m_w, volair, &
346
+ complex(kind=R8KIND) function get_m_mix_nested (m_a, m_i, m_w, volair, &
344
347
volice, volwater, mixingrule, host, matrix, &
345
348
inclusion, hostmatrix, hostinclusion, cumulerror)
346
349
implicit none
@@ -350,7 +353,7 @@ complex*16 function get_m_mix_nested (m_a, m_i, m_w, volair, &
350
353
character(len=*),intent(in):: mixingrule, host, matrix, &
351
354
inclusion, hostmatrix, hostinclusion
352
355
353
- complex*16 ,intent(in):: m_a, m_i, m_w
356
+ complex(kind=R8KIND) ,intent(in):: m_a, m_i, m_w
354
357
355
358
double precision,intent(in):: volice, volair, volwater
356
359
@@ -360,7 +363,7 @@ complex*16 function get_m_mix_nested (m_a, m_i, m_w, volair, &
360
363
!--- local variables:
361
364
integer:: error
362
365
363
- complex*16 :: mtmp
366
+ complex(kind=R8KIND) :: mtmp
364
367
365
368
double precision:: vol1, vol2
366
369
@@ -481,7 +484,7 @@ complex*16 function get_m_mix_nested (m_a, m_i, m_w, volair, &
481
484
end function get_m_mix_nested
482
485
483
486
!=================================================================================================================
484
- complex*16 function get_m_mix (m_a, m_i, m_w, volair, volice, &
487
+ complex(kind=R8KIND) function get_m_mix (m_a, m_i, m_w, volair, volice, &
485
488
volwater, mixingrule, matrix, inclusion, &
486
489
error)
487
490
implicit none
@@ -490,7 +493,7 @@ complex*16 function get_m_mix (m_a, m_i, m_w, volair, volice, &
490
493
!--- input arguments:
491
494
character(len=*),intent(in):: mixingrule, matrix, inclusion
492
495
493
- complex*16 , intent(in):: m_a, m_i, m_w
496
+ complex(kind=R8KIND) , intent(in):: m_a, m_i, m_w
494
497
495
498
double precision, intent(in):: volice, volair, volwater
496
499
@@ -531,15 +534,15 @@ complex*16 function get_m_mix (m_a, m_i, m_w, volair, volice, &
531
534
end function get_m_mix
532
535
533
536
!=================================================================================================================
534
- complex*16 function m_complex_maxwellgarnett(vol1, vol2, vol3, &
537
+ complex(kind=R8KIND) function m_complex_maxwellgarnett(vol1, vol2, vol3, &
535
538
m1, m2, m3, inclusion, error)
536
539
implicit none
537
540
!=================================================================================================================
538
541
539
542
!--- input arguments:
540
543
character(len=*),intent(in):: inclusion
541
544
542
- complex*16 ,intent(in):: m1,m2,m3
545
+ complex(kind=R8KIND) ,intent(in):: m1,m2,m3
543
546
544
547
double precision,intent(in):: vol1,vol2,vol3
545
548
@@ -548,7 +551,7 @@ complex*16 function m_complex_maxwellgarnett(vol1, vol2, vol3, &
548
551
integer,intent(out):: error
549
552
550
553
!--- local variables:
551
- complex*16 :: beta2, beta3, m1t, m2t, m3t
554
+ complex(kind=R8KIND) :: beta2, beta3, m1t, m2t, m3t
552
555
553
556
!-----------------------------------------------------------------------------------------------------------------
554
557
@@ -576,7 +579,7 @@ complex*16 function m_complex_maxwellgarnett(vol1, vol2, vol3, &
576
579
else
577
580
write(radar_debug,*) ' M_COMPLEX_MAXWELLGARNETT: ' , ' unknown inclusion: ' , inclusion
578
581
call physics_message(radar_debug)
579
- m_complex_maxwellgarnett=dcmplx (-999.99d0,-999.99d0)
582
+ m_complex_maxwellgarnett=cmplx (-999.99d0,-999.99d0,kind=R8KIND )
580
583
error = 1
581
584
return
582
585
endif
@@ -587,7 +590,7 @@ complex*16 function m_complex_maxwellgarnett(vol1, vol2, vol3, &
587
590
end function m_complex_maxwellgarnett
588
591
589
592
!=================================================================================================================
590
- complex*16 function m_complex_water_ray(lambda,t)
593
+ complex(kind=R8KIND) function m_complex_water_ray(lambda,t)
591
594
implicit none
592
595
!=================================================================================================================
593
596
@@ -603,7 +606,7 @@ complex*16 function m_complex_water_ray(lambda,t)
603
606
double precision,parameter:: pix=3.1415926535897932384626434d0
604
607
double precision:: epsinf,epss,epsr,epsi
605
608
double precision:: alpha,lambdas,sigma,nenner
606
- complex*16 ,parameter:: i = (0d0,1d0)
609
+ complex(kind=R8KIND) ,parameter:: i = (0d0,1d0)
607
610
608
611
!-----------------------------------------------------------------------------------------------------------------
609
612
@@ -627,7 +630,7 @@ complex*16 function m_complex_water_ray(lambda,t)
627
630
end function m_complex_water_ray
628
631
629
632
!=================================================================================================================
630
- complex*16 function m_complex_ice_maetzler(lambda,t)
633
+ complex(kind=R8KIND) function m_complex_ice_maetzler(lambda,t)
631
634
implicit none
632
635
!=================================================================================================================
633
636
0 commit comments