10 use fckit_configuration_module,
only: fckit_configuration
42 REAL(kind_real),
PARAMETER :: &
43 &rdgas = 2.8704e+2_kind_real,&
44 &rvgas = 4.6150e+2_kind_real,&
45 &rv_rd = rvgas/rdgas,&
47 &zvir = rv_rd - 1_kind_real,&
48 &tice = 273.16_kind_real,&
49 &grav = 9.81_kind_real,&
50 &aerosol_concentration_minvalue=1.e-16_kind_real,&
51 &aerosol_concentration_minvalue_layer=tiny(rdgas),&
52 &ozone_default_value=1.e-3_kind_real
59 integer :: n_absorbers
63 character(len=MAXVARLEN),
allocatable :: absorbers(:)
64 integer,
allocatable :: absorber_id(:)
65 integer,
allocatable :: absorber_units(:)
66 character(len=MAXVARLEN),
allocatable :: clouds(:,:)
67 integer,
allocatable :: cloud_id(:)
68 character(len=MAXVARLEN),
allocatable :: surfaces(:)
70 character(len=255),
allocatable :: sensor_id(:)
71 character(len=255) :: endian_type
72 character(len=255) :: coefficient_path
73 character(len=255) :: &
74 irwatercoeff_file, irlandcoeff_file, irsnowcoeff_file, iricecoeff_file, &
75 viswatercoeff_file, vislandcoeff_file, vissnowcoeff_file, visicecoeff_file, &
77 integer,
allocatable :: land_wsi(:)
78 real(kind_real) :: cloud_fraction = -1.0_kind_real
80 character(len=MAXVARLEN) :: aerosol_option
81 character(len=255) :: salinity_option
101 character(len=MAXVARLEN),
parameter :: &
106 character(len=*),
parameter :: &
108 absorber_id_name(1:n_valid_absorber_ids)
109 integer,
parameter :: &
111 [ h2o_id, co2_id, o3_id, n2o_id, &
112 co_id, ch4_id, o2_id, no_id, &
113 so2_id, no2_id, nh3_id, hno3_id, &
114 oh_id, hf_id, hcl_id, hbr_id, &
115 hi_id, clo_id, ocs_id, h2co_id, &
116 hocl_id, n2_id, hcn_id, ch3l_id, &
117 h2o2_id, c2h2_id, c2h6_id, ph3_id, &
118 cof2_id, sf6_id, h2s_id,hcooh_id ]
119 integer,
parameter :: &
121 mass_mixing_ratio_units &
122 , volume_mixing_ratio_units &
123 , volume_mixing_ratio_units &
126 character(len=MAXVARLEN),
parameter :: &
131 , [n_valid_cloud_categories,2] )
134 character(len=*),
parameter :: &
136 cloud_category_name(1:n_valid_cloud_categories)
137 integer,
parameter :: &
148 character(len=MAXVARLEN),
parameter :: &
152 character(len=MAXVARLEN),
parameter :: &
154 [ character(len=
maxvarlen)::
'Water_Temperature',
'Wind_Speed',
'Wind_Direction',
'Salinity' ]
164 type(fckit_configuration),
intent(in) :: f_confopts
165 type(fckit_configuration),
intent(in) :: f_confoper
167 character(*),
PARAMETER :: routine_name =
'crtm_conf_setup'
168 character(len=255) :: irwatercoeff, viswatercoeff, &
169 irvislandcoeff, irvissnowcoeff, irvisicecoeff, &
171 integer :: jspec, ivar
172 character(len=max_string) :: message
173 character(len=:),
allocatable :: str
174 character(len=:),
allocatable :: str_array(:)
176 CHARACTER(len=MAXVARLEN),
ALLOCATABLE :: var_aerosols(:)
191 if (f_confoper%has(
"Absorbers")) &
192 conf%n_Absorbers =
conf%n_Absorbers + f_confoper%get_size(
"Absorbers")
194 allocate(
conf%Absorbers (
conf%n_Absorbers ), &
195 conf%Absorber_Id (
conf%n_Absorbers ), &
196 conf%Absorber_Units(
conf%n_Absorbers ) )
198 if (
conf%n_Absorbers > 0)
then
199 call f_confoper%get_or_die(
"Absorbers",str_array)
200 conf%Absorbers(1:
conf%n_Absorbers) = str_array
204 do jspec = 2,
conf%n_Absorbers
205 if ( any(
conf%Absorbers(jspec-1) ==
conf%Absorbers(jspec:
conf%n_Absorbers)) )
then
206 write(message,*) trim(routine_name),
' error: ',trim(
conf%Absorbers(jspec)),
' is duplicated in Absorbers'
207 call abor1_ftn(message)
212 do jspec = 1,
conf%n_Absorbers
215 write(message,*) trim(routine_name),
' error: ',trim(
conf%Absorbers(jspec)),
' not supported by UFO_Absorbers'
216 call abor1_ftn(message)
227 if (f_confoper%has(
"Clouds")) &
228 conf%n_Clouds = f_confoper%get_size(
"Clouds")
229 allocate(
conf%Clouds (
conf%n_Clouds,2), &
231 if (
conf%n_Clouds > 0)
then
232 call f_confoper%get_or_die(
"Clouds",str_array)
233 conf%Clouds(1:
conf%n_Clouds,1) = str_array
235 if (f_confoper%has(
"Cloud_Fraction"))
then
236 call f_confoper%get_or_die(
"Cloud_Fraction",
conf%Cloud_Fraction)
237 if (
conf%Cloud_Fraction < 0.0 .or. &
238 conf%Cloud_Fraction > 1.0 )
then
239 write(message,*) trim(routine_name),
' error: must specify ' // &
240 ' 0.0 <= Cloud_Fraction <= 1.0' // &
241 ' or remove Cloud_Fraction from conf' // &
242 ' and provide as a geoval'
243 call abor1_ftn(message)
246 message = trim(routine_name) // &
247 ': Cloud_Fraction is not provided in conf.' // &
248 ' Will request as a geoval.'
249 CALL display_message(routine_name, trim(message), warning )
254 do jspec = 2,
conf%n_Clouds
255 if ( any(
conf%Clouds(jspec-1,1) ==
conf%Clouds(jspec:
conf%n_Clouds,1)) )
then
256 write(message,*) trim(routine_name),
' error: ',trim(
conf%Clouds(jspec,1)), &
257 ' is duplicated in Clouds'
258 call abor1_ftn(message)
263 do jspec = 1,
conf%n_Clouds
265 if (ivar < 1 .or. ivar >
size(
ufo_clouds))
then
266 write(message,*) trim(routine_name),
' error: ',trim(
conf%Clouds(jspec,1)),
' not supported by UFO_Clouds'
267 call abor1_ftn(message)
275 IF (f_confopts%has(
"AerosolOption"))
THEN
276 call f_confopts%get_or_die(
"AerosolOption",str)
277 conf%aerosol_option = str
280 conf%n_Aerosols=
SIZE(var_aerosols)
283 conf%aerosol_option =
""
289 if (f_confoper%has(
"Surfaces")) &
290 conf%n_Surfaces =
conf%n_Surfaces + f_confoper%get_size(
"Surfaces")
292 allocate(
conf%Surfaces (
conf%n_Surfaces ))
294 if (
conf%n_Surfaces > 0)
then
295 call f_confoper%get_or_die(
"Surfaces",str_array)
296 conf%Surfaces(1:
conf%n_Surfaces) = str_array
300 do jspec = 2,
conf%n_Surfaces
301 if ( any(
conf%Surfaces(jspec-1) ==
conf%Surfaces(jspec:
conf%n_Surfaces)) )
then
302 write(message,*)
'crtm_conf_setup error: ',trim(
conf%Surfaces(jspec)),
' is duplicated in Surfaces'
303 call abor1_ftn(message)
308 do jspec = 1,
conf%n_Surfaces
311 write(message,*)
'crtm_conf_setup error: ',trim(
conf%Surfaces(jspec)),
' not supported by UFO_Surfaces'
312 call abor1_ftn(message)
320 IF (f_confopts%get(
"Salinity",str))
THEN
321 conf%salinity_option = str
323 conf%salinity_option =
'off'
327 allocate(
conf%SENSOR_ID(
conf%n_Sensors))
330 call f_confopts%get_or_die(
"Sensor_ID",str)
331 conf%SENSOR_ID(
conf%n_Sensors) = str
334 call f_confopts%get_or_die(
"EndianType",str)
335 conf%ENDIAN_TYPE = str
338 call f_confopts%get_or_die(
"CoefficientPath",str)
339 conf%COEFFICIENT_PATH = str
342 irwatercoeff =
"Nalli"
343 if (f_confopts%has(
"IRwaterCoeff"))
then
344 call f_confopts%get_or_die(
"IRwaterCoeff",str)
347 viswatercoeff =
"NPOESS"
348 if (f_confopts%has(
"VISwaterCoeff"))
then
349 call f_confopts%get_or_die(
"VISwaterCoeff",str)
352 irvislandcoeff =
"NPOESS"
353 if (f_confopts%has(
"IRVISlandCoeff"))
then
354 call f_confopts%get_or_die(
"IRVISlandCoeff",str)
357 irvissnowcoeff =
"NPOESS"
358 if (f_confopts%has(
"IRVISsnowCoeff"))
then
359 call f_confopts%get_or_die(
"IRVISsnowCoeff",str)
362 irvisicecoeff =
"NPOESS"
363 if (f_confopts%has(
"IRVISiceCoeff"))
then
364 call f_confopts%get_or_die(
"IRVISiceCoeff",str)
367 mwwatercoeff =
"FASTEM6"
368 if (f_confopts%has(
"MWwaterCoeff"))
then
369 call f_confopts%get_or_die(
"MWwaterCoeff",str)
374 select case (trim(irvislandcoeff))
376 allocate(
conf%Land_WSI(2))
377 conf%Land_WSI(1:2) = (/16,24/)
379 allocate(
conf%Land_WSI(2))
380 conf%Land_WSI(1:2) = (/15,17/)
382 allocate(
conf%Land_WSI(1))
383 conf%Land_WSI(1) = -1
387 conf%IRwaterCoeff_File = trim(irwatercoeff)//
".IRwater.EmisCoeff.bin"
388 conf%IRlandCoeff_File = trim(irvislandcoeff)//
".IRland.EmisCoeff.bin"
389 conf%IRsnowCoeff_File = trim(irvissnowcoeff)//
".IRsnow.EmisCoeff.bin"
390 conf%IRiceCoeff_File = trim(irvisicecoeff)//
".IRice.EmisCoeff.bin"
393 conf%VISwaterCoeff_File = trim(viswatercoeff)//
".VISwater.EmisCoeff.bin"
394 conf%VISlandCoeff_File = trim(irvislandcoeff)//
".VISland.EmisCoeff.bin"
395 conf%VISsnowCoeff_File = trim(irvissnowcoeff)//
".VISsnow.EmisCoeff.bin"
396 conf%VISiceCoeff_File = trim(irvisicecoeff)//
".VISice.EmisCoeff.bin"
399 conf%MWwaterCoeff_File = trim(mwwatercoeff)//
".MWwater.EmisCoeff.bin"
402 if (f_confopts%has(
"InspectProfileNumber"))
then
403 call f_confopts%get_or_die(
"InspectProfileNumber",
conf%inspect)
415 deallocate(
conf%SENSOR_ID)
416 deallocate(
conf%Land_WSI)
417 deallocate(
conf%Absorbers)
418 deallocate(
conf%Absorber_Id)
419 deallocate(
conf%Absorber_Units)
420 deallocate(
conf%Clouds)
421 deallocate(
conf%Cloud_Id)
428 use fckit_mpi_module,
only: fckit_mpi_comm
432 integer,
intent(in) :: stat
433 character(*),
intent(in) :: program_name
434 character(*),
intent(in) :: message
435 type(fckit_mpi_comm),
intent(in) :: f_comm
437 character(max_string) :: rank_message
439 if ( stat /= success )
THEN
440 write(rank_message,*) trim(message),
" on rank ",f_comm%rank()
441 call display_message( program_name, rank_message, failure )
442 call abor1_ftn(
"Abort from "//program_name)
455 use missing_values_mod
458 integer,
intent(in) :: n_profiles, n_channels
459 type(c_ptr),
value,
intent(in) :: obss
460 integer(c_int),
intent(in) :: channels(:)
461 logical,
intent(inout) :: skip_profiles(:)
463 integer :: jprofile, jchannel
464 character(len=MAXVARLEN) :: varname
465 real(kind_real) :: obsval(n_profiles,n_channels)
478 do jchannel = 1, n_channels
480 call obsspace_get_db(obss,
"ObsValue", varname, obsval(:,jchannel))
486 do jprofile = 1, n_profiles
487 skip_profiles(jprofile) = all(obsval(jprofile,:) ==
missing)
500 integer,
intent(in) :: n_profiles, n_layers
502 type(crtm_atmosphere_type),
intent(inout) :: atm(:)
508 character(max_string) :: err_msg
515 if (geoval%nval /= n_layers)
then
516 write(err_msg,*)
'Load_Atm_Data error: layers inconsistent!'
517 call abor1_ftn(err_msg)
520 do k1 = 1, n_profiles
521 atm(k1)%Temperature(1:n_layers) = geoval%vals(:, k1)
525 do k1 = 1, n_profiles
526 atm(k1)%Pressure(1:n_layers) = geoval%vals(:, k1) * 0.01
530 do k1 = 1, n_profiles
531 atm(k1)%Level_Pressure(:) = geoval%vals(:, k1) * 0.01
532 atm(k1)%Climatology = us_standard_atmosphere
535 do jspec = 1,
conf%n_Absorbers
537 if ( trim(
conf%Absorbers(jspec)) == trim(
var_oz) .AND. &
539 trim(
conf%aerosol_option) /=
"" )
then
540 do k1 = 1, n_profiles
545 do k1 = 1, n_profiles
546 atm(k1)%Absorber(1:n_layers, jspec) = geoval%vals(:, k1)
549 do k1 = 1, n_profiles
550 atm(k1)%Absorber_Id(jspec) =
conf%Absorber_Id(jspec)
551 atm(k1)%Absorber_Units(jspec) =
conf%Absorber_Units(jspec)
555 do jspec = 1,
conf%n_Clouds
558 do k1 = 1, n_profiles
559 atm(k1)%Cloud(jspec)%Water_Content = geoval%vals(:, k1)
560 atm(k1)%Cloud(jspec)%Type =
conf%Cloud_Id(jspec)
565 do k1 = 1, n_profiles
566 atm(k1)%Cloud(jspec)%Effective_Radius = geoval%vals(:, k1)
571 if (
conf%n_Clouds > 0)
then
574 do k1 = 1, n_profiles
575 atm(k1)%Cloud_Fraction(:) = geoval%vals(:, k1)
578 do k1 = 1, n_profiles
579 atm(k1)%Cloud_Fraction(:) =
conf%Cloud_Fraction
588 subroutine load_sfc_data(n_Profiles, n_Channels, channels, geovals, sfc, chinfo, obss, conf)
592 integer,
intent(in) :: n_profiles, n_channels
594 type(crtm_surface_type),
intent(inout) :: sfc(:)
595 type(crtm_channelinfo_type),
intent(in) :: chinfo(:)
596 type(c_ptr),
value,
intent(in) :: obss
597 integer(c_int),
intent(in) :: channels(:)
606 integer,
parameter :: tundra_surface_type = 10
607 integer,
parameter :: scrub_surface_type = 7
608 integer,
parameter :: coarse_soil_type = 1
609 integer,
parameter :: groundcover_vegetation_type = 7
610 integer,
parameter :: bare_soil_vegetation_type = 11
611 integer,
parameter :: sea_water_type = 1
612 integer,
parameter :: fresh_snow_type = 2
613 integer,
parameter :: fresh_ice_type = 1
615 character(len=MAXVARLEN) :: varname
617 real(kind_real),
allocatable :: obstb(:,:)
619 allocate(obstb(n_profiles, n_channels))
620 obstb = 0.0_kind_real
622 do n1 = 1, n_channels
624 call obsspace_get_db(obss,
"ObsValue", varname, obstb(:, n1))
627 do k1 = 1, n_profiles
629 sfc(k1)%sensordata%sensor_id = chinfo(1)%sensor_id
630 sfc(k1)%sensordata%wmo_sensor_id = chinfo(1)%wmo_sensor_id
631 sfc(k1)%sensordata%wmo_satellite_id = chinfo(1)%wmo_satellite_id
632 sfc(k1)%sensordata%sensor_channel = channels
635 do n1 = 1, n_channels
636 sfc(k1)%sensordata%tb(n1) = obstb(k1, n1)
640 sfc(k1)%Water_Type = sea_water_type
646 do k1 = 1, n_profiles
647 sfc(k1)%Wind_Speed = geoval%vals(1, k1)
652 do k1 = 1, n_profiles
653 sfc(k1)%Wind_Direction = geoval%vals(1, k1)
658 do k1 = 1, n_profiles
659 sfc(k1)%Water_Coverage = geoval%vals(1, k1)
664 do k1 = 1, n_profiles
665 sfc(k1)%Water_Temperature = geoval%vals(1, k1)
670 do k1 = 1, n_profiles
671 sfc(k1)%Ice_Coverage = geoval%vals(1, k1)
676 do k1 = 1, n_profiles
677 sfc(k1)%Ice_Temperature = geoval%vals(1, k1)
682 do k1 = 1, n_profiles
683 sfc(k1)%Snow_Coverage = geoval%vals(1, k1)
688 do k1 = 1, n_profiles
689 sfc(k1)%Snow_Temperature = geoval%vals(1, k1)
694 do k1 = 1, n_profiles
695 sfc(k1)%Snow_Depth = geoval%vals(1, k1)
700 do k1 = 1, n_profiles
701 sfc(k1)%Land_Coverage = geoval%vals(1, k1)
708 do k1 = 1, n_profiles
709 iland = int(geoval%vals(1, k1))
710 if (.not.any(iland ==
conf%Land_WSI))
then
711 sfc(k1)%Land_Type = iland
717 do k1 = 1, n_profiles
718 sfc(k1)%Land_Temperature = geoval%vals(1, k1)
723 do k1 = 1, n_profiles
724 sfc(k1)%Lai = geoval%vals(1, k1)
729 do k1 = 1, n_profiles
730 sfc(k1)%Vegetation_Fraction = geoval%vals(1, k1)
735 do k1 = 1, n_profiles
736 sfc(k1)%Vegetation_Type = int(geoval%vals(1, k1))
741 do k1 = 1, n_profiles
742 sfc(k1)%Soil_Type = int(geoval%vals(1, k1))
747 do k1 = 1, n_profiles
748 sfc(k1)%Soil_Moisture_Content = geoval%vals(1, k1)
753 do k1 = 1, n_profiles
754 sfc(k1)%Soil_Temperature = geoval%vals(1, k1)
758 if (trim(
conf%salinity_option) ==
"on")
THEN
760 do k1 = 1, n_profiles
761 sfc(k1)%Salinity = geoval%vals(1, k1)
772 type(c_ptr),
value,
intent(in) :: obss
773 type(crtm_geometry_type),
intent(inout) :: geo(:)
774 real(kind_real),
allocatable :: tmpvar(:)
777 nlocs = obsspace_get_nlocs(obss)
778 allocate(tmpvar(nlocs))
780 call obsspace_get_db(obss,
"MetaData",
"sensor_zenith_angle", tmpvar)
781 geo(:)%Sensor_Zenith_Angle = abs(tmpvar(:))
783 call obsspace_get_db(obss,
"MetaData",
"solar_zenith_angle", tmpvar)
784 geo(:)%Source_Zenith_Angle = tmpvar(:)
786 call obsspace_get_db(obss,
"MetaData",
"sensor_azimuth_angle", tmpvar)
787 geo(:)%Sensor_Azimuth_Angle = tmpvar(:)
789 call obsspace_get_db(obss,
"MetaData",
"solar_azimuth_angle", tmpvar)
790 geo(:)%Source_Azimuth_Angle = tmpvar(:)
794 where (geo(:)%Source_Azimuth_Angle < 0.0_kind_real .or. &
795 geo(:)%Source_Azimuth_Angle > 360.0_kind_real) &
796 geo(:)%Source_Azimuth_Angle = 0.0_kind_real
797 where (geo(:)%Sensor_Azimuth_Angle < 0.0_kind_real .or. &
798 geo(:)%Sensor_Azimuth_Angle > 360.0_kind_real) &
799 geo(:)%Sensor_Azimuth_Angle = 0.0_kind_real
801 where (abs(geo(:)%Source_Zenith_Angle) > 180.0_kind_real) &
802 geo(:)%Source_Zenith_Angle = 100.0_kind_real
804 call obsspace_get_db(obss,
"MetaData",
"scan_position", tmpvar)
805 geo(:)%Ifov = tmpvar(:)
807 call obsspace_get_db(obss,
"MetaData",
"sensor_view_angle", tmpvar)
808 geo(:)%Sensor_Scan_Angle = tmpvar(:)
810 where (abs(geo(:)%Sensor_Scan_Angle) > 80.0_kind_real) &
811 geo(:)%Sensor_Scan_Angle = 0.0_kind_real
821 integer,
intent(in) :: n
822 character(len=*),
intent(out) :: varname
824 character(len=6) :: chan
826 write(chan,
'(I0)') n
827 varname =
'brightness_temperature_' // trim(chan)
837 USE crtm_aerosolcoeff,
ONLY: aeroc
839 INTEGER,
INTENT(in) :: n_profiles,n_layers
841 TYPE(crtm_atmosphere_type),
INTENT(inout) :: atm(:)
843 CHARACTER(*) :: aerosol_option
844 CHARACTER(max_string) :: message
845 CHARACTER(len=MAXVARLEN) :: varname
849 CHARACTER(*),
PARAMETER :: routine_name =
'Load_Aerosol_Data'
851 REAL(kind_real),
DIMENSION(n_layers,n_profiles) :: rh
854 IF (trim(aerosol_option) ==
"aerosols_gocart_default")
THEN
857 rh(1:n_layers,1:n_profiles)=geoval%vals(1:n_layers,1:n_profiles)
858 WHERE (rh > 1_kind_real) rh=1_kind_real
860 ELSEIF (trim(aerosol_option) ==
"aerosols_gocart_merra_2")
THEN
863 rh(1:n_layers,1:n_profiles)=geoval%vals(1:n_layers,1:n_profiles)
864 WHERE (rh > 1_kind_real) rh=1_kind_real
866 ELSEIF (trim(aerosol_option) ==
"aerosols_other")
THEN
869 message =
'this aerosol not implemented - check later'
870 CALL display_message( aerosol_option, message, failure )
878 INTEGER,
PARAMETER :: ndust_bins=5, nseas_bins=4
879 REAL(kind_real),
DIMENSION(ndust_bins),
PARAMETER :: dust_radii=[&
880 &0.55_kind_real,1.4_kind_real,2.4_kind_real,4.5_kind_real,8.0_kind_real]
882 INTEGER,
DIMENSION(nseas_bins),
PARAMETER :: seas_types=[&
883 seasalt_ssam_aerosol,seasalt_sscm1_aerosol,seasalt_sscm2_aerosol,seasalt_sscm3_aerosol]
885 REAL(kind_real),
DIMENSION(n_layers) :: ugkg_kgm2
889 CHARACTER(len=MAXVARLEN) :: varname
900 atm(m)%aerosol(i)%Concentration(1:n_layers)=&
903 SELECT CASE ( trim(varname))
905 atm(m)%aerosol(i)%type = sulfate_aerosol
907 atm(m)%aerosol(i)%effective_radius(k)=&
913 atm(m)%aerosol(i)%type = black_carbon_aerosol
914 atm(m)%aerosol(i)%effective_radius(:)=&
915 &aeroc%Reff(1,atm(m)%aerosol(i)%type)
917 atm(m)%aerosol(i)%type = black_carbon_aerosol
919 atm(m)%aerosol(i)%effective_radius(k)=&
925 atm(m)%aerosol(i)%type = organic_carbon_aerosol
926 atm(m)%aerosol(i)%effective_radius(:)=&
927 &aeroc%Reff(1,atm(m)%aerosol(i)%type)
929 atm(m)%aerosol(i)%type = organic_carbon_aerosol
931 atm(m)%aerosol(i)%effective_radius(k)=&
937 atm(m)%aerosol(i)%type = dust_aerosol
938 atm(m)%aerosol(i)%effective_radius(:)=dust_radii(1)
940 atm(m)%aerosol(i)%type = dust_aerosol
941 atm(m)%aerosol(i)%effective_radius(:)=dust_radii(2)
943 atm(m)%aerosol(i)%type = dust_aerosol
944 atm(m)%aerosol(i)%effective_radius(:)=dust_radii(3)
946 atm(m)%aerosol(i)%type = dust_aerosol
947 atm(m)%aerosol(i)%effective_radius(:)=dust_radii(4)
949 atm(m)%aerosol(i)%type = dust_aerosol
950 atm(m)%aerosol(i)%effective_radius(:)=dust_radii(5)
953 atm(m)%aerosol(i)%type = seas_types(1)
955 atm(m)%aerosol(i)%effective_radius(k)=&
960 atm(m)%aerosol(i)%type = seas_types(2)
962 atm(m)%aerosol(i)%effective_radius(k)=&
967 atm(m)%aerosol(i)%type = seas_types(3)
969 atm(m)%aerosol(i)%effective_radius(k)=&
974 atm(m)%aerosol(i)%type = seas_types(4)
976 atm(m)%aerosol(i)%effective_radius(k)=&
991 message =
'this aerosol not implemented in the CRTM - check later'
992 CALL display_message( aerosol_option, message, failure )
999 message =
'this aerosol not implemented - check later'
1000 CALL display_message( aerosol_option, message, failure )
1009 CHARACTER(*),
INTENT(in) :: aerosol_option
1010 CHARACTER(len=MAXVARLEN),
ALLOCATABLE,
INTENT(out) :: var_aerosols(:)
1012 CHARACTER(max_string) :: err_msg
1014 IF (aerosol_option ==
"aerosols_gocart_default")
THEN
1017 ELSEIF (aerosol_option ==
"aerosols_gocart_merra_2")
THEN
1020 ELSEIF (aerosol_option ==
"var_aerosols_other")
THEN
1024 WRITE(err_msg,*)
'assign_aerosol_names: aerosol_option not implemented '//trim(aerosol_option)
1025 call abor1_ftn(err_msg)
1032 TYPE(crtm_atmosphere_type),
INTENT(in) :: atm
1033 REAL(kind_real),
INTENT(out) :: ugkg_kgm2(:)
1039 DO k=1,
SIZE(ugkg_kgm2)
1043 ugkg_kgm2(k)=1.0e-9_kind_real*(atm%Level_Pressure(k)-&
1044 &atm%Level_Pressure(k-1))*100_kind_real/
grav/&
1045 &(1_kind_real+
rv_rd*atm%Absorber(k,1)*1e-3_kind_real)
1052 TYPE(crtm_atmosphere_type),
INTENT(in) :: atm(:)
1053 REAL(kind_real),
INTENT(out) :: ugkg_kgm2(:,:)
1059 DO k=1,
SIZE(ugkg_kgm2,1)
1060 DO m=1,
SIZE(ugkg_kgm2,2)
1064 ugkg_kgm2(k,m)=1.0e-9_kind_real*(atm(m)%Level_Pressure(k)-&
1065 &atm(m)%Level_Pressure(k-1))*100_kind_real/
grav/&
1066 &(1_kind_real+
rv_rd*atm(m)%Absorber(k,1)*1.e-3_kind_real)
1075 USE crtm_aerosolcoeff,
ONLY: aeroc
1081 INTEGER ,
INTENT(in) :: itype
1082 REAL(kind_real) ,
INTENT(in) :: rh
1085 REAL(kind_real) :: h1
1086 REAL(kind_real) :: r_eff
1090 IF ( rh <= aeroc%rh(1) )
THEN
1092 ELSE IF ( rh >= aeroc%rh(aeroc%n_rh) )
THEN
1095 DO m = 1, aeroc%n_rh-1
1096 IF ( rh < aeroc%rh(m+1) .AND. rh > aeroc%rh(m) )
THEN
1099 h1 = (rh-aeroc%rh(m))/(aeroc%rh(m+1)-aeroc%rh(m))
1106 r_eff = aeroc%reff(j1,itype )
1108 r_eff = (1_kind_real-h1)*aeroc%reff(j1,itype ) + h1*aeroc%reff(j2,itype )
1118 CHARACTER(*),
INTENT(in) :: str
1119 CHARACTER(LEN(str)) :: string
1123 CHARACTER(26),
PARAMETER :: upper =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1124 CHARACTER(26),
PARAMETER :: lower =
'abcdefghijklmnopqrstuvwxyz'
1128 DO i = 1, len_trim(str)
1129 ic = index(upper, str(i:i))
1130 IF (ic > 0) string(i:i) = lower(ic:ic)
1137 CHARACTER(len=*),
INTENT(in) :: names(:)
1138 CHARACTER(len=*),
INTENT(in) :: usrname
1142 IF(trim(usrname)==trim(names(i)))
THEN
1153 TYPE(crtm_atmosphere_type),
INTENT(in) :: atm(:)
1154 REAL(kind_real),
INTENT(out),
DIMENSION(:,:):: rh
1156 REAL,
ALLOCATABLE :: table(:),des(:)
1161 INTEGER i, k, it, n_layers, n_profiles
1164 n_profiles=
SIZE(rh,2)
1169 IF( .NOT.
ALLOCATED(table) )
CALL qsmith_init(table,des)
1173 ap1 = 10.*dim(atm(i)%Temperature(k), tmin) + 1.
1174 ap1 = min(2621., ap1)
1176 es = table(it) + (ap1-it)*des(it)
1177 q=atm(i)%Absorber(k,1)*1.e-3/(1.+atm(i)%Absorber(k,1)*1.e-3)
1178 qs =
esl*es*(1.+
zvir*q)/(atm(i)%Pressure(k)*100.)
1187 REAL(kind_real),
DIMENSION(:,:),
INTENT(in) :: t,sphum,p
1188 REAL(kind_real),
DIMENSION(:,:),
INTENT(out) :: rh
1190 REAL,
ALLOCATABLE :: table(:),des(:)
1195 INTEGER i, k, it, n_layers, n_profiles
1198 n_profiles=
SIZE(t,2)
1203 IF ( .NOT.
ALLOCATED(table) )
CALL qsmith_init(table,des)
1207 ap1 = 10.*dim(t(k,i), tmin) + 1.
1208 ap1 = min(2621., ap1)
1210 es = table(it) + (ap1-it)*des(it)
1212 qs =
esl*es*(1.+
zvir*q)/p(k,i)
1221 REAL,
ALLOCATABLE,
INTENT(out) :: table(:),des(:)
1222 INTEGER,
PARAMETER:: length=2621
1225 IF( .NOT.
ALLOCATED(table) )
THEN
1228 ALLOCATE ( table(length) )
1229 ALLOCATE ( des(length) )
1234 des(i) = table(i+1) - table(i)
1236 des(length) = des(length-1)
1242 INTEGER,
INTENT(in):: n
1245 REAL esbasw, tbasw, tbasi, Tmin, tem, aa, b, c, d, e
1255 tem = tmin+dt*real(i-1)
1256 aa = -7.90298*(tbasw/tem-1)
1257 b = 5.02808*alog10(tbasw/tem)
1258 c = -1.3816e-07*(10**((1-tem/tbasw)*11.344)-1)
1259 d = 8.1328e-03*(10**((tbasw/tem-1)*(-3.49149))-1)
1261 table(i) = 0.1*10**(aa+b+c+d+e)