@@ -65,7 +65,7 @@ subroutine set_spectrum(n_instances, spectrum, spectrum_name, spectral_file, &
6565real (RealExt), intent (in ), optional :: wavelength_blue
6666
6767! Local variables
68- type (StrSpecData), pointer :: spec = > null ()
68+ type (StrSpecData), pointer :: spec
6969integer , parameter :: nd_instances = 2
7070integer :: id_spec
7171integer :: ierr = i_normal
@@ -79,6 +79,8 @@ subroutine set_spectrum(n_instances, spectrum, spectrum_name, spectral_file, &
7979
8080if (lhook) call dr_hook(ModuleName// ' :' // RoutineName,zhook_in,zhook_handle)
8181
82+ nullify(spec)
83+
8284if (.not. allocated (spectrum_array)) then
8385 if (present (n_instances)) then
8486 allocate (spectrum_array(n_instances))
@@ -252,7 +254,7 @@ logical function retain_absorber(ip_absorber, l_absorber)
252254 implicit none
253255 integer , intent (in ) :: ip_absorber
254256 logical , intent (in ), optional :: l_absorber
255-
257+
256258 if (present (l_absorber)) then
257259 retain_absorber = (spec% gas% type_absorb(i) == ip_absorber) &
258260 .and. l_absorber
@@ -339,12 +341,13 @@ subroutine get_spectrum(spectrum_name, spectrum, &
339341real (RealExt), allocatable , optional , intent (out ) :: weight_blue(:)
340342
341343! Local variables
342- type (StrSpecData), pointer :: spec = > null ()
344+ type (StrSpecData), pointer :: spec
343345integer :: id_spec
344346integer :: ierr = i_normal
345347character (len= errormessagelength) :: cmessage
346348character (len=* ), parameter :: RoutineName= ' GET_SPECTRUM'
347349
350+ nullify(spec)
348351
349352do id_spec= 1 , size (spectrum_array)
350353 if (spectrum_array_name(id_spec) == spectrum_name) exit
@@ -404,9 +407,9 @@ subroutine set_mcica(mcica_data_file, sw_spectrum_name, lw_spectrum_name)
404407character (len=* ), intent (in ), optional :: sw_spectrum_name, lw_spectrum_name
405408
406409! Local variables
407- type (StrSpecData), pointer :: sw_spec = > null ()
408- type (StrSpecData), pointer :: lw_spec = > null ()
409- type (StrMcica), pointer :: mcica = > null ()
410+ type (StrSpecData), pointer :: sw_spec
411+ type (StrSpecData), pointer :: lw_spec
412+ type (StrMcica), pointer :: mcica
410413logical :: l_sw, l_lw
411414integer :: id_spec, id_mcica
412415integer :: ierr = i_normal
@@ -420,6 +423,8 @@ subroutine set_mcica(mcica_data_file, sw_spectrum_name, lw_spectrum_name)
420423
421424if (lhook) call dr_hook(ModuleName// ' :' // RoutineName,zhook_in,zhook_handle)
422425
426+ nullify(sw_spec, lw_spec, mcica)
427+
423428if (allocated (spectrum_array)) then
424429 if (.not. allocated (mcica_data_array)) then
425430 allocate (mcica_data_array(size (spectrum_array)))
0 commit comments