Ignore:
Timestamp:
Dec 18, 2017, 11:34:35 PM (7 years ago)
Author:
aslmd
Message:

bug fix in metgrid. runtime error of pointer with gfortran. corrected status of a few variables that were not pointers. generalized the nullify of all pointers. changes inspired by wps 3.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SRC/WPS/metgrid/src/process_domain_module.F90

    r1296 r1866  
    4242      character (len=19) :: valid_date, temp_date
    4343      character (len=128) :: cname, stagger, cunits, cdesc, title
    44       character (len=128), pointer, dimension(:) :: output_flags, td_output_flags
     44      character (len=128), allocatable, dimension(:) :: output_flags, td_output_flags
     45
     46
     47      ! CWH Initialize local pointer variables
     48      nullify(landmask)
     49      nullify(xlat)
     50      nullify(xlon)
     51      nullify(xlat_u)
     52      nullify(xlon_u)
     53      nullify(xlat_v)
     54      nullify(xlon_v)
    4555
    4656      ! Compute number of times that we will process
     
    101111      ! Begin time-dependent processing
    102112      !
     113
     114      allocate(td_output_flags(num_entries))
    103115   
    104116      ! Loop over all times to be processed for this domain
     
    124136         call mprintf(.true.,LOGFILE, 'Preparing to process output time %s', s1=temp_date)
    125137   
    126          allocate(td_output_flags(num_entries))
    127138         do i=1,num_entries
    128139            td_output_flags(i) = output_flags(i)
     
    143154                             truelat2, parent_grid_ratio, corner_lats, corner_lons, td_output_flags)
    144155
    145          deallocate(td_output_flags)
    146156   
    147157      end do  ! Loop over n_times
     158
     159
     160      deallocate(td_output_flags)
    148161
    149162      deallocate(output_flags)
     
    547560      logical, intent(in) :: extra_row, extra_col
    548561      character (len=19), intent(in) :: temp_date
    549       character (len=128), pointer, dimension(:) :: output_flags
     562
     563      character (len=128), dimension(:) :: output_flags
    550564
    551565! BUG: Move this constant to misc_definitions_module?
     
    578592      character (len=128), dimension(3) :: dimnames
    579593      type (fg_input) :: field, u_field, v_field
     594
     595
     596      ! CWH Initialize local pointer variables
     597     
     598      nullify(u_levels)
     599      nullify(v_levels)
     600      nullify(slab)
     601      nullify(halo_slab)
     602      nullify(real_array)
     603      nullify(got_this_field)
    580604
    581605      allocate(got_this_field(num_entries))
     
    12851309      integer :: i, j, idx, idxt, orig_selected_proj, interp_mask_status, &
    12861310                 interp_land_mask_status, interp_water_mask_status
    1287       integer, pointer, dimension(:) :: interp_array
     1311      integer, pointer, dimension(:) :: interp_array, interp_opts
    12881312      real :: rx, ry, temp
    12891313      real, pointer, dimension(:,:) :: data_count
    12901314      type (fg_input) :: mask_field, mask_water_field, mask_land_field
     1315
     1316
     1317
     1318
     1319      ! CWH Initialize local pointer variables
     1320      nullify(interp_array)
     1321      nullify(interp_opts)
     1322      nullify(data_count)
    12911323
    12921324      ! Find index into fieldname, interp_method, masked, and fill_missing
     
    16311663      type (fg_input), pointer, dimension(:) :: headers
    16321664      type (list) :: temp_levels
    1633    
     1665
     1666      !CWH Initialize local pointer variables
     1667      nullify(field_levels)
     1668      nullify(headers)
     1669
    16341670      ! Initialize a list to store levels that are found for 3-d fields
    16351671      call list_init(temp_levels)
     
    17081744      type (list) :: temp_levels
    17091745      type (list_item), pointer, dimension(:) :: keys
    1710    
     1746
     1747      ! CWH Initialize local pointer variables
     1748      nullify(union_levels)
     1749      nullify(field_levels)
     1750      nullify(r_union_levels)
     1751      nullify(headers)
     1752      nullify(all_headers)
     1753      nullify(keys)
     1754
    17111755      ! Initialize a list to store levels that are found for 3-d fields
    17121756      call list_init(temp_levels)
     
    19922036      character (len=128) :: asrcname
    19932037      logical :: filled_all_lev
     2038
     2039      !CWH Initialize local pointer variables
     2040      nullify(all_list)
     2041      nullify(keys)
    19942042
    19952043      filled_all_lev = .false.
Note: See TracChangeset for help on using the changeset viewer.