12 use fckit_configuration_module,
only: fckit_configuration
15 use missing_values_mod
31 character(len=MAXVARLEN),
public,
allocatable :: varin(:)
32 integer,
allocatable :: channels(:)
38 type(crtm_atmosphere_type),
allocatable :: atm_k(:,:)
39 type(crtm_surface_type),
allocatable :: sfc_k(:,:)
41 logical,
allocatable :: skip_profiles(:)
61 type(fckit_configuration),
intent(in) :: f_confOper
62 integer(c_int),
intent(in) :: channels(:)
66 type(fckit_configuration) :: f_confOpts,f_confLinOper
68 call f_confoper%get_or_die(
"obs options",f_confopts)
71 if ( f_confoper%has(
"linear obs operator") )
then
72 call f_confoper%get_or_die(
"linear obs operator",f_conflinoper)
81 nvars_in =
size(
varin_default) + self%conf%n_Absorbers + self%conf%n_Clouds + self%conf%n_Surfaces
82 allocate(self%varin(nvars_in))
87 do jspec = 1, self%conf%n_Absorbers
88 self%varin(ind) = self%conf%Absorbers(jspec)
91 do jspec = 1, self%conf%n_Clouds
92 self%varin(ind) = self%conf%Clouds(jspec,1)
95 do jspec = 1, self%conf%n_Surfaces
96 self%varin(ind) = self%conf%Surfaces(jspec)
101 allocate(self%channels(
size(channels)))
102 self%channels(:) = channels(:)
118 if (
allocated(self%atm_k))
then
119 call crtm_atmosphere_destroy(self%atm_K)
120 deallocate(self%atm_k)
123 if (
allocated(self%sfc_k))
then
124 call crtm_surface_destroy(self%sfc_K)
125 deallocate(self%sfc_k)
128 if (
allocated(self%Skip_Profiles))
deallocate(self%Skip_Profiles)
135 use fckit_mpi_module,
only: fckit_mpi_comm
141 type(c_ptr),
value,
intent(in) :: obss
145 character(*),
parameter :: PROGRAM_NAME =
'ufo_radiancecrtm_tlad_settraj'
146 character(255) :: message, version
147 character(max_string) :: err_msg
148 integer :: err_stat, alloc_stat
151 integer :: jvar, ichannel, jchannel, jprofile, jlevel, jspec
152 real(c_double) :: missing
153 type(fckit_mpi_comm) :: f_comm
157 type(crtm_channelinfo_type) :: chinfo(self%conf_traj%n_Sensors)
158 type(crtm_geometry_type),
allocatable :: geo(:)
161 type(crtm_atmosphere_type),
allocatable :: atm(:)
162 type(crtm_surface_type),
allocatable :: sfc(:)
163 type(crtm_rtsolution_type),
allocatable :: rts(:,:)
164 type(crtm_options_type),
allocatable :: Options(:)
167 type(crtm_rtsolution_type),
allocatable :: rts_K(:,:)
170 character(len=MAXVARLEN) :: varstr
171 character(len=MAXVARLEN),
dimension(hofxdiags%nvar) :: &
172 ystr_diags, xstr_diags
173 character(10),
parameter :: jacobianstr =
"_jacobian_"
174 integer :: str_pos(4), ch_diags(hofxdiags%nvar)
176 real(kind_real) :: total_od, secant_term, wfunc_max
177 real(kind_real),
allocatable :: TmpVar(:)
178 real(kind_real),
allocatable :: Tao(:)
179 real(kind_real),
allocatable :: Wfunc(:)
181 call obsspace_get_comm(obss, f_comm)
185 self%n_Profiles = geovals%nlocs
187 self%n_Layers = temp%nval
205 err_stat = crtm_init( self%conf_traj%SENSOR_ID, chinfo, &
206 file_path=trim(self%conf_traj%COEFFICIENT_PATH), &
207 irwatercoeff_file=trim(self%conf_traj%IRwaterCoeff_File), &
208 irlandcoeff_file=trim(self%conf_traj%IRlandCoeff_File), &
209 irsnowcoeff_file=trim(self%conf_traj%IRsnowCoeff_File), &
210 iricecoeff_file=trim(self%conf_traj%IRiceCoeff_File), &
211 viswatercoeff_file=trim(self%conf_traj%VISwaterCoeff_File), &
212 vislandcoeff_file=trim(self%conf_traj%VISlandCoeff_File), &
213 vissnowcoeff_file=trim(self%conf_traj%VISsnowCoeff_File), &
214 visicecoeff_file=trim(self%conf_traj%VISiceCoeff_File), &
215 mwwatercoeff_file=trim(self%conf_traj%MWwaterCoeff_File), &
217 message =
'Error initializing CRTM (setTraj)'
222 sensor_loop:
do n = 1, self%conf_traj%n_Sensors
227 err_stat = crtm_channelinfo_subset(chinfo(n), self%channels, reset=.false.)
228 message =
'Error subsetting channels'
233 self%n_Channels = crtm_channelinfo_n_channels(chinfo(n))
238 allocate( geo( self%n_Profiles ) , &
239 atm( self%n_Profiles ) , &
240 sfc( self%n_Profiles ) , &
241 rts( self%n_Channels, self%n_Profiles ) , &
242 self%atm_K( self%n_Channels, self%n_Profiles ) , &
243 self%sfc_K( self%n_Channels, self%n_Profiles ) , &
244 rts_k( self%n_Channels, self%n_Profiles ) , &
245 options( self%n_Profiles ) , &
247 message =
'Error allocating structure arrays (setTraj)'
252 call crtm_atmosphere_create( atm, self%n_Layers, self%conf_traj%n_Absorbers, self%conf_traj%n_Clouds, self%conf_traj%n_Aerosols )
253 if ( any(.NOT. crtm_atmosphere_associated(atm)) )
THEN
254 message =
'Error allocating CRTM Forward Atmosphere structure (setTraj)'
255 CALL display_message( program_name, message, failure )
259 if (self%n_Layers > 0)
CALL crtm_rtsolution_create(rts, self%n_Layers )
263 call crtm_surface_create(sfc, self%n_Channels)
264 IF ( any(.NOT. crtm_surface_associated(sfc)) )
THEN
265 message =
'Error allocating CRTM Surface structure (setTraj)'
266 CALL display_message( program_name, message, failure )
273 call crtm_atmosphere_create( self%atm_K, self%n_Layers, self%conf_traj%n_Absorbers, &
274 self%conf_traj%n_Clouds, self%conf_traj%n_Aerosols )
275 if ( any(.NOT. crtm_atmosphere_associated(self%atm_K)) )
THEN
276 message =
'Error allocating CRTM K-matrix Atmosphere structure (setTraj)'
277 CALL display_message( program_name, message, failure )
284 call crtm_surface_create(self%sfc_K, self%n_Channels)
285 IF ( any(.NOT. crtm_surface_associated(self%sfc_K)) )
THEN
286 message =
'Error allocating CRTM K-matrix Surface structure (setTraj)'
287 CALL display_message( program_name, message, failure )
293 call load_atm_data(self%N_PROFILES,self%N_LAYERS,geovals,atm,self%conf_traj)
294 call load_sfc_data(self%N_PROFILES,self%n_Channels,self%channels,geovals,sfc,chinfo,obss,self%conf_traj)
299 call crtm_atmosphere_zero( self%atm_K )
300 call crtm_surface_zero( self%sfc_K )
305 rts_k%Radiance = zero
306 rts_k%Brightness_Temperature = one
308 if (
allocated(self%Skip_Profiles))
deallocate(self%Skip_Profiles)
309 allocate(self%Skip_Profiles(self%n_Profiles))
311 profile_loop:
do jprofile = 1, self%n_Profiles
312 options(jprofile)%Skip_Profile = self%Skip_Profiles(jprofile)
314 do jlevel = atm(jprofile)%n_layers, 1, -1
315 if ( atm(jprofile)%level_pressure(jlevel) <= atm(jprofile)%level_pressure(jlevel-1) )
then
316 options(jprofile)%Skip_Profile = .true.
324 err_stat = crtm_k_matrix( atm , &
333 message =
'Error calling CRTM (setTraj) K-Matrix Model for '//trim(self%conf_traj%SENSOR_ID(n))
345 do jvar = 1, hofxdiags%nvar
346 varstr = hofxdiags%variables(jvar)
347 str_pos(4) = len_trim(varstr)
348 if (str_pos(4) < 1) cycle
349 str_pos(3) = index(varstr,
"_",back=.true.)
350 read(varstr(str_pos(3)+1:str_pos(4)),*, err=999) ch_diags(jvar)
351 999 str_pos(1) = index(varstr,jacobianstr) - 1
352 if (str_pos(1) == 0)
then
353 write(err_msg,*)
'ufo_radiancecrtm_simobs: _jacobian_ must be // &
354 & preceded by dependent variable in config: ', &
355 & hofxdiags%variables(jvar)
356 call abor1_ftn(err_msg)
357 else if (str_pos(1) > 0)
then
359 ystr_diags(jvar) = varstr(1:str_pos(1))
360 str_pos(2) = str_pos(1) + len(jacobianstr) + 1
361 str_pos(4) = str_pos(3) - str_pos(2)
362 xstr_diags(jvar)(1:str_pos(4)) = varstr(str_pos(2):str_pos(3)-1)
363 xstr_diags(jvar)(str_pos(4)+1:) =
""
366 xstr_diags(jvar) =
""
367 ystr_diags(jvar)(1:str_pos(3)-1) = varstr(1:str_pos(3)-1)
368 ystr_diags(jvar)(str_pos(3):) =
""
369 if (ch_diags(jvar) < 0) ystr_diags(jvar) = varstr
374 missing = missing_value(missing)
378 do jvar = 1, hofxdiags%nvar
380 if (len(trim(hofxdiags%variables(jvar))) < 1) cycle
382 if (ch_diags(jvar) > 0)
then
383 if (
size(pack(self%channels,self%channels==ch_diags(jvar))) /= 1)
then
384 write(err_msg,*)
'ufo_radiancecrtm_simobs: mismatch between// &
385 & h(x) channels(', self%channels,
') and// &
386 & ch_diags(jvar) = ', ch_diags(jvar)
387 call abor1_ftn(err_msg)
391 do ichannel = 1,
size(self%channels)
392 if (ch_diags(jvar) == self%channels(ichannel))
then
398 if (
allocated(hofxdiags%geovals(jvar)%vals)) &
399 deallocate(hofxdiags%geovals(jvar)%vals)
404 if (trim(xstr_diags(jvar)) ==
"")
then
406 select case(ystr_diags(jvar))
409 hofxdiags%geovals(jvar)%nval = self%n_Layers
410 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
411 hofxdiags%geovals(jvar)%vals = missing
412 do jprofile = 1, self%n_Profiles
413 if (.not.self%Skip_Profiles(jprofile))
then
414 do jlevel = 1, hofxdiags%geovals(jvar)%nval
415 hofxdiags%geovals(jvar)%vals(jlevel,jprofile) = &
416 rts(jchannel,jprofile) % layer_optical_depth(jlevel)
423 hofxdiags%geovals(jvar)%nval = 1
424 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
425 hofxdiags%geovals(jvar)%vals = missing
426 do jprofile = 1, self%n_Profiles
427 if (.not.self%Skip_Profiles(jprofile))
then
428 hofxdiags%geovals(jvar)%vals(1,jprofile) = &
429 rts(jchannel,jprofile) % Brightness_Temperature
435 hofxdiags%geovals(jvar)%nval = self%n_Layers
436 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
437 hofxdiags%geovals(jvar)%vals = missing
438 allocate(tmpvar(self%n_Profiles))
439 call obsspace_get_db(obss,
"MetaData",
"sensor_zenith_angle", tmpvar)
440 do jprofile = 1, self%n_Profiles
441 if (.not.self%Skip_Profiles(jprofile))
then
442 secant_term = one/cos(tmpvar(jprofile)*
deg2rad)
444 do jlevel = 1, self%n_Layers
445 total_od = total_od + rts(jchannel,jprofile) % layer_optical_depth(jlevel)
446 hofxdiags%geovals(jvar)%vals(jlevel,jprofile) = &
447 exp(-min(limit_exp,total_od*secant_term))
455 hofxdiags%geovals(jvar)%nval = self%n_Layers
456 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
457 hofxdiags%geovals(jvar)%vals = missing
458 allocate(tmpvar(self%n_Profiles))
459 allocate(tao(self%n_Layers))
460 call obsspace_get_db(obss,
"MetaData",
"sensor_zenith_angle", tmpvar)
461 do jprofile = 1, self%n_Profiles
462 if (.not.self%Skip_Profiles(jprofile))
then
464 secant_term = one/cos(tmpvar(jprofile)*
deg2rad)
466 do jlevel = 1, self%n_Layers
467 total_od = total_od + rts(jchannel,jprofile) % layer_optical_depth(jlevel)
468 tao(jlevel) = exp(-min(limit_exp,total_od*secant_term))
471 do jlevel = self%n_Layers-1, 1, -1
472 hofxdiags%geovals(jvar)%vals(jlevel,jprofile) = &
473 abs( (tao(jlevel+1)-tao(jlevel))/ &
474 (log(atm(jprofile)%pressure(jlevel+1))- &
475 log(atm(jprofile)%pressure(jlevel))) )
477 hofxdiags%geovals(jvar)%vals(self%n_Layers,jprofile) = &
478 hofxdiags%geovals(jvar)%vals(self%n_Layers-1,jprofile)
486 hofxdiags%geovals(jvar)%nval = 1
487 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
488 hofxdiags%geovals(jvar)%vals = missing
489 allocate(tmpvar(self%n_Profiles))
490 allocate(tao(self%n_Layers))
491 allocate(wfunc(self%n_Layers))
492 call obsspace_get_db(obss,
"MetaData",
"sensor_zenith_angle", tmpvar)
493 do jprofile = 1, self%n_Profiles
494 if (.not.self%Skip_Profiles(jprofile))
then
496 secant_term = one/cos(tmpvar(jprofile)*
deg2rad)
498 do jlevel = 1, self%n_Layers
499 total_od = total_od + rts(jchannel,jprofile) % layer_optical_depth(jlevel)
500 tao(jlevel) = exp(-min(limit_exp,total_od*secant_term))
503 do jlevel = self%n_Layers-1, 1, -1
505 abs( (tao(jlevel+1)-tao(jlevel))/ &
506 (log(atm(jprofile)%pressure(jlevel+1))- &
507 log(atm(jprofile)%pressure(jlevel))) )
509 wfunc(self%n_Layers) = wfunc(self%n_Layers-1)
512 do jlevel = self%n_Layers-1, 1, -1
513 if (wfunc(jlevel) > wfunc_max)
then
514 wfunc_max = wfunc(jlevel)
515 hofxdiags%geovals(jvar)%vals(1,jprofile) = jlevel
525 write(err_msg,*)
'ufo_radiancecrtm_simobs: //&
526 & ObsDiagnostic is unsupported, ', &
527 & hofxdiags%variables(jvar)
529 hofxdiags%geovals(jvar)%nval = 1
530 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
531 hofxdiags%geovals(jvar)%vals = missing
533 else if (ystr_diags(jvar) ==
var_tb)
then
535 select case (xstr_diags(jvar))
538 hofxdiags%geovals(jvar)%nval = 1
539 allocate(hofxdiags%geovals(jvar)%vals(hofxdiags%geovals(jvar)%nval,self%n_Profiles))
540 hofxdiags%geovals(jvar)%vals = missing
541 do jprofile = 1, self%n_Profiles
542 if (.not.self%Skip_Profiles(jprofile))
then
543 hofxdiags%geovals(jvar)%vals(1,jprofile) = &
544 rts_k(jchannel,jprofile) % surface_emissivity
548 write(err_msg,*)
'ufo_radiancecrtm_simobs: //&
549 & ObsDiagnostic is unsupported, ', &
550 & hofxdiags%variables(jvar)
551 call abor1_ftn(err_msg)
554 write(err_msg,*)
'ufo_radiancecrtm_simobs: //&
555 & ObsDiagnostic is unsupported, ', &
556 & hofxdiags%variables(jvar)
557 call abor1_ftn(err_msg)
563 call crtm_geometry_destroy(geo)
564 call crtm_atmosphere_destroy(atm)
565 call crtm_rtsolution_destroy(rts_k)
566 call crtm_rtsolution_destroy(rts)
567 call crtm_surface_destroy(sfc)
572 deallocate(geo, atm, sfc, rts, rts_k, options, stat = alloc_stat)
573 message =
'Error deallocating structure arrays (setTraj)'
582 err_stat = crtm_destroy( chinfo )
583 message =
'Error destroying CRTM (setTraj)'
599 type(c_ptr),
value,
intent(in) :: obss
600 integer,
intent(in) :: nvars, nlocs
601 real(c_double),
intent(inout) :: hofx(nvars, nlocs)
603 character(len=*),
parameter :: myname_=
"ufo_radiancecrtm_simobs_tl"
604 character(max_string) :: err_msg
605 integer :: jprofile, jchannel, jlevel, jspec, ispec
612 if (.not. self%ltraj)
then
613 write(err_msg,*) myname_,
' trajectory wasnt set!'
614 call abor1_ftn(err_msg)
618 if (geovals%nlocs /= self%n_Profiles)
then
619 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
620 call abor1_ftn(err_msg)
625 hofx(:,:) = 0.0_kind_real
634 if (geoval_d%nval /= self%n_Layers)
then
635 write(err_msg,*) myname_,
' error: layers inconsistent!'
636 call abor1_ftn(err_msg)
640 do jprofile = 1, self%n_Profiles
641 if (.not.self%Skip_Profiles(jprofile))
then
642 do jchannel = 1,
size(self%channels)
643 do jlevel = 1, geoval_d%nval
644 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
645 self%atm_K(jchannel,jprofile)%Temperature(jlevel) * &
646 geoval_d%vals(jlevel,jprofile)
655 do jspec = 1, self%conf%n_Absorbers
662 do jprofile = 1, self%n_Profiles
663 if (.not.self%Skip_Profiles(jprofile))
then
664 do jchannel = 1,
size(self%channels)
665 do jlevel = 1, geoval_d%nval
666 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
667 self%atm_K(jchannel,jprofile)%Absorber(jlevel,ispec) * &
668 geoval_d%vals(jlevel,jprofile)
678 do jspec = 1, self%conf%n_Clouds
685 do jprofile = 1, self%n_Profiles
686 if (.not.self%Skip_Profiles(jprofile))
then
687 do jchannel = 1,
size(self%channels)
688 do jlevel = 1, geoval_d%nval
689 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
690 self%atm_K(jchannel,jprofile)%Cloud(ispec)%Water_Content(jlevel) * &
691 geoval_d%vals(jlevel,jprofile)
701 do jspec = 1, self%conf%n_Surfaces
705 select case(self%conf%Surfaces(jspec))
710 do jprofile = 1, self%n_Profiles
711 if (.not.self%Skip_Profiles(jprofile))
then
712 do jchannel = 1,
size(self%channels)
714 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
715 self%sfc_K(jchannel,jprofile)%water_temperature * &
716 geoval_d%vals(jlevel,jprofile)
722 do jprofile = 1, self%n_Profiles
723 if (.not.self%Skip_Profiles(jprofile))
then
724 do jchannel = 1,
size(self%channels)
726 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
727 self%sfc_K(jchannel,jprofile)%wind_speed * &
728 geoval_d%vals(jlevel,jprofile)
734 do jprofile = 1, self%n_Profiles
735 if (.not.self%Skip_Profiles(jprofile))
then
736 do jchannel = 1,
size(self%channels)
738 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
739 self%sfc_K(jchannel,jprofile)%wind_direction * &
740 geoval_d%vals(jlevel,jprofile)
746 do jprofile = 1, self%n_Profiles
747 if (.not.self%Skip_Profiles(jprofile))
then
748 do jchannel = 1,
size(self%channels)
750 hofx(jchannel, jprofile) = hofx(jchannel, jprofile) + &
751 self%sfc_K(jchannel,jprofile)%salinity * &
752 geoval_d%vals(jlevel,jprofile)
771 type(c_ptr),
value,
intent(in) :: obss
772 integer,
intent(in) :: nvars, nlocs
773 real(c_double),
intent(in) :: hofx(nvars, nlocs)
775 character(len=*),
parameter :: myname_=
"ufo_radiancecrtm_simobs_ad"
776 character(max_string) :: err_msg
777 integer :: jprofile, jchannel, jlevel, jspec, ispec
779 real(c_double) :: missing
786 if (.not. self%ltraj)
then
787 write(err_msg,*) myname_,
' trajectory wasnt set!'
788 call abor1_ftn(err_msg)
792 if (geovals%nlocs /= self%n_Profiles)
then
793 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
794 call abor1_ftn(err_msg)
798 missing = missing_value(missing)
807 if (.not.
allocated(geoval_d%vals))
then
808 geoval_d%nlocs = self%n_Profiles
809 geoval_d%nval = self%n_Layers
810 allocate(geoval_d%vals(geoval_d%nval,geoval_d%nlocs))
811 geoval_d%vals = 0.0_kind_real
815 do jprofile = 1, self%n_Profiles
816 if (.not.self%Skip_Profiles(jprofile))
then
817 do jchannel = 1,
size(self%channels)
818 if (hofx(jchannel, jprofile) /= missing)
then
819 do jlevel = 1, geoval_d%nval
820 geoval_d%vals(jlevel,jprofile) = geoval_d%vals(jlevel,jprofile) + &
821 self%atm_K(jchannel,jprofile)%Temperature(jlevel) * &
822 hofx(jchannel, jprofile)
832 do jspec = 1, self%conf%n_Absorbers
837 if (.not.
allocated(geoval_d%vals))
then
838 geoval_d%nlocs = self%n_Profiles
839 geoval_d%nval = self%n_Layers
840 allocate(geoval_d%vals(geoval_d%nval,geoval_d%nlocs))
841 geoval_d%vals = 0.0_kind_real
847 do jprofile = 1, self%n_Profiles
848 if (.not.self%Skip_Profiles(jprofile))
then
849 do jchannel = 1,
size(self%channels)
850 if (hofx(jchannel, jprofile) /= missing)
then
851 do jlevel = 1, geoval_d%nval
852 geoval_d%vals(jlevel,jprofile) = geoval_d%vals(jlevel,jprofile) + &
853 self%atm_K(jchannel,jprofile)%Absorber(jlevel,ispec) * &
854 hofx(jchannel, jprofile)
865 do jspec = 1, self%conf%n_Clouds
870 if (.not.
allocated(geoval_d%vals))
then
871 geoval_d%nlocs = self%n_Profiles
872 geoval_d%nval = self%n_Layers
873 allocate(geoval_d%vals(geoval_d%nval,geoval_d%nlocs))
874 geoval_d%vals = 0.0_kind_real
880 do jprofile = 1, self%n_Profiles
881 if (.not.self%Skip_Profiles(jprofile))
then
882 do jchannel = 1,
size(self%channels)
883 if (hofx(jchannel, jprofile) /= missing)
then
884 do jlevel = 1, geoval_d%nval
885 geoval_d%vals(jlevel,jprofile) = geoval_d%vals(jlevel,jprofile) + &
886 self%atm_K(jchannel,jprofile)%Cloud(ispec)%Water_Content(jlevel) * &
887 hofx(jchannel, jprofile)
898 do jspec = 1, self%conf%n_Surfaces
903 if (.not.
allocated(geoval_d%vals))
then
904 geoval_d%nlocs = self%n_Profiles
905 geoval_d%nval = self%n_Layers
906 allocate(geoval_d%vals(geoval_d%nval,geoval_d%nlocs))
907 geoval_d%vals = 0.0_kind_real
910 select case(self%conf%Surfaces(jspec))
914 do jprofile = 1, self%n_Profiles
915 if (.not.self%Skip_Profiles(jprofile))
then
916 do jchannel = 1,
size(self%channels)
917 if (hofx(jchannel, jprofile) /= missing)
then
919 geoval_d%vals(jlevel, jprofile) = geoval_d%vals(jlevel,jprofile) + &
920 self%sfc_K(jchannel,jprofile)%water_temperature * &
921 hofx(jchannel,jprofile)
928 do jprofile = 1, self%n_Profiles
929 if (.not.self%Skip_Profiles(jprofile))
then
930 do jchannel = 1,
size(self%channels)
931 if (hofx(jchannel, jprofile) /= missing)
then
933 geoval_d%vals(jlevel, jprofile) = geoval_d%vals(jlevel,jprofile) + &
934 self%sfc_K(jchannel,jprofile)%wind_speed * &
935 hofx(jchannel,jprofile)
942 do jprofile = 1, self%n_Profiles
943 if (.not.self%Skip_Profiles(jprofile))
then
944 do jchannel = 1,
size(self%channels)
945 if (hofx(jchannel, jprofile) /= missing)
then
947 geoval_d%vals(jlevel, jprofile) = geoval_d%vals(jlevel,jprofile) + &
948 self%sfc_K(jchannel,jprofile)%wind_direction * &
949 hofx(jchannel,jprofile)
956 do jprofile = 1, self%n_Profiles
957 if (.not.self%Skip_Profiles(jprofile))
then
958 do jchannel = 1,
size(self%channels)
959 if (hofx(jchannel, jprofile) /= missing)
then
961 geoval_d%vals(jlevel, jprofile) = geoval_d%vals(jlevel,jprofile) + &
962 self%sfc_K(jchannel,jprofile)%salinity * &
963 hofx(jchannel,jprofile)
975 if (.not. geovals%linit ) geovals%linit=.true.