forked from CFMIP/COSPv1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cosp_types.F90
1650 lines (1426 loc) · 68.5 KB
/
cosp_types.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! (c) British Crown Copyright 2008, the Met Office.
! All rights reserved.
!
! Redistribution and use in source and binary forms, with or without modification, are permitted
! provided that the following conditions are met:
!
! * Redistributions of source code must retain the above copyright notice, this list
! of conditions and the following disclaimer.
! * Redistributions in binary form must reproduce the above copyright notice, this list
! of conditions and the following disclaimer in the documentation and/or other materials
! provided with the distribution.
! * Neither the name of the Met Office nor the names of its contributors may be used
! to endorse or promote products derived from this software without specific prior written
! permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
! DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MODULE MOD_COSP_TYPES
USE MOD_COSP_CONSTANTS
USE MOD_COSP_UTILS
use radar_simulator_types, only: class_param, nd, mt_nd, dmax, dmin
IMPLICIT NONE
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!----------------------- DERIVED TYPES ----------------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
! Configuration choices (simulators, variables)
TYPE COSP_CONFIG
logical :: Lradar_sim,Llidar_sim,Lisccp_sim,Lmodis_sim,Lmisr_sim,Lrttov_sim,Lstats,Lwrite_output, &
Lalbisccp,Latb532,Lboxptopisccp,Lboxtauisccp,LcfadDbze94, &
LcfadLidarsr532,Lclcalipso2,Lclcalipso,Lclhcalipso,Lclisccp,Lcllcalipso, &
Lclmcalipso,Lcltcalipso,Lcltlidarradar,Lpctisccp,Ldbze94,Ltauisccp,Lcltisccp, &
Ltoffset,LparasolRefl,LclMISR,Lmeantbisccp,Lmeantbclrisccp, &
Lclcalipsoliq,Lclcalipsoice,Lclcalipsoun, &
Lclcalipsotmp,Lclcalipsotmpliq,Lclcalipsotmpice,Lclcalipsotmpun, &
Lcltcalipsoliq,Lcltcalipsoice,Lcltcalipsoun, &
Lclhcalipsoliq,Lclhcalipsoice,Lclhcalipsoun, &
Lclmcalipsoliq,Lclmcalipsoice,Lclmcalipsoun, &
Lcllcalipsoliq,Lcllcalipsoice,Lcllcalipsoun, &
Lfracout,LlidarBetaMol532,Ltbrttov, &
Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, &
Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, &
Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis
character(len=32) :: out_list(N_OUT_LIST)
END TYPE COSP_CONFIG
! Outputs from RTTOV
TYPE COSP_RTTOV
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Nchan ! Number of channels
! Brightness temperatures (Npoints,Nchan)
real,pointer :: tbs(:,:)
END TYPE COSP_RTTOV
! Outputs from MISR simulator
TYPE COSP_MISR
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Ntau ! Number of tau intervals
integer :: Nlevels ! Number of cth levels
! --- (npoints,ntau,nlevels)
! the fraction of the model grid box covered by each of the MISR cloud types
real,pointer :: fq_MISR(:,:,:)
! --- (npoints)
real,pointer :: MISR_meanztop(:), MISR_cldarea(:)
! --- (npoints,nlevels)
real,pointer :: MISR_dist_model_layertops(:,:)
END TYPE COSP_MISR
! Outputs from ISCCP simulator
TYPE COSP_ISCCP
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Ncolumns ! Number of columns
integer :: Nlevels ! Number of levels
! --- (npoints,tau=7,pressure=7)
! the fraction of the model grid box covered by each of the 49 ISCCP D level cloud types
real,pointer :: fq_isccp(:,:,:)
! --- (npoints) ---
! The fraction of model grid box columns with cloud somewhere in them.
! This should equal the sum over all entries of fq_isccp
real,pointer :: totalcldarea(:)
! mean all-sky 10.5 micron brightness temperature
real,pointer :: meantb(:)
! mean clear-sky 10.5 micron brightness temperature
real,pointer :: meantbclr(:)
! The following three means are averages over the cloudy areas only. If no
! clouds are in grid box all three quantities should equal zero.
! mean cloud top pressure (mb) - linear averaging in cloud top pressure.
real,pointer :: meanptop(:)
! mean optical thickness linear averaging in albedo performed.
real,pointer :: meantaucld(:)
! mean cloud albedo. linear averaging in albedo performed
real,pointer :: meanalbedocld(:)
!--- (npoints,ncol) ---
! optical thickness in each column
real,pointer :: boxtau(:,:)
! cloud top pressure (mb) in each column
real,pointer :: boxptop(:,:)
END TYPE COSP_ISCCP
! Summary statistics from radar
TYPE COSP_VGRID
logical :: use_vgrid ! Logical flag that indicates change of grid
logical :: csat_vgrid ! Flag for Cloudsat grid
integer :: Npoints ! Number of sampled points
integer :: Ncolumns ! Number of subgrid columns
integer :: Nlevels ! Number of model levels
integer :: Nlvgrid ! Number of levels of new grid
! Array with dimensions (Nlvgrid)
real, dimension(:), pointer :: z,zl,zu ! Height and lower and upper boundaries of new levels
! Array with dimensions (Nlevels)
real, dimension(:), pointer :: mz,mzl,mzu ! Height and lower and upper boundaries of model levels
END TYPE COSP_VGRID
! Output data from lidar code
TYPE COSP_SGLIDAR
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Ncolumns ! Number of columns
integer :: Nlevels ! Number of levels
integer :: Nhydro ! Number of hydrometeors
integer :: Nrefl ! Number of parasol reflectances
! Arrays with dimensions (Npoints,Nlevels)
real,dimension(:,:),pointer :: beta_mol ! Molecular backscatter
real,dimension(:,:),pointer :: temp_tot
! Arrays with dimensions (Npoints,Ncolumns,Nlevels)
real,dimension(:,:,:),pointer :: betaperp_tot ! Total backscattered signal
real,dimension(:,:,:),pointer :: beta_tot ! Total backscattered signal
real,dimension(:,:,:),pointer :: tau_tot ! Optical thickness integrated from top to level z
! Arrays with dimensions (Npoints,Ncolumns,Nrefl)
real,dimension(:,:,:),pointer :: refl ! parasol reflectances
END TYPE COSP_SGLIDAR
! Output data from radar code
TYPE COSP_SGRADAR
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Ncolumns ! Number of columns
integer :: Nlevels ! Number of levels
integer :: Nhydro ! Number of hydrometeors
! output vertical levels: spaceborne radar -> from TOA to SURFACE
! Arrays with dimensions (Npoints,Nlevels)
real,dimension(:,:),pointer :: att_gas ! 2-way attenuation by gases [dBZ]
! Arrays with dimensions (Npoints,Ncolumns,Nlevels)
real,dimension(:,:,:),pointer :: Ze_tot ! Effective reflectivity factor [dBZ]
END TYPE COSP_SGRADAR
! Summary statistics from radar
TYPE COSP_RADARSTATS
integer :: Npoints ! Number of sampled points
integer :: Ncolumns ! Number of subgrid columns
integer :: Nlevels ! Number of model levels
integer :: Nhydro ! Number of hydrometeors
! Array with dimensions (Npoints,dBZe_bins,Nlevels)
real, dimension(:,:,:), pointer :: cfad_ze ! Ze CFAD
! Array with dimensions (Npoints)
real,dimension(:),pointer :: radar_lidar_tcc ! Radar&lidar total cloud amount, grid-box scale
! Arrays with dimensions (Npoints,Nlevels)
real, dimension(:,:),pointer :: lidar_only_freq_cloud
END TYPE COSP_RADARSTATS
! Summary statistics from lidar
TYPE COSP_LIDARSTATS
integer :: Npoints ! Number of sampled points
integer :: Ncolumns ! Number of subgrid columns
integer :: Nlevels ! Number of model levels
integer :: Nhydro ! Number of hydrometeors
integer :: Nrefl ! Number of parasol reflectances
! Arrays with dimensions (SR_BINS)
real, dimension(:),pointer :: srbval ! SR bins in cfad_sr
! Arrays with dimensions (Npoints,SR_BINS,Nlevels)
real, dimension(:,:,:),pointer :: cfad_sr ! CFAD of scattering ratio
! Arrays with dimensions (Npoints,Nlevels)
real, dimension(:,:),pointer :: lidarcld ! 3D "lidar" cloud fraction
! Arrays with dimensions (Npoints,LIDAR_NCAT)
real, dimension(:,:),pointer :: cldlayer ! low, mid, high-level, total lidar cloud cover
! Arrays with dimensions (Npoints,Nlevels,Nphase)
real, dimension(:,:,:),pointer :: lidarcldphase ! 3D "lidar" phase cloud fraction
! Arrays with dimensions (Npoints,LIDAR_NCAT,Nphase)
real, dimension(:,:,:),pointer :: cldlayerphase ! low, mid, high-level lidar phase cloud cover
! Arrays with dimensions (Npoints,Ntemps,Nphase)
real, dimension(:,:,:),pointer :: lidarcldtmp ! 3D "lidar" phase cloud temperature
! Arrays with dimensions (Npoints,PARASOL_NREFL)
real, dimension(:,:),pointer :: parasolrefl ! mean parasol reflectance
END TYPE COSP_LIDARSTATS
! Input data for simulator. Subgrid scale.
! Input data from SURFACE to TOA
TYPE COSP_SUBGRID
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Ncolumns ! Number of columns
integer :: Nlevels ! Number of levels
integer :: Nhydro ! Number of hydrometeors
real,dimension(:,:,:),pointer :: prec_frac ! Subgrid precip array. Dimensions (Npoints,Ncolumns,Nlevels)
real,dimension(:,:,:),pointer :: frac_out ! Subgrid cloud array. Dimensions (Npoints,Ncolumns,Nlevels)
END TYPE COSP_SUBGRID
! Input data for simulator at Subgrid scale.
! Used on a reduced number of points
TYPE COSP_SGHYDRO
! Dimensions
integer :: Npoints ! Number of gridpoints
integer :: Ncolumns ! Number of columns
integer :: Nlevels ! Number of levels
integer :: Nhydro ! Number of hydrometeors
real,dimension(:,:,:,:),pointer :: mr_hydro ! Mixing ratio of each hydrometeor
! (Npoints,Ncolumns,Nlevels,Nhydro) [kg/kg]
real,dimension(:,:,:,:),pointer :: Reff ! Effective Radius of each hydrometeor
! (Reff==0 means use default size)
! (Npoints,Ncolumns,Nlevels,Nhydro) [m]
real,dimension(:,:,:,:),pointer :: Np ! Total # concentration each hydrometeor
! (Optional, ignored if Reff > 0).
! (Npoints,Ncolumns,Nlevels,Nhydro) [#/kg]
! Np = Ntot / rho_a = [#/m^3] / [kg/m^3)
! added by Roj with Quickbeam V3
END TYPE COSP_SGHYDRO
! Input data for simulator. Gridbox scale.
TYPE COSP_GRIDBOX
! Scalars and dimensions
integer :: Npoints ! Number of gridpoints
integer :: Nlevels ! Number of levels
integer :: Ncolumns ! Number of columns
integer :: Nhydro ! Number of hydrometeors
integer :: Nprmts_max_hydro ! Max number of parameters for hydrometeor size distributions
integer :: Naero ! Number of aerosol species
integer :: Nprmts_max_aero ! Max number of parameters for aerosol size distributions
integer :: Npoints_it ! Max number of gridpoints to be processed in one iteration
! Time [days]
double precision :: time
double precision :: time_bnds(2)
! Radar ancillary info
real :: radar_freq, & ! Radar frequency [GHz]
k2 ! |K|^2, -1=use frequency dependent default
integer :: surface_radar, & ! surface=1, spaceborne=0
use_mie_tables, & ! use a precomputed loopup table? yes=1,no=0
use_gas_abs, & ! include gaseous absorption? yes=1,no=0
do_ray, & ! calculate/output Rayleigh refl=1, not=0
melt_lay ! melting layer model off=0, on=1
! structures used by radar simulator that need to be set only ONCE per radar configuration (e.g. freq, pointing direction) ... added by roj Feb 2008
type(class_param) :: hp ! structure used by radar simulator to store Ze and N scaling constants and other information
integer :: nsizes ! number of discrete drop sizes (um) used to represent the distribution
! Lidar
integer :: lidar_ice_type !ice particle shape hypothesis in lidar calculations
!(ice_type=0 for spheres, ice_type=1 for non spherical particles)
integer :: lidar_wavelength ! Lidar wavelength [nm]
integer :: surface_lidar ! surface=1, spaceborne=0
! Radar
logical :: use_precipitation_fluxes ! True if precipitation fluxes are input to the algorithm
logical :: use_reff ! True if Reff is to be used by radar (memory not allocated
! Geolocation (Npoints)
real,dimension(:),pointer :: toffset ! Time offset of esch point from the value in time
real,dimension(:),pointer :: longitude ! longitude [degrees East]
real,dimension(:),pointer :: latitude ! latitude [deg North]
! Gridbox information (Npoints,Nlevels)
real,dimension(:,:),pointer :: zlev ! Height of model levels [m]
real,dimension(:,:),pointer :: zlev_half ! Height at half model levels [m] (Bottom of model layer)
real,dimension(:,:),pointer :: dlev ! Depth of model levels [m]
real,dimension(:,:),pointer :: p ! Pressure at full model levels [Pa]
real,dimension(:,:),pointer :: ph ! Pressure at half model levels [Pa]
real,dimension(:,:),pointer :: T ! Temperature at model levels [K]
real,dimension(:,:),pointer :: q ! Relative humidity to water (%)
real,dimension(:,:),pointer :: sh ! Specific humidity to water [kg/kg]
real,dimension(:,:),pointer :: dtau_s ! mean 0.67 micron optical depth of stratiform
! clouds in each model level
! NOTE: this the cloud optical depth of only the
! cloudy part of the grid box, it is not weighted
! with the 0 cloud optical depth of the clear
! part of the grid box
real,dimension(:,:),pointer :: dtau_c ! mean 0.67 micron optical depth of convective
! clouds in each model level. Same note applies as in dtau_s.
real,dimension(:,:),pointer :: dem_s ! 10.5 micron longwave emissivity of stratiform
! clouds in each model level. Same note applies as in dtau_s.
real,dimension(:,:),pointer :: dem_c ! 10.5 micron longwave emissivity of convective
! clouds in each model level. Same note applies as in dtau_s.
real,dimension(:,:),pointer :: mr_ozone ! Ozone mass mixing ratio [kg/kg]
! Point information (Npoints)
real,dimension(:),pointer :: land !Landmask [0 - Ocean, 1 - Land]
real,dimension(:),pointer :: psfc !Surface pressure [Pa]
real,dimension(:),pointer :: sunlit ! (npoints) 1 for day points, 0 for nightime
real,dimension(:),pointer :: skt ! Skin temperature (K)
real,dimension(:),pointer :: u_wind ! eastward wind [m s-1]
real,dimension(:),pointer :: v_wind ! northward wind [m s-1]
! TOTAL and CONV cloud fraction for SCOPS
real,dimension(:,:),pointer :: tca ! Total cloud fraction
real,dimension(:,:),pointer :: cca ! Convective cloud fraction
! Precipitation fluxes on model levels
real,dimension(:,:),pointer :: rain_ls ! large-scale precipitation flux of rain [kg/m2.s]
real,dimension(:,:),pointer :: rain_cv ! convective precipitation flux of rain [kg/m2.s]
real,dimension(:,:),pointer :: snow_ls ! large-scale precipitation flux of snow [kg/m2.s]
real,dimension(:,:),pointer :: snow_cv ! convective precipitation flux of snow [kg/m2.s]
real,dimension(:,:),pointer :: grpl_ls ! large-scale precipitation flux of graupel [kg/m2.s]
! Hydrometeors concentration and distribution parameters
! real,dimension(:,:,:),pointer :: fr_hydro ! Fraction of the gridbox occupied by each hydrometeor (Npoints,Nlevels,Nhydro)
real,dimension(:,:,:),pointer :: mr_hydro ! Mixing ratio of each hydrometeor (Npoints,Nlevels,Nhydro) [kg/kg]
real,dimension(:,:),pointer :: dist_prmts_hydro !Distributional parameters for hydrometeors (Nprmts_max_hydro,Nhydro)
! Effective radius [m]. (Npoints,Nlevels,Nhydro) -- OPTIONAL, value of 0 mean use fixed default
real,dimension(:,:,:),pointer :: Reff
! Total Number Concentration [#/kg]. (Npoints,Nlevels,Nhydro) -- OPTIONAL, value of 0 mean use fixed default
real,dimension(:,:,:),pointer :: Np ! added by Roj with Quickbeam V3
! Aerosols concentration and distribution parameters
real,dimension(:,:,:),pointer :: conc_aero ! Aerosol concentration for each species (Npoints,Nlevels,Naero)
integer,dimension(:),pointer :: dist_type_aero ! Particle size distribution type for each aerosol species (Naero)
real,dimension(:,:,:,:),pointer :: dist_prmts_aero ! Distributional parameters for aerosols
! (Npoints,Nlevels,Nprmts_max_aero,Naero)
! ISCCP simulator inputs
integer :: isccp_top_height ! 1 = adjust top height using both a computed
! infrared brightness temperature and the visible
! optical depth to adjust cloud top pressure. Note
! that this calculation is most appropriate to compare
! to ISCCP data during sunlit hours.
! 2 = do not adjust top height, that is cloud top
! pressure is the actual cloud top pressure
! in the model
! 3 = adjust top height using only the computed
! infrared brightness temperature. Note that this
! calculation is most appropriate to compare to ISCCP
! IR only algortihm (i.e. you can compare to nighttime
! ISCCP data with this option)
integer :: isccp_top_height_direction ! direction for finding atmosphere pressure level
! with interpolated temperature equal to the radiance
! determined cloud-top temperature
! 1 = find the *lowest* altitude (highest pressure) level
! with interpolated temperature equal to the radiance
! determined cloud-top temperature
! 2 = find the *highest* altitude (lowest pressure) level
! with interpolated temperature equal to the radiance
! determined cloud-top temperature
! ONLY APPLICABLE IF top_height EQUALS 1 or 3
! 1 = default setting, and matches all versions of
! ISCCP simulator with versions numbers 3.5.1 and lower
! 2 = experimental setting
integer :: isccp_overlap ! overlap type (1=max, 2=rand, 3=max/rand)
real :: isccp_emsfc_lw ! 10.5 micron emissivity of surface (fraction)
! RTTOV inputs/options
integer :: plat ! satellite platform
integer :: sat ! satellite
integer :: inst ! instrument
integer :: Nchan ! Number of channels to be computed
integer, dimension(:), pointer :: Ichan ! Channel numbers
real, dimension(:), pointer :: Surfem ! Surface emissivity
real :: ZenAng ! Satellite Zenith Angles
real :: co2,ch4,n2o,co ! Mixing ratios of trace gases
END TYPE COSP_GRIDBOX
CONTAINS
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_RTTOV -------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_RTTOV(cfg,Npoints,Nchan,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of sampled points
integer,intent(in) :: Nchan ! Number of channels
type(cosp_rttov),intent(out) :: x
! Local variables
integer :: i,j
! Allocate minumum storage if simulator not used
if (cfg%Lrttov_sim) then
i = Npoints
j = Nchan
else
i = 1
j = 1
endif
x%Npoints = i
x%Nchan = j
! --- Allocate arrays ---
allocate(x%tbs(i, j))
! --- Initialise to zero ---
x%tbs = 0.0
END SUBROUTINE CONSTRUCT_COSP_RTTOV
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE FREE_COSP_RTTOV ------------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_RTTOV(x)
type(cosp_rttov),intent(inout) :: x
! --- Deallocate arrays ---
deallocate(x%tbs)
END SUBROUTINE FREE_COSP_RTTOV
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_MISR ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_MISR(cfg,Npoints,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of gridpoints
type(cosp_misr),intent(out) :: x
! Local variables
integer :: i,j,k
! Allocate minumum storage if simulator not used
if (cfg%Lmisr_sim) then
i = Npoints
j = 7
k = MISR_N_CTH
else
i = 1
j = 1
k = 1
endif
! Dimensions
x%Npoints = i
x%Ntau = j
x%Nlevels = k
! allocate space for MISR simulator outputs ...
allocate(x%fq_MISR(i,j,k), x%MISR_meanztop(i),x%MISR_cldarea(i), x%MISR_dist_model_layertops(i,k))
x%fq_MISR = 0.0
x%MISR_meanztop = 0.0
x%MISR_cldarea = 0.0
x%MISR_dist_model_layertops = 0.0
END SUBROUTINE CONSTRUCT_COSP_MISR
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE FREE_COSP_MISR ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_MISR(x)
type(cosp_misr),intent(inout) :: x
deallocate(x%fq_MISR, x%MISR_meanztop,x%MISR_cldarea, x%MISR_dist_model_layertops)
END SUBROUTINE FREE_COSP_MISR
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_ISCCP ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_ISCCP(cfg,Npoints,Ncolumns,Nlevels,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of sampled points
integer,intent(in) :: Ncolumns ! Number of subgrid columns
integer,intent(in) :: Nlevels ! Number of model levels
type(cosp_isccp),intent(out) :: x
! Local variables
integer :: i,j,k
! Allocate minumum storage if simulator not used
if (cfg%Lisccp_sim) then
i = Npoints
j = Ncolumns
k = Nlevels
else
i = 1
j = 1
k = 1
endif
! Dimensions
x%Npoints = i
x%Ncolumns = j
x%Nlevels = k
! --- Allocate arrays ---
allocate(x%fq_isccp(i,7,7), x%totalcldarea(i), &
x%meanptop(i), x%meantaucld(i), &
x%meantb(i), x%meantbclr(i), &
x%boxtau(i,j), x%boxptop(i,j), &
x%meanalbedocld(i))
! --- Initialise to zero ---
x%fq_isccp = 0.0
x%totalcldarea = 0.0
x%meanptop = 0.0
x%meantaucld = 0.0
x%meantb = 0.0
x%meantbclr = 0.0
x%boxtau = 0.0
x%boxptop = 0.0
x%meanalbedocld= 0.0
END SUBROUTINE CONSTRUCT_COSP_ISCCP
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE FREE_COSP_ISCCP -----------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_ISCCP(x)
type(cosp_isccp),intent(inout) :: x
deallocate(x%fq_isccp, x%totalcldarea, &
x%meanptop, x%meantaucld, x%meantb, x%meantbclr, &
x%boxtau, x%boxptop, x%meanalbedocld)
END SUBROUTINE FREE_COSP_ISCCP
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_VGRID ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_VGRID(gbx,Nlvgrid,use_vgrid,cloudsat,x)
type(cosp_gridbox),intent(in) :: gbx ! Gridbox information
integer,intent(in) :: Nlvgrid ! Number of new levels
logical,intent(in) :: use_vgrid! Logical flag that controls the output on a different grid
logical,intent(in) :: cloudsat ! TRUE if a CloudSat like grid (480m) is requested
type(cosp_vgrid),intent(out) :: x
! Local variables
integer :: i
real :: zstep
x%use_vgrid = use_vgrid
x%csat_vgrid = cloudsat
! Dimensions
x%Npoints = gbx%Npoints
x%Ncolumns = gbx%Ncolumns
x%Nlevels = gbx%Nlevels
! --- Allocate arrays ---
if (use_vgrid) then
x%Nlvgrid = Nlvgrid
else
x%Nlvgrid = gbx%Nlevels
endif
allocate(x%z(x%Nlvgrid),x%zl(x%Nlvgrid),x%zu(x%Nlvgrid))
allocate(x%mz(x%Nlevels),x%mzl(x%Nlevels),x%mzu(x%Nlevels))
! --- Model vertical levels ---
! Use height levels of first model gridbox
x%mz = gbx%zlev(1,:)
x%mzl = gbx%zlev_half(1,:)
x%mzu(1:x%Nlevels-1) = gbx%zlev_half(1,2:x%Nlevels)
x%mzu(x%Nlevels) = gbx%zlev(1,x%Nlevels) + (gbx%zlev(1,x%Nlevels) - x%mzl(x%Nlevels))
if (use_vgrid) then
! --- Initialise to zero ---
x%z = 0.0
x%zl = 0.0
x%zu = 0.0
if (cloudsat) then ! --- CloudSat grid requested ---
zstep = 480.0
else
! Other grid requested. Constant vertical spacing with top at 20 km
zstep = 20000.0/x%Nlvgrid
endif
do i=1,x%Nlvgrid
x%zl(i) = (i-1)*zstep
x%zu(i) = i*zstep
enddo
x%z = (x%zl + x%zu)/2.0
else
x%z = x%mz
x%zl = x%mzl
x%zu = x%mzu
endif
END SUBROUTINE CONSTRUCT_COSP_VGRID
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------------ SUBROUTINE FREE_COSP_VGRID ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_VGRID(x)
type(cosp_vgrid),intent(inout) :: x
deallocate(x%z, x%zl, x%zu, x%mz, x%mzl, x%mzu)
END SUBROUTINE FREE_COSP_VGRID
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_SGLIDAR ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_SGLIDAR(cfg,Npoints,Ncolumns,Nlevels,Nhydro,Nrefl,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of sampled points
integer,intent(in) :: Ncolumns ! Number of subgrid columns
integer,intent(in) :: Nlevels ! Number of model levels
integer,intent(in) :: Nhydro ! Number of hydrometeors
integer,intent(in) :: Nrefl ! Number of parasol reflectances ! parasol
type(cosp_sglidar),intent(out) :: x
! Local variables
integer :: i,j,k,l,m
! Allocate minumum storage if simulator not used
if (cfg%Llidar_sim) then
i = Npoints
j = Ncolumns
k = Nlevels
l = Nhydro
m = Nrefl
else
i = 1
j = 1
k = 1
l = 1
m = 1
endif
! Dimensions
x%Npoints = i
x%Ncolumns = j
x%Nlevels = k
x%Nhydro = l
x%Nrefl = m
! --- Allocate arrays ---
allocate(x%beta_mol(i,k), x%beta_tot(i,j,k), &
x%tau_tot(i,j,k),x%refl(i,j,m), &
x%temp_tot(i,k),x%betaperp_tot(i,j,k))
! --- Initialise to zero ---
x%beta_mol = 0.0
x%beta_tot = 0.0
x%tau_tot = 0.0
x%refl = 0.0 ! parasol
x%temp_tot = 0.0
x%betaperp_tot = 0.0
END SUBROUTINE CONSTRUCT_COSP_SGLIDAR
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------------ SUBROUTINE FREE_COSP_SGLIDAR ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_SGLIDAR(x)
type(cosp_sglidar),intent(inout) :: x
deallocate(x%beta_mol, x%beta_tot, x%tau_tot, x%refl, &
x%temp_tot, x%betaperp_tot)
END SUBROUTINE FREE_COSP_SGLIDAR
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_SGRADAR ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_SGRADAR(cfg,Npoints,Ncolumns,Nlevels,Nhydro,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of sampled points
integer,intent(in) :: Ncolumns ! Number of subgrid columns
integer,intent(in) :: Nlevels ! Number of model levels
integer,intent(in) :: Nhydro ! Number of hydrometeors
type(cosp_sgradar),intent(out) :: x
! Local variables
integer :: i,j,k,l
if (cfg%Lradar_sim) then
i = Npoints
j = Ncolumns
k = Nlevels
l = Nhydro
else ! Allocate minumum storage if simulator not used
i = 1
j = 1
k = 1
l = 1
endif
! Dimensions
x%Npoints = i
x%Ncolumns = j
x%Nlevels = k
x%Nhydro = l
! --- Allocate arrays ---
allocate(x%att_gas(i,k), x%Ze_tot(i,j,k))
! --- Initialise to zero ---
x%att_gas = 0.0
x%Ze_tot = 0.0
! The following line give a compilation error on the Met Office NEC
! call zero_real(x%Z_hydro, x%att_hydro)
! f90: error(666): cosp_types.f90, line nnn:
! Actual argument corresponding to dummy
! argument of ELEMENTAL subroutine
! "zero_real" with INTENET(OUT) attribute
! is not array.
END SUBROUTINE CONSTRUCT_COSP_SGRADAR
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------------ SUBROUTINE FREE_COSP_SGRADAR ----------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_SGRADAR(x)
type(cosp_sgradar),intent(inout) :: x
deallocate(x%att_gas, x%Ze_tot)
END SUBROUTINE FREE_COSP_SGRADAR
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!----------- SUBROUTINE CONSTRUCT_COSP_RADARSTATS ---------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_RADARSTATS(cfg,Npoints,Ncolumns,Nlevels,Nhydro,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of sampled points
integer,intent(in) :: Ncolumns ! Number of subgrid columns
integer,intent(in) :: Nlevels ! Number of model levels
integer,intent(in) :: Nhydro ! Number of hydrometeors
type(cosp_radarstats),intent(out) :: x
! Local variables
integer :: i,j,k,l
! Allocate minumum storage if simulator not used
if (cfg%Lradar_sim) then
i = Npoints
j = Ncolumns
k = Nlevels
l = Nhydro
else
i = 1
j = 1
k = 1
l = 1
endif
! Dimensions
x%Npoints = i
x%Ncolumns = j
x%Nlevels = k
x%Nhydro = l
! --- Allocate arrays ---
allocate(x%cfad_ze(i,DBZE_BINS,k),x%lidar_only_freq_cloud(i,k))
allocate(x%radar_lidar_tcc(i))
! --- Initialise to zero ---
x%cfad_ze = 0.0
x%lidar_only_freq_cloud = 0.0
x%radar_lidar_tcc = 0.0
END SUBROUTINE CONSTRUCT_COSP_RADARSTATS
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------------ SUBROUTINE FREE_COSP_RADARSTATS -------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_RADARSTATS(x)
type(cosp_radarstats),intent(inout) :: x
deallocate(x%cfad_ze,x%lidar_only_freq_cloud,x%radar_lidar_tcc)
END SUBROUTINE FREE_COSP_RADARSTATS
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!----------- SUBROUTINE CONSTRUCT_COSP_LIDARSTATS ---------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_LIDARSTATS(cfg,Npoints,Ncolumns,Nlevels,Nhydro,Nrefl,x)
type(cosp_config),intent(in) :: cfg ! Configuration options
integer,intent(in) :: Npoints ! Number of sampled points
integer,intent(in) :: Ncolumns ! Number of subgrid columns
integer,intent(in) :: Nlevels ! Number of model levels
integer,intent(in) :: Nhydro ! Number of hydrometeors
integer,intent(in) :: Nrefl ! Number of parasol reflectance
type(cosp_lidarstats),intent(out) :: x
! Local variables
integer :: i,j,k,l,m
! Allocate minumum storage if simulator not used
if (cfg%Llidar_sim) then
i = Npoints
j = Ncolumns
k = Nlevels
l = Nhydro
m = Nrefl
else
i = 1
j = 1
k = 1
l = 1
m = 1
endif
! Dimensions
x%Npoints = i
x%Ncolumns = j
x%Nlevels = k
x%Nhydro = l
x%Nrefl = m
! --- Allocate arrays ---
allocate(x%srbval(SR_BINS),x%cfad_sr(i,SR_BINS,k), &
x%lidarcld(i,k), x%cldlayer(i,LIDAR_NCAT), x%parasolrefl(i,m))
allocate(x%lidarcldphase(i,k,6),x%lidarcldtmp(i,LIDAR_NTEMP,5),&
x%cldlayerphase(i,LIDAR_NCAT,6))
! --- Initialise to zero ---
x%srbval = 0.0
x%cfad_sr = 0.0
x%lidarcld = 0.0
x%cldlayer = 0.0
x%parasolrefl = 0.0
x%lidarcldphase = 0.0
x%cldlayerphase = 0.0
x%lidarcldtmp = 0.0
END SUBROUTINE CONSTRUCT_COSP_LIDARSTATS
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------------ SUBROUTINE FREE_COSP_LIDARSTATS -------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_LIDARSTATS(x)
type(cosp_lidarstats),intent(inout) :: x
deallocate(x%srbval, x%cfad_sr, x%lidarcld, x%cldlayer, x%parasolrefl)
deallocate(x%cldlayerphase, x%lidarcldtmp, x%lidarcldphase)
END SUBROUTINE FREE_COSP_LIDARSTATS
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_SUBGRID ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_SUBGRID(Npoints,Ncolumns,Nlevels,y)
integer,intent(in) :: Npoints, & ! Number of gridpoints
Ncolumns, & ! Number of columns
Nlevels ! Number of levels
type(cosp_subgrid),intent(out) :: y
! Dimensions
y%Npoints = Npoints
y%Ncolumns = Ncolumns
y%Nlevels = Nlevels
! --- Allocate arrays ---
allocate(y%frac_out(Npoints,Ncolumns,Nlevels))
if (Ncolumns > 1) then
allocate(y%prec_frac(Npoints,Ncolumns,Nlevels))
else ! CRM mode, not needed
allocate(y%prec_frac(1,1,1))
endif
! --- Initialise to zero ---
y%prec_frac = 0.0
y%frac_out = 0.0
! The following line gives a compilation error on the Met Office NEC
! call zero_real(y%mr_hydro)
! f90: error(666): cosp_types.f90, line nnn:
! Actual argument corresponding to dummy
! argument of ELEMENTAL subroutine
! "zero_real" with INTENET(OUT) attribute
! is not array.
END SUBROUTINE CONSTRUCT_COSP_SUBGRID
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE FREE_COSP_SUBGRID -----------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_SUBGRID(y)
type(cosp_subgrid),intent(inout) :: y
! --- Deallocate arrays ---
deallocate(y%prec_frac, y%frac_out)
END SUBROUTINE FREE_COSP_SUBGRID
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_SGHYDRO -----------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_SGHYDRO(Npoints,Ncolumns,Nlevels,Nhydro,y)
integer,intent(in) :: Npoints, & ! Number of gridpoints
Ncolumns, & ! Number of columns
Nhydro, & ! Number of hydrometeors
Nlevels ! Number of levels
type(cosp_sghydro),intent(out) :: y
! Dimensions
y%Npoints = Npoints
y%Ncolumns = Ncolumns
y%Nlevels = Nlevels
y%Nhydro = Nhydro
! --- Allocate arrays ---
allocate(y%mr_hydro(Npoints,Ncolumns,Nlevels,Nhydro), &
y%Reff(Npoints,Ncolumns,Nlevels,Nhydro), &
y%Np(Npoints,Ncolumns,Nlevels,Nhydro)) ! added by roj with Quickbeam V3
! --- Initialise to zero ---
y%mr_hydro = 0.0
y%Reff = 0.0
y%Np = 0.0 ! added by roj with Quickbeam V3
END SUBROUTINE CONSTRUCT_COSP_SGHYDRO
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE FREE_COSP_SGHYDRO -----------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE FREE_COSP_SGHYDRO(y)
type(cosp_sghydro),intent(inout) :: y
! --- Deallocate arrays ---
deallocate(y%mr_hydro, y%Reff, y%Np) ! added by Roj with Quickbeam V3
END SUBROUTINE FREE_COSP_SGHYDRO
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!------------- SUBROUTINE CONSTRUCT_COSP_GRIDBOX ------------------
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE CONSTRUCT_COSP_GRIDBOX(time,time_bnds,radar_freq,surface_radar,use_mie_tables,use_gas_abs,do_ray,melt_lay,k2, &
Npoints,Nlevels,Ncolumns,Nhydro,Nprmts_max_hydro,Naero,Nprmts_max_aero,Npoints_it, &
lidar_ice_type,lidar_wavelength,surface_lidar,isccp_top_height,isccp_top_height_direction,isccp_overlap,isccp_emsfc_lw, &
use_precipitation_fluxes,use_reff, &
! RTTOV inputs
Plat,Sat,Inst,Nchan,ZenAng,Ichan,SurfEm,co2,ch4,n2o,co,&
y,load_LUT)
double precision,intent(in) :: time ! Time since start of run [days]
double precision,intent(in) :: time_bnds(2) ! Time boundaries
real,intent(in) :: radar_freq, & ! Radar frequency [GHz]
k2 ! |K|^2, -1=use frequency dependent default
integer,intent(in) :: &
surface_radar, & ! surface=1,spaceborne=0
use_mie_tables, & ! use a precomputed lookup table? yes=1,no=0,2=use first column everywhere
use_gas_abs, & ! include gaseous absorption? yes=1,no=0
do_ray, & ! calculate/output Rayleigh refl=1, not=0
melt_lay ! melting layer model off=0, on=1
integer,intent(in) :: Npoints ! Number of gridpoints
integer,intent(in) :: Nlevels ! Number of levels
integer,intent(in) :: Ncolumns ! Number of columns
integer,intent(in) :: Nhydro ! Number of hydrometeors
integer,intent(in) :: Nprmts_max_hydro ! Max number of parameters for hydrometeor size distributions
integer,intent(in) :: Naero ! Number of aerosol species
integer,intent(in) :: Nprmts_max_aero ! Max number of parameters for aerosol size distributions
integer,intent(in) :: Npoints_it ! Number of gridpoints processed in one iteration
integer,intent(in) :: lidar_ice_type ! Ice particle shape in lidar calculations (0=ice-spheres ; 1=ice-non-spherical)
integer,intent(in) :: lidar_wavelength ! Lidar wavelength [nm]
integer,intent(in) :: surface_lidar ! surface=1,spaceborne=0
integer,intent(in) :: isccp_top_height
integer,intent(in) :: isccp_top_height_direction
integer,intent(in) :: isccp_overlap
real,intent(in) :: isccp_emsfc_lw
logical,intent(in) :: use_precipitation_fluxes,use_reff
integer,intent(in) :: Plat
integer,intent(in) :: Sat
integer,intent(in) :: Inst
integer,intent(in) :: Nchan
integer,intent(in) :: Ichan(Nchan)
real,intent(in) :: SurfEm(Nchan)
real,intent(in) :: ZenAng
real,intent(in) :: co2,ch4,n2o,co
type(cosp_gridbox),intent(out) :: y
logical,intent(in),optional :: load_LUT
! local variables
character*240 :: LUT_file_name
logical :: local_load_LUT
if (present(load_LUT)) then
local_load_LUT = load_LUT
else
local_load_LUT = RADAR_SIM_LOAD_scale_LUTs_flag
endif
! Dimensions and scalars
y%radar_freq = radar_freq
y%surface_radar = surface_radar
y%use_mie_tables = use_mie_tables
y%use_gas_abs = use_gas_abs
y%do_ray = do_ray
y%melt_lay = melt_lay
y%k2 = k2
y%Npoints = Npoints
y%Nlevels = Nlevels
y%Ncolumns = Ncolumns
y%Nhydro = Nhydro
y%Nprmts_max_hydro = Nprmts_max_hydro
y%Naero = Naero
y%Nprmts_max_aero = Nprmts_max_aero
y%Npoints_it = Npoints_it
y%lidar_ice_type = lidar_ice_type
y%lidar_wavelength = lidar_wavelength
y%surface_lidar = surface_lidar
y%isccp_top_height = isccp_top_height
y%isccp_top_height_direction = isccp_top_height_direction
y%isccp_overlap = isccp_overlap
y%isccp_emsfc_lw = isccp_emsfc_lw
y%use_precipitation_fluxes = use_precipitation_fluxes
y%use_reff = use_reff
y%time = time
y%time_bnds = time_bnds