[Dart-dev] [6856] DART/trunk/models/clm/model_mod.f90: Changed an automatic array to an allocatable array because the

nancy at ucar.edu nancy at ucar.edu
Fri Mar 21 17:02:05 MDT 2014


Revision: 6856
Author:   thoar
Date:     2014-03-21 17:02:05 -0600 (Fri, 21 Mar 2014)
Log Message:
-----------
Changed an automatic array to an allocatable array because the
routine is public and the dimensions _may_ not be known
until static_init_model() has been called. Since it was a public
routine, it _could_ be called before static_init_model.

Modified Paths:
--------------
    DART/trunk/models/clm/model_mod.f90

-------------- next part --------------
Modified: DART/trunk/models/clm/model_mod.f90
===================================================================
--- DART/trunk/models/clm/model_mod.f90	2014-03-20 21:51:36 UTC (rev 6855)
+++ DART/trunk/models/clm/model_mod.f90	2014-03-21 23:02:05 UTC (rev 6856)
@@ -3633,11 +3633,12 @@
 
 ! Local storage
 
-integer                       :: ivar, indexi, i, j
-integer, dimension(nlon,nlat) :: countmat
+integer :: ivar, indexi, i, j
+integer, allocatable, dimension(:,:) :: countmat
 
 if ( .not. module_initialized ) call static_init_model
 
+allocate(countmat(nlon,nlat))
 countmat = 0
 
 VARTYPES : do ivar = 1,nfields
@@ -3667,6 +3668,8 @@
 enddo
 enddo
 
+deallocate(countmat)
+
 end subroutine find_gridcell_Npft
 
 


More information about the Dart-dev mailing list