Changeset 1318 for LMDZ4/branches/LMDZ4V5.0-dev/libf/cosp/cosp.F90
- Timestamp:
- Feb 23, 2010, 9:12:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/LMDZ4V5.0-dev/libf/cosp/cosp.F90
r1279 r1318 26 26 USE MOD_COSP_TYPES 27 27 USE MOD_COSP_SIMULATOR 28 USE mod_phys_lmdz_para 29 USE mod_grid_phy_lmdz 28 30 IMPLICIT NONE 29 31 … … 61 63 real :: minv,maxv 62 64 real :: maxp,minp 63 integer,dimension(:), allocatable :: & ! Dimensions nPoints65 integer,dimension(:),save, allocatable :: & ! Dimensions nPoints 64 66 seed ! It is recommended that the seed is set to a different value for each model 65 67 ! gridbox it is called on, as it is possible that the choice of the same 66 68 ! seed value every time may introduce some statistical bias in the results, 67 69 ! particularly for low values of NCOL. 70 !$OMP THREADPRIVATE(seed) 71 real,dimension(:),allocatable :: rseed ! It is recommended that the seed is set to a different value for each model 68 72 ! Types used in one iteration 69 73 type(cosp_gridbox) :: gbx_it … … 76 80 type(cosp_radarstats) :: stradar_it 77 81 type(cosp_lidarstats) :: stlidar_it 82 83 logical,save :: first_cosp=.TRUE. 84 !$OMP THREADPRIVATE(first_cosp) 78 85 79 86 !++++++++++ Dimensions ++++++++++++ … … 162 169 endif 163 170 164 171 if (first_cosp) then 165 172 ! We base the seed in the decimal part of the surface pressure. 166 allocate(seed(Npoints)) 167 seed = int(gbx%psfc) ! This is to avoid division by zero when Npoints = 1 173 allocate(seed(Npoints)) 174 175 allocate(rseed(klon_glo)) 176 CALL gather(gbx%psfc,rseed) 177 call bcast(rseed) 178 ! seed = int(gbx%psfc) ! This is to avoid division by zero when Npoints = 1 168 179 ! Roj Oct/2008 ... Note: seed value of 0 caused me some problems + I want to 169 180 ! randomize for each call to COSP even when Npoints ==1 170 minp = minval(gbx%psfc) 171 maxp = maxval(gbx%psfc) 172 if (Npoints .gt. 1) seed=int((gbx%psfc-minp)/(maxp-minp)*100000) + 1 173 174 181 minp = minval(rseed) 182 maxp = maxval(rseed) 183 184 if (Npoints .gt. 1) THEN 185 seed=int((gbx%psfc-minp)/(maxp-minp)*100000) + 1 186 else 187 seed=int(gbx%psfc-minp) 188 endif 189 190 deallocate(rseed) 191 first_cosp=.false. 192 endif 193 175 194 if (gbx%Npoints_it >= gbx%Npoints) then ! One iteration gbx%Npoints 176 195 call cosp_iter(overlap,seed,cfg,vgrid,gbx,sgx,sgradar,sglidar,isccp,misr,stradar,stlidar) … … 273 292 call free_cosp_lidarstats(stlidar_it) 274 293 endif 275 deallocate(seed)276 294 277 295 … … 305 323 integer :: i,j,k 306 324 real,dimension(:,:),pointer :: column_frac_out ! Array with one column of frac_out 307 integer :: scops_debug=0 ! set to non-zero value to print out inputs for debugging in SCOPS 325 integer,parameter :: scops_debug=0 ! set to non-zero value to print out inputs for debugging in SCOPS 326 308 327 real,dimension(:, :),allocatable :: cca_scops,ls_p_rate,cv_p_rate, & 309 328 tca_scops ! Cloud cover in each model level (HORIZONTAL gridbox fraction) of total cloud.
Note: See TracChangeset
for help on using the changeset viewer.